@7365admin1/layer-common 4.7.3 → 4.8.1-staging.304
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 +25 -4
- package/components/EntryPass/QrTemplatePreview.vue +21 -25
- package/components/Facility/BookingSetup.vue +63 -0
- package/components/HidIntercomManagement.vue +193 -43
- package/components/HidProfileQrCode.vue +323 -0
- package/components/HidReaderUserRoster.vue +32 -2
- package/components/HidUserEnrollment.vue +771 -212
- package/components/InvitationClientForm.vue +19 -1
- package/components/RolePermissionFormPreviewUpdate.vue +45 -0
- package/components/RolePermissionMain.vue +20 -0
- package/components/VisitorManagement.vue +267 -5
- package/composables/useCleaningPermission.ts +40 -0
- package/composables/useFacility.ts +11 -0
- package/composables/useHidAmico.ts +97 -0
- package/composables/useHidNavigation.ts +25 -1
- package/composables/useLandscapingPermission.ts +35 -0
- package/composables/usePeople.ts +19 -0
- package/composables/useWebUsb.ts +14 -11
- package/package.json +1 -1
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
- package/types/facility.d.ts +4 -0
- package/types/people.d.ts +4 -1
- package/utils/materialSymbols.ts +3 -0
- package/utils/org-modules.ts +86 -8
|
@@ -251,9 +251,27 @@ watch(
|
|
|
251
251
|
const roles = ref<any[]>([])
|
|
252
252
|
const { getRoles } = useRole()
|
|
253
253
|
|
|
254
|
+
/*
|
|
255
|
+
* `type` is the ROLE type, not the service the client subscribes to, and the
|
|
256
|
+
* only caller (`ClientMain.vue` "Invite Client") passes no `app` prop -- so
|
|
257
|
+
* this sent `type: ""` and the endpoint applied no type filter at all. The
|
|
258
|
+
* dropdown therefore listed every org-less role of every type, which includes
|
|
259
|
+
* the platform's OWN staff roles (`type: "admin"` -- the two rows the console's
|
|
260
|
+
* `/super-admin/role-permissions` screen edits). Offering a Seven365 console
|
|
261
|
+
* staff role on a CLIENT invitation is the defect.
|
|
262
|
+
*
|
|
263
|
+
* A client admin's role is `type: "organization"`, which is what the client
|
|
264
|
+
* roles screen (`org/[organization]/roles-permissions.vue`) already lists. This
|
|
265
|
+
* narrows to exactly that. It is a narrowing of this one picker only: no role
|
|
266
|
+
* changes, no permission changes, and the org-less `organization` roles that
|
|
267
|
+
* were already being picked are all still offered.
|
|
268
|
+
*
|
|
269
|
+
* Keying off the selected service instead would empty the dropdown -- no
|
|
270
|
+
* org-less role carries a service type -- so `props.app` is not the filter.
|
|
271
|
+
*/
|
|
254
272
|
const { data: roleData, refresh: refreshRoles } = await useLazyAsyncData(
|
|
255
273
|
"roles",
|
|
256
|
-
() => getRoles({ org: org.value?._id, type:
|
|
274
|
+
() => getRoles({ org: org.value?._id, type: "organization", limit: 50 }),
|
|
257
275
|
{ watch: [() => props.app] }
|
|
258
276
|
)
|
|
259
277
|
|
|
@@ -108,6 +108,41 @@
|
|
|
108
108
|
</template>
|
|
109
109
|
</template>
|
|
110
110
|
</div>
|
|
111
|
+
|
|
112
|
+
<!--
|
|
113
|
+
F5: grants the role HOLDS that this client's module list no
|
|
114
|
+
longer offers. Read-only: nothing here can be ticked or unticked,
|
|
115
|
+
and saving keeps them exactly as stored.
|
|
116
|
+
-->
|
|
117
|
+
<div v-if="hasNotOffered" class="role-perm__not-offered mt-4">
|
|
118
|
+
<div class="role-perm__row-title mb-1">
|
|
119
|
+
Granted — not offered to this client
|
|
120
|
+
</div>
|
|
121
|
+
<div class="role-perm__row-sub mb-2">
|
|
122
|
+
This role still holds these. They are outside this client's
|
|
123
|
+
modules, so they cannot be changed here, and saving keeps them.
|
|
124
|
+
</div>
|
|
125
|
+
<div class="role-perm__list">
|
|
126
|
+
<template
|
|
127
|
+
v-for="(actions, resourceKey, resourceIndex) in props.notOfferedPermissions"
|
|
128
|
+
:key="resourceKey"
|
|
129
|
+
>
|
|
130
|
+
<v-divider v-if="resourceIndex > 0" />
|
|
131
|
+
<v-list-item density="compact" :ripple="false">
|
|
132
|
+
<v-list-item-title class="text-capitalize role-perm__row-title">
|
|
133
|
+
{{ formatResourceLabel(String(resourceKey)) }}
|
|
134
|
+
</v-list-item-title>
|
|
135
|
+
<v-list-item-subtitle class="role-perm__row-sub">
|
|
136
|
+
{{
|
|
137
|
+
Object.keys(actions || {})
|
|
138
|
+
.map((action) => formatActionLabel(action))
|
|
139
|
+
.join(", ")
|
|
140
|
+
}}
|
|
141
|
+
</v-list-item-subtitle>
|
|
142
|
+
</v-list-item>
|
|
143
|
+
</template>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
111
146
|
<div v-if="errorMessages" class="role-perm__error mt-2">
|
|
112
147
|
{{ errorMessages }}
|
|
113
148
|
</div>
|
|
@@ -175,6 +210,12 @@ const props = defineProps({
|
|
|
175
210
|
type: Object,
|
|
176
211
|
default: () => ({}),
|
|
177
212
|
},
|
|
213
|
+
// F5: held grants outside the client's offer, `{ resource: { action } }`.
|
|
214
|
+
// Display only -- never part of the tree the toggles act on.
|
|
215
|
+
notOfferedPermissions: {
|
|
216
|
+
type: Object,
|
|
217
|
+
default: () => ({}),
|
|
218
|
+
},
|
|
178
219
|
// "Update role". This dialog had no permission prop at all, so it showed Edit
|
|
179
220
|
// to everyone -- including on the seeded platform-owner role -- and the
|
|
180
221
|
// `canUpdateRole` the apps have been passing to `RolePermissionMain` in good
|
|
@@ -294,6 +335,10 @@ const visiblePermissions = computed(() => {
|
|
|
294
335
|
return matches;
|
|
295
336
|
});
|
|
296
337
|
|
|
338
|
+
const hasNotOffered = computed(
|
|
339
|
+
() => Object.keys(props.notOfferedPermissions || {}).length > 0
|
|
340
|
+
);
|
|
341
|
+
|
|
297
342
|
const hasVisiblePermissions = computed(
|
|
298
343
|
() => Object.keys(visiblePermissions.value).length > 0
|
|
299
344
|
);
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
@success="successfulUpdate()"
|
|
113
113
|
:permissions="Permissions"
|
|
114
114
|
:original-permissions="originalPermissions"
|
|
115
|
+
:not-offered-permissions="heldNotOffered"
|
|
115
116
|
v-model="selectedPermissions"
|
|
116
117
|
v-model:edit="edit"
|
|
117
118
|
:name="name"
|
|
@@ -572,6 +573,25 @@ const Permissions = computed(() => {
|
|
|
572
573
|
: filterPermissions(offeredPermissions.value, originalPermissions.value);
|
|
573
574
|
});
|
|
574
575
|
|
|
576
|
+
/*
|
|
577
|
+
* F5: WHAT THE ROLE HOLDS THAT THIS CLIENT IS NO LONGER OFFERED.
|
|
578
|
+
*
|
|
579
|
+
* The tree above is the narrowed catalogue, so a grant outside the client's
|
|
580
|
+
* module list simply vanished from it and the role LOOKED as if it lacked a
|
|
581
|
+
* module it still holds. The dialog lists these separately, read-only. Saving
|
|
582
|
+
* keeps them: the dialog's model is the full stored array and every toggle only
|
|
583
|
+
* touches keys in the tree. Empty (the same object) whenever nothing is narrowed.
|
|
584
|
+
*/
|
|
585
|
+
const heldNotOffered = computed(() => {
|
|
586
|
+
const all = (props.permissions ?? {}) as TPermissions;
|
|
587
|
+
const offered = offeredPermissions.value as TPermissions;
|
|
588
|
+
if (offered === all) return {};
|
|
589
|
+
const outside = Object.fromEntries(
|
|
590
|
+
Object.entries(all).filter(([resource]) => !(resource in offered))
|
|
591
|
+
) as TPermissions;
|
|
592
|
+
return filterPermissions(outside, originalPermissions.value);
|
|
593
|
+
});
|
|
594
|
+
|
|
575
595
|
function successfulUpdate() {
|
|
576
596
|
const savedPermissions = [...selectedPermissions.value];
|
|
577
597
|
|
|
@@ -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,84 @@
|
|
|
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
|
+
|
|
799
901
|
<div
|
|
800
902
|
v-else-if="selectedVisitorObject[key]"
|
|
801
903
|
class="visitor-preview__row"
|
|
@@ -1898,6 +2000,71 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
1898
2000
|
() => selectedVisitorStatus.value === "pending"
|
|
1899
2001
|
);
|
|
1900
2002
|
|
|
2003
|
+
/**
|
|
2004
|
+
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2005
|
+
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2006
|
+
* party has one wherever the screen shows it.
|
|
2007
|
+
*
|
|
2008
|
+
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2009
|
+
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2010
|
+
* no details would otherwise render as a bare inset box.
|
|
2011
|
+
*/
|
|
2012
|
+
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2013
|
+
const members = selectedVisitorDataObject.value?.members;
|
|
2014
|
+
if (!Array.isArray(members)) return [];
|
|
2015
|
+
|
|
2016
|
+
return members.filter(
|
|
2017
|
+
(member: Record<string, any>) =>
|
|
2018
|
+
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2019
|
+
);
|
|
2020
|
+
});
|
|
2021
|
+
|
|
2022
|
+
/**
|
|
2023
|
+
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2024
|
+
*
|
|
2025
|
+
* Per member and not per card, so revealing one person's number does not
|
|
2026
|
+
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2027
|
+
* a preview must not open on the next visitor with the last one's NRIC
|
|
2028
|
+
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2029
|
+
* across if the same row were reopened.
|
|
2030
|
+
*/
|
|
2031
|
+
const showVisitorNric = ref(false);
|
|
2032
|
+
const shownMemberNrics = ref<number[]>([]);
|
|
2033
|
+
|
|
2034
|
+
function isMemberNricShown(index: number) {
|
|
2035
|
+
return shownMemberNrics.value.includes(index);
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
function toggleMemberNric(index: number) {
|
|
2039
|
+
shownMemberNrics.value = isMemberNricShown(index)
|
|
2040
|
+
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2041
|
+
: [...shownMemberNrics.value, index];
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
watch(
|
|
2045
|
+
() => dialog.viewVisitor,
|
|
2046
|
+
(open) => {
|
|
2047
|
+
if (open) return;
|
|
2048
|
+
showVisitorNric.value = false;
|
|
2049
|
+
shownMemberNrics.value = [];
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2055
|
+
* because the API returns it on `members[]` even though neither
|
|
2056
|
+
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2057
|
+
* model, name and nric only) declares it - the two types have drifted from the
|
|
2058
|
+
* document and from each other. Reading the key defensively costs nothing and
|
|
2059
|
+
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2060
|
+
* reconcile separately.
|
|
2061
|
+
*/
|
|
2062
|
+
const memberDetailFields = [
|
|
2063
|
+
{ key: "nric", label: "NRIC" },
|
|
2064
|
+
{ key: "contact", label: "Contact" },
|
|
2065
|
+
{ key: "plateNumber", label: "Vehicle" },
|
|
2066
|
+
] as const;
|
|
2067
|
+
|
|
1901
2068
|
const formatType = (item: any) =>
|
|
1902
2069
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
1903
2070
|
|
|
@@ -1911,6 +2078,7 @@ const formattedFields = {
|
|
|
1911
2078
|
level: "Level",
|
|
1912
2079
|
unit: "Unit",
|
|
1913
2080
|
purpose: "Purpose",
|
|
2081
|
+
members: "Members",
|
|
1914
2082
|
checkIn: "Check In",
|
|
1915
2083
|
snapshotEntryImage: "Entry Image",
|
|
1916
2084
|
checkOut: "Check Out",
|
|
@@ -2889,6 +3057,100 @@ watchEffect(async () => {
|
|
|
2889
3057
|
word-break: break-word;
|
|
2890
3058
|
}
|
|
2891
3059
|
|
|
3060
|
+
/* A row whose value is a set of records rather than a value - it drops the
|
|
3061
|
+
two-column grid and runs the full width of the card body. */
|
|
3062
|
+
.visitor-preview__row--block {
|
|
3063
|
+
display: block;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
.visitor-preview__members {
|
|
3067
|
+
display: flex;
|
|
3068
|
+
flex-direction: column;
|
|
3069
|
+
gap: 8px;
|
|
3070
|
+
margin-top: 8px;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
/*
|
|
3074
|
+
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3075
|
+
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3076
|
+
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3077
|
+
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3078
|
+
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3079
|
+
* off, so the lines below are set on the scale rather than inherited.
|
|
3080
|
+
*/
|
|
3081
|
+
.visitor-preview__member {
|
|
3082
|
+
padding: 9px 12px;
|
|
3083
|
+
border: 1px solid var(--border);
|
|
3084
|
+
border-radius: var(--r-inner);
|
|
3085
|
+
background: var(--hover);
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
.visitor-preview__member-line {
|
|
3089
|
+
display: flex;
|
|
3090
|
+
gap: 8px;
|
|
3091
|
+
margin-top: 3px;
|
|
3092
|
+
font-size: var(--fs-breadcrumb);
|
|
3093
|
+
color: var(--text2);
|
|
3094
|
+
word-break: break-word;
|
|
3095
|
+
}
|
|
3096
|
+
|
|
3097
|
+
.visitor-preview__member-key {
|
|
3098
|
+
flex: 0 0 52px;
|
|
3099
|
+
color: var(--muted);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
/*
|
|
3103
|
+
* THE NRIC REVEAL.
|
|
3104
|
+
*
|
|
3105
|
+
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3106
|
+
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3107
|
+
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3108
|
+
* make the NRIC line half again the height of the Contact line under it.
|
|
3109
|
+
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3110
|
+
* rhythm, and reads the right way round: the number is what changes.
|
|
3111
|
+
*
|
|
3112
|
+
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3113
|
+
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3114
|
+
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3115
|
+
* same left edge as every other value in the card.
|
|
3116
|
+
*/
|
|
3117
|
+
.visitor-preview__reveal {
|
|
3118
|
+
display: inline-flex;
|
|
3119
|
+
align-items: center;
|
|
3120
|
+
gap: 6px;
|
|
3121
|
+
margin: -3px -7px;
|
|
3122
|
+
padding: 3px 7px;
|
|
3123
|
+
border: none;
|
|
3124
|
+
border-radius: var(--r-inner-sm);
|
|
3125
|
+
background: transparent;
|
|
3126
|
+
font: inherit;
|
|
3127
|
+
color: inherit;
|
|
3128
|
+
text-align: left;
|
|
3129
|
+
cursor: pointer;
|
|
3130
|
+
transition: background var(--motion) ease;
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
.visitor-preview__reveal:hover {
|
|
3134
|
+
background: var(--hover);
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
.visitor-preview__reveal:focus-visible {
|
|
3138
|
+
outline: 2px solid var(--accent);
|
|
3139
|
+
outline-offset: 1px;
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3143
|
+
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3144
|
+
.visitor-preview__eye {
|
|
3145
|
+
color: var(--accent-text);
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3149
|
+
.visitor-preview__reveal {
|
|
3150
|
+
transition: none;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
|
|
2892
3154
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
2893
3155
|
.visitor-type-filter {
|
|
2894
3156
|
max-width: 200px;
|
|
@@ -21,6 +21,46 @@ export default function useCleaningPermission() {
|
|
|
21
21
|
invitations: invitationPermissions,
|
|
22
22
|
"bulletin-board": bulletinBoardPermissions,
|
|
23
23
|
|
|
24
|
+
// Owner decision 3A, 2026-09-11: Emergency Contacts is offered in the
|
|
25
|
+
// Cleaning role editor. Exactly the seven actions `constants/permissions.ts`
|
|
26
|
+
// defines; descriptions from `usePropertyPermission`. The long spelling
|
|
27
|
+
// `see-all-emergency-contacts` is deliberately NOT added -- the hygiene app
|
|
28
|
+
// already accepts `see-all`, and a second "see all" row would only confuse.
|
|
29
|
+
"emergency-contact": {
|
|
30
|
+
"see-all": {
|
|
31
|
+
check: true,
|
|
32
|
+
description: "Allows the user to view the list of all emergency contacts.",
|
|
33
|
+
},
|
|
34
|
+
"see-details": {
|
|
35
|
+
check: true,
|
|
36
|
+
description:
|
|
37
|
+
"Allows the user to view the details of a specific emergency contact.",
|
|
38
|
+
},
|
|
39
|
+
"add-emergency-contact": {
|
|
40
|
+
check: true,
|
|
41
|
+
description: "Allows the user to add a new emergency contact to the system.",
|
|
42
|
+
},
|
|
43
|
+
"update-emergency-contact": {
|
|
44
|
+
check: true,
|
|
45
|
+
description: "Allows the user to update emergency contact details.",
|
|
46
|
+
},
|
|
47
|
+
"delete-emergency-contact": {
|
|
48
|
+
check: true,
|
|
49
|
+
description:
|
|
50
|
+
"Allows the user to remove an emergency contact from the system permanently.",
|
|
51
|
+
},
|
|
52
|
+
"add-emergency-contact-category": {
|
|
53
|
+
check: true,
|
|
54
|
+
description:
|
|
55
|
+
"Allows the user to add a new emergency contact category to the system.",
|
|
56
|
+
},
|
|
57
|
+
"delete-emergency-contact-category": {
|
|
58
|
+
check: true,
|
|
59
|
+
description:
|
|
60
|
+
"Allows the user to delete an emergency contact category from the system.",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
24
64
|
// `hasPermission` looks an action up as `catalogue[resource][action]`, so a
|
|
25
65
|
// resource with no key here can never answer anything but `false` -- the
|
|
26
66
|
// gate is then reachable only through the `"*"` short-circuit. These two
|
|
@@ -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,
|