@7365admin1/layer-common 4.35.1-staging.384 → 4.36.0
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 +10 -4
- package/assets/css/primitives.css +0 -43
- package/assets/css/robot-hero.css +2 -2
- package/components/AccessCardAddForm.vue +4 -5
- package/components/AccessCardAssignToUnitForm.vue +2 -3
- package/components/AccessCardPreviewDialog.vue +3 -4
- package/components/AppSelect.vue +3 -77
- package/components/CameraForm.vue +6 -20
- package/components/DashboardMain.vue +60 -66
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/EntryPass/QrTemplatePreview.vue +25 -21
- package/components/EntryPassInformation.vue +24 -119
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +17 -74
- package/components/HidIntercomManagement.vue +14 -180
- package/components/HidQrCodeConfiguration.vue +195 -17
- package/components/HidReaderManagement.vue +0 -398
- package/components/HidReaderUserRoster.vue +3 -44
- package/components/HidUserEnrollment.vue +155 -845
- package/components/InvitationClientForm.vue +1 -19
- package/components/Layout/NavigationDrawer.vue +1 -4
- package/components/NotificationBell.vue +7 -59
- package/components/Robot/BuildingMap.vue +9 -16
- package/components/Robot/LiftQueue.vue +4 -9
- package/components/Robot/MapEditor.vue +8 -1
- package/components/RolePermissionFormCreate.vue +3 -4
- package/components/RolePermissionFormPreviewUpdate.vue +5 -12
- package/components/RolePermissionMain.vue +0 -1
- package/components/ServiceProviderInvitationPrompt.vue +155 -0
- package/components/ServiceProviderMain.vue +30 -178
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +10 -285
- package/components/VisitorSocketPopUp.vue +1 -2
- package/composables/useANPRSettings.ts +15 -45
- package/composables/useAccessManagement.ts +0 -5
- package/composables/useCleaningPermission.ts +0 -2
- package/composables/useCommonPermission.ts +0 -32
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -159
- package/composables/useHidNavigation.ts +1 -25
- package/composables/usePeople.ts +0 -19
- package/composables/usePropertyPermission.ts +0 -19
- package/composables/useRobotBuilding.ts +3 -22
- package/composables/useRobots.ts +0 -13
- package/composables/useSecurityPermission.ts +0 -19
- package/composables/useServiceProvider.ts +0 -3
- package/composables/useServiceProviderInvitation.ts +3 -101
- package/composables/useSiteEntryPassSettings.ts +0 -26
- package/composables/useWebUsb.ts +11 -14
- package/package.json +2 -2
- 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-readers/index.vue +1 -1
- package/plugins/API.ts +0 -11
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/people.d.ts +1 -28
- package/utils/module-routes.ts +1 -8
- package/utils/nav-sections.ts +2 -8
- package/utils/notification-target.ts +8 -277
- package/utils/permission-labels.ts +2 -20
- package/components/ClientInvitations.vue +0 -291
- package/components/HidAccessPermissions.vue +0 -424
- package/components/HidProfileQrCode.vue +0 -332
- package/composables/useHidReaderSelection.ts +0 -50
- package/composables/useSiteCategory.ts +0 -45
- package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +0 -23
- package/utils/dashboard-widget-prefs.ts +0 -54
- package/utils/hid-permission-assignments.ts +0 -190
- package/utils/hid-reader-selection.ts +0 -52
- package/utils/occupancy-role.ts +0 -109
- package/utils/robot-fleet-core.ts +0 -57
- package/utils/sp-inviter-row.ts +0 -86
|
@@ -742,35 +742,11 @@
|
|
|
742
742
|
class="visitor-preview__row"
|
|
743
743
|
>
|
|
744
744
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
745
|
-
<div
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
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>
|
|
745
|
+
<div
|
|
746
|
+
v-tooltip:top="selectedVisitorObject[key]"
|
|
747
|
+
class="visitor-preview__value"
|
|
748
|
+
>
|
|
749
|
+
{{ maskNRIC(selectedVisitorObject[key]) }}
|
|
774
750
|
</div>
|
|
775
751
|
</div>
|
|
776
752
|
|
|
@@ -820,84 +796,6 @@
|
|
|
820
796
|
</div>
|
|
821
797
|
</div>
|
|
822
798
|
|
|
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
799
|
<!-- The vehicle number, with Block on its right: the Registered
|
|
902
800
|
tab only, for someone who may add vehicles. It opens the
|
|
903
801
|
Vehicle Mgmt Block Listed form with the category taken from
|
|
@@ -1604,17 +1502,8 @@ const { org: orgId, site: siteId } = route.params as {
|
|
|
1604
1502
|
site: string;
|
|
1605
1503
|
};
|
|
1606
1504
|
|
|
1607
|
-
|
|
1608
|
-
// toast to have fetched them - that copy could belong to the previous site.
|
|
1609
|
-
const {
|
|
1610
|
-
enableUnregistered,
|
|
1611
|
-
loaded: anprSettingsLoaded,
|
|
1612
|
-
ensureANPRSettings,
|
|
1613
|
-
} = useANPRSettings(siteId);
|
|
1505
|
+
const { enableUnregistered } = useANPRSettings(siteId);
|
|
1614
1506
|
const enableUnregisteredTab = computed(() => enableUnregistered.value);
|
|
1615
|
-
ensureANPRSettings(true).catch(() => {
|
|
1616
|
-
// No settings = no Unregistered tab, same as before.
|
|
1617
|
-
});
|
|
1618
1507
|
|
|
1619
1508
|
const {
|
|
1620
1509
|
getVisitors,
|
|
@@ -2199,71 +2088,6 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
2199
2088
|
() => selectedVisitorStatus.value === "pending"
|
|
2200
2089
|
);
|
|
2201
2090
|
|
|
2202
|
-
/**
|
|
2203
|
-
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2204
|
-
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2205
|
-
* party has one wherever the screen shows it.
|
|
2206
|
-
*
|
|
2207
|
-
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2208
|
-
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2209
|
-
* no details would otherwise render as a bare inset box.
|
|
2210
|
-
*/
|
|
2211
|
-
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2212
|
-
const members = selectedVisitorDataObject.value?.members;
|
|
2213
|
-
if (!Array.isArray(members)) return [];
|
|
2214
|
-
|
|
2215
|
-
return members.filter(
|
|
2216
|
-
(member: Record<string, any>) =>
|
|
2217
|
-
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2218
|
-
);
|
|
2219
|
-
});
|
|
2220
|
-
|
|
2221
|
-
/**
|
|
2222
|
-
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2223
|
-
*
|
|
2224
|
-
* Per member and not per card, so revealing one person's number does not
|
|
2225
|
-
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2226
|
-
* a preview must not open on the next visitor with the last one's NRIC
|
|
2227
|
-
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2228
|
-
* across if the same row were reopened.
|
|
2229
|
-
*/
|
|
2230
|
-
const showVisitorNric = ref(false);
|
|
2231
|
-
const shownMemberNrics = ref<number[]>([]);
|
|
2232
|
-
|
|
2233
|
-
function isMemberNricShown(index: number) {
|
|
2234
|
-
return shownMemberNrics.value.includes(index);
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
function toggleMemberNric(index: number) {
|
|
2238
|
-
shownMemberNrics.value = isMemberNricShown(index)
|
|
2239
|
-
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2240
|
-
: [...shownMemberNrics.value, index];
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
watch(
|
|
2244
|
-
() => dialog.viewVisitor,
|
|
2245
|
-
(open) => {
|
|
2246
|
-
if (open) return;
|
|
2247
|
-
showVisitorNric.value = false;
|
|
2248
|
-
shownMemberNrics.value = [];
|
|
2249
|
-
}
|
|
2250
|
-
);
|
|
2251
|
-
|
|
2252
|
-
/**
|
|
2253
|
-
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2254
|
-
* because the API returns it on `members[]` even though neither
|
|
2255
|
-
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2256
|
-
* model, name and nric only) declares it - the two types have drifted from the
|
|
2257
|
-
* document and from each other. Reading the key defensively costs nothing and
|
|
2258
|
-
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2259
|
-
* reconcile separately.
|
|
2260
|
-
*/
|
|
2261
|
-
const memberDetailFields = [
|
|
2262
|
-
{ key: "nric", label: "NRIC" },
|
|
2263
|
-
{ key: "contact", label: "Contact" },
|
|
2264
|
-
{ key: "plateNumber", label: "Vehicle" },
|
|
2265
|
-
] as const;
|
|
2266
|
-
|
|
2267
2091
|
const formatType = (item: any) =>
|
|
2268
2092
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
2269
2093
|
|
|
@@ -2277,7 +2101,6 @@ const formattedFields = {
|
|
|
2277
2101
|
level: "Level",
|
|
2278
2102
|
unit: "Unit",
|
|
2279
2103
|
purpose: "Purpose",
|
|
2280
|
-
members: "Members",
|
|
2281
2104
|
checkIn: "Check In",
|
|
2282
2105
|
snapshotEntryImage: "Entry Image",
|
|
2283
2106
|
checkOut: "Check Out",
|
|
@@ -3110,11 +2933,7 @@ watch([searchInput, dateFrom, dateTo, filterTypes, activeTab], () => {
|
|
|
3110
2933
|
const syncVisitorFiltersFromRoute = () => {
|
|
3111
2934
|
const requestedTab = (route.query.tab as string) || "registered";
|
|
3112
2935
|
const nextTab =
|
|
3113
|
-
|
|
3114
|
-
// toast links here) instead of bouncing it to Registered.
|
|
3115
|
-
(anprSettingsLoaded.value &&
|
|
3116
|
-
!enableUnregisteredTab.value &&
|
|
3117
|
-
requestedTab === "unregistered") ||
|
|
2936
|
+
(!enableUnregisteredTab.value && requestedTab === "unregistered") ||
|
|
3118
2937
|
(!showResidentTransactionsTab.value && requestedTab === "resident-transactions")
|
|
3119
2938
|
? "registered"
|
|
3120
2939
|
: requestedTab;
|
|
@@ -3173,9 +2992,9 @@ const { socketUnregisteredVisitorTrigger, visitorSocketData } =
|
|
|
3173
2992
|
useVisitorSocket();
|
|
3174
2993
|
|
|
3175
2994
|
watch(
|
|
3176
|
-
|
|
3177
|
-
(
|
|
3178
|
-
if (!enabled &&
|
|
2995
|
+
enableUnregisteredTab,
|
|
2996
|
+
(enabled) => {
|
|
2997
|
+
if (!enabled && activeTab.value === "unregistered") {
|
|
3179
2998
|
activeTab.value = "registered";
|
|
3180
2999
|
}
|
|
3181
3000
|
},
|
|
@@ -3273,100 +3092,6 @@ watchEffect(async () => {
|
|
|
3273
3092
|
word-break: break-word;
|
|
3274
3093
|
}
|
|
3275
3094
|
|
|
3276
|
-
/* A row whose value is a set of records rather than a value - it drops the
|
|
3277
|
-
two-column grid and runs the full width of the card body. */
|
|
3278
|
-
.visitor-preview__row--block {
|
|
3279
|
-
display: block;
|
|
3280
|
-
}
|
|
3281
|
-
|
|
3282
|
-
.visitor-preview__members {
|
|
3283
|
-
display: flex;
|
|
3284
|
-
flex-direction: column;
|
|
3285
|
-
gap: 8px;
|
|
3286
|
-
margin-top: 8px;
|
|
3287
|
-
}
|
|
3288
|
-
|
|
3289
|
-
/*
|
|
3290
|
-
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3291
|
-
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3292
|
-
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3293
|
-
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3294
|
-
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3295
|
-
* off, so the lines below are set on the scale rather than inherited.
|
|
3296
|
-
*/
|
|
3297
|
-
.visitor-preview__member {
|
|
3298
|
-
padding: 9px 12px;
|
|
3299
|
-
border: 1px solid var(--border);
|
|
3300
|
-
border-radius: var(--r-inner);
|
|
3301
|
-
background: var(--hover);
|
|
3302
|
-
}
|
|
3303
|
-
|
|
3304
|
-
.visitor-preview__member-line {
|
|
3305
|
-
display: flex;
|
|
3306
|
-
gap: 8px;
|
|
3307
|
-
margin-top: 3px;
|
|
3308
|
-
font-size: var(--fs-breadcrumb);
|
|
3309
|
-
color: var(--text2);
|
|
3310
|
-
word-break: break-word;
|
|
3311
|
-
}
|
|
3312
|
-
|
|
3313
|
-
.visitor-preview__member-key {
|
|
3314
|
-
flex: 0 0 52px;
|
|
3315
|
-
color: var(--muted);
|
|
3316
|
-
}
|
|
3317
|
-
|
|
3318
|
-
/*
|
|
3319
|
-
* THE NRIC REVEAL.
|
|
3320
|
-
*
|
|
3321
|
-
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3322
|
-
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3323
|
-
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3324
|
-
* make the NRIC line half again the height of the Contact line under it.
|
|
3325
|
-
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3326
|
-
* rhythm, and reads the right way round: the number is what changes.
|
|
3327
|
-
*
|
|
3328
|
-
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3329
|
-
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3330
|
-
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3331
|
-
* same left edge as every other value in the card.
|
|
3332
|
-
*/
|
|
3333
|
-
.visitor-preview__reveal {
|
|
3334
|
-
display: inline-flex;
|
|
3335
|
-
align-items: center;
|
|
3336
|
-
gap: 6px;
|
|
3337
|
-
margin: -3px -7px;
|
|
3338
|
-
padding: 3px 7px;
|
|
3339
|
-
border: none;
|
|
3340
|
-
border-radius: var(--r-inner-sm);
|
|
3341
|
-
background: transparent;
|
|
3342
|
-
font: inherit;
|
|
3343
|
-
color: inherit;
|
|
3344
|
-
text-align: left;
|
|
3345
|
-
cursor: pointer;
|
|
3346
|
-
transition: background var(--motion) ease;
|
|
3347
|
-
}
|
|
3348
|
-
|
|
3349
|
-
.visitor-preview__reveal:hover {
|
|
3350
|
-
background: var(--hover);
|
|
3351
|
-
}
|
|
3352
|
-
|
|
3353
|
-
.visitor-preview__reveal:focus-visible {
|
|
3354
|
-
outline: 2px solid var(--accent);
|
|
3355
|
-
outline-offset: 1px;
|
|
3356
|
-
}
|
|
3357
|
-
|
|
3358
|
-
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3359
|
-
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3360
|
-
.visitor-preview__eye {
|
|
3361
|
-
color: var(--accent-text);
|
|
3362
|
-
}
|
|
3363
|
-
|
|
3364
|
-
@media (prefers-reduced-motion: reduce) {
|
|
3365
|
-
.visitor-preview__reveal {
|
|
3366
|
-
transition: none;
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
|
-
|
|
3370
3095
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
3371
3096
|
.visitor-type-filter {
|
|
3372
3097
|
max-width: 200px;
|
|
@@ -137,9 +137,8 @@ const config = useRuntimeConfig();
|
|
|
137
137
|
const publicConfig = config.public as Record<string, string | undefined>;
|
|
138
138
|
const route = useRoute();
|
|
139
139
|
const { tab } = useVisitor();
|
|
140
|
-
// A getter, not the string: this component outlives site switches.
|
|
141
140
|
const { enableUnregistered, ensureANPRSettings } = useANPRSettings(
|
|
142
|
-
|
|
141
|
+
props.siteId
|
|
143
142
|
);
|
|
144
143
|
const enableUnregisteredSnackbar = computed(() => enableUnregistered.value);
|
|
145
144
|
const { socketUnregisteredVisitorTrigger, visitorSocketData } =
|
|
@@ -1,50 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* A site's ANPR switches (e.g. "Enable Unregistered Vehicles"), shared by every
|
|
5
|
-
* caller on the page: the Visitor Mgmt tabs, the plate toast in the layout, and
|
|
6
|
-
* Site Settings.
|
|
7
|
-
*
|
|
8
|
-
* `siteId` may be a ref or a getter. The layout's toast lives across site
|
|
9
|
-
* switches, so a plain string captured once kept answering for the FIRST site
|
|
10
|
-
* it saw - and the Visitor Mgmt page never fetched at all, so its
|
|
11
|
-
* "Unregistered" tab showed only when that stale copy happened to be for the
|
|
12
|
-
* right site (i.e. after a hard refresh on the page itself).
|
|
13
|
-
*
|
|
14
|
-
* One map keyed by site id: a key that is present means "fetched", even when
|
|
15
|
-
* the site has no settings yet (stored as `{}`).
|
|
16
|
-
*/
|
|
17
|
-
export default function (siteId?: MaybeRefOrGetter<string | undefined>) {
|
|
18
|
-
const site = computed(() => toValue(siteId) || "");
|
|
19
|
-
|
|
20
|
-
const bySite = useState<Record<string, Record<string, any>>>(
|
|
21
|
-
"anpr-settings-by-site",
|
|
22
|
-
() => ({})
|
|
1
|
+
export default function (siteId?: string) {
|
|
2
|
+
const stateKey = computed(() =>
|
|
3
|
+
siteId ? `anpr-settings-${siteId}` : "anpr-settings"
|
|
23
4
|
);
|
|
24
5
|
|
|
25
|
-
const anprSettings =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
/** True once this site's settings have been read (or saved) at least once. */
|
|
33
|
-
const loaded = computed(() => site.value in bySite.value);
|
|
6
|
+
const anprSettings = useState<Record<string, any> | null>(
|
|
7
|
+
stateKey.value,
|
|
8
|
+
() => null
|
|
9
|
+
);
|
|
34
10
|
|
|
35
11
|
const enableUnregistered = computed(
|
|
36
12
|
() => anprSettings.value?.ANPRSwitches?.enableUnregistered === true
|
|
37
13
|
);
|
|
38
14
|
|
|
39
|
-
function store(forSite: unknown, response: Record<string, any> | null) {
|
|
40
|
-
const key = String(forSite ?? "");
|
|
41
|
-
if (!key) return;
|
|
42
|
-
bySite.value = { ...bySite.value, [key]: response ?? {} };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
15
|
async function fetchANPRSettings(data?: any) {
|
|
46
|
-
const payload =
|
|
47
|
-
data ?? (site.value ? { site: site.value, userType: "site" } : undefined);
|
|
16
|
+
const payload = data ?? (siteId ? { site: siteId, userType: "site" } : undefined);
|
|
48
17
|
|
|
49
18
|
if (!payload) {
|
|
50
19
|
return anprSettings.value;
|
|
@@ -58,21 +27,23 @@ export default function (siteId?: MaybeRefOrGetter<string | undefined>) {
|
|
|
58
27
|
}
|
|
59
28
|
);
|
|
60
29
|
|
|
61
|
-
|
|
30
|
+
if (response) {
|
|
31
|
+
anprSettings.value = response;
|
|
32
|
+
}
|
|
62
33
|
|
|
63
34
|
return response;
|
|
64
35
|
}
|
|
65
36
|
|
|
66
37
|
async function ensureANPRSettings(force = false) {
|
|
67
|
-
if (!
|
|
38
|
+
if (!siteId) {
|
|
68
39
|
return anprSettings.value;
|
|
69
40
|
}
|
|
70
41
|
|
|
71
|
-
if (!force &&
|
|
42
|
+
if (!force && anprSettings.value) {
|
|
72
43
|
return anprSettings.value;
|
|
73
44
|
}
|
|
74
45
|
|
|
75
|
-
return await fetchANPRSettings({ site:
|
|
46
|
+
return await fetchANPRSettings({ site: siteId, userType: "site" });
|
|
76
47
|
}
|
|
77
48
|
|
|
78
49
|
async function getANPRSettingBySite(data: any) {
|
|
@@ -89,7 +60,7 @@ export default function (siteId?: MaybeRefOrGetter<string | undefined>) {
|
|
|
89
60
|
);
|
|
90
61
|
|
|
91
62
|
if (response) {
|
|
92
|
-
|
|
63
|
+
anprSettings.value = response;
|
|
93
64
|
}
|
|
94
65
|
|
|
95
66
|
return response;
|
|
@@ -97,7 +68,6 @@ export default function (siteId?: MaybeRefOrGetter<string | undefined>) {
|
|
|
97
68
|
|
|
98
69
|
return {
|
|
99
70
|
anprSettings,
|
|
100
|
-
loaded,
|
|
101
71
|
enableUnregistered,
|
|
102
72
|
ensureANPRSettings,
|
|
103
73
|
getANPRSettingBySite,
|
|
@@ -228,11 +228,7 @@ 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;
|
|
234
231
|
}) {
|
|
235
|
-
const search = params.search?.trim();
|
|
236
232
|
return useNuxtApp().$api<Record<string, any>>(
|
|
237
233
|
`/api/access-management/available-card-contractor/${params.type}`,
|
|
238
234
|
{
|
|
@@ -242,7 +238,6 @@ export default function useAccessManagement() {
|
|
|
242
238
|
unitId: params.unitId,
|
|
243
239
|
page: params.page ?? 1,
|
|
244
240
|
limit: params.limit ?? 100,
|
|
245
|
-
...(search ? { search } : {}),
|
|
246
241
|
},
|
|
247
242
|
}
|
|
248
243
|
);
|
|
@@ -13,7 +13,6 @@ export default function useCleaningPermission() {
|
|
|
13
13
|
bulletinBoardPermissions,
|
|
14
14
|
|
|
15
15
|
inventoryPermissions,
|
|
16
|
-
robotPermissions,
|
|
17
16
|
} = useCommonPermissions();
|
|
18
17
|
const permissions: TPermissions = {
|
|
19
18
|
inventory: inventoryPermissions,
|
|
@@ -292,7 +291,6 @@ export default function useCleaningPermission() {
|
|
|
292
291
|
"Allows the user to view detailed information for item checkouts.",
|
|
293
292
|
},
|
|
294
293
|
},
|
|
295
|
-
"robot-mgmt": robotPermissions,
|
|
296
294
|
};
|
|
297
295
|
|
|
298
296
|
return {
|
|
@@ -331,39 +331,7 @@ export function useCommonPermissions() {
|
|
|
331
331
|
},
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
/*
|
|
335
|
-
* ROBOTS - owner approval 2026-09-25, item 1: the Property Management and
|
|
336
|
-
* Cleaning role editors offer Robots, so a narrower role can be given robot
|
|
337
|
-
* access. Same five strings, spelling and wording as `useSecurityPermission`
|
|
338
|
-
* and exactly what core `robot-permission.util.ts ROBOT_PERMISSIONS` enforces.
|
|
339
|
-
* Catalogue-only: offering an entry grants nobody anything until it is ticked.
|
|
340
|
-
*/
|
|
341
|
-
const robotPermissions = {
|
|
342
|
-
"add-robot": {
|
|
343
|
-
check: true,
|
|
344
|
-
description: "Allows the user to add a new robot to the system.",
|
|
345
|
-
},
|
|
346
|
-
"see-all-robots": {
|
|
347
|
-
check: true,
|
|
348
|
-
description: "Allows the user to view the list of all robots.",
|
|
349
|
-
},
|
|
350
|
-
"see-robot-details": {
|
|
351
|
-
check: true,
|
|
352
|
-
description: "Allows the user to view the details of a specific robot.",
|
|
353
|
-
},
|
|
354
|
-
"update-robot": {
|
|
355
|
-
check: true,
|
|
356
|
-
description: "Allows the user to update robot details.",
|
|
357
|
-
},
|
|
358
|
-
"delete-robot": {
|
|
359
|
-
check: true,
|
|
360
|
-
description:
|
|
361
|
-
"Allows the user to remove a robot from the system permanently.",
|
|
362
|
-
},
|
|
363
|
-
};
|
|
364
|
-
|
|
365
334
|
return {
|
|
366
|
-
robotPermissions,
|
|
367
335
|
inventoryPermissions,
|
|
368
336
|
invitationPermissions,
|
|
369
337
|
memberPermissions,
|
|
@@ -6,7 +6,6 @@ export default function useDocument() {
|
|
|
6
6
|
type = "all",
|
|
7
7
|
site = "",
|
|
8
8
|
parentId = "",
|
|
9
|
-
expiry = "all",
|
|
10
9
|
}: {
|
|
11
10
|
page?: number;
|
|
12
11
|
search?: string;
|
|
@@ -14,11 +13,6 @@ export default function useDocument() {
|
|
|
14
13
|
type?: string;
|
|
15
14
|
site?: string;
|
|
16
15
|
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;
|
|
22
16
|
} = {}) {
|
|
23
17
|
const query: Record<string, any> = {
|
|
24
18
|
page,
|
|
@@ -27,7 +21,6 @@ export default function useDocument() {
|
|
|
27
21
|
type,
|
|
28
22
|
site,
|
|
29
23
|
parentId,
|
|
30
|
-
expiry,
|
|
31
24
|
};
|
|
32
25
|
|
|
33
26
|
return useNuxtApp().$api<Record<string, any>>(`/api/documents`, {
|
|
@@ -76,8 +76,6 @@ export default function usetFacility() {
|
|
|
76
76
|
hourInterval?: number;
|
|
77
77
|
isBookingFeeEnabled: boolean;
|
|
78
78
|
isGuestEnabled: boolean;
|
|
79
|
-
isResidentChecklistEnabled: boolean;
|
|
80
|
-
isSecurityChecklistEnabled: boolean;
|
|
81
79
|
bookingAmount: number | null;
|
|
82
80
|
peakBookingFeeAmount?: number | null;
|
|
83
81
|
bookingFeeGuestAmount?: number | null;
|
|
@@ -175,8 +173,6 @@ export default function usetFacility() {
|
|
|
175
173
|
hourInterval = 1,
|
|
176
174
|
isBookingFeeEnabled = false,
|
|
177
175
|
isGuestEnabled = false,
|
|
178
|
-
isResidentChecklistEnabled = false,
|
|
179
|
-
isSecurityChecklistEnabled = false,
|
|
180
176
|
bookingAmount = 0,
|
|
181
177
|
peakBookingFeeAmount = 0,
|
|
182
178
|
bookingFeeGuestAmount = 0,
|
|
@@ -240,13 +236,6 @@ export default function usetFacility() {
|
|
|
240
236
|
this.hourInterval = hourInterval;
|
|
241
237
|
this.isBookingFeeEnabled = isBookingFeeEnabled;
|
|
242
238
|
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;
|
|
250
239
|
this.bookingAmount = bookingAmount;
|
|
251
240
|
this.peakBookingFeeAmount = peakBookingFeeAmount;
|
|
252
241
|
this.bookingFeeGuestAmount = bookingFeeGuestAmount;
|