@7365admin1/layer-common 4.32.0 → 4.32.1-staging.365

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +4 -4
  2. package/assets/css/robot-hero.css +26 -0
  3. package/components/AccessCardAddForm.vue +5 -4
  4. package/components/AccessCardAssignToUnitForm.vue +3 -2
  5. package/components/AccessCardPreviewDialog.vue +4 -3
  6. package/components/Dialog/DeleteConfirmation.vue +17 -2
  7. package/components/Dialog/ReusablePrompt.vue +26 -3
  8. package/components/Dialog/UpdateMoreAction.vue +11 -1
  9. package/components/DocumentForm.vue +407 -112
  10. package/components/DocumentManagement.vue +213 -12
  11. package/components/EntryPass/QrTemplatePreview.vue +21 -25
  12. package/components/EntryPassInformation.vue +119 -24
  13. package/components/Facility/BookingSetup.vue +63 -0
  14. package/components/HidAccessLogDashboard.vue +41 -8
  15. package/components/HidAccessPermissions.vue +424 -0
  16. package/components/HidIntercomManagement.vue +148 -14
  17. package/components/HidProfileQrCode.vue +332 -0
  18. package/components/HidReaderManagement.vue +26 -0
  19. package/components/HidReaderUserRoster.vue +44 -3
  20. package/components/HidUserEnrollment.vue +845 -155
  21. package/components/InvitationClientForm.vue +19 -1
  22. package/components/NotificationBell.vue +39 -3
  23. package/components/Robot/ActivityLog.vue +113 -0
  24. package/components/Robot/AlertsTable.vue +1 -0
  25. package/components/Robot/Detail.vue +8 -5
  26. package/components/Robot/Form.vue +170 -214
  27. package/components/Robot/MiniMap.vue +7 -1
  28. package/components/Robot/SiteAlerts.vue +117 -0
  29. package/components/Robot/SiteScreen.vue +69 -5
  30. package/components/VehicleForm.vue +45 -2
  31. package/components/VehicleManagement.vue +95 -10
  32. package/components/VisitorManagement.vue +267 -5
  33. package/composables/useAccessManagement.ts +5 -0
  34. package/composables/useCleaningPermission.ts +4 -4
  35. package/composables/useCommonPermission.ts +16 -0
  36. package/composables/useDocument.ts +7 -0
  37. package/composables/useFacility.ts +11 -0
  38. package/composables/useHidAmico.ts +117 -0
  39. package/composables/useHidNavigation.ts +25 -1
  40. package/composables/useHidReaderSelection.ts +50 -0
  41. package/composables/useLandscapingPermission.ts +4 -4
  42. package/composables/useMechanicalElectricalPermission.ts +4 -4
  43. package/composables/usePeople.ts +19 -0
  44. package/composables/usePestControlPermission.ts +4 -4
  45. package/composables/usePoolMaintenancePermission.ts +4 -4
  46. package/composables/useRobotBuilding.ts +9 -12
  47. package/composables/useRobots.ts +53 -4
  48. package/composables/useSecurityPermission.ts +4 -10
  49. package/composables/useSiteCategory.ts +45 -0
  50. package/composables/useSiteEntryPassSettings.ts +26 -0
  51. package/composables/useWebUsb.ts +14 -11
  52. package/package.json +1 -1
  53. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
  54. package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
  55. package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
  56. package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
  57. package/types/document.d.ts +14 -0
  58. package/types/facility.d.ts +4 -0
  59. package/types/people.d.ts +28 -1
  60. package/utils/hid-permission-assignments.ts +190 -0
  61. package/utils/hid-reader-selection.ts +52 -0
  62. package/utils/notification-target.ts +75 -0
  63. package/utils/occupancy-role.ts +109 -0
  64. package/utils/robot-display.ts +146 -0
  65. package/utils/vehicle-actions.ts +12 -4
package/CHANGELOG.md CHANGED
@@ -1375,11 +1375,11 @@
1375
1375
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1376
1376
  own rule from two endpoints the console already calls, unprojected:
1377
1377
 
1378
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1379
- GET /api/roles/id/:role that membership's role document
1378
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1379
+ GET /api/roles/id/:role that membership's role document
1380
1380
 
1381
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1382
- staff = member.type === "admin" && role.type === "admin"
1381
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1382
+ staff = member.type === "admin" && role.type === "admin"
1383
1383
 
1384
1384
  `role.default` is the marker because it is the only property of a platform
1385
1385
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -699,6 +699,8 @@
699
699
  .hero-bot__body { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; background: var(--hero-bot); outline: 2px solid var(--hero-bg); }
700
700
  .hero-bot__tick { position: absolute; right: -5px; top: 5px; width: 5px; height: 4px; background: var(--hero-accent); }
701
701
  .hero-bot__name { position: absolute; left: 10px; top: -18px; font-size: 10px; font-weight: 600; white-space: nowrap; background: var(--hero-bg); padding: 0 4px; line-height: 1.45; }
702
+ .hero-bot__name--left { left: auto; right: 10px; }
703
+ .hero-bot__name--below { top: 10px; }
702
704
 
703
705
  /* Patrol checkpoints and route tags. */
704
706
  .hero-cp {
@@ -839,6 +841,30 @@
839
841
  .hero-dialog__body { font-size: 14px; opacity: 0.85; }
840
842
  .hero-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
841
843
 
844
+ /* ============================================ HERO phase (e): add / edit dialog, alerts, activity log */
845
+
846
+ /* The Remove dialog is the DS default (440px); Add / edit is 520px (README §8). */
847
+ .hero-dialog--form { width: 100%; }
848
+ .hero-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
849
+ .hero-form-grid__full { grid-column: 1 / -1; }
850
+ @media (max-width: 480px) { .hero-form-grid { grid-template-columns: 1fr; } }
851
+ .hero-form-grid select.hero-input {
852
+ appearance: none;
853
+ padding-right: 30px;
854
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
855
+ background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
856
+ background-size: 5px 5px;
857
+ background-repeat: no-repeat;
858
+ cursor: pointer;
859
+ }
860
+ /* The DS backdrop: neutral-900 at 50% (light grey over the dark theme, as in the prototype). */
861
+ .v-overlay.v-theme--hero-light > .v-overlay__scrim, .v-overlay.v-theme--hero-dark > .v-overlay__scrim { background: rgb(var(--v-hero-neutral-900)) !important; opacity: 0.5 !important; }
862
+ .hero-dialog__note { font-size: 12px; opacity: 0.65; }
863
+ .hero-notice--error { border-left-color: var(--hero-accent); }
864
+ .hero-input:disabled { opacity: 0.6; cursor: not-allowed; }
865
+ .hero-log__when { font-variant-numeric: tabular-nums; opacity: 0.7; white-space: nowrap; }
866
+ .hero-log__who, .hero-log__target { font-weight: 600; }
867
+
842
868
  /* ----------------------------------------------------------- animations */
843
869
 
844
870
  /* ============================================ HERO phase (d): building map, editor, lift queue */
@@ -433,7 +433,10 @@ const {
433
433
  bulkPhysicalAccessCard: _bulkPhysicalAccessCard,
434
434
  getBlockLevelUnitList: _getBlockLevelUnitList,
435
435
  } = useAccessManagement();
436
- const { getBySiteId: _getEntryPassSettings } = useSiteEntryPassSettings();
436
+ const {
437
+ getBySiteId: _getEntryPassSettings,
438
+ getEncryptedAcmUrl: _getEncryptedAcmUrl,
439
+ } = useSiteEntryPassSettings();
437
440
  const { getFileUrl } = useFile();
438
441
 
439
442
  const config = useRuntimeConfig();
@@ -588,9 +591,7 @@ watch(uploadMode, (mode) => {
588
591
 
589
592
  onMounted(async () => {
590
593
  try {
591
- const { encrypted: acmUrl } = await $fetch<{ encrypted: string }>(
592
- "/api/encrypt-acm-url"
593
- );
594
+ const acmUrl = await _getEncryptedAcmUrl(siteId);
594
595
  encryptedAcmUrl.value = acmUrl;
595
596
  const [doorLevels, liftLevels, groups] = await Promise.all([
596
597
  _getDoorAccessLevels(acmUrl),
@@ -203,6 +203,7 @@ const {
203
203
  getBlockLevelUnitList: _getBlockLevelUnitList,
204
204
  } = useAccessManagement();
205
205
  const { requiredRule } = useUtils();
206
+ const { getEncryptedAcmUrl } = useSiteEntryPassSettings();
206
207
 
207
208
  const route = useRoute();
208
209
  const siteId = computed(() => props.siteId || (route.params.site as string));
@@ -294,7 +295,7 @@ onMounted(async () => {
294
295
 
295
296
  const [blockLevelResult, acmResult] = await Promise.allSettled([
296
297
  _getBlockLevelUnitList(siteId.value),
297
- $fetch<{ encrypted: string }>("/api/encrypt-acm-url"),
298
+ getEncryptedAcmUrl(siteId.value),
298
299
  ]);
299
300
 
300
301
  // Blocks / Levels / Units
@@ -309,7 +310,7 @@ onMounted(async () => {
309
310
 
310
311
  // ACM levels (door + lift)
311
312
  if (acmResult.status === "fulfilled") {
312
- const acmUrl = acmResult.value.encrypted;
313
+ const acmUrl = acmResult.value;
313
314
  try {
314
315
  const [doorLevels, liftLevels] = await Promise.all([
315
316
  _getDoorAccessLevels(acmUrl),
@@ -403,6 +403,7 @@ const emit = defineEmits<{
403
403
  }>();
404
404
 
405
405
  const { getResidents, assignUser } = useAccessManagement();
406
+ const { getEncryptedAcmUrl } = useSiteEntryPassSettings();
406
407
 
407
408
  const historyDialog = ref(false);
408
409
  const showAssignForm = ref(false);
@@ -475,12 +476,12 @@ async function openAssignForm() {
475
476
  if (!props.unit?._id || !props.orgId || !props.siteId) return;
476
477
  peopleLoading.value = true;
477
478
  try {
478
- const [residentsRes, acmRes] = await Promise.all([
479
+ const [residentsRes, acmUrl] = await Promise.all([
479
480
  getResidents({ orgId: props.orgId, siteId: props.siteId, unitId: props.unit._id }),
480
- $fetch<{ encrypted: string }>("/api/encrypt-acm-url"),
481
+ getEncryptedAcmUrl(props.siteId),
481
482
  ]);
482
483
  peopleItems.value = residentsRes?.data ?? [];
483
- encryptedAcmUrl.value = acmRes?.encrypted ?? "";
484
+ encryptedAcmUrl.value = acmUrl ?? "";
484
485
  } catch {
485
486
  peopleItems.value = [];
486
487
  } finally {
@@ -27,7 +27,8 @@
27
27
  Cancel
28
28
  </v-btn>
29
29
 
30
- <v-btn class="screen-btn-primary" variant="flat" @click="emit('delete')">
30
+ <v-btn class="screen-btn-primary" :class="{ 'no-permission': noPermission }"
31
+ :aria-disabled="noPermission || undefined" variant="flat" @click="emit('delete')">
31
32
  Delete
32
33
  </v-btn>
33
34
  </div>
@@ -47,6 +48,15 @@ const props = defineProps({
47
48
  loading: {
48
49
  type: Boolean,
49
50
  default: false
51
+ },
52
+ /**
53
+ * The action is not allowed (the server has refused it for want of the
54
+ * right). The confirm is drawn disabled but still takes the click, so the
55
+ * caller can say why - without sending the request again.
56
+ */
57
+ noPermission: {
58
+ type: Boolean,
59
+ default: false
50
60
  }
51
61
  })
52
62
 
@@ -54,4 +64,9 @@ const emit = defineEmits(["close", "delete"])
54
64
 
55
65
  </script>
56
66
 
57
- <style scoped></style>
67
+ <style scoped>
68
+ .no-permission {
69
+ opacity: 0.45;
70
+ cursor: not-allowed;
71
+ }
72
+ </style>
@@ -3,7 +3,10 @@
3
3
  <v-card-text class="screen-modal__body pa-5 my-5 px-7 text-center">
4
4
  <span class="screen-card-title d-block">{{ promptTitle }}</span>
5
5
 
6
- <span v-if="message" class="d-block mt-5">
6
+ <!-- Red (`text-error`, the theme's error token) when the caller says
7
+ the message is a failure; other callers pass notes, so it stays
8
+ plain by default. -->
9
+ <span v-if="message" class="d-block mt-5" :class="{ 'text-error': messageError }">
7
10
  {{ message }}
8
11
  </span>
9
12
  </v-card-text>
@@ -25,7 +28,8 @@
25
28
  draws no destructive button, so overriding it here would be
26
29
  inventing a control the design never named. Left as it renders
27
30
  today and raised for a design decision. -->
28
- <v-btn :class="confirmButtonColor ? 'text-none' : 'screen-btn-primary'"
31
+ <v-btn :class="[confirmButtonColor ? 'text-none' : 'screen-btn-primary', { 'no-permission': noPermission }]"
32
+ :aria-disabled="noPermission || undefined"
29
33
  variant="flat" :color="confirmButtonColor || undefined" @click="emit('proceed')">
30
34
  {{ confirmLabel }}
31
35
  </v-btn>
@@ -54,6 +58,20 @@ const props = defineProps({
54
58
  confirmButtonColor: {
55
59
  type: String,
56
60
  default: ""
61
+ },
62
+ /**
63
+ * The action is not allowed (the server has refused it for want of the
64
+ * right). The confirm is drawn disabled but still takes the click, so the
65
+ * caller can say why - without sending the request again.
66
+ */
67
+ noPermission: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ /** `message` is a refusal or failure: drawn in the error colour. */
72
+ messageError: {
73
+ type: Boolean,
74
+ default: false
57
75
  }
58
76
 
59
77
  })
@@ -62,4 +80,9 @@ const emit = defineEmits(["close", "proceed"])
62
80
 
63
81
  </script>
64
82
 
65
- <style scoped></style>
83
+ <style scoped>
84
+ .no-permission {
85
+ opacity: 0.45;
86
+ cursor: not-allowed;
87
+ }
88
+ </style>
@@ -23,7 +23,7 @@
23
23
  Close
24
24
  </v-btn>
25
25
 
26
- <v-menu v-if="canUpdate || canDelete" contained>
26
+ <v-menu v-if="canUpdate || canDelete || $slots.actions" contained>
27
27
  <template #activator="{ props }">
28
28
  <v-btn
29
29
  variant="flat"
@@ -42,6 +42,16 @@
42
42
  render-verified either. Only the row type and the destructive ink
43
43
  change. -->
44
44
  <v-list class="pa-0 update-more__list">
45
+ <!--
46
+ Screen-specific rows, above Edit and the destructive one.
47
+
48
+ Additive: a screen that passes nothing gets the menu it always
49
+ had, and `$slots.actions` is undefined unless a caller actually
50
+ defines the slot - so the button does not appear over an empty
51
+ list when a screen has neither permission nor extra rows.
52
+ -->
53
+ <slot name="actions" />
54
+
45
55
  <v-list-item v-if="canUpdate" @click="emit('edit')">
46
56
  <v-list-item-title>
47
57
  {{ editButtonLabel }}