@7365admin1/layer-common 3.2.7 → 3.2.8-staging.201

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 (283) hide show
  1. package/assets/css/primitives.css +1113 -0
  2. package/assets/css/screens.css +1097 -0
  3. package/assets/css/shell.css +258 -0
  4. package/assets/css/tokens.css +236 -0
  5. package/components/AcceptDialog.vue +17 -18
  6. package/components/AccessCard/AvailableStats.vue +24 -16
  7. package/components/AccessCardAddForm.vue +42 -42
  8. package/components/AccessCardAssignToUnitForm.vue +13 -21
  9. package/components/AccessCardDeleteDialog.vue +41 -39
  10. package/components/AccessCardDetailsDialog.vue +125 -79
  11. package/components/AccessCardPreviewDialog.vue +58 -84
  12. package/components/AccessCardQrTagging.vue +60 -63
  13. package/components/AccessCardReplaceForm.vue +27 -23
  14. package/components/AccessManagement.vue +86 -85
  15. package/components/AddEqupmentForm.vue +18 -22
  16. package/components/AddPassKeyToVisitor.vue +95 -73
  17. package/components/AppButton.vue +62 -0
  18. package/components/AppCard.vue +20 -0
  19. package/components/AppDateField.vue +49 -0
  20. package/components/AppField.vue +76 -0
  21. package/components/AppKpiTile.vue +65 -0
  22. package/components/AppSegmented.vue +38 -0
  23. package/components/AppSelect.vue +247 -0
  24. package/components/AreaChecklistHistoryLogs.vue +51 -44
  25. package/components/AreaChecklistHistoryMain.vue +14 -7
  26. package/components/AreaFormDialog.vue +71 -59
  27. package/components/AreaMain.vue +73 -107
  28. package/components/AttachmentsViewer.vue +84 -22
  29. package/components/AttendanceCheckInOutDialog.vue +85 -88
  30. package/components/AttendanceDetailsDialog.vue +57 -63
  31. package/components/AttendanceMain.vue +4 -3
  32. package/components/AttendanceMapSearchDialog.vue +42 -44
  33. package/components/AttendanceSettingsDialog.vue +79 -63
  34. package/components/Avatar/Main.vue +54 -2
  35. package/components/BillingMain.vue +26 -30
  36. package/components/BtnUploadFile.vue +53 -11
  37. package/components/BuildingForm.vue +34 -27
  38. package/components/BuildingManagement/buildings.vue +39 -39
  39. package/components/BuildingManagement/units.vue +26 -42
  40. package/components/BuildingUnitFormAdd.vue +20 -23
  41. package/components/BuildingUnitFormEdit.vue +8 -4
  42. package/components/BulletinBoardForm.vue +19 -24
  43. package/components/BulletinBoardManagement.vue +49 -57
  44. package/components/BulletinBoardView.vue +9 -6
  45. package/components/BulletinExpirationChip.vue +13 -4
  46. package/components/Button/Close.vue +2 -2
  47. package/components/CameraForm.vue +21 -22
  48. package/components/CameraMain.vue +50 -49
  49. package/components/Card/DeleteConfirmation.vue +24 -22
  50. package/components/Card/MemberInfoSummary.vue +28 -3
  51. package/components/Card/Toggle.vue +15 -3
  52. package/components/CardToolbar.vue +37 -0
  53. package/components/Carousel.vue +56 -36
  54. package/components/Chat/Bubbles.vue +43 -14
  55. package/components/Chat/Information.vue +49 -32
  56. package/components/Chat/ListCard.vue +38 -9
  57. package/components/Chat/Message.vue +41 -15
  58. package/components/Chat/Navigation.vue +27 -15
  59. package/components/Chat/SkeletonLoader.vue +9 -2
  60. package/components/ChecklistItemRow.vue +25 -1
  61. package/components/CleaningScheduleMain.vue +44 -49
  62. package/components/ClientDetailForm.vue +81 -56
  63. package/components/ClientMain.vue +92 -82
  64. package/components/ConfirmDialog.vue +14 -8
  65. package/components/Container/Standard.vue +9 -7
  66. package/components/CreateSubsciptionPlan.vue +148 -89
  67. package/components/DashboardEmptyState.vue +48 -3
  68. package/components/DashboardMain.vue +924 -676
  69. package/components/DashboardPanel.vue +84 -21
  70. package/components/DeliveryCompany.vue +34 -20
  71. package/components/Dialog/DeleteConfirmation.vue +20 -21
  72. package/components/Dialog/ReplaceAutofillPrompt.vue +19 -26
  73. package/components/Dialog/ReusablePrompt.vue +30 -29
  74. package/components/Dialog/UpdateMoreAction.vue +62 -59
  75. package/components/DocumentForm.vue +14 -21
  76. package/components/DocumentManagement.vue +162 -108
  77. package/components/DocumentViewer.vue +29 -12
  78. package/components/DrawImage.vue +29 -21
  79. package/components/EntryPass/QrTemplatePreview.vue +27 -16
  80. package/components/EntryPassInformation.vue +40 -10
  81. package/components/EntryPassMain.vue +49 -27
  82. package/components/EquipmentItemMain.vue +84 -97
  83. package/components/EquipmentManagementMain.vue +81 -103
  84. package/components/Facility/BookingSetup.vue +43 -52
  85. package/components/Feedback/Form.vue +26 -12
  86. package/components/FeedbackMain.vue +35 -49
  87. package/components/FileInput.vue +75 -58
  88. package/components/FileInputWithList.vue +59 -12
  89. package/components/FormDialog.vue +60 -21
  90. package/components/HidAccessLogDashboard.vue +512 -490
  91. package/components/HidCameraCaptureDialog.vue +216 -0
  92. package/components/HidEnabledGate.vue +67 -9
  93. package/components/HidIntercomManagement.vue +1322 -653
  94. package/components/HidQrCodeConfiguration.vue +1030 -258
  95. package/components/HidReaderForm.vue +142 -59
  96. package/components/HidReaderManagement.vue +211 -323
  97. package/components/HidServiceSettingsPanel.vue +44 -13
  98. package/components/HidUserEnrollment.vue +1185 -412
  99. package/components/HygieneUpdateMoreAction.vue +44 -44
  100. package/components/IncidentReport/Authorities.vue +30 -18
  101. package/components/IncidentReport/IncidentInformation.vue +10 -10
  102. package/components/IncidentReport/IncidentInformationDownload.vue +3 -4
  103. package/components/IncidentReport/affectedEntities.vue +41 -20
  104. package/components/Input/Date.vue +3 -0
  105. package/components/Input/DatePicker.vue +1 -2
  106. package/components/Input/DateTimePicker.vue +1 -1
  107. package/components/Input/File.vue +55 -10
  108. package/components/Input/FileV2.vue +39 -6
  109. package/components/Input/InputPhoneNumberV2.vue +2 -1
  110. package/components/Input/ListGroupSelection.vue +56 -8
  111. package/components/Input/NRICNumber.vue +1 -0
  112. package/components/Input/NewDate.vue +1 -0
  113. package/components/Input/Number.vue +1 -0
  114. package/components/Input/Password.vue +1 -0
  115. package/components/Input/PhoneNumber.vue +21 -1
  116. package/components/Input/VehicleNumber.vue +1 -0
  117. package/components/InputLabel.vue +2 -2
  118. package/components/InvitationClientForm.vue +21 -19
  119. package/components/InvitationForm.vue +15 -21
  120. package/components/InvitationMain.vue +46 -61
  121. package/components/Layout/Header.vue +263 -36
  122. package/components/Layout/NavigationDrawer.vue +300 -30
  123. package/components/ListItem.vue +33 -3
  124. package/components/LocalPagination.vue +27 -3
  125. package/components/ManageChecklistMain.vue +136 -86
  126. package/components/MemberInformation.vue +32 -16
  127. package/components/MemberMain.vue +113 -93
  128. package/components/MyAttendanceMain.vue +3 -5
  129. package/components/NavigationItem.vue +83 -3
  130. package/components/Nfc/NFCPatrolReportMain.vue +47 -33
  131. package/components/Nfc/NFCPatrolRouteForm.vue +18 -20
  132. package/components/Nfc/NFCPatrolRouteMain.vue +116 -103
  133. package/components/Nfc/NFCPatrolSettings.vue +14 -4
  134. package/components/Nfc/NFCTagForm.vue +22 -8
  135. package/components/Nfc/NFCTagMain.vue +41 -43
  136. package/components/Nfc/PatrolReport/DailyReportTab.vue +8 -1
  137. package/components/Nfc/PatrolReport/MonthlyReportTab.vue +8 -1
  138. package/components/Nfc/PatrolReport/MonthlyReportTable.vue +5 -3
  139. package/components/Nfc/PatrolReport/PatrolActivityTable.vue +26 -6
  140. package/components/Nfc/PatrolReport/PatrolReportTab.vue +8 -0
  141. package/components/Nfc/PatrolReport/PatrolRouteSummary.vue +41 -9
  142. package/components/Nfc/PatrolReport/RemarksDialog.vue +39 -9
  143. package/components/Nfc/PatrolReport/ReportEmptyState.vue +29 -9
  144. package/components/Nfc/PatrolReport/ReportFilters.vue +19 -10
  145. package/components/Nfc/PatrolReport/ReportLocationHeader.vue +32 -6
  146. package/components/Nfc/PatrolReport/SummaryReportTable.vue +28 -6
  147. package/components/NotificationSettings.vue +373 -0
  148. package/components/NumberSettingField.vue +9 -2
  149. package/components/OnlineFormConfigurationForm.vue +725 -237
  150. package/components/OnlineFormFill.vue +213 -106
  151. package/components/OnlineFormRenderPreview.vue +25 -30
  152. package/components/OnlineFormsConfiguration.vue +113 -109
  153. package/components/OrgViewDialog.vue +34 -16
  154. package/components/OvernightParkingAvailability.vue +49 -26
  155. package/components/OvernightParkingManagement.vue +78 -18
  156. package/components/PageHeader.vue +43 -0
  157. package/components/PassInformation.vue +109 -53
  158. package/components/PasswordConfirmation.vue +44 -26
  159. package/components/PeopleForm.vue +41 -20
  160. package/components/PhotoUpload.vue +110 -48
  161. package/components/PlaceholderComponent.vue +35 -19
  162. package/components/PlanActionsMenu.vue +12 -2
  163. package/components/PlanStatusBadge.vue +7 -8
  164. package/components/PlateNumberDisplay.vue +9 -6
  165. package/components/QrTemplate/PrintDialog.vue +66 -43
  166. package/components/RolePermissionFormCreate.vue +104 -79
  167. package/components/RolePermissionFormPreviewUpdate.vue +111 -109
  168. package/components/RolePermissionMain.vue +183 -81
  169. package/components/ScanVisitorQRCode.vue +99 -35
  170. package/components/ScheduleAreaMain.vue +34 -59
  171. package/components/ScheduleTaskForm.vue +61 -42
  172. package/components/ScheduleTaskMain.vue +56 -69
  173. package/components/SearchVehicleNumberUser.vue +39 -37
  174. package/components/ServiceProviderFormCreate.vue +29 -20
  175. package/components/ServiceProviderInvitationPrompt.vue +155 -0
  176. package/components/ServiceProviderMain.vue +601 -432
  177. package/components/Signature.vue +40 -34
  178. package/components/SignaturePad.vue +5 -29
  179. package/components/SiteSettings.vue +41 -11
  180. package/components/SiteSettingsWorkOrder.vue +61 -30
  181. package/components/SlideCardGroup.vue +35 -11
  182. package/components/Snackbar.vue +36 -3
  183. package/components/SpecificAttr.vue +18 -8
  184. package/components/StatusChip.vue +156 -0
  185. package/components/StockCard.vue +17 -12
  186. package/components/SubscriptionPlanTable.vue +207 -140
  187. package/components/SwitchContext.vue +201 -9
  188. package/components/TableHygiene.vue +36 -46
  189. package/components/TableList.vue +10 -10
  190. package/components/TableListSecondary.vue +105 -54
  191. package/components/TableMain.vue +251 -78
  192. package/components/TableV3.vue +61 -70
  193. package/components/TiptapEditor.vue +33 -40
  194. package/components/TiptapEditorQr.vue +5 -2
  195. package/components/Tooltip/Info.vue +69 -24
  196. package/components/UnitMain.vue +40 -60
  197. package/components/UnitPersonCard.vue +42 -13
  198. package/components/VehicleAddSelection.vue +48 -32
  199. package/components/VehicleForm.vue +112 -129
  200. package/components/VehicleManagement.vue +26 -12
  201. package/components/VehicleUpdateMoreAction.vue +59 -46
  202. package/components/VisitorDataFromScannedQRCodeForm.vue +90 -65
  203. package/components/VisitorForm.vue +774 -210
  204. package/components/VisitorFormSelection.vue +40 -37
  205. package/components/VisitorManagement.vue +239 -82
  206. package/components/VisitorPassKeyQRScanner.vue +65 -18
  207. package/components/VisitorSearchResultSummary.vue +60 -16
  208. package/components/VisitorSocketPopUp.vue +22 -14
  209. package/components/VisitorsReportPreview.vue +44 -29
  210. package/components/WorkOrder/Create.vue +26 -17
  211. package/components/WorkOrder/ListView.vue +38 -7
  212. package/components/WorkOrder/Main.vue +62 -59
  213. package/composables/useFeedback.ts +3 -3
  214. package/composables/useHidAmico.ts +269 -0
  215. package/composables/useHidNavigation.ts +2 -9
  216. package/composables/useMember.ts +3 -3
  217. package/composables/useNFCPatrolDailyReport.ts +13 -0
  218. package/composables/useNFCPatrolMonthlyReport.ts +22 -56
  219. package/composables/useNFCPatrolReport.ts +13 -0
  220. package/composables/useNotificationPreference.ts +87 -0
  221. package/composables/useOnlineFormPages.ts +2 -0
  222. package/composables/useRole.ts +22 -0
  223. package/composables/useServiceProvider.ts +3 -3
  224. package/composables/useServiceProviderInvitation.ts +145 -0
  225. package/composables/useSipWebPhone.ts +336 -0
  226. package/composables/useSubscriptionPlan.ts +62 -0
  227. package/composables/useThemePreference.ts +63 -0
  228. package/composables/useVisitor.ts +6 -1
  229. package/composables/useWebUsb.ts +127 -37
  230. package/composables/useWorkOrder.ts +17 -3
  231. package/error.vue +30 -6
  232. package/nuxt.config.ts +36 -0
  233. package/package.json +25 -4
  234. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +2 -2
  235. package/pages/[org]/[site]/access-mgmt/{identity-mapping → hid-cards}/index.vue +2 -2
  236. package/pages/[org]/[site]/access-mgmt/intercom/index.vue +1 -1
  237. package/pages/notification-settings.vue +19 -0
  238. package/pages/payment-method-linked.vue +34 -10
  239. package/pages/require-customer.vue +48 -10
  240. package/pages/require-organization-membership.vue +32 -8
  241. package/pages/unauthorized.vue +29 -4
  242. package/plugins/secure-member.client.ts +21 -56
  243. package/plugins/vuetify.ts +69 -2
  244. package/types/nfc-patrol-report.ts +3 -2
  245. package/types/site.d.ts +71 -0
  246. package/types/subscription.ts +18 -11
  247. package/utils/breadcrumb.test.ts +108 -0
  248. package/utils/breadcrumb.ts +82 -0
  249. package/utils/dashboard.test.ts +118 -0
  250. package/utils/dashboard.ts +53 -0
  251. package/utils/data.test.ts +95 -0
  252. package/utils/data.ts +40 -2
  253. package/utils/hid-discover.test.ts +102 -0
  254. package/utils/list-page.test.ts +60 -0
  255. package/utils/list-page.ts +38 -0
  256. package/utils/materialSymbols.ts +363 -0
  257. package/utils/nav-sections.test.ts +190 -0
  258. package/utils/nav-sections.ts +151 -0
  259. package/utils/nfc-patrol-report.test.ts +130 -0
  260. package/utils/nfc-patrol-report.ts +101 -0
  261. package/utils/role.test.ts +69 -0
  262. package/utils/role.ts +10 -0
  263. package/utils/route-name.test.ts +85 -0
  264. package/utils/route-name.ts +24 -0
  265. package/utils/status.test.ts +110 -0
  266. package/utils/status.ts +135 -0
  267. package/utils/table-card.test.ts +84 -0
  268. package/utils/theme-aa-ledger.ts +148 -0
  269. package/utils/theme.test.ts +485 -7
  270. package/utils/theme.ts +295 -110
  271. package/.changeset/README.md +0 -8
  272. package/.changeset/config.json +0 -11
  273. package/.editorconfig +0 -12
  274. package/.github/workflows/main.yml +0 -17
  275. package/.github/workflows/publish-staging.yml +0 -47
  276. package/.github/workflows/publish.yml +0 -39
  277. package/PUBLISHING.md +0 -269
  278. package/components/HidIdentityMapping.vue +0 -975
  279. package/components/ScheduleTaskAreaFormDialog.vue +0 -144
  280. package/components/ScheduleTaskAreaUpdateMoreAction.vue +0 -109
  281. package/components/ScheduleTastTicketMain.vue +0 -182
  282. package/components/TableWithButton.vue +0 -94
  283. package/test/visitor-socket.test.mjs +0 -36
@@ -1,144 +0,0 @@
1
- <template>
2
- <v-dialog
3
- :model-value="modelValue"
4
- @update:model-value="(v) => emit('update:modelValue', v)"
5
- max-width="450"
6
- >
7
- <v-card>
8
- <v-toolbar>
9
- <template v-if="$slots.header">
10
- <slot
11
- name="header"
12
- :title="
13
- mode === 'edit' ? `Edit ${entityType}` : `Add New ${entityType}`
14
- "
15
- :onClose="onClose"
16
- />
17
- </template>
18
- <template v-else>
19
- <v-row no-gutters class="fill-height px-6" align="center">
20
- <span class="font-weight-bold text-h6 text-capitalize">{{
21
- mode === "edit" ? `Edit ${entityType}` : `Add New ${entityType}`
22
- }}</span>
23
- </v-row>
24
- </template>
25
- </v-toolbar>
26
-
27
- <v-card-text>
28
- <v-form ref="formRef" v-model="valid">
29
- <v-row>
30
- <v-col cols="12">
31
- <InputLabel for="name" :title="label" required />
32
- <v-text-field v-model="nameValue" :rules="[requiredRule]" />
33
- </v-col>
34
- </v-row>
35
- </v-form>
36
- </v-card-text>
37
-
38
- <v-toolbar class="pa-0" density="compact">
39
- <v-row no-gutters>
40
- <v-col cols="6" class="pa-0">
41
- <v-btn
42
- block
43
- variant="text"
44
- class="text-none"
45
- size="large"
46
- @click="close"
47
- height="48"
48
- >
49
- Cancel
50
- </v-btn>
51
- </v-col>
52
-
53
- <v-col cols="6" class="pa-0">
54
- <v-btn
55
- block
56
- variant="flat"
57
- color="black"
58
- class="text-none font-weight-bold rounded-0"
59
- height="48"
60
- :loading="submitting"
61
- @click="submit"
62
- >
63
- {{ mode === "edit" ? "Save" : "Create" }}
64
- </v-btn>
65
- </v-col>
66
- </v-row>
67
- </v-toolbar>
68
- </v-card>
69
- </v-dialog>
70
- </template>
71
-
72
- <script setup lang="ts">
73
- const props = defineProps({
74
- modelValue: { type: Boolean, required: true },
75
- mode: { type: String as PropType<"add" | "edit">, default: "add" },
76
- area: { type: Object as PropType<Record<string, any> | null>, default: null },
77
- label: { type: String, default: "Name" },
78
- nameModel: { type: String as PropType<string | null>, default: null },
79
- entityType: { type: String, default: "Area" }, // values: "Area", "Unit"
80
- });
81
-
82
- const emit = defineEmits([
83
- "update:modelValue",
84
- "saved",
85
- "update:nameModel",
86
- ] as const);
87
-
88
- const formRef = ref(null);
89
- const valid = ref(false);
90
- const submitting = ref(false);
91
-
92
- const form = reactive({ name: "", description: "", status: "active" });
93
-
94
- watchEffect(() => {
95
- if (props.area) {
96
- form.name = props.area.name || "";
97
- form.description = props.area.description || "";
98
- form.status = props.area.status || "active";
99
- } else {
100
- form.name = "";
101
- form.description = "";
102
- form.status = "active";
103
- }
104
- });
105
-
106
- const { requiredRule } = useUtils();
107
-
108
- const nameValue = computed({
109
- get: () => {
110
- return props.nameModel !== null ? props.nameModel : form.name;
111
- },
112
- set: (v: string) => {
113
- if (props.nameModel !== null) {
114
- emit("update:nameModel", v);
115
- } else {
116
- form.name = v;
117
- }
118
- },
119
- });
120
-
121
- function close() {
122
- emit("update:modelValue", false);
123
- }
124
-
125
- const onClose = () => close();
126
-
127
- async function submit() {
128
- if (!valid.value) return;
129
- submitting.value = true;
130
- try {
131
- await new Promise((r) => setTimeout(r, 500));
132
- emit("saved", { ...form, _id: props.area?._id || Date.now().toString() });
133
-
134
- form.name = "";
135
- form.description = "";
136
- form.status = "active";
137
-
138
- emit("update:modelValue", false);
139
- } catch (e) {
140
- } finally {
141
- submitting.value = false;
142
- }
143
- }
144
- </script>
@@ -1,109 +0,0 @@
1
- <template>
2
- <v-card width="100%">
3
- <v-toolbar>
4
- <template v-if="$slots.header">
5
- <slot name="header" :title="title" :onClose="onClose" />
6
- </template>
7
- <template v-else>
8
- <v-row no-gutters class="fill-height px-6" align="center">
9
- <span class="font-weight-bold text-h5 text-capitalize">{{
10
- title
11
- }}</span>
12
- </v-row>
13
- </template>
14
- </v-toolbar>
15
-
16
- <v-card-text style="max-height: 100vh; overflow-y: auto" class="pb-0">
17
- <slot name="content" />
18
- </v-card-text>
19
-
20
- <v-toolbar class="pa-0" density="compact">
21
- <v-row no-gutters>
22
- <v-col cols="6" class="pa-0">
23
- <v-btn
24
- block
25
- variant="text"
26
- class="text-none"
27
- size="large"
28
- @click="emit('close')"
29
- height="48"
30
- >
31
- Close
32
- </v-btn>
33
- </v-col>
34
-
35
- <v-col cols="6" class="pa-0">
36
- <v-menu>
37
- <template #activator="{ props }">
38
- <v-btn
39
- block
40
- variant="flat"
41
- color="black"
42
- class="text-none"
43
- height="48"
44
- v-bind="props"
45
- tile
46
- >
47
- More actions
48
- </v-btn>
49
- </template>
50
-
51
- <v-list class="pa-0">
52
- <v-list-item v-if="canUpdate" @click="emit('edit')">
53
- <v-list-item-title class="text-subtitle-2">
54
- {{ editButtonLabel }}
55
- </v-list-item-title>
56
- </v-list-item>
57
-
58
- <v-list-item
59
- v-if="canDelete"
60
- @click="emit('delete')"
61
- class="text-red"
62
- >
63
- <v-list-item-title class="text-subtitle-2">
64
- {{ deleteButtonLabel }}
65
- </v-list-item-title>
66
- </v-list-item>
67
- </v-list>
68
- </v-menu>
69
- </v-col>
70
- </v-row>
71
- </v-toolbar>
72
- </v-card>
73
- </template>
74
-
75
- <script setup lang="ts">
76
- const prop = defineProps({
77
- canUpdate: {
78
- type: Boolean,
79
- default: true,
80
- },
81
- canDelete: {
82
- type: Boolean,
83
- default: true,
84
- },
85
- editButtonLabel: {
86
- type: String,
87
- default: "Edit Area",
88
- },
89
- deleteButtonLabel: {
90
- type: String,
91
- default: "Delete Area",
92
- },
93
- title: {
94
- type: String,
95
- default: "Area Actions",
96
- },
97
- });
98
-
99
- const emit = defineEmits(["close", "manage", "edit", "delete"]);
100
- const {
101
- canUpdate,
102
- editButtonLabel,
103
- deleteButtonLabel,
104
- manageButtonLabel,
105
- title,
106
- } = prop;
107
- </script>
108
-
109
- <style scoped></style>
@@ -1,182 +0,0 @@
1
- <template>
2
- <v-row no-gutters align="center" justify="center">
3
- <v-col cols="12" lg="10">
4
- <TableMain
5
- :title="'Schedule Tasks'"
6
- :items="items"
7
- :headers="headers"
8
- :loading="loading"
9
- :show-header="true"
10
- v-model:page="page"
11
- :pages="pages"
12
- :pageRange="pageRange"
13
- :no-data-text="'No Schedule Tasks found'"
14
- @row-click="onRowClick"
15
- >
16
- <template #item.task="{ item }">
17
- {{ item.task || "N/A" }}
18
- </template>
19
-
20
- <template #item.createdAt="{ value }">
21
- {{
22
- formatDate
23
- ? formatDate(value)
24
- : value
25
- ? new Date(value).toLocaleDateString()
26
- : ""
27
- }}
28
- </template>
29
-
30
- <template #item.area="{ value }">
31
- {{ value || "N/A" }}
32
- </template>
33
-
34
- <template #item.createdBy="{ item }">
35
- <v-avatar
36
- size="32"
37
- class="mr-2"
38
- :color="getAvatarColor(item.createdBy)"
39
- >
40
- <span class="white--text">{{ getInitials(item.createdBy) }}</span>
41
- </v-avatar>
42
- {{ item.createdBy || "N/A" }}
43
- </template>
44
-
45
- <template #item.cleaners="{ value }">
46
- {{ value || "N/A" }}
47
- </template>
48
-
49
- <template #item.status="{ value }">
50
- <v-chip
51
- :color="getStatusColor(value)"
52
- class="font-weight-bold"
53
- style="background: #ffe6c2; color: #ff9800"
54
- >
55
- {{ value || "To-Do" }}
56
- </v-chip>
57
- </template>
58
- <!-- Completion Date/Time -->
59
- <template #item.completionDate="{ value }">
60
- {{ value ? formatDate(value) : "N/A" }}
61
- </template>
62
- <!-- Action (Accept button) -->
63
- <template #item.action="{ item }">
64
- <v-btn outlined class="accept-btn" @click.stop="acceptTask(item)">
65
- Accept
66
- </v-btn>
67
- </template>
68
- </TableMain>
69
-
70
- <!-- Accept Confirmation Dialog -->
71
- <AcceptDialog
72
- :model-value="showAcceptDialog"
73
- title="Accept Scheduled Task"
74
- message="Are you sure you want to Accept this Scheduled Task?"
75
- @confirm="confirmAccept"
76
- @cancel="showAcceptDialog = false"
77
- />
78
-
79
- <!-- ScheduleTaskForm Dialog -->
80
- <ScheduleTaskForm v-model:show="showForm" />
81
- </v-col>
82
- </v-row>
83
- </template>
84
-
85
- <script lang="ts" setup>
86
- const props = defineProps({
87
- orgId: { type: String, required: true },
88
- site: { type: String, required: true },
89
- type: { type: String, required: true },
90
- });
91
- const loading = ref(false);
92
- const page = ref(1);
93
- const pages = ref(1);
94
- const pageRange = ref("1-3 of 3");
95
- const showForm = ref(false);
96
-
97
- const showAcceptDialog = ref(false);
98
- const selectedTask = ref(null);
99
-
100
- const items = ref([
101
- {
102
- _id: "1",
103
- task: "Clean Windows",
104
- createdAt: "2025-10-28T10:00:00Z",
105
- area: "",
106
- createdBy: "Demo Smith",
107
- cleaners: "N/A",
108
- status: "To-Do",
109
- completionDate: "2025-10-28T10:00:00Z",
110
- },
111
- {
112
- _id: "2",
113
- task: "Clean The 3",
114
- createdAt: "2025-10-28T10:00:00Z",
115
- area: "",
116
- createdBy: "Hygiene SP",
117
- cleaners: "N/A",
118
- status: "To-Do",
119
- completionDate: "2025-10-28T10:00:00Z",
120
- },
121
- ]);
122
-
123
- const headers = [
124
- { title: "Task", value: "task" },
125
- { title: "Date Created", value: "createdAt" },
126
- { title: "Area", value: "area" },
127
- { title: "Created By", value: "createdBy" },
128
- { title: "Cleaners", value: "cleaners" },
129
- { title: "Status", value: "status" },
130
- { title: "Completion Date/Time", value: "completionDate" },
131
- { title: "Action", value: "action" },
132
- ];
133
-
134
- const { formatDate } = useUtils();
135
-
136
- function getInitials(name: string) {
137
- if (!name) return "";
138
- return name
139
- .split(" ")
140
- .map((n) => n[0])
141
- .join("")
142
- .toUpperCase();
143
- }
144
- function getAvatarColor(name: string) {
145
- if (name === "Demo Smith") return "purple";
146
- if (name === "Hygiene SP") return "blue";
147
- return "grey";
148
- }
149
- function getStatusColor(status: string) {
150
- if (status === "To-Do") return "orange";
151
- if (status === "Completed") return "green";
152
- return "grey";
153
- }
154
- function acceptTask(item: any) {
155
- selectedTask.value = item;
156
- showAcceptDialog.value = true;
157
- }
158
- function confirmAccept() {
159
- // Handle accept logic here (e.g., update status, API call)
160
- showAcceptDialog.value = false;
161
- }
162
- function onRowClick(data: any) {
163
- const item = data?.item ?? data;
164
- const id = item?._id || item?.id;
165
- if (id) {
166
- const path = `/${props.orgId}/${props.site}/schedule-tasks-ticket/${id}`;
167
- navigateTo(path);
168
- } else {
169
- console.warn("Row clicked but no id found to navigate:", item);
170
- }
171
- }
172
- </script>
173
-
174
- <style scoped>
175
- .accept-btn {
176
- border: 1px solid #333;
177
- background: #fff;
178
- border-radius: 4px;
179
- cursor: pointer;
180
- min-width: 80px;
181
- }
182
- </style>
@@ -1,94 +0,0 @@
1
- <template>
2
- <v-card flat border="sm black" :loading="loading" class="px-0" :ripple="false">
3
- <v-toolbar class="px-5">
4
- <template #prepend>
5
- <span class="text-subtitle-1 font-weight-black">{{ tableTitle }}</span>
6
- </template>
7
- <template #append>
8
- <v-btn color="primary" variant="flat" size="large" density="comfortable" :text="buttonLabel"
9
- class="text-capitalize" />
10
- </template>
11
- </v-toolbar>
12
- <v-card-text class="pa-0 bg-red">
13
- <v-data-table :headers="headers" :items="items" :item-value="itemValue" :items-per-page="itemsPerPage"
14
- fixed-header hide-default-footer hide-default-header @click:row="$emit('row-click', $event)"
15
- style="max-height: calc(100vh - (200px))">
16
- <template v-for="(_, slotName) in $slots" #[slotName]="slotProps">
17
- <slot :name="slotName" v-bind="slotProps" />
18
- </template>
19
- </v-data-table>
20
- </v-card-text>
21
- </v-card>
22
- </template>
23
-
24
- <script setup lang="ts">
25
- const selected = defineModel({
26
- type: Array as PropType<Array<string>>,
27
- default: () => [],
28
- });
29
- const page = defineModel("page", { type: Number, default: 0 });
30
-
31
- const props = defineProps({
32
- headers: {
33
- type: Array as PropType<Array<Record<string, string | number>>>,
34
- required: true,
35
- default: () => [],
36
- },
37
- items: {
38
- type: Array as PropType<Array<Record<string, any>>>,
39
- required: true,
40
- default: () => [],
41
- },
42
-
43
- itemValue: {
44
- type: String,
45
- default: "_id",
46
- },
47
- itemsPerPage: {
48
- type: Number,
49
- default: 20,
50
- },
51
- loading: {
52
- type: Boolean,
53
- required: true,
54
- default: true,
55
- },
56
- tableTitle: {
57
- type: String,
58
- default: "",
59
- required: false
60
- },
61
- buttonLabel: {
62
- type: String,
63
- default: "Add",
64
- required: false
65
- }
66
- });
67
-
68
- const emit = defineEmits(["refresh", "update:pagination", "row-click"]);
69
-
70
- function increment() {
71
- page.value++;
72
- emit("update:pagination", page.value);
73
- }
74
-
75
- function decrement() {
76
- page.value--;
77
- emit("update:pagination", page.value);
78
- }
79
-
80
- function tableRowClickHandler(_: any, row: any) {
81
- const item = props.items[row.index];
82
- emit("row-click", item);
83
- }
84
-
85
- const selectAll = ref(false);
86
-
87
- watch(selectAll, (curr) => {
88
- selected.value.splice(0, selected.value.length);
89
- if (curr) {
90
- const ids = props.items.map((i) => i._id as string);
91
- selected.value.push(...ids);
92
- }
93
- });
94
- </script>
@@ -1,36 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { test } from "node:test";
3
-
4
- import { cameraAlertMessage } from "./.build/useVisitorSocket.mjs";
5
-
6
- /*
7
- * The reported symptom was one camera raising a red toast every 10 seconds on
8
- * an unrelated page. API-core now paces the alert; this side has to make sure
9
- * several cameras failing at once still cannot become several snackbars.
10
- */
11
-
12
- test("nothing is shown when no camera is down", () => {
13
- assert.equal(cameraAlertMessage([]), "");
14
- });
15
-
16
- test("one failing camera shows the server's own message, which names it", () => {
17
- const text = "The entry and exit ANPR camera at Seventh Condominium is not responding.";
18
- assert.equal(cameraAlertMessage([text]), text);
19
- });
20
-
21
- test("several failing cameras collapse into a single line", () => {
22
- const many = ["camera one is down", "camera two is down", "camera three is down"];
23
- const text = cameraAlertMessage(many);
24
- assert.match(text, /^3 cameras at this site are not responding/);
25
- for (const message of many) assert.doesNotMatch(text, new RegExp(message));
26
- });
27
-
28
- test("the collapsed line points at the page that lists them", () => {
29
- assert.match(cameraAlertMessage(["a", "b"]), /Site Settings > Cameras/);
30
- });
31
-
32
- test("no camera message tells the operator to deactivate anything", () => {
33
- for (const messages of [["a camera is down"], ["a", "b"]]) {
34
- assert.doesNotMatch(cameraAlertMessage(messages), /inactive|deactivat/i);
35
- }
36
- });