@7365admin1/layer-common 4.163.0 → 4.163.2

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.163.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 836f08d: Vehicle Mgmt: a Records filter (Current / Deleted) on the toolbar, so deleted vehicles stay out of the list but can still be found and restored (IS-0864).
8
+
9
+ ## 4.163.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 26537ae: CCTV Engine alerts: wording matches what the server does (the switch sends phone notifications; empty roles = everyone who can see CCTV events).
14
+
3
15
  ## 4.163.0
4
16
 
5
17
  ### Minor Changes
@@ -3698,11 +3710,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3698
3710
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3699
3711
  own rule from two endpoints the console already calls, unprojected:
3700
3712
 
3701
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3702
- GET /api/roles/id/:role that membership's role document
3713
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3714
+ GET /api/roles/id/:role that membership's role document
3703
3715
 
3704
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3705
- staff = member.type === "admin" && role.type === "admin"
3716
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3717
+ staff = member.type === "admin" && role.type === "admin"
3706
3718
 
3707
3719
  `role.default` is the marker because it is the only property of a platform
3708
3720
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -8,7 +8,7 @@
8
8
  <CctvEngineHowTo
9
9
  id="alerts"
10
10
  :steps="[
11
- 'Under Tell people with these roles, choose who should get a phone notification.',
11
+ 'Turn on Send phone notifications. Leave the roles empty to tell everyone who can see CCTV events at this site, or choose roles to tell only them.',
12
12
  'Optional: type the objects that matter (e.g. person, car, rubbish) so not everything alerts. Empty means every object.',
13
13
  'Optional: limit to zones or cameras, and set quiet hours. Then press Save alert settings.',
14
14
  ]"
@@ -34,18 +34,18 @@
34
34
  :items="roles"
35
35
  item-title="name"
36
36
  item-value="_id"
37
- label="Tell people with these roles"
37
+ label="Only notify these roles (optional)"
38
38
  multiple
39
39
  chips
40
40
  closable-chips
41
41
  density="comfortable"
42
42
  class="mt-3"
43
43
  :loading="rolesLoading"
44
- :hint="rolesProblem || 'They get a notification with the picture. Nobody is told if this is empty.'"
44
+ :hint="rolesProblem || 'Empty = everyone who can see CCTV events at this site. Notifications are only sent when Send phone notifications is on.'"
45
45
  persistent-hint
46
46
  />
47
47
 
48
- <v-switch v-model="form.notifyGuards" color="primary" label="Also notify the guards on duty" hide-details class="mt-2" />
48
+ <v-switch v-model="form.notifyGuards" color="primary" label="Send phone notifications (with the picture)" hide-details class="mt-2" />
49
49
  <v-switch v-model="form.createIncident" color="primary" label="Create an incident report for each alert" hide-details />
50
50
 
51
51
  <v-switch v-model="quiet" color="primary" label="Quiet hours (no notifications between these times)" hide-details />
@@ -133,7 +133,7 @@ async function save() {
133
133
  notifyGuards: form.notifyGuards,
134
134
  quietHours: quiet.value ? { start: form.quietStart, end: form.quietEnd } : null,
135
135
  });
136
- msg.value = "Saved. From now on alerts appear in Events marked Alert, and the roles you chose get a phone notification with the picture.";
136
+ msg.value = form.notifyGuards ? "Saved. Alerts appear in Events marked Alert, and a phone notification with the picture is sent." : "Saved. Alerts appear in Events marked Alert. Phone notifications are off.";
137
137
  } catch (e) {
138
138
  saveError.value = e;
139
139
  } finally {
@@ -40,7 +40,8 @@
40
40
  </template>
41
41
 
42
42
  <!-- Residents / Season Passes / Block Listed, on the toolbar row the way
43
- the other screens draw their tabs. Each tab shows every status. -->
43
+ the other screens draw their tabs. Deleted plates show only under the
44
+ Deleted filter. -->
44
45
  <template #tabs>
45
46
  <button v-for="tab in vehicleTabs" :key="tab.value" type="button" role="tab" class="app-tab"
46
47
  :class="{ 'app-tab--active': activeTab === tab.value }" :aria-selected="activeTab === tab.value"
@@ -54,6 +55,9 @@
54
55
  <v-select v-if="qrEnabled" v-model="qrStickerFilter" :items="qrStickerFilterItems" label="QR sticker"
55
56
  density="compact" variant="outlined" hide-details class="vehicle-qr-filter" style="max-width: 190px"
56
57
  data-test="vehicle-qr-filter" />
58
+ <v-select v-model="statusFilter" :items="statusFilterItems" label="Records"
59
+ density="compact" variant="outlined" hide-details class="vehicle-status-filter" style="max-width: 160px"
60
+ data-test="vehicle-status-filter" />
57
61
  <AppField v-model="searchInput" search compact placeholder="Search" klass="app-toolbar__search" />
58
62
  </template>
59
63
 
@@ -615,6 +619,14 @@ const qrStickerFilterItems = [
615
619
  ];
616
620
  const qrStickersOn = computed(() => qrEnabled.value && props.canUpdateVehicle);
617
621
 
622
+ // Deleting is a soft delete and the list leaves deleted plates out unless asked
623
+ // for (IS-0864). "Deleted" is how one is found again - and Restored.
624
+ const statusFilter = ref("");
625
+ const statusFilterItems = [
626
+ { title: "Current", value: "" },
627
+ { title: "Deleted", value: "deleted" },
628
+ ];
629
+
618
630
  /**
619
631
  * Re-issue / Undo / Link / Remove on one plate change that vehicle, so on a
620
632
  * Block Listed plate they follow Manage Blocklist (owner, 2026-10-23) when the
@@ -983,6 +995,7 @@ const { data: getVehiclesReq, refresh: getVehiclesRefresh, pending: getVehiclesP
983
995
  search: searchInput.value,
984
996
  view: activeTab.value,
985
997
  site: props.site,
998
+ status: statusFilter.value,
986
999
  qrSticker: qrEnabled.value ? qrStickerFilter.value : "",
987
1000
  }),
988
1001
  {
@@ -1495,6 +1508,11 @@ watch(qrStickerFilter, () => {
1495
1508
  getVehiclesRefresh();
1496
1509
  })
1497
1510
 
1511
+ watch(statusFilter, () => {
1512
+ page.value = 1;
1513
+ getVehiclesRefresh();
1514
+ })
1515
+
1498
1516
  // A new tab starts from its first page and loads straight away.
1499
1517
  watch(activeTab, () => {
1500
1518
  page.value = 1;
@@ -12,7 +12,8 @@ export default function useVehicle() {
12
12
  qrSticker = "",
13
13
  } = {}) {
14
14
  // `view` is the screen's tab: residents, season-passes or block-listed.
15
- // Every status comes back unless `status` narrows it.
15
+ // Deleted vehicles come back only with `status: "deleted"`; with no
16
+ // `status` every other status does.
16
17
  return await useNuxtApp().$api<Record<string, any>>("/api/vehicles", {
17
18
  method: "GET",
18
19
  query: { search, page, limit, order, type, category, site, status, view, qrSticker },
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.163.0",
5
+ "version": "4.163.2",
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.",
@@ -523,10 +523,11 @@ export function setupSteps(input: {
523
523
 
524
524
  if (input.can(CCTV_PERMISSIONS.manageAlerts)) {
525
525
  const a = input.alertSettings;
526
+ // Server rule (core onAlert / NotificationService.cctvAlert): the `notifyGuards` switch turns phone notifications on;
527
+ // they go to everyone at the site holding cctv-engine:view-events, or only to `notifyRoles` when some are chosen.
526
528
  const roles = a?.notifyRoles?.length ?? 0;
527
- const guards = a?.notifyGuards === true;
528
- const told = roles > 0 || guards;
529
- const who = [roles ? plural(roles, "role", "roles") : "", guards ? "guards on duty" : ""].filter(Boolean).join(" and ");
529
+ const told = a?.notifyGuards === true;
530
+ const who = roles ? `People in ${plural(roles, "role", "roles")}` : "Everyone who can see CCTV events";
530
531
  const every = told && !(a?.labels ?? []).length;
531
532
  steps.push({
532
533
  key: "alerts",
@@ -535,8 +536,8 @@ export function setupSteps(input: {
535
536
  state: a === null || !told ? "attention" : "done",
536
537
  now:
537
538
  a === null ? unread
538
- : !told ? "Nobody is notified yet. Everything is still saved in Events."
539
- : `${who} will be notified${every ? " for every object seen (add objects to narrow it)" : ""}.`,
539
+ : !told ? "Phone notifications are off. Everything is still saved in Events."
540
+ : `${who} will get a phone notification${every ? " for every object seen (add objects to narrow it)" : ""}.`,
540
541
  section: "alerts",
541
542
  action: "Set up alerts",
542
543
  });
@@ -601,7 +602,7 @@ export function setupSteps(input: {
601
602
  /** Where each kind of result appears. `query` pre-fills the Events filters. */
602
603
  export const RESULT_PLACES: { title: string; body: string; section: TCctvSection; query?: Record<string, string>; needs: TCctvPermission }[] = [
603
604
  { title: "Everything seen", body: "People, vehicles, plates, faces and smart detections, newest first, each with a photo.", section: "events", needs: CCTV_PERMISSIONS.viewEvents },
604
- { title: "Alerts only", body: "The events that raised an alert. The people you chose in Alerts also got a phone notification.", section: "events", query: { severity: "alert" }, needs: CCTV_PERMISSIONS.viewEvents },
605
+ { title: "Alerts only", body: "The events that raised an alert. With phone notifications on, people were also told on their phones.", section: "events", query: { severity: "alert" }, needs: CCTV_PERMISSIONS.viewEvents },
605
606
  { title: "Smart detection results", body: "What your smart detections saw (e.g. rubbish), with the photo and time.", section: "events", query: { kind: "classification" }, needs: CCTV_PERMISSIONS.viewEvents },
606
607
  { title: "Find a past moment", body: "Describe it in words, e.g. person in orange shirt, and pick the dates.", section: "search", needs: CCTV_PERMISSIONS.viewEvents },
607
608
  { title: "Watch now", body: "The cameras, live.", section: "live", needs: CCTV_PERMISSIONS.viewLive },