@7365admin1/layer-common 4.32.1-staging.366 → 4.33.1
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 +16 -4
- package/components/AccessCardAddForm.vue +4 -5
- package/components/AccessCardAssignToUnitForm.vue +2 -3
- package/components/AccessCardPreviewDialog.vue +3 -4
- package/components/Dialog/DeleteConfirmation.vue +2 -17
- package/components/Dialog/ReusablePrompt.vue +3 -26
- package/components/Dialog/UpdateMoreAction.vue +1 -11
- package/components/DocumentForm.vue +112 -407
- package/components/DocumentManagement.vue +12 -213
- package/components/EntryPass/QrTemplatePreview.vue +25 -21
- package/components/EntryPassInformation.vue +24 -119
- package/components/Facility/BookingSetup.vue +0 -63
- package/components/HidAccessLogDashboard.vue +8 -41
- package/components/HidIntercomManagement.vue +14 -148
- package/components/HidReaderManagement.vue +0 -26
- package/components/HidReaderUserRoster.vue +3 -44
- package/components/HidUserEnrollment.vue +155 -845
- package/components/InvitationClientForm.vue +1 -19
- package/components/NotificationBell.vue +3 -39
- package/components/VehicleForm.vue +2 -45
- package/components/VehicleManagement.vue +10 -95
- package/components/VisitorManagement.vue +5 -267
- package/composables/useAccessManagement.ts +0 -5
- package/composables/useCleaningPermission.ts +4 -4
- package/composables/useCommonPermission.ts +0 -16
- package/composables/useDocument.ts +0 -7
- package/composables/useFacility.ts +0 -11
- package/composables/useHidAmico.ts +0 -117
- package/composables/useHidNavigation.ts +1 -25
- package/composables/useLandscapingPermission.ts +4 -4
- package/composables/useMechanicalElectricalPermission.ts +4 -4
- package/composables/usePeople.ts +0 -19
- package/composables/usePestControlPermission.ts +4 -4
- package/composables/usePoolMaintenancePermission.ts +4 -4
- package/composables/useSecurityPermission.ts +10 -4
- package/composables/useSiteEntryPassSettings.ts +0 -26
- package/composables/useWebUsb.ts +11 -14
- 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/people.d.ts +1 -28
- package/utils/vehicle-actions.ts +4 -12
- 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/notification-target.ts +0 -75
- package/utils/occupancy-role.ts +0 -109
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where a notification takes you when you click it.
|
|
3
|
-
*
|
|
4
|
-
* Kept free of Vue and Nuxt so the decision is unit-tested directly
|
|
5
|
-
* (`utils/notification-target.test.ts`); `NotificationBell.vue` does nothing
|
|
6
|
-
* with the answer but hand it to the router.
|
|
7
|
-
*
|
|
8
|
-
* WHY THE BELL NEEDED THIS AT ALL
|
|
9
|
-
* The bell has drawn rows since it shipped and clicking one only ever marked it
|
|
10
|
-
* read. For an expiring document that is survivable — the row says what it says.
|
|
11
|
-
* For a marketplace order it is not: "A new marketplace order has reached your
|
|
12
|
-
* company" is a message whose entire point is the order, and a vendor who taps
|
|
13
|
-
* the push on their phone and then goes looking in the org app had nowhere to
|
|
14
|
-
* land.
|
|
15
|
-
*
|
|
16
|
-
* WHAT THE ROW ACTUALLY CARRIES
|
|
17
|
-
* `iservice365-API-core`'s marketplace senders store `module` as the display
|
|
18
|
-
* tag and the record's id in `params.id` — for the vendor rows that id is the
|
|
19
|
-
* SUB-order, which is the same id the vendor's order queue routes on. `screen`
|
|
20
|
-
* is deliberately empty on those rows (it is a mobile deep-link path, and no
|
|
21
|
-
* mobile screen exists), so the module is what we route on, not `screen`.
|
|
22
|
-
*
|
|
23
|
-
* WHY AN APP-SPECIFIC ROUTE NAME LIVES IN THE SHARED LAYER
|
|
24
|
-
* Eleven web apps render this bell and only `iservice365-web-app-org` has an
|
|
25
|
-
* order queue. Rather than make eleven apps configure a map, the name is
|
|
26
|
-
* written down once here and the bell asks its own router whether the route
|
|
27
|
-
* exists before pushing — so in the ten apps without the page the click stays
|
|
28
|
-
* exactly what it was: mark as read, go nowhere.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/** Only the fields a destination is decided from. */
|
|
32
|
-
export type TTargetRow = {
|
|
33
|
-
module?: string;
|
|
34
|
-
params?: { id?: string } | null;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/** What the surrounding app knows that the stored row does not. */
|
|
38
|
-
export type TTargetContext = {
|
|
39
|
-
/** The organization in the current URL. Org routes are all nested under it. */
|
|
40
|
-
organization?: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type TNotificationTarget = {
|
|
44
|
-
name: string;
|
|
45
|
-
params: Record<string, string>;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** Nuxt's generated names for `pages/org/[organization]/marketplace/orders/`. */
|
|
49
|
-
export const ORDER_QUEUE_ROUTE = "org-organization-marketplace-orders";
|
|
50
|
-
export const ORDER_DETAIL_ROUTE = "org-organization-marketplace-orders-id";
|
|
51
|
-
|
|
52
|
-
/** The stored `module` tag on a row sent to a vendor's staff. */
|
|
53
|
-
export const VENDOR_ORDER_MODULE = "marketplace-vendor-order";
|
|
54
|
-
|
|
55
|
-
export function notificationTarget(
|
|
56
|
-
item: TTargetRow | null | undefined,
|
|
57
|
-
context: TTargetContext = {},
|
|
58
|
-
): TNotificationTarget | null {
|
|
59
|
-
const organization = String(context.organization ?? "").trim();
|
|
60
|
-
|
|
61
|
-
if (String(item?.module ?? "") !== VENDOR_ORDER_MODULE) return null;
|
|
62
|
-
|
|
63
|
-
// Every order route is nested under the organization. Without one there is no
|
|
64
|
-
// URL to build, and guessing an organization for somebody who belongs to
|
|
65
|
-
// several is worse than leaving the click as it was.
|
|
66
|
-
if (!organization) return null;
|
|
67
|
-
|
|
68
|
-
const id = String(item?.params?.id ?? "").trim();
|
|
69
|
-
|
|
70
|
-
// No id — an older row, or one whose params were dropped — still has an
|
|
71
|
-
// honest destination: the queue the order is sitting in.
|
|
72
|
-
if (!id) return { name: ORDER_QUEUE_ROUTE, params: { organization } };
|
|
73
|
-
|
|
74
|
-
return { name: ORDER_DETAIL_ROUTE, params: { organization, id } };
|
|
75
|
-
}
|
package/utils/occupancy-role.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OWNER / OCCUPANT / PERSON IN CHARGE - the three standings a business
|
|
3
|
-
* tenancy has, and everything the product says about them.
|
|
4
|
-
*
|
|
5
|
-
* One list, because three screens read it: the form that asks the question
|
|
6
|
-
* (`PeopleFormMgmt`), the list and preview that print the answer back, and
|
|
7
|
-
* the row menu that reassigns it (`people-mgmt`). The values are the ones the
|
|
8
|
-
* server stores and validates - `OccupancyRoles` in core's `person.model.ts`
|
|
9
|
-
* - so a value added on one side has to be added on the other.
|
|
10
|
-
*/
|
|
11
|
-
export const OCCUPANCY_ROLE_OPTIONS: TOccupancyRoleOption[] = [
|
|
12
|
-
{
|
|
13
|
-
value: "owner",
|
|
14
|
-
title: "Owner",
|
|
15
|
-
action: "Assign Owner",
|
|
16
|
-
prompt: "Assign Owner",
|
|
17
|
-
description:
|
|
18
|
-
"The legal titleholder or primary deed owner of the property.",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
value: "occupant",
|
|
22
|
-
title: "Occupant",
|
|
23
|
-
action: "Assign Occupant",
|
|
24
|
-
prompt: "Assign Occupant",
|
|
25
|
-
description:
|
|
26
|
-
"The person currently living in, renting, or utilizing the physical unit.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: "person-in-charge",
|
|
30
|
-
title: "Person in Charge",
|
|
31
|
-
action: "Assign Person in Charge",
|
|
32
|
-
prompt: "Assign Person in Charge (PIC)",
|
|
33
|
-
description:
|
|
34
|
-
"The designated manager responsible for maintenance, emergencies, and daily operations.",
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* The same three, in the order the ROW MENU draws them, which is not the
|
|
40
|
-
* order the form's radio does. Derived rather than re-typed so the wording
|
|
41
|
-
* cannot drift between the two.
|
|
42
|
-
*/
|
|
43
|
-
export const OCCUPANCY_ROLE_ACTIONS: TOccupancyRoleOption[] = (
|
|
44
|
-
["person-in-charge", "owner", "occupant"] as TOccupancyRole[]
|
|
45
|
-
).map(
|
|
46
|
-
(value) =>
|
|
47
|
-
OCCUPANCY_ROLE_OPTIONS.find(
|
|
48
|
-
(option) => option.value === value,
|
|
49
|
-
) as TOccupancyRoleOption,
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* The label for a stored role, or "" for a person who was never asked - which
|
|
54
|
-
* is everyone on a residential site and everyone saved before the question
|
|
55
|
-
* existed. Callers decide what to print instead; nobody should print a raw
|
|
56
|
-
* `person-in-charge` at a user.
|
|
57
|
-
*/
|
|
58
|
-
export function occupancyRoleLabel(role?: string | null): string {
|
|
59
|
-
return (
|
|
60
|
-
OCCUPANCY_ROLE_OPTIONS.find((option) => option.value === role)?.title ?? ""
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Does this person hold OWNER at their unit?
|
|
66
|
-
*
|
|
67
|
-
* The role when there is one, `isOwner` when there is not - the same test the
|
|
68
|
-
* server applies (`holdsUnitOwner` in core's `unit-owner.util.ts`). A person
|
|
69
|
-
* recorded before the role existed carries only the flag, and the people list
|
|
70
|
-
* already prints them as "Owner".
|
|
71
|
-
*/
|
|
72
|
-
export function holdsUnitOwner(person?: {
|
|
73
|
-
occupancyRole?: string | null;
|
|
74
|
-
isOwner?: boolean;
|
|
75
|
-
}): boolean {
|
|
76
|
-
if (!person) return false;
|
|
77
|
-
|
|
78
|
-
if (person.occupancyRole) return person.occupancyRole === "owner";
|
|
79
|
-
|
|
80
|
-
return person.isOwner === true;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* MUST THIS PERSON HAND THE UNIT OVER BEFORE THEY CAN BE DEACTIVATED?
|
|
85
|
-
*
|
|
86
|
-
* The owner of a unit does not leave while they still own it - the standing
|
|
87
|
-
* moves to another tenant at the same block, level and unit first.
|
|
88
|
-
*
|
|
89
|
-
* Keyed to the ROLE and never to `isOwner`, exactly as the server keys it
|
|
90
|
-
* (`mustHandOverBeforeDeactivating` in core): the flag is on every resident in
|
|
91
|
-
* the estate, and no residential screen can change it, so a rule keyed to it
|
|
92
|
-
* would trap records that can never satisfy it.
|
|
93
|
-
*/
|
|
94
|
-
export function mustHandOverBeforeDeactivating(person?: {
|
|
95
|
-
occupancyRole?: string | null;
|
|
96
|
-
}): boolean {
|
|
97
|
-
return person?.occupancyRole === "owner";
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Why a deactivation was held back. The SERVER carries the enforcing copy of
|
|
102
|
-
* this rule and of these words (core `unit-owner.util.ts`); this one exists so
|
|
103
|
-
* the console can say it before the round trip rather than after.
|
|
104
|
-
*/
|
|
105
|
-
export function ownerHandoverRequiredMessage(name?: string): string {
|
|
106
|
-
const who = name?.trim() ? `"${name.trim()}"` : "This person";
|
|
107
|
-
|
|
108
|
-
return `${who} is the owner of this unit. Assign the owner role to another tenant at the same block, level and unit before deactivating them.`;
|
|
109
|
-
}
|