@7365admin1/layer-common 4.97.1-staging.724 → 4.97.1-staging.725

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.
@@ -262,6 +262,10 @@
262
262
  <div v-if="message" class="role-create__save-error" role="alert">
263
263
  Couldn't save: {{ message }}
264
264
  </div>
265
+ <!-- DV-1847: a role with no permission was saved as full access. -->
266
+ <div v-else-if="!hasPermission" class="role-create__save-error" role="status">
267
+ Select at least one permission.
268
+ </div>
265
269
 
266
270
  <div class="role-create__footer">
267
271
  <AppButton
@@ -278,7 +282,7 @@
278
282
  </AppButton>
279
283
 
280
284
  <AppButton variant="ghost" @click="cancel">{{ props.cancelText }}</AppButton>
281
- <AppButton :disabled="!validForm || disable" @click="submit">Submit</AppButton>
285
+ <AppButton :disabled="!validForm || !hasPermission || disable" @click="submit">Submit</AppButton>
282
286
  </div>
283
287
  </v-card>
284
288
  </template>
@@ -294,7 +298,7 @@ import useRole from "../composables/useRole";
294
298
  import useUtils from "../composables/useUtils";
295
299
  import useSite from "../composables/useSite";
296
300
  import { readApiError } from "../utils/subscription-form";
297
- import { withSecurityMarker } from "../utils/security-catalogue";
301
+ import { countRealPermissions, withSecurityMarker } from "../utils/security-catalogue";
298
302
  import { isTradeCatalogue, withTradeMarker } from "../utils/trade-catalogue";
299
303
  import { applyRolePreset, ROLE_PRESETS, type TRolePreset } from "../utils/inventory-presets";
300
304
 
@@ -393,6 +397,11 @@ const catalogueSize = computed(() =>
393
397
  )
394
398
  );
395
399
 
400
+ // DV-1847: the catalogue marker is not a permission.
401
+ const hasPermission = computed(
402
+ () => countRealPermissions(permState.value.selected) > 0
403
+ );
404
+
396
405
  const totalLabel = computed(() => {
397
406
  const selected = permState.value.selected.length;
398
407
  return catalogueSize.value > 0
@@ -541,6 +550,7 @@ watch(
541
550
  );
542
551
 
543
552
  async function submit() {
553
+ if (!hasPermission.value) return;
544
554
  disable.value = true;
545
555
  message.value = "";
546
556
  try {
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.724",
5
+ "version": "4.97.1-staging.725",
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.",