@7365admin1/layer-common 4.97.1-staging.529 → 4.97.1-staging.530

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
@@ -2082,11 +2082,11 @@
2082
2082
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
2083
2083
  own rule from two endpoints the console already calls, unprojected:
2084
2084
 
2085
- GET /api/members/user/:user/app/admin the Seven365 staff membership
2086
- GET /api/roles/id/:role that membership's role document
2085
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
2086
+ GET /api/roles/id/:role that membership's role document
2087
2087
 
2088
- owner = member.type === "admin" && role.type === "admin" && role.default === true
2089
- staff = member.type === "admin" && role.type === "admin"
2088
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
2089
+ staff = member.type === "admin" && role.type === "admin"
2090
2090
 
2091
2091
  `role.default` is the marker because it is the only property of a platform
2092
2092
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -12,13 +12,14 @@
12
12
  :pages="pages"
13
13
  :pageRange="pageRange"
14
14
  :no-data-text="`No ${checklistTitle} found`"
15
- @refresh="getCleanerChecklistRefresh"
15
+ @refresh="onRefresh"
16
16
  @row-click="onRowClick"
17
17
  >
18
18
  <template #extension>
19
19
  <v-row no-gutters class="w-100 d-flex flex-column">
20
20
  <div class="filter-bar">
21
21
  <InputDateTimePicker
22
+ :key="`start-${filterKey}`"
22
23
  v-model:utc="startDate"
23
24
  density="compact"
24
25
  hide-details
@@ -26,6 +27,7 @@
26
27
  placeholder="Start Date"
27
28
  />
28
29
  <InputDateTimePicker
30
+ :key="`end-${filterKey}`"
29
31
  v-model:utc="endDate"
30
32
  density="compact"
31
33
  hide-details
@@ -200,10 +202,55 @@ const {
200
202
  serviceType: props.serviceType,
201
203
  }),
202
204
  {
203
- watch: [() => page.value, () => props.site, startDate, endDate, status],
205
+ watch: [() => page.value, () => props.site],
204
206
  }
205
207
  );
206
208
 
209
+ /**
210
+ * A filter change keeps no page. The filters used to sit in the fetch's own
211
+ * watch list beside `page`, so picking a Start Date while on page 3 asked for
212
+ * page 3 of the NARROWED list - usually past its end, so the table came back
213
+ * empty ("No ... found") with a pager that no longer matched. Back to page 1;
214
+ * when already on page 1 the `page` watch cannot fire, so fetch directly.
215
+ */
216
+ watch([startDate, endDate, status], () => {
217
+ if (page.value !== 1) {
218
+ page.value = 1;
219
+ return;
220
+ }
221
+ getCleanerChecklistRefresh();
222
+ });
223
+
224
+ /**
225
+ * The refresh button starts the list over: no Start Date, no End Date, Status
226
+ * "All", page 1. Only the button - the socket events still reload with the
227
+ * filters the person set.
228
+ *
229
+ * The pickers are bound by `v-model:utc` alone, and `InputDateTimePicker`
230
+ * keeps its own copy of the local value, which it shows whenever the UTC one
231
+ * is empty - so clearing `startDate` here left the old date in the field.
232
+ * Bumping `filterKey` remounts both pickers empty.
233
+ *
234
+ * When a filter actually changes, the filter watch above resets the page and
235
+ * fetches; when none was set, nothing fires it, so do the same here.
236
+ */
237
+ const filterKey = ref(0);
238
+
239
+ function onRefresh() {
240
+ const filtered =
241
+ startDate.value !== "" || endDate.value !== "" || status.value !== "all";
242
+ startDate.value = "";
243
+ endDate.value = "";
244
+ status.value = "all";
245
+ filterKey.value++;
246
+ if (filtered) return;
247
+ if (page.value !== 1) {
248
+ page.value = 1;
249
+ return;
250
+ }
251
+ getCleanerChecklistRefresh();
252
+ }
253
+
207
254
  function calculateRemainingTime(
208
255
  closeIn: Date | string | number | null | undefined
209
256
  ) {
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.529",
5
+ "version": "4.97.1-staging.530",
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.",