@7365admin1/layer-common 4.97.1-staging.622 → 4.97.1-staging.624
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.
|
@@ -376,10 +376,16 @@
|
|
|
376
376
|
Replace Card
|
|
377
377
|
</v-list-item-title>
|
|
378
378
|
</v-list-item>
|
|
379
|
-
|
|
379
|
+
<!-- Any card type: the details dialog fetches by card id alone.
|
|
380
|
+
It was gated to physical cards, and with nothing selected on
|
|
381
|
+
open it read as broken, so the hint says what is missing. -->
|
|
382
|
+
<v-list-item :disabled="!selectedCardInUnit" @click="historyDialog = true">
|
|
380
383
|
<v-list-item-title class="text-subtitle-2 cursor-pointer">
|
|
381
384
|
Card Details
|
|
382
385
|
</v-list-item-title>
|
|
386
|
+
<v-list-item-subtitle v-if="!selectedCardInUnit" class="text-caption">
|
|
387
|
+
Select a card first
|
|
388
|
+
</v-list-item-subtitle>
|
|
383
389
|
</v-list-item>
|
|
384
390
|
<v-list-item
|
|
385
391
|
@click="emit('delete')"
|
|
@@ -437,10 +443,6 @@ const props = defineProps({
|
|
|
437
443
|
type: Boolean,
|
|
438
444
|
default: false,
|
|
439
445
|
},
|
|
440
|
-
isSelectedCardPhysical: {
|
|
441
|
-
type: Boolean,
|
|
442
|
-
default: false,
|
|
443
|
-
},
|
|
444
446
|
siteId: {
|
|
445
447
|
type: String,
|
|
446
448
|
default: "",
|
|
@@ -849,6 +851,25 @@ function toggleCard(card: Record<string, any>) {
|
|
|
849
851
|
props.selectedCardInUnit?._id === card._id ? null : card
|
|
850
852
|
);
|
|
851
853
|
}
|
|
854
|
+
|
|
855
|
+
// A unit with a single card opens with it selected, so More actions works
|
|
856
|
+
// without a click on a chip that is the only choice anyway.
|
|
857
|
+
const unitCards = computed(() =>
|
|
858
|
+
["available", "assigned", "replaced", "deleted"].flatMap((state) => [
|
|
859
|
+
...(props.unit?.[state]?.physical ?? []),
|
|
860
|
+
...(props.unit?.[state]?.non_physical ?? []),
|
|
861
|
+
])
|
|
862
|
+
);
|
|
863
|
+
|
|
864
|
+
watch(
|
|
865
|
+
() => [props.modelValue, props.unit?._id],
|
|
866
|
+
() => {
|
|
867
|
+
if (!props.modelValue || props.selectedCardInUnit) return;
|
|
868
|
+
if (unitCards.value.length === 1) {
|
|
869
|
+
emit("update:selectedCardInUnit", unitCards.value[0]);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
);
|
|
852
873
|
</script>
|
|
853
874
|
|
|
854
875
|
<style scoped>
|
|
@@ -106,7 +106,6 @@
|
|
|
106
106
|
:can-delete-access-card="canDeleteAccessCard"
|
|
107
107
|
:can-assign-to-person="canUpdateAccessCard && canAssignAccessCard"
|
|
108
108
|
:is-selected-card-assigned-physical="isSelectedCardAssignedPhysical"
|
|
109
|
-
:is-selected-card-physical="isSelectedCardPhysical"
|
|
110
109
|
:site-id="siteId"
|
|
111
110
|
:org-id="orgId"
|
|
112
111
|
@replace="openReplaceDialog()"
|
|
@@ -252,14 +251,6 @@ const isSelectedCardAssignedPhysical = computed(() =>
|
|
|
252
251
|
) ?? false
|
|
253
252
|
);
|
|
254
253
|
|
|
255
|
-
const isSelectedCardPhysical = computed(() =>
|
|
256
|
-
["available", "assigned", "replaced", "deleted"].some((state) =>
|
|
257
|
-
selectedCard.value?.[state]?.physical?.some(
|
|
258
|
-
(c: any) => c._id === selectedCardInUnit.value?._id
|
|
259
|
-
)
|
|
260
|
-
)
|
|
261
|
-
);
|
|
262
|
-
|
|
263
254
|
const { getUserTypeAccessCards, deleteCard: _deleteCard } = useAccessManagement();
|
|
264
255
|
|
|
265
256
|
const statsRef = ref<{ refresh: () => void } | null>(null);
|
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.
|
|
5
|
+
"version": "4.97.1-staging.624",
|
|
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.",
|
|
@@ -39,6 +39,19 @@ export const LOOKUP_TIMEOUT_MS = 5000;
|
|
|
39
39
|
*/
|
|
40
40
|
export const SEND_SITE = false;
|
|
41
41
|
|
|
42
|
+
/*
|
|
43
|
+
* Per app opt in, ahead of the switch above: an app that sets
|
|
44
|
+
* `runtimeConfig.public.roleFollowsSite` to true (or the env var
|
|
45
|
+
* `NUXT_PUBLIC_ROLE_FOLLOWS_SITE=true`) sends the site now, so its role follows
|
|
46
|
+
* the site while every other app keeps today's answer. Declare the key in the
|
|
47
|
+
* APP's own nuxt.config, never in this layer's, or an env var in any app's
|
|
48
|
+
* deploy could turn it on there. Absent or misspelled means off.
|
|
49
|
+
*/
|
|
50
|
+
export function roleFollowsSite(): boolean {
|
|
51
|
+
const value = useRuntimeConfig().public.roleFollowsSite;
|
|
52
|
+
return SEND_SITE || value === true || value === "true";
|
|
53
|
+
}
|
|
54
|
+
|
|
42
55
|
function bounded<T>(request: Promise<T>): Promise<T> {
|
|
43
56
|
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
44
57
|
const timeout = new Promise<never>((_, reject) => {
|
|
@@ -111,7 +124,7 @@ export default defineNuxtPlugin(() => {
|
|
|
111
124
|
// it when the answer can actually DIFFER: the first resolution, or a site
|
|
112
125
|
// change while Q16 is on. While Q16 is held a site change re-asks the same
|
|
113
126
|
// question, so the resolved role stays on screen and nothing flickers.
|
|
114
|
-
if (resolvedFor === null ||
|
|
127
|
+
if (resolvedFor === null || roleFollowsSite()) userAppRoleStatus.value = "loading";
|
|
115
128
|
inFlightKey = key;
|
|
116
129
|
inFlight = run(userId, site, staffOrg).finally(() => {
|
|
117
130
|
inFlight = null;
|
|
@@ -139,7 +152,7 @@ export default defineNuxtPlugin(() => {
|
|
|
139
152
|
// adds is Q16 itself. Sending `org` as well would change the fallback
|
|
140
153
|
// too, and that is a separate change.
|
|
141
154
|
const member = await bounded(
|
|
142
|
-
getByUserType(userId, APP, undefined,
|
|
155
|
+
getByUserType(userId, APP, undefined, roleFollowsSite() && site ? site : undefined),
|
|
143
156
|
);
|
|
144
157
|
hasMemberDocument = true;
|
|
145
158
|
id.value = member.org ?? "";
|