@7365admin1/layer-common 4.34.0 → 4.34.1-staging.368
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 +4 -37
- package/components/AccessCardAddForm.vue +5 -4
- package/components/AccessCardAssignToUnitForm.vue +3 -2
- package/components/AccessCardPreviewDialog.vue +4 -3
- package/components/Dialog/UpdateMoreAction.vue +11 -1
- package/components/DocumentForm.vue +407 -112
- package/components/DocumentManagement.vue +213 -12
- package/components/EntryPass/QrTemplatePreview.vue +21 -25
- package/components/EntryPassInformation.vue +119 -24
- package/components/Facility/BookingSetup.vue +63 -0
- package/components/HidAccessLogDashboard.vue +41 -8
- package/components/HidAccessPermissions.vue +424 -0
- package/components/HidIntercomManagement.vue +148 -14
- package/components/HidProfileQrCode.vue +332 -0
- package/components/HidQrCodeConfiguration.vue +17 -195
- package/components/HidReaderManagement.vue +306 -0
- package/components/HidReaderUserRoster.vue +44 -3
- package/components/HidUserEnrollment.vue +845 -155
- package/components/InvitationClientForm.vue +19 -1
- package/components/NotificationBell.vue +39 -3
- package/components/VisitorForm.vue +12 -0
- package/components/VisitorManagement.vue +267 -5
- package/composables/useAccessManagement.ts +5 -0
- package/composables/useDocument.ts +7 -0
- package/composables/useFacility.ts +11 -0
- package/composables/useHidAmico.ts +134 -0
- package/composables/useHidNavigation.ts +25 -1
- package/composables/useHidReaderSelection.ts +50 -0
- package/composables/usePeople.ts +19 -0
- package/composables/useSiteCategory.ts +45 -0
- package/composables/useSiteEntryPassSettings.ts +26 -0
- package/composables/useWebUsb.ts +14 -11
- 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-qr-code/index.vue +23 -0
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
- package/types/document.d.ts +14 -0
- package/types/facility.d.ts +4 -0
- package/types/people.d.ts +28 -1
- package/utils/hid-permission-assignments.ts +190 -0
- package/utils/hid-reader-selection.ts +52 -0
- package/utils/notification-target.ts +75 -0
- package/utils/occupancy-role.ts +109 -0
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
v-model="search"
|
|
28
28
|
search
|
|
29
29
|
placeholder="Search Amico user, UID or registration"
|
|
30
|
-
@keyup.enter="
|
|
30
|
+
@keyup.enter="onSearchSubmit"
|
|
31
31
|
/>
|
|
32
32
|
<AppSelect
|
|
33
33
|
v-model="userType"
|
|
@@ -208,6 +208,7 @@ const {
|
|
|
208
208
|
} = useHidAmico();
|
|
209
209
|
const readers = ref<HidReader[]>([]);
|
|
210
210
|
const users = ref<HidReaderUser[]>([]);
|
|
211
|
+
const { selectHidReader, resolveForSite } = useHidReaderSelection();
|
|
211
212
|
const selectedReaderId = ref("");
|
|
212
213
|
const search = ref("");
|
|
213
214
|
const userType = ref<"all" | "user" | "visitor">("all");
|
|
@@ -270,7 +271,11 @@ async function loadReaders() {
|
|
|
270
271
|
readers.value = (Array.isArray(items) ? items : [])
|
|
271
272
|
.map(toReader)
|
|
272
273
|
.filter((reader): reader is HidReader => reader !== null);
|
|
273
|
-
|
|
274
|
+
/* Shared with every other HID screen — see `useHidReaderSelection`. The
|
|
275
|
+
resolver refuses a remembered reader that is not this site's, so a site
|
|
276
|
+
switch or a deleted reader falls back to the first rather than querying
|
|
277
|
+
an id the site does not own. */
|
|
278
|
+
selectedReaderId.value = resolveForSite(props.site, readers.value);
|
|
274
279
|
} catch (error: unknown) {
|
|
275
280
|
readers.value = [];
|
|
276
281
|
showToast(getErrorMessage(error), "error");
|
|
@@ -284,6 +289,8 @@ async function loadUsers() {
|
|
|
284
289
|
return;
|
|
285
290
|
}
|
|
286
291
|
|
|
292
|
+
const sequence = loadUsersSequence.value + 1;
|
|
293
|
+
loadUsersSequence.value = sequence;
|
|
287
294
|
loading.value = true;
|
|
288
295
|
try {
|
|
289
296
|
let clientFiltersUserType = false;
|
|
@@ -319,6 +326,7 @@ async function loadUsers() {
|
|
|
319
326
|
const pageItems = clientFiltersUserType
|
|
320
327
|
? matchingItems.slice(pageStart, pageStart + 10)
|
|
321
328
|
: matchingItems;
|
|
329
|
+
if (sequence !== loadUsersSequence.value) return;
|
|
322
330
|
users.value = pageItems.map(toReaderUser);
|
|
323
331
|
total.value = clientFiltersUserType
|
|
324
332
|
? matchingItems.length
|
|
@@ -330,13 +338,15 @@ async function loadUsers() {
|
|
|
330
338
|
? ""
|
|
331
339
|
: toText(response.pageRange ?? data.pageRange);
|
|
332
340
|
} catch (error: unknown) {
|
|
341
|
+
if (sequence !== loadUsersSequence.value) return;
|
|
333
342
|
users.value = [];
|
|
334
343
|
total.value = 0;
|
|
335
344
|
pages.value = 1;
|
|
336
345
|
serverPageRange.value = "";
|
|
337
346
|
showToast(getErrorMessage(error), "error");
|
|
338
347
|
} finally {
|
|
339
|
-
|
|
348
|
+
// Only the newest load owns the spinner.
|
|
349
|
+
if (sequence === loadUsersSequence.value) loading.value = false;
|
|
340
350
|
}
|
|
341
351
|
}
|
|
342
352
|
|
|
@@ -350,6 +360,31 @@ function reloadFromFirstPage() {
|
|
|
350
360
|
loadUsers();
|
|
351
361
|
}
|
|
352
362
|
|
|
363
|
+
/**
|
|
364
|
+
* Typing is the search. It used to reload on `@keyup.enter` and on nothing
|
|
365
|
+
* else, so unless you guessed Enter was required the screen sent no request at
|
|
366
|
+
* all. Debounced, because each reload is a login/load/logout round trip to a
|
|
367
|
+
* reader over a VPN; Enter still works and skips the wait.
|
|
368
|
+
*/
|
|
369
|
+
const SEARCH_DEBOUNCE_MS = 400;
|
|
370
|
+
let searchDebounce: ReturnType<typeof setTimeout> | undefined;
|
|
371
|
+
|
|
372
|
+
function onSearchInput() {
|
|
373
|
+
clearTimeout(searchDebounce);
|
|
374
|
+
searchDebounce = setTimeout(reloadFromFirstPage, SEARCH_DEBOUNCE_MS);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function onSearchSubmit() {
|
|
378
|
+
clearTimeout(searchDebounce);
|
|
379
|
+
reloadFromFirstPage();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
watch(search, onSearchInput);
|
|
383
|
+
onBeforeUnmount(() => clearTimeout(searchDebounce));
|
|
384
|
+
|
|
385
|
+
/** Discards a load whose answer arrives after a newer one started. */
|
|
386
|
+
const loadUsersSequence = ref(0);
|
|
387
|
+
|
|
353
388
|
function hasFacialData(user: HidReaderUser) {
|
|
354
389
|
return user.metadata?.facialEnrolled === true || Boolean(toText(user.metadata?.facialData));
|
|
355
390
|
}
|
|
@@ -511,6 +546,12 @@ function toNumber(value: unknown, fallback: number) {
|
|
|
511
546
|
const number = Number(value);
|
|
512
547
|
return Number.isFinite(number) ? number : fallback;
|
|
513
548
|
}
|
|
549
|
+
|
|
550
|
+
/* Publish every change, including the seed above: a screen that had to fall
|
|
551
|
+
back to the first reader should leave the others agreeing with it. */
|
|
552
|
+
watch(selectedReaderId, (value) => {
|
|
553
|
+
if (value) selectHidReader(props.site, value);
|
|
554
|
+
});
|
|
514
555
|
</script>
|
|
515
556
|
|
|
516
557
|
<style scoped>
|