@7365admin1/layer-common 4.7.1 → 4.7.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,20 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - ce15a17: Require a photo before a checklist task can be completed.
8
+
9
+ The Submit button in the completion dialog stays disabled until at least one
10
+ photo is attached, and the uploader is marked required. It gates on the uploaded
11
+ ids rather than previews, so a half-finished upload cannot slip through to a
12
+ server that then refuses it.
13
+
14
+ The reject dialog is deliberately not gated — a reject is somebody reporting a
15
+ problem, and demanding a photograph first would stop them reporting it. The
16
+ server scopes the rule the same way.
17
+
3
18
  ## 4.7.1
4
19
 
5
20
  ### Patch Changes
@@ -948,11 +963,11 @@
948
963
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
949
964
  own rule from two endpoints the console already calls, unprojected:
950
965
 
951
- GET /api/members/user/:user/app/admin the Seven365 staff membership
952
- GET /api/roles/id/:role that membership's role document
966
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
967
+ GET /api/roles/id/:role that membership's role document
953
968
 
954
- owner = member.type === "admin" && role.type === "admin" && role.default === true
955
- staff = member.type === "admin" && role.type === "admin"
969
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
970
+ staff = member.type === "admin" && role.type === "admin"
956
971
 
957
972
  `role.default` is the marker because it is the only property of a platform
958
973
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -272,11 +272,18 @@
272
272
  <v-divider class="mb-4" />
273
273
  <PhotoUpload
274
274
  title="Take/Upload Photos"
275
- :required="false"
275
+ :required="true"
276
276
  v-model="modalData.photos"
277
277
  v-model:photo-ids="modalData.photoIds"
278
278
  @error="handlePhotoError"
279
279
  />
280
+ <p
281
+ v-if="!modalData.photoIds.length"
282
+ class="text-caption text-medium-emphasis mt-1"
283
+ >
284
+ At least one photo is required to complete this task. You can take
285
+ or upload more than one.
286
+ </p>
280
287
  </v-col>
281
288
  </v-row>
282
289
  </v-card-text>
@@ -639,8 +646,33 @@ const modalData = reactive({
639
646
  lastApprovedKey: null as string | null,
640
647
  });
641
648
 
649
+ /*
650
+ * A PHOTO IS REQUIRED TO COMPLETE A TASK.
651
+ *
652
+ * Owner requirement, 2026-09-10: *"once task was completed they required to take
653
+ * photo before completing the task ... all the services that has this module
654
+ * must be the same process."*
655
+ *
656
+ * The server refuses a completion with no attachment
657
+ * (`module-hygiene hygiene-area-checklist.controller.ts`), which is what makes
658
+ * the rule true for every service and every client at once. This is the half
659
+ * that tells somebody BEFORE they lose their typing: the Submit button stays
660
+ * disabled and the uploader is marked required, rather than letting them fill
661
+ * the form in and answering with a 400.
662
+ *
663
+ * `photoIds`, not `photos`: the ids are what is actually submitted as
664
+ * `attachment`. A preview that never finished uploading is not evidence, and
665
+ * gating on it would let a failed upload through to a server that then refuses
666
+ * it.
667
+ *
668
+ * The REJECT dialog is deliberately NOT gated — a reject is somebody reporting a
669
+ * problem, and demanding a photograph first would stop them reporting it. The
670
+ * server takes the same view.
671
+ */
642
672
  const isModalValid = computed(() => {
643
- return modalData.remark?.trim().length > 0;
673
+ return (
674
+ modalData.remark?.trim().length > 0 && modalData.photoIds.length > 0
675
+ );
644
676
  });
645
677
 
646
678
  const showRejectModal = ref(false);
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.7.1",
5
+ "version": "4.7.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.",