@7365admin1/layer-common 4.73.1-staging.456 → 4.74.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 +15 -4
- package/assets/css/primitives.css +0 -43
- package/components/AccessCardPreviewDialog.vue +50 -286
- package/components/AppSelect.vue +3 -77
- package/components/BuildingUnitFormEdit.vue +0 -6
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +17 -74
- package/components/HidIntercomManagement.vue +14 -183
- 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/MemberMain.vue +13 -68
- package/components/VisitorForm.vue +0 -12
- package/components/VisitorManagement.vue +5 -267
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -165
- package/composables/useHidNavigation.ts +1 -25
- package/composables/useMember.ts +0 -16
- package/composables/usePeople.ts +0 -19
- package/composables/useServiceProvider.ts +2 -33
- 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-readers/index.vue +1 -1
- package/types/document.d.ts +0 -14
- package/types/facility.d.ts +0 -4
- package/types/member.d.ts +0 -4
- package/types/people.d.ts +1 -28
- package/types/service-provider.d.ts +0 -5
- package/utils/role.ts +6 -43
- package/components/BuildingUnitManagement.vue +0 -298
- 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/hid-permission-assignments.ts +0 -190
- package/utils/hid-reader-selection.ts +0 -52
- package/utils/occupancy-role.ts +0 -109
- package/utils/service-type.ts +0 -30
|
@@ -388,27 +388,9 @@ watch(
|
|
|
388
388
|
const roles = ref<any[]>([])
|
|
389
389
|
const { getRoles } = useRole()
|
|
390
390
|
|
|
391
|
-
/*
|
|
392
|
-
* `type` is the ROLE type, not the service the client subscribes to, and the
|
|
393
|
-
* only caller (`ClientMain.vue` "Invite Client") passes no `app` prop -- so
|
|
394
|
-
* this sent `type: ""` and the endpoint applied no type filter at all. The
|
|
395
|
-
* dropdown therefore listed every org-less role of every type, which includes
|
|
396
|
-
* the platform's OWN staff roles (`type: "admin"` -- the two rows the console's
|
|
397
|
-
* `/super-admin/role-permissions` screen edits). Offering a Seven365 console
|
|
398
|
-
* staff role on a CLIENT invitation is the defect.
|
|
399
|
-
*
|
|
400
|
-
* A client admin's role is `type: "organization"`, which is what the client
|
|
401
|
-
* roles screen (`org/[organization]/roles-permissions.vue`) already lists. This
|
|
402
|
-
* narrows to exactly that. It is a narrowing of this one picker only: no role
|
|
403
|
-
* changes, no permission changes, and the org-less `organization` roles that
|
|
404
|
-
* were already being picked are all still offered.
|
|
405
|
-
*
|
|
406
|
-
* Keying off the selected service instead would empty the dropdown -- no
|
|
407
|
-
* org-less role carries a service type -- so `props.app` is not the filter.
|
|
408
|
-
*/
|
|
409
391
|
const { data: roleData, refresh: refreshRoles } = await useLazyAsyncData(
|
|
410
392
|
"roles",
|
|
411
|
-
() => getRoles({ org: org.value?._id, type:
|
|
393
|
+
() => getRoles({ org: org.value?._id, type: props.app, limit: 50 }),
|
|
412
394
|
{ watch: [() => props.app] }
|
|
413
395
|
)
|
|
414
396
|
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
<div class="d-flex align-center flex-wrap ga-2">
|
|
42
42
|
<span class="flex-grow-1">{{ otherSiteBanner }}</span>
|
|
43
43
|
<AppButton
|
|
44
|
-
v-if="!orgLevel"
|
|
45
44
|
data-test="member-other-site-filter"
|
|
46
45
|
@click="toggleOtherSite()"
|
|
47
46
|
>
|
|
@@ -101,8 +100,6 @@
|
|
|
101
100
|
|
|
102
101
|
<div class="app-table-scroll">
|
|
103
102
|
<v-data-table
|
|
104
|
-
class="member-table"
|
|
105
|
-
:class="{ 'member-table--pin-action': actionLast }"
|
|
106
103
|
:headers="props.headers"
|
|
107
104
|
:items="items"
|
|
108
105
|
item-value="_id"
|
|
@@ -121,21 +118,15 @@
|
|
|
121
118
|
(memberRoleChip in utils/role.ts, server roleState). -->
|
|
122
119
|
<template #item.roleName="{ item }">
|
|
123
120
|
<StatusChip
|
|
124
|
-
v-if="memberRoleChip(item
|
|
121
|
+
v-if="memberRoleChip(item)"
|
|
125
122
|
:dot="false"
|
|
126
123
|
pill
|
|
127
|
-
:tone="memberRoleChip(item
|
|
128
|
-
class="member-role-chip"
|
|
124
|
+
:tone="memberRoleChip(item)?.tone"
|
|
129
125
|
data-test="member-role-chip"
|
|
130
126
|
>
|
|
131
|
-
{{ memberRoleChip(item
|
|
127
|
+
{{ memberRoleChip(item)?.text }}
|
|
132
128
|
</StatusChip>
|
|
133
129
|
</template>
|
|
134
|
-
<!-- Organization app: every person, and where they may go
|
|
135
|
-
(owner report 2026-09-29: a site-limited person stays listed). -->
|
|
136
|
-
<template v-if="orgLevel" #item.siteName="{ item }">
|
|
137
|
-
<span data-test="member-site-scope">{{ siteAccessLabel(item) }}</span>
|
|
138
|
-
</template>
|
|
139
130
|
<template #item.dateInvited="{ item }">
|
|
140
131
|
{{ formatDateInvited(item.dateInvited) }}
|
|
141
132
|
</template>
|
|
@@ -143,18 +134,6 @@
|
|
|
143
134
|
<span data-test="member-last-active">{{ formatLastActive(item.lastLoginAt) }}</span>
|
|
144
135
|
</template>
|
|
145
136
|
<template #item.action-table="{ item }">
|
|
146
|
-
<div class="d-flex align-center justify-end ga-1">
|
|
147
|
-
<!-- The main task on the organisation's Members list, so it is a
|
|
148
|
-
button on every row rather than only inside the menu. -->
|
|
149
|
-
<AppButton
|
|
150
|
-
v-if="siteAccessAllowed && item.user"
|
|
151
|
-
variant="ghost"
|
|
152
|
-
icon="mdi-map-marker-multiple-outline"
|
|
153
|
-
data-test="member-site-access-button"
|
|
154
|
-
@click="openSiteAccess(item)"
|
|
155
|
-
>
|
|
156
|
-
Site access
|
|
157
|
-
</AppButton>
|
|
158
137
|
<!--
|
|
159
138
|
`props.assignRole` belongs in this test. The menu's only item that
|
|
160
139
|
is not status-dependent is Assign Role, but the menu itself opened
|
|
@@ -163,12 +142,12 @@
|
|
|
163
142
|
and the permission was unreachable.
|
|
164
143
|
-->
|
|
165
144
|
<v-menu
|
|
166
|
-
v-if="
|
|
145
|
+
v-if="
|
|
167
146
|
props.assignRole ||
|
|
168
147
|
(currentStatus === 'active' &&
|
|
169
148
|
(canSuspendMembers || canDeleteMembers)) ||
|
|
170
149
|
(currentStatus === 'suspended' &&
|
|
171
|
-
(canActivateMembers || canDeleteMembers))
|
|
150
|
+
(canActivateMembers || canDeleteMembers))
|
|
172
151
|
"
|
|
173
152
|
v-model="item.menuOpen"
|
|
174
153
|
:close-on-content-click="false"
|
|
@@ -237,7 +216,6 @@
|
|
|
237
216
|
</v-list-item>
|
|
238
217
|
</v-list>
|
|
239
218
|
</v-menu>
|
|
240
|
-
</div>
|
|
241
219
|
</template>
|
|
242
220
|
</v-data-table>
|
|
243
221
|
</div>
|
|
@@ -371,8 +349,6 @@ import {
|
|
|
371
349
|
otherSiteBannerText,
|
|
372
350
|
roleUsableHere,
|
|
373
351
|
safeReturnTo,
|
|
374
|
-
siteAccessLabel,
|
|
375
|
-
limitedSites,
|
|
376
352
|
withCurrentRole,
|
|
377
353
|
} from "../utils/role";
|
|
378
354
|
import { formatLastActive } from "../utils/last-active";
|
|
@@ -481,11 +457,6 @@ const props = defineProps({
|
|
|
481
457
|
},
|
|
482
458
|
});
|
|
483
459
|
|
|
484
|
-
/* The Organization app's Members list: no site, organisation memberships. It
|
|
485
|
-
lists every person (site-limited ones as one row with `limitedTo`), labels
|
|
486
|
-
where each may go, and has no "role from another site" banner - there is no
|
|
487
|
-
"this site" here. */
|
|
488
|
-
const orgLevel = computed(() => !props.siteId && props.type === "organization");
|
|
489
460
|
const items = ref<Array<Record<string, any>>>([]);
|
|
490
461
|
const onlyOtherSite = ref(false);
|
|
491
462
|
const page = ref(1);
|
|
@@ -562,8 +533,6 @@ const {
|
|
|
562
533
|
type: props.type,
|
|
563
534
|
siteId: props.siteId,
|
|
564
535
|
roleState: onlyOtherSite.value ? "other-site" : "",
|
|
565
|
-
// Organization app: site-limited people too, one row each (`limitedTo`).
|
|
566
|
-
people: orgLevel.value,
|
|
567
536
|
}),
|
|
568
537
|
{
|
|
569
538
|
watch: [() => props.status, () => props.orgId, () => props.siteId, headerSearch, onlyOtherSite],
|
|
@@ -592,10 +561,8 @@ const { data: otherSiteReq, refresh: refreshOtherSite } = useAsyncData(
|
|
|
592
561
|
: Promise.resolve(null),
|
|
593
562
|
{ watch: [() => props.status, () => props.orgId, () => props.siteId] }
|
|
594
563
|
);
|
|
595
|
-
// At organisation level there is no "this site": the count says what is wrong
|
|
596
|
-
// and points to "Fix roles from other sites" (no per-site filter there).
|
|
597
564
|
const otherSiteBanner = computed(() =>
|
|
598
|
-
otherSiteBannerText(otherSiteReq.value?.total
|
|
565
|
+
otherSiteBannerText(otherSiteReq.value?.total)
|
|
599
566
|
);
|
|
600
567
|
watch(otherSiteBanner, (text) => {
|
|
601
568
|
// the last one fixed: back to the full list
|
|
@@ -665,12 +632,6 @@ function setMember({
|
|
|
665
632
|
screen, whoever may assign roles can choose a member's sites. The server
|
|
666
633
|
decides again (owner / org-wide admin only). */
|
|
667
634
|
const siteAccessAllowed = computed(() => props.assignRole && !props.siteId);
|
|
668
|
-
/* A site-limited person's row stands for several per-site memberships, so the
|
|
669
|
-
one-membership actions (Assign Role, Suspend, Delete) are not offered on it;
|
|
670
|
-
Site access manages them. */
|
|
671
|
-
const isLimited = (item: Record<string, any>) => orgLevel.value && limitedSites(item).length > 0;
|
|
672
|
-
/* Keep the actions column on screen however wide the table gets. */
|
|
673
|
-
const actionLast = computed(() => props.headers[props.headers.length - 1]?.value === "action-table");
|
|
674
635
|
const siteAccessDialog = ref(false);
|
|
675
636
|
const siteAccessUser = ref("");
|
|
676
637
|
const siteAccessName = ref("");
|
|
@@ -816,16 +777,20 @@ function formatDateInvited(value?: string | null) {
|
|
|
816
777
|
if (Number.isNaN(date.getTime())) return "";
|
|
817
778
|
|
|
818
779
|
const parts = new Intl.DateTimeFormat("en-US", {
|
|
819
|
-
month: "
|
|
780
|
+
month: "long",
|
|
820
781
|
day: "numeric",
|
|
821
782
|
year: "numeric",
|
|
783
|
+
hour: "2-digit",
|
|
784
|
+
minute: "2-digit",
|
|
785
|
+
hour12: true,
|
|
822
786
|
}).formatToParts(date);
|
|
823
787
|
|
|
824
788
|
const getPart = (type: Intl.DateTimeFormatPartTypes) =>
|
|
825
789
|
parts.find((part) => part.type === type)?.value ?? "";
|
|
826
790
|
|
|
827
|
-
|
|
828
|
-
|
|
791
|
+
return `${getPart("month")} ${getPart("day")}, ${getPart("year")} ${getPart(
|
|
792
|
+
"hour"
|
|
793
|
+
)}:${getPart("minute")}${getPart("dayPeriod").toUpperCase()}`;
|
|
829
794
|
}
|
|
830
795
|
|
|
831
796
|
async function handleUpdateMemberStatus() {
|
|
@@ -861,23 +826,3 @@ const updateActionText = computed(() => {
|
|
|
861
826
|
return map[updateAction.value] || updateAction.value;
|
|
862
827
|
});
|
|
863
828
|
</script>
|
|
864
|
-
|
|
865
|
-
<style scoped>
|
|
866
|
-
/* The actions column stays pinned to the right edge (owner report 2026-09-29:
|
|
867
|
-
at 1151px the menu sat off-screen behind a sideways scroll). */
|
|
868
|
-
.member-table--pin-action :deep(th:last-child),
|
|
869
|
-
.member-table--pin-action :deep(td:last-child) {
|
|
870
|
-
position: sticky;
|
|
871
|
-
right: 0;
|
|
872
|
-
z-index: 1;
|
|
873
|
-
background: rgb(var(--v-theme-surface));
|
|
874
|
-
box-shadow: -1px 0 0 rgba(var(--v-border-color), var(--v-border-opacity));
|
|
875
|
-
}
|
|
876
|
-
.member-table--pin-action :deep(thead th:last-child) {
|
|
877
|
-
z-index: 3;
|
|
878
|
-
}
|
|
879
|
-
.member-table :deep(.member-role-chip) {
|
|
880
|
-
white-space: normal;
|
|
881
|
-
height: auto;
|
|
882
|
-
}
|
|
883
|
-
</style>
|
|
@@ -910,20 +910,8 @@ const hidQrReaderId = computed(() => (
|
|
|
910
910
|
hidQrConfiguredReaderId.value || String(hidQrReader.value?._id || "")
|
|
911
911
|
));
|
|
912
912
|
|
|
913
|
-
/*
|
|
914
|
-
* Visitor QR passes are hidden at the manager's request (2026-09-23).
|
|
915
|
-
*
|
|
916
|
-
* A flag rather than a deletion: issuing, the preview dialog, printing and the
|
|
917
|
-
* regenerate handler below are all intact and untouched, so bringing the
|
|
918
|
-
* feature back is this one line. Every surface that offers a Visitor QR reads
|
|
919
|
-
* `hidQrCodePassAllowed`, which is why the switch belongs here and not in each
|
|
920
|
-
* of them.
|
|
921
|
-
*/
|
|
922
|
-
const HID_VISITOR_QR_ENABLED = false;
|
|
923
|
-
|
|
924
913
|
const hidQrCodePassAllowed = computed(() => {
|
|
925
914
|
return (
|
|
926
|
-
HID_VISITOR_QR_ENABLED &&
|
|
927
915
|
hidQrCodePassEnabled.value &&
|
|
928
916
|
["guest", "contractor", "walk-in"].includes(prop.type)
|
|
929
917
|
);
|
|
@@ -749,35 +749,11 @@
|
|
|
749
749
|
class="visitor-preview__row"
|
|
750
750
|
>
|
|
751
751
|
<div class="visitor-preview__label">{{ label }}</div>
|
|
752
|
-
<div
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
draw it, is a 14px target - the floor is 24px. So the
|
|
758
|
-
NUMBER is the control and the eye is its affordance:
|
|
759
|
-
the whole masked value is pressable, which makes the
|
|
760
|
-
target the width of the digits rather than of a glyph,
|
|
761
|
-
and being a real `button` it also takes a tab stop,
|
|
762
|
-
which a `v-icon` with a click handler never did. -->
|
|
763
|
-
<button
|
|
764
|
-
type="button"
|
|
765
|
-
class="visitor-preview__reveal"
|
|
766
|
-
:aria-label="showVisitorNric ? 'Hide NRIC' : 'Show NRIC'"
|
|
767
|
-
:aria-pressed="showVisitorNric"
|
|
768
|
-
@click="showVisitorNric = !showVisitorNric"
|
|
769
|
-
>
|
|
770
|
-
<span class="visitor-preview__value">
|
|
771
|
-
{{
|
|
772
|
-
showVisitorNric
|
|
773
|
-
? selectedVisitorObject[key]
|
|
774
|
-
: maskNRIC(selectedVisitorObject[key])
|
|
775
|
-
}}
|
|
776
|
-
</span>
|
|
777
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
778
|
-
{{ showVisitorNric ? "mdi-eye-off-outline" : "mdi-eye-outline" }}
|
|
779
|
-
</v-icon>
|
|
780
|
-
</button>
|
|
752
|
+
<div
|
|
753
|
+
v-tooltip:top="selectedVisitorObject[key]"
|
|
754
|
+
class="visitor-preview__value"
|
|
755
|
+
>
|
|
756
|
+
{{ maskNRIC(selectedVisitorObject[key]) }}
|
|
781
757
|
</div>
|
|
782
758
|
</div>
|
|
783
759
|
|
|
@@ -827,84 +803,6 @@
|
|
|
827
803
|
</div>
|
|
828
804
|
</div>
|
|
829
805
|
|
|
830
|
-
<!--
|
|
831
|
-
THE CONTRACTOR'S PARTY.
|
|
832
|
-
|
|
833
|
-
The list row has always said `( +2 members)` beside the name
|
|
834
|
-
and then had nowhere to send you for the names themselves. The
|
|
835
|
-
block spans both columns rather than sitting in the 116px
|
|
836
|
-
value track: a member is a record, not a value, and several of
|
|
837
|
-
them in a 250px column is unreadable.
|
|
838
|
-
|
|
839
|
-
Read off `selectedVisitorDataObject` (the raw row) and not
|
|
840
|
-
`selectedVisitorObject`, which filters itself down to
|
|
841
|
-
`typeFieldMap` plus five fixed keys - `members` is on neither
|
|
842
|
-
list, and widening that computed would change what four other
|
|
843
|
-
dialogs on this screen see.
|
|
844
|
-
-->
|
|
845
|
-
<div
|
|
846
|
-
v-else-if="key === 'members' && selectedVisitorMembers.length"
|
|
847
|
-
class="visitor-preview__row visitor-preview__row--block"
|
|
848
|
-
>
|
|
849
|
-
<div class="visitor-preview__label">
|
|
850
|
-
{{ label }} ({{ selectedVisitorMembers.length }})
|
|
851
|
-
</div>
|
|
852
|
-
<div class="visitor-preview__members">
|
|
853
|
-
<div
|
|
854
|
-
v-for="(member, index) in selectedVisitorMembers"
|
|
855
|
-
:key="member?.nric || member?.name || index"
|
|
856
|
-
class="visitor-preview__member"
|
|
857
|
-
>
|
|
858
|
-
<div class="visitor-preview__value">
|
|
859
|
-
{{ member?.name || "N/A" }}
|
|
860
|
-
</div>
|
|
861
|
-
<template v-for="field in memberDetailFields" :key="field.key">
|
|
862
|
-
<div
|
|
863
|
-
v-if="member?.[field.key]"
|
|
864
|
-
class="visitor-preview__member-line"
|
|
865
|
-
>
|
|
866
|
-
<span class="visitor-preview__member-key">
|
|
867
|
-
{{ field.label }}
|
|
868
|
-
</span>
|
|
869
|
-
<!-- A member's NRIC is the same class of data as the
|
|
870
|
-
visitor's, so it gets the same control. Each
|
|
871
|
-
member reveals separately - one toggle for the
|
|
872
|
-
whole card would show three people's NRICs to
|
|
873
|
-
read one. -->
|
|
874
|
-
<button
|
|
875
|
-
v-if="field.key === 'nric'"
|
|
876
|
-
type="button"
|
|
877
|
-
class="visitor-preview__reveal"
|
|
878
|
-
:aria-label="
|
|
879
|
-
isMemberNricShown(index)
|
|
880
|
-
? `Hide NRIC for ${member?.name || 'this member'}`
|
|
881
|
-
: `Show NRIC for ${member?.name || 'this member'}`
|
|
882
|
-
"
|
|
883
|
-
:aria-pressed="isMemberNricShown(index)"
|
|
884
|
-
@click="toggleMemberNric(index)"
|
|
885
|
-
>
|
|
886
|
-
<span>
|
|
887
|
-
{{
|
|
888
|
-
isMemberNricShown(index)
|
|
889
|
-
? member.nric
|
|
890
|
-
: maskNRIC(member.nric)
|
|
891
|
-
}}
|
|
892
|
-
</span>
|
|
893
|
-
<v-icon size="16" class="visitor-preview__eye">
|
|
894
|
-
{{
|
|
895
|
-
isMemberNricShown(index)
|
|
896
|
-
? "mdi-eye-off-outline"
|
|
897
|
-
: "mdi-eye-outline"
|
|
898
|
-
}}
|
|
899
|
-
</v-icon>
|
|
900
|
-
</button>
|
|
901
|
-
<span v-else>{{ member[field.key] }}</span>
|
|
902
|
-
</div>
|
|
903
|
-
</template>
|
|
904
|
-
</div>
|
|
905
|
-
</div>
|
|
906
|
-
</div>
|
|
907
|
-
|
|
908
806
|
<!-- The vehicle number, with Block on its right: the Registered
|
|
909
807
|
tab only, for someone who may add vehicles. It opens the
|
|
910
808
|
Vehicle Mgmt Block Listed form with the category taken from
|
|
@@ -2225,71 +2123,6 @@ const isSelectedVisitorPendingApproval = computed(
|
|
|
2225
2123
|
() => selectedVisitorStatus.value === "pending"
|
|
2226
2124
|
);
|
|
2227
2125
|
|
|
2228
|
-
/**
|
|
2229
|
-
* The members a contractor brought with them. Not gated on the Guests tab: the
|
|
2230
|
-
* list row's own `( +N members)` count is not either, and a contractor with a
|
|
2231
|
-
* party has one wherever the screen shows it.
|
|
2232
|
-
*
|
|
2233
|
-
* Blank entries are dropped rather than drawn as an empty card - the payload
|
|
2234
|
-
* carries `""` for every detail nobody filled in, so a member with no name and
|
|
2235
|
-
* no details would otherwise render as a bare inset box.
|
|
2236
|
-
*/
|
|
2237
|
-
const selectedVisitorMembers = computed<Record<string, any>[]>(() => {
|
|
2238
|
-
const members = selectedVisitorDataObject.value?.members;
|
|
2239
|
-
if (!Array.isArray(members)) return [];
|
|
2240
|
-
|
|
2241
|
-
return members.filter(
|
|
2242
|
-
(member: Record<string, any>) =>
|
|
2243
|
-
member?.name || member?.nric || member?.contact || member?.plateNumber
|
|
2244
|
-
);
|
|
2245
|
-
});
|
|
2246
|
-
|
|
2247
|
-
/**
|
|
2248
|
-
* WHICH NRICs ARE UNCOVERED RIGHT NOW.
|
|
2249
|
-
*
|
|
2250
|
-
* Per member and not per card, so revealing one person's number does not
|
|
2251
|
-
* uncover the rest of the party's. Both are cleared when the dialog closes -
|
|
2252
|
-
* a preview must not open on the next visitor with the last one's NRIC
|
|
2253
|
-
* already showing, and it is the same `selectedVisitorId` that would carry it
|
|
2254
|
-
* across if the same row were reopened.
|
|
2255
|
-
*/
|
|
2256
|
-
const showVisitorNric = ref(false);
|
|
2257
|
-
const shownMemberNrics = ref<number[]>([]);
|
|
2258
|
-
|
|
2259
|
-
function isMemberNricShown(index: number) {
|
|
2260
|
-
return shownMemberNrics.value.includes(index);
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
function toggleMemberNric(index: number) {
|
|
2264
|
-
shownMemberNrics.value = isMemberNricShown(index)
|
|
2265
|
-
? shownMemberNrics.value.filter((x) => x !== index)
|
|
2266
|
-
: [...shownMemberNrics.value, index];
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
watch(
|
|
2270
|
-
() => dialog.viewVisitor,
|
|
2271
|
-
(open) => {
|
|
2272
|
-
if (open) return;
|
|
2273
|
-
showVisitorNric.value = false;
|
|
2274
|
-
shownMemberNrics.value = [];
|
|
2275
|
-
}
|
|
2276
|
-
);
|
|
2277
|
-
|
|
2278
|
-
/**
|
|
2279
|
-
* What a member row prints under the name, in order. `plateNumber` is in here
|
|
2280
|
-
* because the API returns it on `members[]` even though neither
|
|
2281
|
-
* `TMemberInfo` (this package) nor `TContractorMembers` (API-core's visitor
|
|
2282
|
-
* model, name and nric only) declares it - the two types have drifted from the
|
|
2283
|
-
* document and from each other. Reading the key defensively costs nothing and
|
|
2284
|
-
* shows the vehicle a member actually arrived in; the types are somebody's to
|
|
2285
|
-
* reconcile separately.
|
|
2286
|
-
*/
|
|
2287
|
-
const memberDetailFields = [
|
|
2288
|
-
{ key: "nric", label: "NRIC" },
|
|
2289
|
-
{ key: "contact", label: "Contact" },
|
|
2290
|
-
{ key: "plateNumber", label: "Vehicle" },
|
|
2291
|
-
] as const;
|
|
2292
|
-
|
|
2293
2126
|
const formatType = (item: any) =>
|
|
2294
2127
|
(item.deliveryType ? item.deliveryType + "-" : "") + item.type;
|
|
2295
2128
|
|
|
@@ -2303,7 +2136,6 @@ const formattedFields = {
|
|
|
2303
2136
|
level: "Level",
|
|
2304
2137
|
unit: "Unit",
|
|
2305
2138
|
purpose: "Purpose",
|
|
2306
|
-
members: "Members",
|
|
2307
2139
|
checkIn: "Check In",
|
|
2308
2140
|
snapshotEntryImage: "Entry Image",
|
|
2309
2141
|
checkOut: "Check Out",
|
|
@@ -3310,100 +3142,6 @@ watchEffect(async () => {
|
|
|
3310
3142
|
word-break: break-word;
|
|
3311
3143
|
}
|
|
3312
3144
|
|
|
3313
|
-
/* A row whose value is a set of records rather than a value - it drops the
|
|
3314
|
-
two-column grid and runs the full width of the card body. */
|
|
3315
|
-
.visitor-preview__row--block {
|
|
3316
|
-
display: block;
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
|
-
.visitor-preview__members {
|
|
3320
|
-
display: flex;
|
|
3321
|
-
flex-direction: column;
|
|
3322
|
-
gap: 8px;
|
|
3323
|
-
margin-top: 8px;
|
|
3324
|
-
}
|
|
3325
|
-
|
|
3326
|
-
/*
|
|
3327
|
-
* An added member reads as an inset on the card it sits in - `--hover` on
|
|
3328
|
-
* `--border` at the inner radius. Those are `Card/MemberInfoSummary`'s three
|
|
3329
|
-
* decisions, unchanged, so a member looks the same in the preview as it does
|
|
3330
|
-
* in the form that created it. Only the TYPE differs: that card still prints
|
|
3331
|
-
* `<strong>Label:</strong> value`, which is the pattern this dialog just moved
|
|
3332
|
-
* off, so the lines below are set on the scale rather than inherited.
|
|
3333
|
-
*/
|
|
3334
|
-
.visitor-preview__member {
|
|
3335
|
-
padding: 9px 12px;
|
|
3336
|
-
border: 1px solid var(--border);
|
|
3337
|
-
border-radius: var(--r-inner);
|
|
3338
|
-
background: var(--hover);
|
|
3339
|
-
}
|
|
3340
|
-
|
|
3341
|
-
.visitor-preview__member-line {
|
|
3342
|
-
display: flex;
|
|
3343
|
-
gap: 8px;
|
|
3344
|
-
margin-top: 3px;
|
|
3345
|
-
font-size: var(--fs-breadcrumb);
|
|
3346
|
-
color: var(--text2);
|
|
3347
|
-
word-break: break-word;
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
|
-
.visitor-preview__member-key {
|
|
3351
|
-
flex: 0 0 52px;
|
|
3352
|
-
color: var(--muted);
|
|
3353
|
-
}
|
|
3354
|
-
|
|
3355
|
-
/*
|
|
3356
|
-
* THE NRIC REVEAL.
|
|
3357
|
-
*
|
|
3358
|
-
* The pressable thing is the masked number, not the glyph beside it: an eye on
|
|
3359
|
-
* its own is a 14-16px target where 24px is the floor, and on a 12.5px member
|
|
3360
|
-
* line an `AppButton variant="icon"` - the layer's 32px icon square - would
|
|
3361
|
-
* make the NRIC line half again the height of the Contact line under it.
|
|
3362
|
-
* Pressing the digits gives a target the width of the value at no cost to the
|
|
3363
|
-
* rhythm, and reads the right way round: the number is what changes.
|
|
3364
|
-
*
|
|
3365
|
-
* It inherits its type rather than setting any, so the visitor's NRIC stays on
|
|
3366
|
-
* `--fs-cell` and a member's on the `--fs-breadcrumb` of the line it sits in.
|
|
3367
|
-
* The negative margin pays back the padding, so a revealed value starts on the
|
|
3368
|
-
* same left edge as every other value in the card.
|
|
3369
|
-
*/
|
|
3370
|
-
.visitor-preview__reveal {
|
|
3371
|
-
display: inline-flex;
|
|
3372
|
-
align-items: center;
|
|
3373
|
-
gap: 6px;
|
|
3374
|
-
margin: -3px -7px;
|
|
3375
|
-
padding: 3px 7px;
|
|
3376
|
-
border: none;
|
|
3377
|
-
border-radius: var(--r-inner-sm);
|
|
3378
|
-
background: transparent;
|
|
3379
|
-
font: inherit;
|
|
3380
|
-
color: inherit;
|
|
3381
|
-
text-align: left;
|
|
3382
|
-
cursor: pointer;
|
|
3383
|
-
transition: background var(--motion) ease;
|
|
3384
|
-
}
|
|
3385
|
-
|
|
3386
|
-
.visitor-preview__reveal:hover {
|
|
3387
|
-
background: var(--hover);
|
|
3388
|
-
}
|
|
3389
|
-
|
|
3390
|
-
.visitor-preview__reveal:focus-visible {
|
|
3391
|
-
outline: 2px solid var(--accent);
|
|
3392
|
-
outline-offset: 1px;
|
|
3393
|
-
}
|
|
3394
|
-
|
|
3395
|
-
/* The design's interactive ink - not Vuetify's fixed blue, which is one colour
|
|
3396
|
-
on both themes. `affectedEntities` gives its NRIC eye the same value. */
|
|
3397
|
-
.visitor-preview__eye {
|
|
3398
|
-
color: var(--accent-text);
|
|
3399
|
-
}
|
|
3400
|
-
|
|
3401
|
-
@media (prefers-reduced-motion: reduce) {
|
|
3402
|
-
.visitor-preview__reveal {
|
|
3403
|
-
transition: none;
|
|
3404
|
-
}
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
3145
|
/* The width the type filter carried as `max-width="200"` on the v-select. */
|
|
3408
3146
|
.visitor-type-filter {
|
|
3409
3147
|
max-width: 200px;
|
|
@@ -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;
|