@7365admin1/layer-common 4.97.1-staging.683 → 4.97.1-staging.685
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.
|
@@ -1227,8 +1227,9 @@ select option {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
|
|
1229
1229
|
/* Long values (emails, sync messages) wrap inside the card instead of
|
|
1230
|
-
running off it; chips and
|
|
1231
|
-
|
|
1230
|
+
running off it; chips (Vuetify's and our StatusChip) and buttons keep
|
|
1231
|
+
their one-line shape: a StatusChip role pill broke as "Range / r". */
|
|
1232
|
+
.v-data-table__td-value :is(span, div, p, a):not(.v-chip):not(.v-chip *):not(.status-chip):not(.status-chip *):not(.v-btn):not(.v-btn *) {
|
|
1232
1233
|
white-space: normal !important;
|
|
1233
1234
|
overflow: visible;
|
|
1234
1235
|
text-overflow: clip;
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
it. -->
|
|
292
292
|
<div class="field-label">Enrolling <span>*</span></div>
|
|
293
293
|
<AppSelect
|
|
294
|
-
v-if="
|
|
294
|
+
v-if="pickingSubject && subjectCategoryOptions.length"
|
|
295
295
|
v-model="form.subjectCategory"
|
|
296
296
|
:items="subjectCategoryOptions"
|
|
297
297
|
klass="mb-3"
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
class="field-hint field-hint--error mb-3"
|
|
309
309
|
data-test="hid-unlinked-warning"
|
|
310
310
|
>
|
|
311
|
-
{{ UNLINKED_HID_USER_WARNING }}
|
|
311
|
+
{{ UNLINKED_HID_USER_WARNING }} {{ LINK_HID_USER_PROMPT }}
|
|
312
312
|
</p>
|
|
313
313
|
<!-- WHY THERE IS NOTHING TO PICK. Drawn in place of the dropdown when
|
|
314
314
|
the reader serves nobody, and beneath it when only some types were
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
Nothing extra is needed to stop the save: with no type there is no
|
|
318
318
|
subject, and the save already refuses that. -->
|
|
319
319
|
<p
|
|
320
|
-
v-if="
|
|
320
|
+
v-if="pickingSubject && subjectCategoryNote"
|
|
321
321
|
class="field-hint mb-3"
|
|
322
322
|
:class="{ 'field-hint--error': enrolmentSubjects.emptied }"
|
|
323
323
|
>
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
asked for. A row that never had one keeps not having one; that
|
|
340
340
|
is not a reason to make somebody fill in a location before they
|
|
341
341
|
can change a PIN. -->
|
|
342
|
-
<template v-if="
|
|
342
|
+
<template v-if="pickingSubject && isResidentSubject">
|
|
343
343
|
<div class="field-label">Block <span>*</span></div>
|
|
344
344
|
<!-- The listener sits on a wrapper, NOT on AppSelect: AppSelect
|
|
345
345
|
spreads `$attrs` over its v-menu activator AFTER the activator's
|
|
@@ -384,7 +384,7 @@
|
|
|
384
384
|
with no unit has no candidates to show, and the dialog is then
|
|
385
385
|
purely the reader's own credentials - photo, PIN, password -
|
|
386
386
|
which is exactly the edit that must not be blocked. -->
|
|
387
|
-
<template v-if="isResidentSubject && (
|
|
387
|
+
<template v-if="isResidentSubject && (pickingSubject || form.unit)">
|
|
388
388
|
<div class="field-label">Resident <span>*</span></div>
|
|
389
389
|
<AppSelect
|
|
390
390
|
v-model="form.subjectId"
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
access is bound by user id, so there is nothing to bind. The note
|
|
406
406
|
below says how many were left out rather than letting a missing
|
|
407
407
|
colleague read as a bug. -->
|
|
408
|
-
<template v-if="
|
|
408
|
+
<template v-if="pickingSubject && isMemberSubject">
|
|
409
409
|
<div class="field-label">Member <span>*</span></div>
|
|
410
410
|
<AppSelect
|
|
411
411
|
v-model="form.subjectId"
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
so the two screens cannot disagree about who works here.
|
|
441
441
|
Unpaged - the endpoint returns the site's people in one response -
|
|
442
442
|
so searching and filtering cost no request. -->
|
|
443
|
-
<template v-if="
|
|
443
|
+
<template v-if="pickingSubject && isProviderSubject">
|
|
444
444
|
<div class="field-label">Service</div>
|
|
445
445
|
<AppSelect
|
|
446
446
|
v-model="providerService"
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
else: it is the one subject type that arrives a shift at a time,
|
|
465
465
|
and the people it adds fill in their own credentials from their
|
|
466
466
|
app afterwards. -->
|
|
467
|
-
<div class="hid-bulk-cta mb-3">
|
|
467
|
+
<div v-if="!selectedUser" class="hid-bulk-cta mb-3">
|
|
468
468
|
<AppButton
|
|
469
469
|
variant="ghost"
|
|
470
470
|
icon="mdi-account-multiple-plus-outline"
|
|
@@ -507,7 +507,7 @@
|
|
|
507
507
|
whatever the reader already holds. -->
|
|
508
508
|
<!-- A mirror of the chosen member's role, on the same rule as Name:
|
|
509
509
|
restated from the record, never collected. -->
|
|
510
|
-
<template v-if="
|
|
510
|
+
<template v-if="pickingSubject && isPersonSubject">
|
|
511
511
|
<div class="field-label">{{ subjectMirrorLabel }}</div>
|
|
512
512
|
<AppField
|
|
513
513
|
v-model="form.subjectRole"
|
|
@@ -1315,6 +1315,7 @@ const {
|
|
|
1315
1315
|
runObjectOperation,
|
|
1316
1316
|
createIdentity,
|
|
1317
1317
|
updateIdentity,
|
|
1318
|
+
linkReaderUser,
|
|
1318
1319
|
deleteIdentity,
|
|
1319
1320
|
pushStoredFace,
|
|
1320
1321
|
getSitePermissions,
|
|
@@ -1435,6 +1436,16 @@ const deleteSummary = computed(() =>
|
|
|
1435
1436
|
);
|
|
1436
1437
|
const cardDialog = ref(false);
|
|
1437
1438
|
const selectedUser = ref<HidUser | null>(null);
|
|
1439
|
+
/**
|
|
1440
|
+
* LINK FROM EDIT. An Unmapped user (created on the reader, or enrolled before
|
|
1441
|
+
* enrolment linked a person) can be linked to the person it is: the same
|
|
1442
|
+
* pickers as enrolment are drawn in the edit dialog, and the save writes OUR
|
|
1443
|
+
* record only (`linkReaderUser`) - nothing is sent to the reader, nobody is
|
|
1444
|
+
* removed from it - so their existing access shows in their Service365 app.
|
|
1445
|
+
*/
|
|
1446
|
+
const linkingUnmapped = computed(() => Boolean(selectedUser.value) && !hasMappedRecord(selectedUser.value as HidUser));
|
|
1447
|
+
/** The subject pickers are drawn while enrolling, and while linking an Unmapped user. */
|
|
1448
|
+
const pickingSubject = computed(() => !selectedUser.value || linkingUnmapped.value);
|
|
1438
1449
|
const cardUser = ref<HidUser | null>(null);
|
|
1439
1450
|
const physicalCards = ref<HidCard[]>([]);
|
|
1440
1451
|
const physicalCardsByUserId = ref<Record<string, HidCard[]>>({});
|
|
@@ -3285,6 +3296,26 @@ async function saveUser() {
|
|
|
3285
3296
|
},
|
|
3286
3297
|
};
|
|
3287
3298
|
|
|
3299
|
+
if (selectedUser.value && linkingUnmapped.value && form.subjectId) {
|
|
3300
|
+
/*
|
|
3301
|
+
* LINK ONLY. Our record gets the person (and the account behind them);
|
|
3302
|
+
* the reader is not written - the user, face, card, PIN and door access
|
|
3303
|
+
* it already holds stay as they are. Anything else edited in the same
|
|
3304
|
+
* save is left for a second save, so the link never rides on a reader
|
|
3305
|
+
* write that could fail half way.
|
|
3306
|
+
*/
|
|
3307
|
+
const linkReaderId = String(selectedUser.value.reader || readerId);
|
|
3308
|
+
await linkReaderUser(linkReaderId, String(selectedUser.value.hidUserId || form.hidUserId), {
|
|
3309
|
+
...subjectLinkOf(form.subjectCategory, form.subjectId),
|
|
3310
|
+
name: form.name,
|
|
3311
|
+
registration: form.registration,
|
|
3312
|
+
});
|
|
3313
|
+
formDialog.value = false;
|
|
3314
|
+
await loadUsers();
|
|
3315
|
+
showToast("Linked. This person's HID access now shows in their Service365 app.", "success");
|
|
3316
|
+
return;
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3288
3319
|
if (selectedUser.value) {
|
|
3289
3320
|
/*
|
|
3290
3321
|
* AN EDIT REACHES EVERY READER THIS PERSON IS ON.
|
|
@@ -4561,6 +4592,9 @@ function getMappingStatus(user: HidUser) {
|
|
|
4561
4592
|
}
|
|
4562
4593
|
|
|
4563
4594
|
/** Shown on an edit of, and after saving, a HID user linked to nobody. */
|
|
4595
|
+
const LINK_HID_USER_PROMPT =
|
|
4596
|
+
"Pick who this is below and save to link them; nothing is changed on the reader.";
|
|
4597
|
+
|
|
4564
4598
|
const UNLINKED_HID_USER_WARNING =
|
|
4565
4599
|
"Not linked to anyone in iService365, so this access will not show in their"
|
|
4566
4600
|
+ " Service365 app. To give the person app access, delete this HID user and"
|
|
@@ -589,6 +589,23 @@ export default function useHidAmico() {
|
|
|
589
589
|
});
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
+
/**
|
|
593
|
+
* Link a user that exists only on the reader to the person it is. OUR record
|
|
594
|
+
* only - the server sends nothing to the reader - so the person's existing
|
|
595
|
+
* access shows in their Service365 app. Body from `subjectLinkOf`.
|
|
596
|
+
*/
|
|
597
|
+
function linkReaderUser(
|
|
598
|
+
readerId: string,
|
|
599
|
+
hidUserId: string | number,
|
|
600
|
+
payload: { person?: string; member?: string; serviceProvider?: string; type?: string; name?: string; registration?: string },
|
|
601
|
+
) {
|
|
602
|
+
const body = Object.fromEntries(Object.entries(payload).filter(([, value]) => value !== "" && value !== undefined));
|
|
603
|
+
return useNuxtApp().$api<HidApiRecord>(`${basePath}/readers/${readerId}/users/${hidUserId}/link`, {
|
|
604
|
+
method: "POST",
|
|
605
|
+
body,
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
|
|
592
609
|
function deleteIdentity(identityId: string) {
|
|
593
610
|
return useNuxtApp().$api<HidApiRecord>(`${basePath}/identities/${identityId}`, {
|
|
594
611
|
method: "DELETE",
|
|
@@ -735,6 +752,7 @@ export default function useHidAmico() {
|
|
|
735
752
|
getReaderAccessLogs,
|
|
736
753
|
createIdentity,
|
|
737
754
|
updateIdentity,
|
|
755
|
+
linkReaderUser,
|
|
738
756
|
deleteIdentity,
|
|
739
757
|
getIntercomStatus,
|
|
740
758
|
makeIntercomCall,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.97.1-staging.
|
|
5
|
+
"version": "4.97.1-staging.685",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|