@7365admin1/layer-common 4.97.1-staging.706 → 4.97.1-staging.708

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
- effectiveModules(
424
- (orgForModules.value as any)?.modules,
425
- // Only the site's OWN organisation is narrowed by it (owner Q1).
426
- siteModulesForOrg(siteForModules.value as any, props.orgId)
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)
@@ -295,6 +295,7 @@
295
295
  :items="qrPickItems"
296
296
  no-filter
297
297
  placeholder="Type a sticker number, e.g. TLR120 or 120"
298
+ @focus="selectQrPickText"
298
299
  density="comfortable"
299
300
  :hint="newPlateNumbers.filter(Boolean).length > 1 ? 'Linked to the first plate number above.' : 'Type a sticker number to find it.'"
300
301
  persistent-hint
@@ -617,11 +618,19 @@ const qrPickerOn = ref(false);
617
618
  * 2026-11-17: a site can hold hundreds of blank stickers; the first 50 alone
618
619
  * could not find TLR120).
619
620
  */
621
+ // only the latest search may fill the list - a slower earlier answer is dropped
622
+ let qrPickAsked = 0;
620
623
  async function loadQrPicks(search = "") {
624
+ const asked = ++qrPickAsked;
621
625
  const res = await getBlankStickersBySerial(prop.site, { search, limit: 50 });
622
- qrPicks.value = res.items;
626
+ if (asked === qrPickAsked) qrPicks.value = res.items;
623
627
  return res;
624
628
  }
629
+ // clicking the field selects the picked sticker's text, so typing replaces it
630
+ function selectQrPickText(e: FocusEvent) {
631
+ const input = e.target as HTMLInputElement | null;
632
+ if (input?.select) setTimeout(() => input.select(), 0);
633
+ }
625
634
  let qrPickTimer: ReturnType<typeof setTimeout> | undefined;
626
635
  watch(qrPickSearch, (v) => {
627
636
  clearTimeout(qrPickTimer);
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.706",
5
+ "version": "4.97.1-staging.708",
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.",
@@ -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
  *