@7365admin1/layer-common 4.21.3 → 4.21.4-staging.339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -4
- package/components/AnprCameraBadge.vue +142 -0
- package/components/DocumentForm.vue +407 -112
- package/components/DocumentManagement.vue +213 -12
- package/components/EntryPass/QrTemplatePreview.vue +21 -25
- package/components/EntryPassInformation.vue +119 -24
- package/components/Facility/BookingSetup.vue +63 -0
- package/components/HidAccessLogDashboard.vue +29 -5
- package/components/HidAccessPermissions.vue +424 -0
- package/components/HidIntercomManagement.vue +48 -1
- package/components/HidProfileQrCode.vue +323 -0
- package/components/HidReaderManagement.vue +26 -0
- package/components/HidReaderUserRoster.vue +32 -2
- package/components/HidUserEnrollment.vue +833 -152
- package/components/InvitationClientForm.vue +19 -1
- package/components/PlateNumberDisplay.vue +91 -1
- package/components/VehicleForm.vue +246 -2
- package/components/VehicleManagement.vue +302 -51
- package/components/VisitorManagement.vue +357 -5
- package/composables/useAccessManagement.ts +5 -0
- package/composables/useDocument.ts +7 -0
- package/composables/useFacility.ts +11 -0
- package/composables/useHidAmico.ts +97 -0
- package/composables/useHidNavigation.ts +25 -1
- package/composables/usePeople.ts +19 -0
- package/composables/useVehicle.ts +83 -1
- package/composables/useWebUsb.ts +14 -11
- package/package.json +1 -1
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/document.d.ts +14 -0
- package/types/facility.d.ts +4 -0
- package/types/people.d.ts +5 -2
- package/types/vehicle.d.ts +57 -2
- package/utils/hid-permission-assignments.ts +190 -0
- package/utils/vehicle-actions.ts +45 -17
|
@@ -742,11 +742,35 @@
|
|
|
742
742
|
class="visitor-preview__row"
|
|
743
743
|
>
|
|
744
744
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
745
|
-
<div
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
745
|
+
<div>
|
|
746
|
+
<!-- Was a hover tooltip on the value: the full NRIC only
|
|
747
|
+
reachable by hovering, which says nothing is there to
|
|
748
|
+
reach and cannot be reached at all on a touch screen.
|
|
749
|
+
The eye alone, at the 14px the Incident Report screens
|
|
750
|
+
draw it, is a 14px target - the floor is 24px. So the
|
|
751
|
+
NUMBER is the control and the eye is its affordance:
|
|
752
|
+
the whole masked value is pressable, which makes the
|
|
753
|
+
target the width of the digits rather than of a glyph,
|
|
754
|
+
and being a real `button` it also takes a tab stop,
|
|
755
|
+
which a `v-icon` with a click handler never did. -->
|
|
756
|
+
<button
|
|
757
|
+
type="button"
|
|
758
|
+
class="visitor-preview__reveal"
|
|
759
|
+
:aria-label="showVisitorNric ? 'Hide NRIC' : 'Show NRIC'"
|
|
760
|
+
:aria-pressed="showVisitorNric"
|
|
761
|
+
@click="showVisitorNric = !showVisitorNric"
|
|
762
|
+
>
|
|
763
|
+
<span class="visitor-preview__value">
|
|
764
|
+
{{
|
|
765
|
+
showVisitorNric
|
|
766
|
+
? selectedVisitorObject[key]
|
|
767
|
+
: maskNRIC(selectedVisitorObject[key])
|
|
768
|
+
}}
|
|
769
|
+
</span>
|
|
770
|
+
<v-icon size="16" class="visitor-preview__eye">
|
|
771
|
+
{{ showVisitorNric ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
|
|
772
|
+
</v-icon>
|
|
773
|
+
</button>
|
|
750
774
|
</div>
|
|
751
775
|
</div>
|
|
752
776
|
|
|
@@ -796,6 +820,105 @@
|
|
|
796
820
|
</div>
|
|
797
821
|
</div>
|
|
798
822
|
|
|
823
|
+
<!--
|
|
824
|
+
THE CONTRACTOR'S PARTY.
|
|
825
|
+
|
|
826
|
+
The list row has always said `( +2 members)` beside the name
|
|
827
|
+
and then had nowhere to send you for the names themselves. The
|
|
828
|
+
block spans both columns rather than sitting in the 116px
|
|
829
|
+
value track: a member is a record, not a value, and several of
|
|
830
|
+
them in a 250px column is unreadable.
|
|
831
|
+
|
|
832
|
+
Read off `selectedVisitorDataObject` (the raw row) and not
|
|
833
|
+
`selectedVisitorObject`, which filters itself down to
|
|
834
|
+
`typeFieldMap` plus five fixed keys - `members` is on neither
|
|
835
|
+
list, and widening that computed would change what four other
|
|
836
|
+
dialogs on this screen see.
|
|
837
|
+
-->
|
|
838
|
+
<div
|
|
839
|
+
v-else-if="key === 'members' && selectedVisitorMembers.length"
|
|
840
|
+
class="visitor-preview__row visitor-preview__row--block"
|
|
841
|
+
>
|
|
842
|
+
<div class="visitor-preview__label">
|
|
843
|
+
{{ label }} ({{ selectedVisitorMembers.length }})
|
|
844
|
+
</div>
|
|
845
|
+
<div class="visitor-preview__members">
|
|
846
|
+
<div
|
|
847
|
+
v-for="(member, index) in selectedVisitorMembers"
|
|
848
|
+
:key="member?.nric || member?.name || index"
|
|
849
|
+
class="visitor-preview__member"
|
|
850
|
+
>
|
|
851
|
+
<div class="visitor-preview__value">
|
|
852
|
+
{{ member?.name || "N/A" }}
|
|
853
|
+
</div>
|
|
854
|
+
<template v-for="field in memberDetailFields" :key="field.key">
|
|
855
|
+
<div
|
|
856
|
+
v-if="member?.[field.key]"
|
|
857
|
+
class="visitor-preview__member-line"
|
|
858
|
+
>
|
|
859
|
+
<span class="visitor-preview__member-key">
|
|
860
|
+
{{ field.label }}
|
|
861
|
+
</span>
|
|
862
|
+
<!-- A member's NRIC is the same class of data as the
|
|
863
|
+
visitor's, so it gets the same control. Each
|
|
864
|
+
member reveals separately - one toggle for the
|
|
865
|
+
whole card would show three people's NRICs to
|
|
866
|
+
read one. -->
|
|
867
|
+
<button
|
|
868
|
+
v-if="field.key === 'nric'"
|
|
869
|
+
type="button"
|
|
870
|
+
class="visitor-preview__reveal"
|
|
871
|
+
:aria-label="
|
|
872
|
+
isMemberNricShown(index)
|
|
873
|
+
? `Hide NRIC for ${member?.name || 'this member'}`
|
|
874
|
+
: `Show NRIC for ${member?.name || 'this member'}`
|
|
875
|
+
"
|
|
876
|
+
:aria-pressed="isMemberNricShown(index)"
|
|
877
|
+
@click="toggleMemberNric(index)"
|
|
878
|
+
>
|
|
879
|
+
<span>
|
|
880
|
+
{{
|
|
881
|
+
isMemberNricShown(index)
|
|
882
|
+
? member.nric
|
|
883
|
+
: maskNRIC(member.nric)
|
|
884
|
+
}}
|
|
885
|
+
</span>
|
|
886
|
+
<v-icon size="16" class="visitor-preview__eye">
|
|
887
|
+
{{
|
|
888
|
+
isMemberNricShown(index)
|
|
889
|
+
? "mdi-eye-off-outline"
|
|
890
|
+
: "mdi-eye-outline"
|
|
891
|
+
}}
|
|
892
|
+
</v-icon>
|
|
893
|
+
</button>
|
|
894
|
+
<span v-else>{{ member[field.key] }}</span>
|
|
895
|
+
</div>
|
|
896
|
+
</template>
|
|
897
|
+
</div>
|
|
898
|
+
</div>
|
|
899
|
+
</div>
|
|
900
|
+
|
|
901
|
+
<!-- The vehicle number, with Block on its right: the Registered
|
|
902
|
+
tab only, for someone who may add vehicles. It opens the
|
|
903
|
+
Vehicle Mgmt Block Listed form with the category taken from
|
|
904
|
+
the transaction type. -->
|
|
905
|
+
<div
|
|
906
|
+
v-else-if="
|
|
907
|
+
key === 'plateNumber' &&
|
|
908
|
+
selectedVisitorObject[key] &&
|
|
909
|
+
canBlockSelectedVehicle
|
|
910
|
+
"
|
|
911
|
+
class="visitor-preview__row"
|
|
912
|
+
>
|
|
913
|
+
<div class="visitor-preview__label">{{ label }}</div>
|
|
914
|
+
<div class="visitor-preview__value d-flex align-center justify-space-between ga-2">
|
|
915
|
+
<span>{{ selectedVisitorObject[key] }}</span>
|
|
916
|
+
<AppButton variant="err" icon="mdi-cancel" @click="openBlockVehicle">
|
|
917
|
+
Block
|
|
918
|
+
</AppButton>
|
|
919
|
+
</div>
|
|
920
|
+
</div>
|
|
921
|
+
|
|
799
922
|
<div
|
|
800
923
|
v-else-if="selectedVisitorObject[key]"
|
|
801
924
|
class="visitor-preview__row"
|
|
@@ -817,6 +940,23 @@
|
|
|
817
940
|
</VehicleUpdateMoreAction>
|
|
818
941
|
</v-dialog>
|
|
819
942
|
|
|
943
|
+
<v-dialog v-model="dialog.blockVehicle" width="450" persistent>
|
|
944
|
+
<VehicleForm
|
|
945
|
+
v-if="dialog.blockVehicle"
|
|
946
|
+
type="blocklist"
|
|
947
|
+
mode="add"
|
|
948
|
+
:site="siteId"
|
|
949
|
+
:org="orgId"
|
|
950
|
+
:vehicle-data="blockVehicleData"
|
|
951
|
+
:preset-category="blockVehicleCategory"
|
|
952
|
+
:prefill-plate="blockVehiclePlate"
|
|
953
|
+
@done="handleBlockVehicleDone"
|
|
954
|
+
@back="dialog.blockVehicle = false"
|
|
955
|
+
@close="dialog.blockVehicle = false"
|
|
956
|
+
@close:all="dialog.blockVehicle = false"
|
|
957
|
+
/>
|
|
958
|
+
</v-dialog>
|
|
959
|
+
|
|
820
960
|
<v-dialog v-model="dialog.snapshotImage" max-width="700">
|
|
821
961
|
<v-card>
|
|
822
962
|
<v-card-title class="d-flex justify-space-between align-center">
|
|
@@ -1423,6 +1563,11 @@ const props = defineProps({
|
|
|
1423
1563
|
type: Boolean,
|
|
1424
1564
|
default: false,
|
|
1425
1565
|
},
|
|
1566
|
+
/** May add vehicles - shows Block beside a Registered visitor's vehicle number. */
|
|
1567
|
+
canBlockVehicle: {
|
|
1568
|
+
type: Boolean,
|
|
1569
|
+
default: false,
|
|
1570
|
+
},
|
|
1426
1571
|
});
|
|
1427
1572
|
|
|
1428
1573
|
const { authenticate, currentUser } = useLocalAuth();
|
|
@@ -1610,8 +1755,55 @@ const dialog = reactive({
|
|
|
1610
1755
|
approveRejectOvernightParkingRequestDialog: false,
|
|
1611
1756
|
returnNfcCard: false,
|
|
1612
1757
|
approveRejectVisitorDialog: false,
|
|
1758
|
+
blockVehicle: false,
|
|
1759
|
+
});
|
|
1760
|
+
|
|
1761
|
+
/* ---- Block a visitor's vehicle ------------------------------------------ */
|
|
1762
|
+
|
|
1763
|
+
/** The row itself: the preview object keeps only the fields it prints. */
|
|
1764
|
+
const selectedVisitorRow = computed<Record<string, any>>(
|
|
1765
|
+
() => items.value.find((x: any) => x?._id === selectedVisitorId.value) ?? {}
|
|
1766
|
+
);
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* The Block Listed category for a visitor transaction type: a guest is a
|
|
1770
|
+
* visitor; contractor, delivery, pick-up and drop-off stay as they are.
|
|
1771
|
+
*/
|
|
1772
|
+
function blockCategoryForVisitorType(type: unknown): string {
|
|
1773
|
+
const value = String(type ?? "").toLowerCase();
|
|
1774
|
+
if (["contractor", "delivery", "pick-up", "drop-off"].includes(value)) return value;
|
|
1775
|
+
return "visitor";
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
const canBlockSelectedVehicle = computed(() => {
|
|
1779
|
+
if (!props.canBlockVehicle || activeTab.value !== "registered") return false;
|
|
1780
|
+
const row = selectedVisitorRow.value;
|
|
1781
|
+
const type = String(row?.type ?? "");
|
|
1782
|
+
return !!row?.plateNumber && type !== "resident" && type !== "tenant";
|
|
1613
1783
|
});
|
|
1614
1784
|
|
|
1785
|
+
const blockVehiclePlate = ref("");
|
|
1786
|
+
const blockVehicleCategory = ref("");
|
|
1787
|
+
const blockVehicleData = ref<Record<string, any>>({});
|
|
1788
|
+
|
|
1789
|
+
function openBlockVehicle() {
|
|
1790
|
+
const row = selectedVisitorRow.value;
|
|
1791
|
+
blockVehiclePlate.value = String(row?.plateNumber ?? "").trim().toUpperCase();
|
|
1792
|
+
blockVehicleCategory.value = blockCategoryForVisitorType(row?.type);
|
|
1793
|
+
blockVehicleData.value = {
|
|
1794
|
+
name: row?.name ?? "",
|
|
1795
|
+
nric: row?.nric ?? "",
|
|
1796
|
+
phoneNumber: row?.contact ?? "",
|
|
1797
|
+
remarks: row?.remarks ?? "",
|
|
1798
|
+
};
|
|
1799
|
+
dialog.blockVehicle = true;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
function handleBlockVehicleDone() {
|
|
1803
|
+
dialog.blockVehicle = false;
|
|
1804
|
+
showMessage(`Vehicle ${blockVehiclePlate.value} is now in Block Listed.`, "success");
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1615
1807
|
const snapshotImageUrl = ref("");
|
|
1616
1808
|
const remarksType = ref<"checkIn" | "checkOut">("checkIn");
|
|
1617
1809
|
const remarksInput = ref("");
|
|
@@ -1898,6 +2090,71 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
1898
2090
|
() => selectedVisitorStatus.value === "pending"
|
|
1899
2091
|
);
|
|
1900
2092
|
|
|
2093
|
+
/**
|
|
2094
|
+
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2095
|
+
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2096
|
+
* party has one wherever the screen shows it.
|
|
2097
|
+
*
|
|
2098
|
+
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2099
|
+
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2100
|
+
* no details would otherwise render as a bare inset box.
|
|
2101
|
+
*/
|
|
2102
|
+
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2103
|
+
const members = selectedVisitorDataObject.value?.members;
|
|
2104
|
+
if (!Array.isArray(members)) return [];
|
|
2105
|
+
|
|
2106
|
+
return members.filter(
|
|
2107
|
+
(member: Record<string, any>) =>
|
|
2108
|
+
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2109
|
+
);
|
|
2110
|
+
});
|
|
2111
|
+
|
|
2112
|
+
/**
|
|
2113
|
+
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2114
|
+
*
|
|
2115
|
+
* Per member and not per card, so revealing one person's number does not
|
|
2116
|
+
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2117
|
+
* a preview must not open on the next visitor with the last one's NRIC
|
|
2118
|
+
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2119
|
+
* across if the same row were reopened.
|
|
2120
|
+
*/
|
|
2121
|
+
const showVisitorNric = ref(false);
|
|
2122
|
+
const shownMemberNrics = ref<number[]>([]);
|
|
2123
|
+
|
|
2124
|
+
function isMemberNricShown(index: number) {
|
|
2125
|
+
return shownMemberNrics.value.includes(index);
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
function toggleMemberNric(index: number) {
|
|
2129
|
+
shownMemberNrics.value = isMemberNricShown(index)
|
|
2130
|
+
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2131
|
+
: [...shownMemberNrics.value, index];
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
watch(
|
|
2135
|
+
() => dialog.viewVisitor,
|
|
2136
|
+
(open) => {
|
|
2137
|
+
if (open) return;
|
|
2138
|
+
showVisitorNric.value = false;
|
|
2139
|
+
shownMemberNrics.value = [];
|
|
2140
|
+
}
|
|
2141
|
+
);
|
|
2142
|
+
|
|
2143
|
+
/**
|
|
2144
|
+
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2145
|
+
* because the API returns it on `members[]` even though neither
|
|
2146
|
+
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2147
|
+
* model, name and nric only) declares it - the two types have drifted from the
|
|
2148
|
+
* document and from each other. Reading the key defensively costs nothing and
|
|
2149
|
+
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2150
|
+
* reconcile separately.
|
|
2151
|
+
*/
|
|
2152
|
+
const memberDetailFields = [
|
|
2153
|
+
{ key: "nric", label: "NRIC" },
|
|
2154
|
+
{ key: "contact", label: "Contact" },
|
|
2155
|
+
{ key: "plateNumber", label: "Vehicle" },
|
|
2156
|
+
] as const;
|
|
2157
|
+
|
|
1901
2158
|
const formatType = (item: any) =>
|
|
1902
2159
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
1903
2160
|
|
|
@@ -1911,6 +2168,7 @@ const formattedFields = {
|
|
|
1911
2168
|
level: "Level",
|
|
1912
2169
|
unit: "Unit",
|
|
1913
2170
|
purpose: "Purpose",
|
|
2171
|
+
members: "Members",
|
|
1914
2172
|
checkIn: "Check In",
|
|
1915
2173
|
snapshotEntryImage: "Entry Image",
|
|
1916
2174
|
checkOut: "Check Out",
|
|
@@ -2889,6 +3147,100 @@ watchEffect(async () => {
|
|
|
2889
3147
|
word-break: break-word;
|
|
2890
3148
|
}
|
|
2891
3149
|
|
|
3150
|
+
/* A row whose value is a set of records rather than a value - it drops the
|
|
3151
|
+
two-column grid and runs the full width of the card body. */
|
|
3152
|
+
.visitor-preview__row--block {
|
|
3153
|
+
display: block;
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
.visitor-preview__members {
|
|
3157
|
+
display: flex;
|
|
3158
|
+
flex-direction: column;
|
|
3159
|
+
gap: 8px;
|
|
3160
|
+
margin-top: 8px;
|
|
3161
|
+
}
|
|
3162
|
+
|
|
3163
|
+
/*
|
|
3164
|
+
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3165
|
+
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3166
|
+
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3167
|
+
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3168
|
+
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3169
|
+
* off, so the lines below are set on the scale rather than inherited.
|
|
3170
|
+
*/
|
|
3171
|
+
.visitor-preview__member {
|
|
3172
|
+
padding: 9px 12px;
|
|
3173
|
+
border: 1px solid var(--border);
|
|
3174
|
+
border-radius: var(--r-inner);
|
|
3175
|
+
background: var(--hover);
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
.visitor-preview__member-line {
|
|
3179
|
+
display: flex;
|
|
3180
|
+
gap: 8px;
|
|
3181
|
+
margin-top: 3px;
|
|
3182
|
+
font-size: var(--fs-breadcrumb);
|
|
3183
|
+
color: var(--text2);
|
|
3184
|
+
word-break: break-word;
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
.visitor-preview__member-key {
|
|
3188
|
+
flex: 0 0 52px;
|
|
3189
|
+
color: var(--muted);
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
/*
|
|
3193
|
+
* THE NRIC REVEAL.
|
|
3194
|
+
*
|
|
3195
|
+
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3196
|
+
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3197
|
+
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3198
|
+
* make the NRIC line half again the height of the Contact line under it.
|
|
3199
|
+
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3200
|
+
* rhythm, and reads the right way round: the number is what changes.
|
|
3201
|
+
*
|
|
3202
|
+
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3203
|
+
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3204
|
+
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3205
|
+
* same left edge as every other value in the card.
|
|
3206
|
+
*/
|
|
3207
|
+
.visitor-preview__reveal {
|
|
3208
|
+
display: inline-flex;
|
|
3209
|
+
align-items: center;
|
|
3210
|
+
gap: 6px;
|
|
3211
|
+
margin: -3px -7px;
|
|
3212
|
+
padding: 3px 7px;
|
|
3213
|
+
border: none;
|
|
3214
|
+
border-radius: var(--r-inner-sm);
|
|
3215
|
+
background: transparent;
|
|
3216
|
+
font: inherit;
|
|
3217
|
+
color: inherit;
|
|
3218
|
+
text-align: left;
|
|
3219
|
+
cursor: pointer;
|
|
3220
|
+
transition: background var(--motion) ease;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
.visitor-preview__reveal:hover {
|
|
3224
|
+
background: var(--hover);
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
.visitor-preview__reveal:focus-visible {
|
|
3228
|
+
outline: 2px solid var(--accent);
|
|
3229
|
+
outline-offset: 1px;
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3233
|
+
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3234
|
+
.visitor-preview__eye {
|
|
3235
|
+
color: var(--accent-text);
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3239
|
+
.visitor-preview__reveal {
|
|
3240
|
+
transition: none;
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
|
|
2892
3244
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
2893
3245
|
.visitor-type-filter {
|
|
2894
3246
|
max-width: 200px;
|
|
@@ -228,7 +228,11 @@ export default function useAccessManagement() {
|
|
|
228
228
|
unitId: string;
|
|
229
229
|
page?: number;
|
|
230
230
|
limit?: number;
|
|
231
|
+
/** Card-number search. Sent only when non-empty; API-core does not read
|
|
232
|
+
* it yet, so until it does the list comes back unfiltered. */
|
|
233
|
+
search?: string;
|
|
231
234
|
}) {
|
|
235
|
+
const search = params.search?.trim();
|
|
232
236
|
return useNuxtApp().$api<Record<string, any>>(
|
|
233
237
|
`/api/access-management/available-card-contractor/${params.type}`,
|
|
234
238
|
{
|
|
@@ -238,6 +242,7 @@ export default function useAccessManagement() {
|
|
|
238
242
|
unitId: params.unitId,
|
|
239
243
|
page: params.page ?? 1,
|
|
240
244
|
limit: params.limit ?? 100,
|
|
245
|
+
...(search ? { search } : {}),
|
|
241
246
|
},
|
|
242
247
|
}
|
|
243
248
|
);
|
|
@@ -6,6 +6,7 @@ export default function useDocument() {
|
|
|
6
6
|
type = "all",
|
|
7
7
|
site = "",
|
|
8
8
|
parentId = "",
|
|
9
|
+
expiry = "all",
|
|
9
10
|
}: {
|
|
10
11
|
page?: number;
|
|
11
12
|
search?: string;
|
|
@@ -13,6 +14,11 @@ export default function useDocument() {
|
|
|
13
14
|
type?: string;
|
|
14
15
|
site?: string;
|
|
15
16
|
parentId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Which tab is asking: "active" for Documents, "expired" for
|
|
19
|
+
* Document (Expired). Defaults to "all" so existing callers are unaffected.
|
|
20
|
+
*/
|
|
21
|
+
expiry?: string;
|
|
16
22
|
} = {}) {
|
|
17
23
|
const query: Record<string, any> = {
|
|
18
24
|
page,
|
|
@@ -21,6 +27,7 @@ export default function useDocument() {
|
|
|
21
27
|
type,
|
|
22
28
|
site,
|
|
23
29
|
parentId,
|
|
30
|
+
expiry,
|
|
24
31
|
};
|
|
25
32
|
|
|
26
33
|
return useNuxtApp().$api<Record<string, any>>(`/api/documents`, {
|
|
@@ -76,6 +76,8 @@ export default function usetFacility() {
|
|
|
76
76
|
hourInterval?: number;
|
|
77
77
|
isBookingFeeEnabled: boolean;
|
|
78
78
|
isGuestEnabled: boolean;
|
|
79
|
+
isResidentChecklistEnabled: boolean;
|
|
80
|
+
isSecurityChecklistEnabled: boolean;
|
|
79
81
|
bookingAmount: number | null;
|
|
80
82
|
peakBookingFeeAmount?: number | null;
|
|
81
83
|
bookingFeeGuestAmount?: number | null;
|
|
@@ -173,6 +175,8 @@ export default function usetFacility() {
|
|
|
173
175
|
hourInterval = 1,
|
|
174
176
|
isBookingFeeEnabled = false,
|
|
175
177
|
isGuestEnabled = false,
|
|
178
|
+
isResidentChecklistEnabled = false,
|
|
179
|
+
isSecurityChecklistEnabled = false,
|
|
176
180
|
bookingAmount = 0,
|
|
177
181
|
peakBookingFeeAmount = 0,
|
|
178
182
|
bookingFeeGuestAmount = 0,
|
|
@@ -236,6 +240,13 @@ export default function usetFacility() {
|
|
|
236
240
|
this.hourInterval = hourInterval;
|
|
237
241
|
this.isBookingFeeEnabled = isBookingFeeEnabled;
|
|
238
242
|
this.isGuestEnabled = isGuestEnabled;
|
|
243
|
+
// Exactly one owner, always. `isResidentChecklistEnabled` is the flag
|
|
244
|
+
// the apps gate on, so it decides, and security is its complement —
|
|
245
|
+
// stored rather than computed so each app can read its own flag without
|
|
246
|
+
// knowing the rule. A facility predating both fields lands on security,
|
|
247
|
+
// which is how every one of them already behaved.
|
|
248
|
+
this.isResidentChecklistEnabled = isResidentChecklistEnabled === true;
|
|
249
|
+
this.isSecurityChecklistEnabled = !this.isResidentChecklistEnabled;
|
|
239
250
|
this.bookingAmount = bookingAmount;
|
|
240
251
|
this.peakBookingFeeAmount = peakBookingFeeAmount;
|
|
241
252
|
this.bookingFeeGuestAmount = bookingFeeGuestAmount;
|
|
@@ -28,6 +28,22 @@ export type HidReaderPayload = {
|
|
|
28
28
|
lastCallbackType?: string;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
export type HidProfileQr = {
|
|
32
|
+
readerId: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
memberId: string;
|
|
35
|
+
hidUserId: string;
|
|
36
|
+
registration: string;
|
|
37
|
+
readerName: string;
|
|
38
|
+
portalName: string;
|
|
39
|
+
qrEnabled: boolean;
|
|
40
|
+
issued: boolean;
|
|
41
|
+
qrValue: string;
|
|
42
|
+
issuedAt: string;
|
|
43
|
+
/** null when the permission lookup itself failed, so "unknown" stays distinct from "no". */
|
|
44
|
+
assigned: boolean | null;
|
|
45
|
+
};
|
|
46
|
+
|
|
31
47
|
type HidIdentityPayload = {
|
|
32
48
|
site?: string;
|
|
33
49
|
hidUserId?: string | number;
|
|
@@ -166,6 +182,36 @@ export default function useHidAmico() {
|
|
|
166
182
|
});
|
|
167
183
|
}
|
|
168
184
|
|
|
185
|
+
/**
|
|
186
|
+
* The signed-in member's own QR code on one reader.
|
|
187
|
+
*
|
|
188
|
+
* No user id in the path: the server takes the caller from the session, so
|
|
189
|
+
* these cannot be pointed at somebody else. `assigned` in the response says
|
|
190
|
+
* whether the HID permissions screen actually admits this member to the
|
|
191
|
+
* reader - issuing a code does not grant access, and the screen has to be
|
|
192
|
+
* able to say so.
|
|
193
|
+
*/
|
|
194
|
+
function getProfileQr(readerId: string) {
|
|
195
|
+
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
196
|
+
`${basePath}/readers/${readerId}/profile-qr`,
|
|
197
|
+
{ method: "GET" },
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function issueProfileQr(readerId: string) {
|
|
202
|
+
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
203
|
+
`${basePath}/readers/${readerId}/profile-qr`,
|
|
204
|
+
{ method: "POST" },
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function deleteProfileQr(readerId: string) {
|
|
209
|
+
return useNuxtApp().$api<{ data: HidProfileQr }>(
|
|
210
|
+
`${basePath}/readers/${readerId}/profile-qr`,
|
|
211
|
+
{ method: "DELETE" },
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
169
215
|
function createReader(payload: HidReaderPayload) {
|
|
170
216
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers`, {
|
|
171
217
|
method: "POST",
|
|
@@ -414,6 +460,27 @@ export default function useHidAmico() {
|
|
|
414
460
|
);
|
|
415
461
|
}
|
|
416
462
|
|
|
463
|
+
function getUserPasswordStatus(readerId: string, hidUserId: string | number) {
|
|
464
|
+
return useNuxtApp().$api<HidApiRecord>(
|
|
465
|
+
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
466
|
+
{ method: "GET" },
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function setUserPassword(readerId: string, hidUserId: string | number, password: string) {
|
|
471
|
+
return useNuxtApp().$api<HidApiRecord>(
|
|
472
|
+
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
473
|
+
{ method: "PUT", body: { password } },
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function deleteUserPassword(readerId: string, hidUserId: string | number) {
|
|
478
|
+
return useNuxtApp().$api<HidApiRecord>(
|
|
479
|
+
`${basePath}/readers/${readerId}/users/${hidUserId}/password`,
|
|
480
|
+
{ method: "DELETE" },
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
|
|
417
484
|
function deleteUserPin(readerId: string, hidUserId: string | number) {
|
|
418
485
|
return useNuxtApp().$api<{ data: { pinEnrolled: boolean } }>(
|
|
419
486
|
`${basePath}/readers/${readerId}/users/${hidUserId}/pin`,
|
|
@@ -474,6 +541,29 @@ export default function useHidAmico() {
|
|
|
474
541
|
);
|
|
475
542
|
}
|
|
476
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Wake the resident's phone for a call the web phone has just placed.
|
|
546
|
+
*
|
|
547
|
+
* The SIP INVITE is the call and travels over the WebSocket, not through the
|
|
548
|
+
* API; this only rings the resident's mobile so somebody is there to answer
|
|
549
|
+
* it. It is therefore fired after the INVITE and never awaited in a way that
|
|
550
|
+
* could fail the call — see `startWebCall` in `HidIntercomManagement.vue`.
|
|
551
|
+
*
|
|
552
|
+
* `notified: false` with a reason is a normal response, not an error: staff
|
|
553
|
+
* extensions and external SIP addresses have no resident behind them.
|
|
554
|
+
*/
|
|
555
|
+
function notifyIntercomCall(
|
|
556
|
+
siteId: string,
|
|
557
|
+
payload: { orgId: string; destination: string; callId: string; readerId?: string },
|
|
558
|
+
) {
|
|
559
|
+
return useNuxtApp().$api<{
|
|
560
|
+
data: { notified: boolean; delivered?: number; reason?: string };
|
|
561
|
+
}>(
|
|
562
|
+
`${basePath}/sites/${siteId}/intercom/notify-call`,
|
|
563
|
+
{ method: "POST", body: payload },
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
|
|
477
567
|
function getPermissionCandidates(
|
|
478
568
|
siteId: string,
|
|
479
569
|
query: {
|
|
@@ -505,6 +595,9 @@ export default function useHidAmico() {
|
|
|
505
595
|
|
|
506
596
|
return {
|
|
507
597
|
getReaders,
|
|
598
|
+
getProfileQr,
|
|
599
|
+
issueProfileQr,
|
|
600
|
+
deleteProfileQr,
|
|
508
601
|
discoverReader,
|
|
509
602
|
createReader,
|
|
510
603
|
updateReader,
|
|
@@ -530,6 +623,9 @@ export default function useHidAmico() {
|
|
|
530
623
|
getUserPinStatus,
|
|
531
624
|
setUserPin,
|
|
532
625
|
deleteUserPin,
|
|
626
|
+
getUserPasswordStatus,
|
|
627
|
+
setUserPassword,
|
|
628
|
+
deleteUserPassword,
|
|
533
629
|
getIdentities,
|
|
534
630
|
getReaderUsers,
|
|
535
631
|
getReaderAccessLogs,
|
|
@@ -540,6 +636,7 @@ export default function useHidAmico() {
|
|
|
540
636
|
makeIntercomCall,
|
|
541
637
|
finalizeIntercomCall,
|
|
542
638
|
ensureSipAccount,
|
|
639
|
+
notifyIntercomCall,
|
|
543
640
|
getSitePermissions,
|
|
544
641
|
getPermissionCandidates,
|
|
545
642
|
updateSitePermissions,
|
|
@@ -46,9 +46,33 @@ export default function useHidNavigation() {
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
+
// "HID Reader Users" now points at `access-mgmt/administrator`, not at
|
|
50
|
+
// `access-mgmt/hid-users`.
|
|
51
|
+
//
|
|
52
|
+
// Both routes mount a roster of the reader's users, but only this one
|
|
53
|
+
// can act on them. `administrator` renders HidUserEnrollment WITHOUT
|
|
54
|
+
// `card-management`, and that prop is what gates the Enroll action:
|
|
55
|
+
// <template v-if="!props.cardManagement" #actions>
|
|
56
|
+
// `hid-users` renders HidReaderUserRoster, which is read-only apart
|
|
57
|
+
// from PIN management. So the menu entry with this name used to lead
|
|
58
|
+
// to the screen that cannot enrol, while the screen that can was
|
|
59
|
+
// reachable only by typing the URL.
|
|
60
|
+
//
|
|
61
|
+
// `hid-users` is left in place and simply unlisted - the same state
|
|
62
|
+
// `administrator` was in - so any existing link to it still resolves.
|
|
49
63
|
title: "HID Reader Users",
|
|
50
64
|
route: {
|
|
51
|
-
name: "org-site-access-mgmt-
|
|
65
|
+
name: "org-site-access-mgmt-administrator",
|
|
66
|
+
params: { org, site },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
// The signed-in member's own pass, not somebody else's. Every other
|
|
71
|
+
// entry in this group acts on a resident or a visitor; this one has
|
|
72
|
+
// no subject but the caller.
|
|
73
|
+
title: "HID QR Code",
|
|
74
|
+
route: {
|
|
75
|
+
name: "org-site-access-mgmt-hid-qr-code",
|
|
52
76
|
params: { org, site },
|
|
53
77
|
},
|
|
54
78
|
},
|