@7365admin1/layer-common 4.21.4-staging.340 → 4.21.4-staging.342

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.
@@ -52,9 +52,9 @@
52
52
  <div v-for="cam in uniqueCameras" :key="cam.host || cam.camera || cam.name" class="anpr-badge__row">
53
53
  <span class="anpr-badge__type">{{ directionLabel(cam.direction) }}</span>
54
54
  <StatusChip
55
- :tone="cam.list === 'blocked' ? 'err' : 'ok'"
55
+ :tone="listTone(cam.list)"
56
56
  :dot="false"
57
- :label="cam.list === 'blocked' ? 'Blocked' : 'Allowed'"
57
+ :label="listLabel(cam.list)"
58
58
  />
59
59
  </div>
60
60
  </v-card>
@@ -75,6 +75,8 @@ const props = defineProps({
75
75
  plateId: { type: String, default: "" },
76
76
  status: { type: String, default: "" },
77
77
  type: { type: String, default: "" },
78
+ /** The pass's expiry: once passed, "Allowed" reads "Expired" in red. */
79
+ end: { type: [String, Date] as PropType<string | Date | null>, default: null },
78
80
  /** Active cameras per list at the site; null hides Sync. */
79
81
  activeCounts: {
80
82
  type: Object as PropType<{ allowed: number; blocked: number } | null>,
@@ -99,9 +101,26 @@ const expected = computed(() => {
99
101
  : props.activeCounts.allowed;
100
102
  });
101
103
 
104
+ /** An allowed pass whose expiry has passed - the camera no longer opens for it. */
105
+ const expired = computed(() => {
106
+ if (!props.end) return false;
107
+ const end = new Date(props.end as any).getTime();
108
+ return !Number.isNaN(end) && end <= Date.now();
109
+ });
110
+
111
+ function listLabel(list: string) {
112
+ if (list === "blocked") return "Blocked";
113
+ return expired.value ? "Expired" : "Allowed";
114
+ }
115
+
116
+ function listTone(list: string) {
117
+ return list === "blocked" || expired.value ? "err" : "ok";
118
+ }
119
+
102
120
  const showSync = computed(
103
121
  () =>
104
122
  !!props.plateId &&
123
+ !expired.value &&
105
124
  LIVE.includes(props.status) &&
106
125
  expected.value > 0 &&
107
126
  count.value < expected.value
@@ -162,11 +162,8 @@
162
162
  />
163
163
  <v-list-item class="screen-menu__item" title="Call Settings" prepend-icon="mdi-cog" @click="openCallDialog(item)" />
164
164
  <v-list-item class="screen-menu__item" title="Dial Code" prepend-icon="mdi-dialpad" @click="openDialCodeDialog(item)" />
165
- <v-list-item class="screen-menu__item" title="Make a call" prepend-icon="mdi-phone" @click="openMakeCallDialog(item)" />
166
- <v-list-item class="screen-menu__item" title="Web call" prepend-icon="mdi-headset" @click="openWebPhoneDialog(item)" />
167
165
  </v-list>
168
166
  <v-list v-else density="compact" class="screen-menu">
169
- <v-list-item class="screen-menu__item" title="Call" prepend-icon="mdi-phone" @click="openContactCall(item)" />
170
167
  <v-list-item class="screen-menu__item" title="Check reader SIP status" prepend-icon="mdi-lan-check" @click="testContactSipStatus(item)" />
171
168
  <v-list-item class="screen-menu__item" title="View" prepend-icon="mdi-eye" @click="openContactView(item)" />
172
169
  <v-list-item class="screen-menu__item" title="Edit" prepend-icon="mdi-pencil" @click="openContactDialog(item)" />
@@ -12,6 +12,7 @@
12
12
  :plate-id="plate._id ?? ''"
13
13
  :status="plate.status ?? ''"
14
14
  :type="plate.type ?? ''"
15
+ :end="plate.end ?? null"
15
16
  :active-counts="activeCounts"
16
17
  @synced="(result) => emit('synced', result)"
17
18
  />
@@ -185,7 +185,8 @@
185
185
  {{ value }}
186
186
  <AnprCameraBadge :cameras="(plateNumberItem as any).anprCameras ?? []" :plate-number="value"
187
187
  :plate-id="(plateNumberItem as any)._id ?? ''" :status="(plateNumberItem as any).status ?? ''"
188
- :type="(plateNumberItem as any).type ?? ''" :active-counts="activeCameraCounts"
188
+ :type="(plateNumberItem as any).type ?? ''" :end="(plateNumberItem as any).end ?? null"
189
+ :active-counts="activeCameraCounts"
189
190
  @synced="handleSynced" />
190
191
  </span>
191
192
  </template>
@@ -1587,6 +1587,11 @@ const props = defineProps({
1587
1587
  type: Boolean,
1588
1588
  default: false,
1589
1589
  },
1590
+ /** Resident Transactions > See All Resident Transactions - shows that tab. */
1591
+ canViewResidentTransactions: {
1592
+ type: Boolean,
1593
+ default: false,
1594
+ },
1590
1595
  });
1591
1596
 
1592
1597
  const { authenticate, currentUser } = useLocalAuth();
@@ -1947,7 +1952,10 @@ const tabOptions = computed(() => {
1947
1952
  ? [{ name: "Unregistered", value: "unregistered" }]
1948
1953
  : []),
1949
1954
  { name: "Guests", value: "guests" },
1950
- { name: "Resident Transactions", value: "resident-transactions" },
1955
+ // Its own right in the role editor; the server refuses the list without it.
1956
+ ...(props.canViewResidentTransactions
1957
+ ? [{ name: "Resident Transactions", value: "resident-transactions" }]
1958
+ : []),
1951
1959
  { name: "Overnight Parking", value: "overnight-parking" },
1952
1960
  ];
1953
1961
 
@@ -3058,11 +3066,11 @@ watch([searchInput, dateFrom, dateTo, filterTypes, activeTab], () => {
3058
3066
 
3059
3067
  const syncVisitorFiltersFromRoute = () => {
3060
3068
  const requestedTab = (route.query.tab as string) || "registered";
3061
- const nextTab = enableUnregisteredTab.value
3062
- ? requestedTab
3063
- : requestedTab === "unregistered"
3064
- ? "registered"
3065
- : requestedTab;
3069
+ const nextTab =
3070
+ (!enableUnregisteredTab.value && requestedTab === "unregistered") ||
3071
+ (!props.canViewResidentTransactions && requestedTab === "resident-transactions")
3072
+ ? "registered"
3073
+ : requestedTab;
3066
3074
 
3067
3075
  if (activeTab.value !== nextTab) {
3068
3076
  activeTab.value = nextTab;
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.21.4-staging.340",
5
+ "version": "4.21.4-staging.342",
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.",