@7365admin1/layer-common 4.189.0 → 4.189.1

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,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.189.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f46655: Add Area / Add Unit popup stays open and shows "Required" when Create is clicked with an empty name, instead of closing without a message.
8
+
3
9
  ## 4.189.0
4
10
 
5
11
  ### Minor Changes
@@ -4142,11 +4148,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
4142
4148
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
4143
4149
  own rule from two endpoints the console already calls, unprojected:
4144
4150
 
4145
- GET /api/members/user/:user/app/admin the Seven365 staff membership
4146
- GET /api/roles/id/:role that membership's role document
4151
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
4152
+ GET /api/roles/id/:role that membership's role document
4147
4153
 
4148
- owner = member.type === "admin" && role.type === "admin" && role.default === true
4149
- staff = member.type === "admin" && role.type === "admin"
4154
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
4155
+ staff = member.type === "admin" && role.type === "admin"
4150
4156
 
4151
4157
  `role.default` is the marker because it is the only property of a platform
4152
4158
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -58,7 +58,7 @@
58
58
  />
59
59
  <v-text-field
60
60
  v-model="model"
61
- :rules="[requiredRule]"
61
+ :rules="[nameRequiredRule]"
62
62
  class="filter-field mb-0"
63
63
  />
64
64
  </v-col>
@@ -149,7 +149,6 @@
149
149
 
150
150
  <script setup lang="ts">
151
151
  import useUnits from '../composables/useUnits';
152
- import useUtils from '../composables/useUtils';
153
152
 
154
153
  const model = defineModel("name", { type: String, default: "" });
155
154
  const typeModel = defineModel("type", { type: String, default: "Common" });
@@ -185,7 +184,8 @@ const valid = ref(false);
185
184
  const submitting = ref(false);
186
185
  const show = ref(false);
187
186
 
188
- const { requiredRule } = useUtils();
187
+ // Spaces only is still an empty name.
188
+ const nameRequiredRule = (v: any) => !!String(v ?? "").trim() || "Required";
189
189
 
190
190
  const unitsRequiredRule = (v: any) => {
191
191
  if (Array.isArray(v)) return v.length > 0 || "Select at least one unit";
@@ -237,7 +237,11 @@ async function submit() {
237
237
  let ok = valid.value;
238
238
  if (form && typeof form.validate === "function") {
239
239
  try {
240
- ok = await form.validate();
240
+ // Vuetify 3 resolves to `{ valid, errors }`, an object that is always
241
+ // truthy: reading it as the result let an empty name through and closed
242
+ // the popup without saving or saying anything (DV-1872).
243
+ const result = await form.validate();
244
+ ok = typeof result === "object" && result !== null ? !!result.valid : !!result;
241
245
  } catch (e) {
242
246
  ok = false;
243
247
  }
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.189.0",
5
+ "version": "4.189.1",
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.",