@7365admin1/layer-common 4.97.1-staging.707 → 4.97.1-staging.709
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.
|
@@ -225,6 +225,7 @@ import {
|
|
|
225
225
|
effectiveModules,
|
|
226
226
|
ownerGrant,
|
|
227
227
|
siteModulesForOrg,
|
|
228
|
+
withMaMonitorModules,
|
|
228
229
|
} from "../utils/org-modules";
|
|
229
230
|
import { withoutDeniedResources } from "../utils/module-routes";
|
|
230
231
|
|
|
@@ -420,10 +421,13 @@ const offeredPermissions = computed(() =>
|
|
|
420
421
|
withoutDeniedResources(catalogueForOwnerGrant(
|
|
421
422
|
catalogueForOrg(
|
|
422
423
|
props.permissions ?? {},
|
|
423
|
-
|
|
424
|
-
(
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
withMaMonitorModules(
|
|
425
|
+
effectiveModules(
|
|
426
|
+
(orgForModules.value as any)?.modules,
|
|
427
|
+
// Only the site's OWN organisation is narrowed by it (owner Q1).
|
|
428
|
+
siteModulesForOrg(siteForModules.value as any, props.orgId)
|
|
429
|
+
),
|
|
430
|
+
props.type
|
|
427
431
|
)
|
|
428
432
|
),
|
|
429
433
|
ownerGrant(orgForModules.value as any, grantRole.value as any, props.type)
|
|
@@ -673,7 +673,7 @@ const qrError = ref("");
|
|
|
673
673
|
const qrLinkHint = computed(() => (qrCodeToLink.value ? stickerCodeHint(qrCodeToLink.value) : ""));
|
|
674
674
|
// the combobox keeps a typed-but-not-committed code in its search text
|
|
675
675
|
const qrSearch = ref("");
|
|
676
|
-
// the pick-list's stickers ("TLR002 -
|
|
676
|
+
// the pick-list's stickers ("TLR002" - the long code only for an unnumbered sticker), by sticker number with the next one first
|
|
677
677
|
const qrPicks = ref<BlankPick[]>([]);
|
|
678
678
|
const qrCodes = computed(() => qrPicks.value.map(blankPickLabel));
|
|
679
679
|
const qrSummary = ref<BlankSummary | null>(null);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span class="d-inline-flex align-center ga-1 text-caption" data-test="vehicle-sticker-code">
|
|
3
3
|
<span v-if="label" class="text-medium-emphasis">{{ label }}</span>
|
|
4
|
-
|
|
4
|
+
<!-- the long code is hidden (owner 2026-11-17: too long; the sticker number beside it is what people use) - copy still gives it -->
|
|
5
5
|
<v-btn :icon="copied ? 'mdi-check' : 'mdi-content-copy'" flat size="x-small" density="compact"
|
|
6
|
-
aria-label="Copy sticker code" @click.stop="copy" />
|
|
6
|
+
aria-label="Copy sticker code" title="Copy sticker code" @click.stop="copy" />
|
|
7
7
|
</span>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup lang="ts">
|
|
11
|
-
//
|
|
11
|
+
// Copy button for a sticker's long code (the code itself is not shown). Shown only when the server sent it.
|
|
12
12
|
const props = defineProps<{ code: string; label?: string }>();
|
|
13
13
|
const copied = ref(false);
|
|
14
14
|
async function copy() {
|
|
@@ -21,7 +21,3 @@ async function copy() {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
24
|
-
|
|
25
|
-
<style scoped>
|
|
26
|
-
.vehicle-sticker-code { font-size: 0.75rem; letter-spacing: 0.02em; }
|
|
27
|
-
</style>
|
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.709",
|
|
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.",
|
package/utils/org-modules.ts
CHANGED
|
@@ -189,6 +189,33 @@ export function effectiveModules(
|
|
|
189
189
|
return allowed.length ? allowed : org;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Provider modules a managing agent only MONITORS at its sites (owner
|
|
194
|
+
* 2026-11-17). The MA's own module list does not decide them - core's
|
|
195
|
+
* `MA_MONITOR_MODULES` (module-gate.util.ts) holds the same keys - so the MA
|
|
196
|
+
* role editor keeps offering their view rights even when the list predates them.
|
|
197
|
+
*/
|
|
198
|
+
export const MA_MONITOR_MODULES: readonly string[] = Object.freeze([
|
|
199
|
+
"daily-occurrence-books",
|
|
200
|
+
"daily-occurrence-entries",
|
|
201
|
+
"virtual-patrol",
|
|
202
|
+
"nfc-patrol",
|
|
203
|
+
"attendance-mgmt",
|
|
204
|
+
"cleaning-schedule-mgmt",
|
|
205
|
+
"landscape-schedule-mgmt",
|
|
206
|
+
"pest-schedule-mgmt",
|
|
207
|
+
"pool-schedule-mgmt",
|
|
208
|
+
"area-mgmt",
|
|
209
|
+
"unit-mgmt",
|
|
210
|
+
"schedule-task-mgmt",
|
|
211
|
+
]);
|
|
212
|
+
|
|
213
|
+
/** An MA role editor's module list plus the provider modules it monitors; any other type unchanged. `[]` (= everything) stays `[]`. */
|
|
214
|
+
export function withMaMonitorModules(modules: string[], type: unknown): string[] {
|
|
215
|
+
if (type !== "property_management_agency" || !modules.length) return modules;
|
|
216
|
+
return [...new Set([...modules, ...MA_MONITOR_MODULES])];
|
|
217
|
+
}
|
|
218
|
+
|
|
192
219
|
/**
|
|
193
220
|
* The site tier, but only for the organisation that OWNS the site.
|
|
194
221
|
*
|
|
@@ -166,10 +166,9 @@ export function blankPickSerial(i: Pick<BlankPick, "serialNo" | "serialLabel">):
|
|
|
166
166
|
return n ? String(i.serialLabel ?? "").trim() || `No. ${n}` : "";
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/** "TLR002
|
|
169
|
+
/** "TLR002" - the long code only for a sticker with no number (owner 2026-11-17: the code is too long to read). */
|
|
170
170
|
export function blankPickLabel(i: BlankPick): string {
|
|
171
|
-
|
|
172
|
-
return sn ? `${sn} - ${i.code}` : i.code;
|
|
171
|
+
return blankPickSerial(i) || i.code;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
/** Ascending by sticker number; stickers with no number last, in the order they came. */
|