@7365admin1/layer-common 4.154.0 → 4.155.0

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.155.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8bc84fd: Security Ops: two new actions in the `security-ops` resource of the security role catalogue. `manage-ops-sites` lets a role add sites that are not on iSecure365 to Security Ops, edit or deactivate them, and remove people from a site. `work-at-ops-sites` puts the holder on every Ops site of their company automatically, including sites added later. The role catalogue fixture is regenerated; core's `test/e2e/fixtures/lc-role-catalogues.json` needs the same two keys.
8
+
9
+ ## 4.154.1
10
+
11
+ ### Patch Changes
12
+
13
+ - b2d43ad: Vehicle QR stickers: the serial number (No. 1, 2, 3 ...) now prints on the sticker by default; a serial choice the person picked in this browser still wins.
14
+
3
15
  ## 4.154.0
4
16
 
5
17
  ### Minor Changes
@@ -3602,11 +3614,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3602
3614
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3603
3615
  own rule from two endpoints the console already calls, unprojected:
3604
3616
 
3605
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3606
- GET /api/roles/id/:role that membership's role document
3617
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3618
+ GET /api/roles/id/:role that membership's role document
3607
3619
 
3608
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3609
- staff = member.type === "admin" && role.type === "admin"
3620
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3621
+ staff = member.type === "admin" && role.type === "admin"
3610
3622
 
3611
3623
  `role.default` is the marker because it is the only property of a platform
3612
3624
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -268,6 +268,7 @@ import {
268
268
  TEXT_OPTIONS,
269
269
  frameOptionsFor,
270
270
  normalizeDesign,
271
+ rememberedDesign,
271
272
  sizeOptionsFor,
272
273
  stickerFaceSvg,
273
274
  type StickerDesign,
@@ -320,9 +321,11 @@ const siteName = ref("");
320
321
  // The last design chosen in this browser. Storage can be blocked (private
321
322
  // window): then it is simply the standard look each time.
322
323
  const DESIGN_KEY = "vehicleQrStickerDesign";
324
+ // The serial choice is kept on its own, only when the person picks it.
325
+ const SERIAL_KEY = "vehicleQrStickerSerial";
323
326
  function loadDesign(): StickerDesign {
324
327
  try {
325
- return normalizeDesign(JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"));
328
+ return rememberedDesign(JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"), localStorage.getItem(SERIAL_KEY));
326
329
  } catch {
327
330
  return { ...DEFAULT_STICKER_DESIGN };
328
331
  }
@@ -335,6 +338,16 @@ watch(design, (d) => {
335
338
  /* not saved - nothing else to do */
336
339
  }
337
340
  });
341
+ watch(
342
+ () => design.serial,
343
+ (s) => {
344
+ try {
345
+ localStorage.setItem(SERIAL_KEY, s);
346
+ } catch {
347
+ /* not saved - nothing else to do */
348
+ }
349
+ },
350
+ );
338
351
  function resetDesign() {
339
352
  Object.assign(design, DEFAULT_STICKER_DESIGN);
340
353
  }
@@ -830,6 +830,16 @@ export default function useSecurityPermission() {
830
830
  description:
831
831
  "Allows the user to view site visits across the sites they can reach, including other executives' visits.",
832
832
  },
833
+ "manage-ops-sites": {
834
+ check: true,
835
+ description:
836
+ "Allows the user to add sites that are not on iSecure365 to Security Ops, edit or deactivate them, and remove people from a site.",
837
+ },
838
+ "work-at-ops-sites": {
839
+ check: true,
840
+ description:
841
+ "Puts the user on every Ops site of the company automatically, including sites added later. They can be removed from a single site in Ops Settings.",
842
+ },
833
843
  },
834
844
  // NEW. Seeing the CCTV wall, as distinct from setting cameras up
835
845
  // (`site-settings:manage-cctv-camera`).
@@ -355,7 +355,19 @@ export const PERMISSIONS = {
355
355
  // administers this site, not that they run security at it - measured
356
356
  // 2026-10-13, every wildcard holder at a live site was an org owner, a test
357
357
  // account or a service provider's administrator.
358
- "security-ops": ["start-site-visit", "see-all-site-visits"],
358
+ //
359
+ // `manage-ops-sites` and `work-at-ops-sites` (2026-10-30): a security company
360
+ // adds its own sites, including ones not on iSecure365, in Security Ops, Ops
361
+ // Settings. The first lets a role add, edit and deactivate those sites and
362
+ // remove people from one; the second puts the holder on every Ops site of
363
+ // their company, computed by API-core's reach rule rather than copied
364
+ // memberships, so a later hire needs nothing per site.
365
+ "security-ops": [
366
+ "start-site-visit",
367
+ "see-all-site-visits",
368
+ "manage-ops-sites",
369
+ "work-at-ops-sites",
370
+ ],
359
371
  // Owner answer Q9, 2026-09-11: seeing the CCTV wall. Distinct from
360
372
  // `site-settings:manage-cctv-camera`, which is camera setup.
361
373
  "cctv-mgmt": ["see-all-cctv", "view-recordings"],
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.154.0",
5
+ "version": "4.155.0",
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.",
@@ -175,7 +175,7 @@ export const DEFAULT_STICKER_DESIGN: StickerDesign = {
175
175
  label: "app",
176
176
  text: "below",
177
177
  cutLines: true,
178
- serial: "off",
178
+ serial: "sticker",
179
179
  };
180
180
 
181
181
  /** A saved or typed-in design with anything unknown replaced by the default. */
@@ -198,10 +198,20 @@ export function normalizeDesign(raw: unknown): StickerDesign {
198
198
  label: pick(r.label, LABEL_OPTIONS, d.label),
199
199
  text: pick(r.text, TEXT_OPTIONS, d.text),
200
200
  cutLines: typeof r.cutLines === "boolean" ? r.cutLines : true,
201
- serial: pick(r.serial, SERIAL_OPTIONS, "off"),
201
+ serial: pick(r.serial, SERIAL_OPTIONS, d.serial),
202
202
  };
203
203
  }
204
204
 
205
+ /**
206
+ * The design remembered in this browser. The whole design is saved on every
207
+ * change, so a saved serial of "off" may only be the old default; the serial
208
+ * choice counts only when it was saved on its own (the person picked it).
209
+ */
210
+ export function rememberedDesign(saved: unknown, savedSerial: unknown): StickerDesign {
211
+ const r = saved && typeof saved === "object" ? (saved as Record<string, unknown>) : {};
212
+ return normalizeDesign({ ...r, serial: savedSerial });
213
+ }
214
+
205
215
  export function stickerTheme(id: string): StickerTheme {
206
216
  return STICKER_THEMES.find((t) => t.id === id) ?? STICKER_THEMES[0];
207
217
  }