@anzusystems/common-admin 2.0.0-rc.14 → 2.0.0-rc.16
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/dist/common-admin.js +38 -35
- package/dist/domains/anzuUser/api/anzuUserApi.d.ts +1 -1
- package/dist/domains/anzuUser/api/anzuUserApi.js +2 -2
- package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMissingAccount.js +6 -0
- package/dist/domains/anzuUser/components/AUserMissingAccount.js.map +1 -0
- package/dist/domains/anzuUser/components/AUserMissingAccount.vue.d.ts +20 -0
- package/dist/domains/anzuUser/components/AUserMissingAccount.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/domains/anzuUser/components/AUserMissingAccount.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +56 -11
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js +38 -27
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js +64 -63
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +15 -33
- package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js +54 -155
- package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +2 -0
- package/dist/domains/anzuUser/composables/anzuUserActions.js +74 -71
- package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
- package/dist/domains/anzuUser/composables/userCreateFromSource.d.ts +70 -0
- package/dist/domains/anzuUser/composables/userCreateFromSource.js +62 -0
- package/dist/domains/anzuUser/composables/userCreateFromSource.js.map +1 -0
- package/dist/domains/anzuUser/utils/userTabs.d.ts +7 -1
- package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
- package/dist/lib.d.ts +5 -2
- package/package.json +2 -2
package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -9,18 +9,18 @@ import { computed as u, createBlock as d, createCommentVNode as f, createElement
|
|
|
9
9
|
import { useI18n as E } from "vue-i18n";
|
|
10
10
|
import { VChip as D } from "vuetify/components/VChip";
|
|
11
11
|
import { VSpacer as O } from "vuetify/components/VGrid";
|
|
12
|
-
import { VBtn as
|
|
12
|
+
import { VBtn as ee } from "vuetify/components/VBtn";
|
|
13
13
|
// src/domains/anzuUser/components/AUserSystemPanel.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
15
|
-
key: 1,
|
|
16
|
-
class: "text-body-small text-medium-emphasis"
|
|
17
|
-
}, N = {
|
|
14
|
+
var te = ["data-cy"], k = { class: "d-flex align-center flex-wrap ga-2" }, A = { class: "font-weight-medium" }, j = {
|
|
18
15
|
key: 2,
|
|
19
|
-
class: "text-body-small text-medium-emphasis w-100"
|
|
20
|
-
}, P = {
|
|
21
|
-
key: 5,
|
|
22
16
|
class: "text-body-small text-medium-emphasis",
|
|
23
17
|
"data-cy": "user-system-no-write"
|
|
18
|
+
}, M = { class: "d-flex align-center flex-wrap ga-2 mt-1" }, N = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "text-body-small text-medium-emphasis"
|
|
21
|
+
}, P = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "text-body-small text-medium-emphasis mt-1"
|
|
24
24
|
}, F = /*@__PURE__*/ _({
|
|
25
25
|
__name: "AUserSystemPanel",
|
|
26
26
|
props: {
|
|
@@ -49,61 +49,62 @@ var A = ["data-cy"], j = { class: "font-weight-medium" }, M = {
|
|
|
49
49
|
ok: "success",
|
|
50
50
|
warn: "warning",
|
|
51
51
|
error: "error"
|
|
52
|
-
}, Q = u(() => V.value.access === o.Unavailable || V.value.access === o.Unauthenticated), $ = () => U(L.userId);
|
|
53
|
-
return b($), w(() => L.userId, $), y(W), F({ refresh: $ }), (r, i) => (x(), p("div", {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
52
|
+
}, Q = u(() => H.value === null ? "" : [H.value.person.fullName, H.value.email].filter(Boolean).join(" · ")), ne = u(() => V.value.access === o.Unavailable || V.value.access === o.Unauthenticated), $ = () => U(L.userId);
|
|
53
|
+
return b($), w(() => L.userId, $), y(W), F({ refresh: $ }), (r, i) => (x(), p("div", { "data-cy": `user-system-panel-${_.descriptor.system}` }, [
|
|
54
|
+
m("div", k, [
|
|
55
|
+
m("div", A, S(G.value), 1),
|
|
56
|
+
g(O),
|
|
57
|
+
K.value && Y.value ? (x(), d(t, {
|
|
58
|
+
key: 0,
|
|
59
|
+
target: Y.value,
|
|
60
|
+
"system-label": G.value
|
|
61
|
+
}, null, 8, ["target", "system-label"])) : f("", !0),
|
|
62
|
+
q.value ? (x(), d(e, {
|
|
63
|
+
key: 1,
|
|
64
|
+
"system-label": G.value,
|
|
65
|
+
"create-note": _.descriptor.createNote,
|
|
66
|
+
"will-be-enabled": _.createEnabled,
|
|
67
|
+
loading: _.creating,
|
|
68
|
+
"required-metadata": _.descriptor.requiredMetadata,
|
|
69
|
+
"user-id": _.userId,
|
|
70
|
+
source: _.source,
|
|
71
|
+
onConfirm: i[0] ||= (e) => R("create", _.descriptor, e)
|
|
72
|
+
}, null, 8, [
|
|
73
|
+
"system-label",
|
|
74
|
+
"create-note",
|
|
75
|
+
"will-be-enabled",
|
|
76
|
+
"loading",
|
|
77
|
+
"required-metadata",
|
|
78
|
+
"user-id",
|
|
79
|
+
"source"
|
|
80
|
+
])) : f("", !0),
|
|
81
|
+
J.value ? (x(), p("span", j, S(C(z)("common.userSystem.state.noWriteRight")), 1)) : f("", !0),
|
|
82
|
+
ne.value ? (x(), d(ee, {
|
|
83
|
+
key: 3,
|
|
84
|
+
size: "small",
|
|
85
|
+
variant: "text",
|
|
86
|
+
"data-cy": "user-system-retry",
|
|
87
|
+
onClick: $
|
|
88
|
+
}, {
|
|
89
|
+
default: T(() => [h(S(C(z)("common.userSystem.button.retry")), 1)]),
|
|
90
|
+
_: 1
|
|
91
|
+
})) : f("", !0)
|
|
92
|
+
]),
|
|
93
|
+
m("div", M, [
|
|
94
|
+
g(n, { axes: C(V) }, null, 8, ["axes"]),
|
|
95
|
+
X.value ? (x(), d(D, {
|
|
96
|
+
key: 0,
|
|
97
|
+
color: Z[X.value.tone],
|
|
98
|
+
label: "",
|
|
99
|
+
size: "small"
|
|
100
|
+
}, {
|
|
101
|
+
default: T(() => [h(S(X.value.label) + ": " + S(X.value.value), 1)]),
|
|
102
|
+
_: 1
|
|
103
|
+
}, 8, ["color"])) : f("", !0),
|
|
104
|
+
Q.value ? (x(), p("div", N, S(Q.value), 1)) : f("", !0)
|
|
105
|
+
]),
|
|
106
|
+
_.descriptor.enabledNote ? (x(), p("div", P, S(_.descriptor.enabledNote), 1)) : f("", !0)
|
|
107
|
+
], 8, te));
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
export { F as default };
|
package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AUserSystemPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","
|
|
1
|
+
{"version":3,"file":"AUserSystemPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","_component_VSpacer","_createBlock","AUserManageButton","AUserCreateInSystemButton","_unref","_component_VBtn","_withCtx","_createTextVNode","AUserSystemStatusChip","_component_VChip","AUserCreateInSystemButton_default","AUserManageButton_default","AUserSystemStatusChip_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","AUserSystemPanel_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","useI18n","refreshHook","inject","UserSystemRefreshHookKey","useUserSystemProbe","label","computed","showManage","axes","UserSystemLoad","user","isUndefined","descriptorMayWrite","showCreate","isAuthoritativelyAbsent","showNoWriteRight","manageTarget","extraState","EXTRA_STATE_COLOR","userLine","canRetry","UserSystemAccess","run","probe","onMounted","watch","onBeforeUnmount","cancel","openBlock","createElementBlock","createElementVNode","toDisplayString","createVNode","VSpacer","createBlock","createCommentVNode","_cache","unref","t","VBtn","withCtx","createTextVNode","VChip"],"sources":["../../../../src/domains/anzuUser/components/AUserSystemPanel.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport AUserCreateInSystemButton from '@/domains/anzuUser/components/AUserCreateInSystemButton.vue'\nimport AUserManageButton from '@/domains/anzuUser/components/AUserManageButton.vue'\nimport AUserSystemStatusChip from '@/domains/anzuUser/components/AUserSystemStatusChip.vue'\nimport { type AnyUserSystemDescriptor, descriptorMayWrite } from '@/domains/anzuUser/composables/userSystemDescriptor'\nimport { useUserSystemProbe, UserSystemRefreshHookKey } from '@/domains/anzuUser/composables/userSystemProbe'\nimport { isAuthoritativelyAbsent, UserSystemAccess, UserSystemLoad } from '@/domains/anzuUser/utils/userSystemState'\nimport type { BaseUser } from '@/shared/types/AnzuUser'\nimport type { IntegerId } from '@/shared/types/common'\nimport { isUndefined } from '@/shared/utils/common'\n\nconst props = withDefaults(\n defineProps<{\n descriptor: AnyUserSystemDescriptor\n userId: IntegerId\n /**\n * On a viewing page there is no Create, because no read-only screen offers a write action.\n * Manage stays because it only navigates.\n */\n readonly?: boolean\n /** Whether the account about to be created would be switched on. */\n createEnabled?: boolean\n /** What the owning system holds, to prefill the create form. */\n source?: BaseUser | null\n creating?: boolean\n }>(),\n {\n readonly: false,\n createEnabled: false,\n source: null,\n creating: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'create', descriptor: AnyUserSystemDescriptor, user: BaseUser): void\n}>()\n\nconst { t } = useI18n()\n\n// Provided once per page rather than passed down through every row.\nconst refreshHook = inject(UserSystemRefreshHookKey, undefined)\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { axes, user, probe, cancel } = useUserSystemProbe({ descriptor: props.descriptor, refreshHook })\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst label = computed(() => props.descriptor.label ?? props.descriptor.system)\n\n/**\n * The buttons depend on the probe's answer, not on `<Acl>`, except that the descriptor can deny writing (`canWrite`).\n * On a cross-system surface no current user is loaded for other backends, so `can()` would throw and\n * `<Acl>` would render nothing. The probe is the only signal, so its 401 handling must be right.\n */\nconst showManage = computed(\n () =>\n axes.value.load === UserSystemLoad.Loaded &&\n user.value !== null &&\n !isUndefined(props.descriptor.manage) &&\n descriptorMayWrite(props.descriptor, 'update')\n)\nconst showCreate = computed(\n () => !props.readonly && isAuthoritativelyAbsent(axes.value) && descriptorMayWrite(props.descriptor, 'create')\n)\n\nconst showNoWriteRight = computed(\n () =>\n (axes.value.load === UserSystemLoad.Loaded &&\n user.value !== null &&\n !isUndefined(props.descriptor.manage) &&\n !descriptorMayWrite(props.descriptor, 'update')) ||\n (!props.readonly && isAuthoritativelyAbsent(axes.value) && !descriptorMayWrite(props.descriptor, 'create'))\n)\n\nconst manageTarget = computed(() => {\n if (user.value === null || isUndefined(props.descriptor.manage)) return null\n return props.descriptor.manage(user.value)\n})\n\nconst extraState = computed(() => {\n if (user.value === null || isUndefined(props.descriptor.extraState)) return null\n return props.descriptor.extraState(user.value)\n})\n\nconst EXTRA_STATE_COLOR = { ok: 'success', warn: 'warning', error: 'error' } as const\n\nconst userLine = computed(() =>\n user.value === null ? '' : [user.value.person.fullName, user.value.email].filter(Boolean).join(' · ')\n)\n\nconst canRetry = computed(\n () => axes.value.access === UserSystemAccess.Unavailable || axes.value.access === UserSystemAccess.Unauthenticated\n)\n\nconst run = () => probe(props.userId)\n\nonMounted(run)\n\nwatch(() => props.userId, run)\n\nonBeforeUnmount(cancel)\n\ndefineExpose({\n refresh: run,\n})\n</script>\n\n<template>\n <div :data-cy=\"`user-system-panel-${descriptor.system}`\">\n <div class=\"d-flex align-center flex-wrap ga-2\">\n <div class=\"font-weight-medium\">{{ label }}</div>\n <VSpacer />\n <AUserManageButton\n v-if=\"showManage && manageTarget\"\n :target=\"manageTarget\"\n :system-label=\"label\"\n />\n <AUserCreateInSystemButton\n v-if=\"showCreate\"\n :system-label=\"label\"\n :create-note=\"descriptor.createNote\"\n :will-be-enabled=\"createEnabled\"\n :loading=\"creating\"\n :required-metadata=\"descriptor.requiredMetadata\"\n :user-id=\"userId\"\n :source=\"source\"\n @confirm=\"(user) => emit('create', descriptor, user)\"\n />\n <span\n v-if=\"showNoWriteRight\"\n class=\"text-body-small text-medium-emphasis\"\n data-cy=\"user-system-no-write\"\n >\n {{ t('common.userSystem.state.noWriteRight') }}\n </span>\n <VBtn\n v-if=\"canRetry\"\n size=\"small\"\n variant=\"text\"\n data-cy=\"user-system-retry\"\n @click=\"run\"\n >\n {{ t('common.userSystem.button.retry') }}\n </VBtn>\n </div>\n <div class=\"d-flex align-center flex-wrap ga-2 mt-1\">\n <AUserSystemStatusChip :axes=\"axes\" />\n <VChip\n v-if=\"extraState\"\n :color=\"EXTRA_STATE_COLOR[extraState.tone]\"\n label\n size=\"small\"\n >\n {{ extraState.label }}: {{ extraState.value }}\n </VChip>\n <div\n v-if=\"userLine\"\n class=\"text-body-small text-medium-emphasis\"\n >\n {{ userLine }}\n </div>\n </div>\n <div\n v-if=\"descriptor.enabledNote\"\n class=\"text-body-small text-medium-emphasis mt-1\"\n >\n {{ descriptor.enabledNote }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,IAAM4B,IAAQC,GAuBRC,IAAOH,GAIP,EAAE,SAAMI,EAAQ,GAGhBC,IAAcC,EAAOC,GAA0B,KAAA,CAAS,GAGxD,EAAE,SAAM,SAAM,UAAO,cAAWC,EAAmB;GAAE,YAAYP,EAAM;GAAY;EAAY,CAAC,GAGhGQ,IAAQC,QAAeT,EAAM,WAAW,SAASA,EAAM,WAAW,MAAM,GAOxEU,IAAaD,QAEfE,EAAK,MAAM,SAASC,EAAe,UACnCC,EAAK,UAAU,QACf,CAACC,EAAYd,EAAM,WAAW,MAAM,KACpCe,EAAmBf,EAAM,YAAY,QAAQ,CACjD,GACMgB,IAAaP,QACX,CAACT,EAAM,YAAYiB,EAAwBN,EAAK,KAAK,KAAKI,EAAmBf,EAAM,YAAY,QAAQ,CAC/G,GAEMkB,IAAmBT,QAEpBE,EAAK,MAAM,SAASC,EAAe,UAClCC,EAAK,UAAU,QACf,CAACC,EAAYd,EAAM,WAAW,MAAM,KACpC,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;KACjB,SAASA,EAAA;KACT,qBAAmBA,EAAA,WAAW;KAC9B,WAASA,EAAA;KACT,QAAQA,EAAA;KACR,WAAO,AAAAsC,EAAA,QAAG,MAASrC,EAAI,UAAWD,EAAA,YAAYY,CAAI;;;;;;;;;;IAG7CK,EAAA,SADR9C,EAAA,GAAAC,EAMO,QANPoB,GAMOlB,EADFM,EAAA4D,CAAA,CAAC,CAAA,sCAAA,CAAA,GAAA,CAAA,K;IAGElB,GAAA,SADRnD,EAAA,GAAAM,EAQOI,IAAA;;KANL,MAAK;KACL,SAAQ;KACR,WAAQ;KACP,SAAO2C;;KAER,SAAA1C,QAAyC,CAAtCC,EAAAT,EAAAM,EAAA4D,CAAA,CAAC,CAAA,gCAAA,CAAA,GAAA,CAAA,C;;;;GAGRnE,EAgBM,OAhBNoB,GAgBM;IAfJlB,EAAsCS,GAAA,EAAd,MAAMJ,EAAA8B,CAAA,EAAI,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;IAE1BS,EAAA,SADRhD,EAAA,GAAAM,EAOQQ,GAAA;;KALL,OAAOmC,EAAkBD,EAAA,MAAW;KACrC,OAAA;KACA,MAAK;;KAEL,SAAArC,QAAsB,CAAnBC,EAAAT,EAAA6C,EAAA,MAAW,KAAK,IAAG,OAAE7C,EAAG6C,EAAA,MAAW,KAAK,GAAA,CAAA,C;;;IAGrCE,EAAA,SADRlD,EAAA,GAAAC,EAKM,OALNsB,GAKMpB,EADD+C,EAAA,KAAQ,GAAA,CAAA,K;;GAIPrB,EAAA,WAAW,eADnB7B,EAAA,GAAAC,EAKM,OALNuB,GAKMrB,EADD0B,EAAA,WAAW,WAAW,GAAA,CAAA,K"}
|
|
@@ -1,60 +1,42 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
1
2
|
import { AnyUserSystemDescriptor } from '../composables/userSystemDescriptor';
|
|
2
|
-
import { IntegerId } from '../../../shared/types/common';
|
|
3
3
|
import { UserSystemRefreshHook } from '../composables/userSystemProbe';
|
|
4
|
+
import { UserSystemTab } from '../utils/userTabs';
|
|
4
5
|
type __VLS_Props = {
|
|
5
|
-
userId: IntegerId;
|
|
6
|
-
/** Which tab carries the owning form, i.e. gets the slot. */
|
|
7
|
-
owner: string;
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* owns four systems but has two tabs, since the system is part of the path.
|
|
7
|
+
* One per system this admin manages and the operator may open, in draw order.
|
|
8
|
+
* Each links to that system's user page in the page's mode (detail or edit); the admin decides which are shown.
|
|
12
9
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
10
|
+
tabs: UserSystemTab[];
|
|
11
|
+
/** The "other systems" page. Without it the tab is not drawn. */
|
|
12
|
+
otherSystemsTo?: RouteLocationRaw | undefined;
|
|
13
|
+
/** The tab of the page shown: a system of `tabs` or `OTHER_SYSTEMS_TAB`. */
|
|
14
|
+
active: string;
|
|
15
|
+
/** For the tab labels. */
|
|
15
16
|
descriptors: AnyUserSystemDescriptor[];
|
|
16
17
|
/**
|
|
17
18
|
* After a 401, refresh once and retry.
|
|
18
19
|
* Each app refreshes differently (inhouse `refreshSession`, cms and contentHub a
|
|
19
20
|
* `refresh-token` call), so the library cannot do it. Without it an expired token shows as "no
|
|
20
|
-
* account in this system", which decision 16 forbids. Every panel in
|
|
21
|
+
* account in this system", which decision 16 forbids. Every panel in the slot receives it.
|
|
21
22
|
*/
|
|
22
23
|
refreshHook?: UserSystemRefreshHook | undefined;
|
|
23
|
-
readonly?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Whether the
|
|
26
|
-
* It drives the dot on the
|
|
27
|
-
* everywhere, because a hidden button would read as read-only.
|
|
28
|
-
* It also drives the leave guard. Switching tabs is not navigation,
|
|
29
|
-
* so nothing else asks before a panel button leaves the page.
|
|
25
|
+
* Whether the page's form has unsaved edits.
|
|
26
|
+
* It drives the dot on the active tab and the leave guard, which asks before a tab leaves the page.
|
|
30
27
|
*/
|
|
31
28
|
unsavedChanges?: boolean;
|
|
32
|
-
tabQueryKey?: string;
|
|
33
29
|
};
|
|
34
|
-
type __VLS_ModelProps = {
|
|
35
|
-
'activeTab'?: string;
|
|
36
|
-
};
|
|
37
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
30
|
declare const __VLS_template: () => {
|
|
39
31
|
__VLS_Slots: {
|
|
40
32
|
default?: (props: {}) => any;
|
|
41
33
|
};
|
|
42
34
|
};
|
|
43
35
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
44
|
-
declare const __VLS_base: import('vue').DefineComponent<
|
|
45
|
-
refresh: () => void;
|
|
46
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
47
|
-
"update:activeTab": (value: string) => any;
|
|
48
|
-
} & {
|
|
49
|
-
created: (descriptor: AnyUserSystemDescriptor) => any;
|
|
50
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
51
|
-
onCreated?: ((descriptor: AnyUserSystemDescriptor) => any) | undefined;
|
|
52
|
-
"onUpdate:activeTab"?: ((value: string) => any) | undefined;
|
|
53
|
-
}>, {
|
|
36
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
54
37
|
unsavedChanges: boolean;
|
|
55
|
-
readonly: boolean;
|
|
56
38
|
refreshHook: UserSystemRefreshHook;
|
|
57
|
-
|
|
39
|
+
otherSystemsTo: string | import('vue-router').RouteLocationAsRelativeGeneric | import('vue-router').RouteLocationAsPathGeneric;
|
|
58
40
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
59
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
42
|
declare const _default: typeof __VLS_export;
|
package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,179 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import s from "
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { descriptorMayWrite as l } from "../composables/userSystemDescriptor.js";
|
|
11
|
-
import { UserSystemRefreshHookKey as ne } from "../composables/userSystemProbe.js";
|
|
12
|
-
import { OTHER_SYSTEMS_TAB as u } from "../utils/userTabs.js";
|
|
13
|
-
import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createTextVNode as re, createVNode as g, defineComponent as _, isRef as v, mergeModels as y, onMounted as ie, openBlock as b, provide as ae, ref as x, renderList as S, renderSlot as oe, toDisplayString as se, unref as C, useModel as w, watch as T, withCtx as E } from "vue";
|
|
14
|
-
import { useI18n as ce } from "vue-i18n";
|
|
15
|
-
import { VIcon as le } from "vuetify/components/VIcon";
|
|
16
|
-
import { useRoute as D, useRouter as O } from "vue-router";
|
|
17
|
-
import { VTab as k, VTabs as ue } from "vuetify/components/VTabs";
|
|
18
|
-
import { VWindow as de, VWindowItem as A } from "vuetify/components/VWindow";
|
|
1
|
+
import e from "../../unsavedGuard/components/AUnsavedConfirmDialog.js";
|
|
2
|
+
import { useUnsavedChangesGuard as t } from "../../unsavedGuard/composables/useUnsavedChangesGuard.js";
|
|
3
|
+
import { UserSystemRefreshHookKey as n } from "../composables/userSystemProbe.js";
|
|
4
|
+
import { OTHER_SYSTEMS_TAB as r } from "../utils/userTabs.js";
|
|
5
|
+
import { isUndefined as i } from "../../../shared/utils/common.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, isRef as m, openBlock as h, provide as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
7
|
+
import { useI18n as S } from "vue-i18n";
|
|
8
|
+
import { VIcon as C } from "vuetify/components/VIcon";
|
|
9
|
+
import { VTab as w, VTabs as T } from "vuetify/components/VTabs";
|
|
19
10
|
// src/domains/anzuUser/components/AUserTabsShell.vue?vue&type=script&setup=true&lang.ts
|
|
20
|
-
var
|
|
11
|
+
var E = { class: "mt-4" }, D = /*@__PURE__*/ p({
|
|
21
12
|
__name: "AUserTabsShell",
|
|
22
|
-
props:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
props: {
|
|
14
|
+
tabs: {},
|
|
15
|
+
otherSystemsTo: { default: void 0 },
|
|
16
|
+
active: {},
|
|
26
17
|
descriptors: {},
|
|
27
18
|
refreshHook: {
|
|
28
19
|
type: Function,
|
|
29
20
|
default: void 0
|
|
30
21
|
},
|
|
31
|
-
readonly: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: !1
|
|
34
|
-
},
|
|
35
22
|
unsavedChanges: {
|
|
36
23
|
type: Boolean,
|
|
37
24
|
default: !1
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
activeTabModifiers: {}
|
|
46
|
-
}),
|
|
47
|
-
emits: /*@__PURE__*/ y(["created"], ["update:activeTab"]),
|
|
48
|
-
setup(_, { expose: y, emit: j }) {
|
|
49
|
-
let M = _, N = j, P = w(_, "activeTab"), { t: F } = ce(), I = D(), L = O(), R = f(() => new Map(M.descriptors.map((e) => [e.system, e]))), z = f(() => [...M.ownedTabs, u]), B = f(() => M.descriptors.filter((e) => !M.ownedTabs.includes(e.system))), V = (e) => R.value.get(e)?.label ?? e, H = (e) => typeof e == "string" && z.value.includes(e);
|
|
50
|
-
ie(() => {
|
|
51
|
-
let e = I.query[M.tabQueryKey];
|
|
52
|
-
P.value = H(e) ? e : M.owner;
|
|
53
|
-
}), T(P, (e) => {
|
|
54
|
-
H(e) && L.replace({ query: {
|
|
55
|
-
...I.query,
|
|
56
|
-
[M.tabQueryKey]: e
|
|
57
|
-
} });
|
|
58
|
-
});
|
|
59
|
-
let fe = f(() => M.unsavedChanges), { hasUnsavedChanges: pe, dirtyLabels: me, promptOpen: U, resolvePrompt: he } = c({ sources: [fe] }), W = x(null), G = x([]), K = o(), { createAnzuUser: ge } = t(), { showError: q, showRecordWas: _e } = e();
|
|
60
|
-
i(M.refreshHook) || ae(ne, M.refreshHook);
|
|
61
|
-
let J = f(() => R.value.get(M.owner)), Y = x(null), X = x(null), Z = async () => {
|
|
62
|
-
let e = J.value;
|
|
63
|
-
i(e) || (Y.value = await K.readSourceUser(e, M.userId));
|
|
64
|
-
}, Q = f(() => Y.value?.enabled === !0), $ = async (e, t) => {
|
|
65
|
-
let o = J.value;
|
|
66
|
-
if (!i(o)) {
|
|
67
|
-
X.value = e.system;
|
|
68
|
-
try {
|
|
69
|
-
let i = await K.readSourceUser(o, M.userId);
|
|
70
|
-
if (r(i)) {
|
|
71
|
-
q(F("common.userSystem.create.sourceUnreadable", { system: V(o.system) }));
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (i.enabled !== Q.value) {
|
|
75
|
-
Y.value = i, q(F("common.userSystem.create.sourceChanged"));
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (!l(e, "create")) return;
|
|
79
|
-
let s = ge(e.system);
|
|
80
|
-
s.id = i.id, s.email = t.email, s.person = n(t.person), s.avatar = n(t.avatar), s.enabled = i.enabled;
|
|
81
|
-
let c = await K.createInSystem(e, s);
|
|
82
|
-
if (c.outcome !== a.Done) {
|
|
83
|
-
q(V(e.system) + ": " + F("common.userSystem.bulk.outcome." + c.outcome));
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
_e("created"), N("created", e), W.value?.refreshSystem(e.system), G.value.forEach((e) => e?.refresh());
|
|
87
|
-
} finally {
|
|
88
|
-
X.value = null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
return T(P, (e) => {
|
|
93
|
-
H(e) && e !== M.owner && r(Y.value) && Z();
|
|
94
|
-
}, { immediate: !0 }), y({ refresh: () => {
|
|
95
|
-
Z(), W.value?.refresh(), G.value.forEach((e) => e?.refresh());
|
|
96
|
-
} }), (e, t) => (b(), h("div", null, [
|
|
97
|
-
g(ue, {
|
|
98
|
-
modelValue: P.value,
|
|
99
|
-
"onUpdate:modelValue": t[0] ||= (e) => P.value = e,
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(p) {
|
|
28
|
+
let D = p, { t: O } = S(), k = o(() => new Map(D.descriptors.map((e) => [e.system, e]))), A = (e) => k.value.get(e)?.label ?? e, j = o(() => D.unsavedChanges), { hasUnsavedChanges: M, dirtyLabels: N, promptOpen: P, resolvePrompt: F } = t({ sources: [j] });
|
|
29
|
+
return i(D.refreshHook) || g(n, D.refreshHook), (t, n) => (h(), l("div", null, [
|
|
30
|
+
f(T, {
|
|
31
|
+
"model-value": p.active,
|
|
100
32
|
"data-cy": "user-tabs"
|
|
101
33
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
key: e,
|
|
104
|
-
value: e,
|
|
105
|
-
|
|
34
|
+
default: x(() => [(h(!0), l(a, null, _(p.tabs, (e) => (h(), s(w, {
|
|
35
|
+
key: e.system,
|
|
36
|
+
value: e.system,
|
|
37
|
+
to: e.to,
|
|
38
|
+
exact: "",
|
|
39
|
+
"data-cy": `user-tab-${e.system}`
|
|
106
40
|
}, {
|
|
107
|
-
default:
|
|
41
|
+
default: x(() => [d(y(A(e.system)) + " ", 1), e.system === p.active && b(M) ? (h(), s(C, {
|
|
108
42
|
key: 0,
|
|
109
43
|
class: "ml-1",
|
|
110
44
|
size: "x-small",
|
|
111
45
|
color: "warning",
|
|
112
46
|
icon: "mdi-circle",
|
|
113
47
|
"data-cy": "user-tab-unsaved"
|
|
114
|
-
})) :
|
|
48
|
+
})) : c("", !0)]),
|
|
115
49
|
_: 2
|
|
116
|
-
}, 1032, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
value: t
|
|
50
|
+
}, 1032, [
|
|
51
|
+
"value",
|
|
52
|
+
"to",
|
|
53
|
+
"data-cy"
|
|
54
|
+
]))), 128)), b(i)(p.otherSystemsTo) ? c("", !0) : (h(), s(w, {
|
|
55
|
+
key: 0,
|
|
56
|
+
value: b(r),
|
|
57
|
+
to: p.otherSystemsTo,
|
|
58
|
+
exact: "",
|
|
59
|
+
"data-cy": `user-tab-${b(r)}`
|
|
127
60
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
key: 1,
|
|
130
|
-
ref_for: !0,
|
|
131
|
-
ref_key: "ownedPanels",
|
|
132
|
-
ref: G,
|
|
133
|
-
descriptor: R.value.get(t),
|
|
134
|
-
"user-id": _.userId,
|
|
135
|
-
readonly: _.readonly,
|
|
136
|
-
"create-enabled": Q.value,
|
|
137
|
-
source: Y.value,
|
|
138
|
-
creating: X.value === t,
|
|
139
|
-
onCreate: $
|
|
140
|
-
}, null, 8, [
|
|
141
|
-
"descriptor",
|
|
142
|
-
"user-id",
|
|
143
|
-
"readonly",
|
|
144
|
-
"create-enabled",
|
|
145
|
-
"source",
|
|
146
|
-
"creating"
|
|
147
|
-
]))]),
|
|
148
|
-
_: 2
|
|
149
|
-
}, 1032, ["value"]))), 128)), g(A, { value: C(u) }, {
|
|
150
|
-
default: E(() => [g(ee, {
|
|
151
|
-
ref_key: "otherSystems",
|
|
152
|
-
ref: W,
|
|
153
|
-
descriptors: B.value,
|
|
154
|
-
"user-id": _.userId,
|
|
155
|
-
readonly: _.readonly,
|
|
156
|
-
"create-enabled": Q.value,
|
|
157
|
-
source: Y.value,
|
|
158
|
-
"creating-system": X.value,
|
|
159
|
-
onCreate: $
|
|
160
|
-
}, null, 8, [
|
|
161
|
-
"descriptors",
|
|
162
|
-
"user-id",
|
|
163
|
-
"readonly",
|
|
164
|
-
"create-enabled",
|
|
165
|
-
"source",
|
|
166
|
-
"creating-system"
|
|
167
|
-
])]),
|
|
61
|
+
default: x(() => [d(y(b(O)("common.userSystem.tab.otherSystems")), 1)]),
|
|
168
62
|
_: 1
|
|
169
|
-
}, 8, [
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
63
|
+
}, 8, [
|
|
64
|
+
"value",
|
|
65
|
+
"to",
|
|
66
|
+
"data-cy"
|
|
67
|
+
]))]),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["model-value"]),
|
|
70
|
+
u("div", E, [v(t.$slots, "default")]),
|
|
71
|
+
f(e, {
|
|
72
|
+
modelValue: b(P),
|
|
73
|
+
"onUpdate:modelValue": n[0] ||= (e) => m(P) ? P.value = e : null,
|
|
74
|
+
"dirty-labels": b(N),
|
|
75
|
+
onResolve: b(F)
|
|
177
76
|
}, null, 8, [
|
|
178
77
|
"modelValue",
|
|
179
78
|
"dirty-labels",
|
|
@@ -182,6 +81,6 @@ var j = /*@__PURE__*/ _({
|
|
|
182
81
|
]));
|
|
183
82
|
}
|
|
184
83
|
});
|
|
185
|
-
export {
|
|
84
|
+
export { D as default };
|
|
186
85
|
|
|
187
86
|
//# sourceMappingURL=AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map
|
package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AUserTabsShell.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createElementBlock","_createVNode","_component_VTabs","_withCtx","_Fragment","_renderList","_createBlock","_component_VTab","_createTextVNode","_toDisplayString","_unref","_component_VIcon","_component_VWindow","_component_VWindowItem","_renderSlot","AUserSystemPanel","AUserOtherSystemsTable","AUnsavedConfirmDialog","_isRef","AUnsavedConfirmDialog_default","AUserOtherSystemsTable_default","AUserSystemPanel_default","AUserTabsShell_vue_vue_type_script_setup_true_lang_default","\"activeTab\"","\"activeTabModifiers\"","__expose","__emit","props","__props","emit","activeTab","useModel","useI18n","route","useRoute","router","useRouter","bySystem","computed","item","tabs","OTHER_SYSTEMS_TAB","otherDescriptors","labelFor","system","isValidTab","value","onMounted","fromUrl","watch","unsavedSource","useUnsavedChangesGuard","otherSystems","ref","ownedPanels","writes","useUserCrossSystemWrites","useAnzuUserFactory","useAlerts","isUndefined","provide","UserSystemRefreshHookKey","ownerDescriptor","sourceUser","creatingSystem","loadSource","descriptor","createEnabled","onCreate","owner","source","isNull","t","showError","descriptorMayWrite","body","createAnzuUser","metadata","cloneDeep","result","BulkOutcome","showRecordWas","panel","openBlock","createElementBlock","createVNode","VTabs","_cache","$event","withCtx","Fragment","renderList","createBlock","VTab","tab","createTextVNode","toDisplayString","unref","hasUnsavedChanges","VIcon","createCommentVNode","VWindow","VWindowItem","renderSlot","_ctx","promptOpen","isRef","dirtyLabels","resolvePrompt"],"sources":["../../../../src/domains/anzuUser/components/AUserTabsShell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, onMounted, provide, ref, watch } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useAnzuUserFactory } from '@/domains/anzuUser/factory/AnzuUserFactory'\nimport { cloneDeep, isNull, isUndefined } from '@/shared/utils/common'\nimport { BulkOutcome } from '@/domains/anzuUser/store/userCrossSystemStore'\nimport { useUserCrossSystemWrites } from '@/domains/anzuUser/composables/userCrossSystemWrites'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport AUserOtherSystemsTable from '@/domains/anzuUser/components/AUserOtherSystemsTable.vue'\nimport AUserSystemPanel from '@/domains/anzuUser/components/AUserSystemPanel.vue'\nimport { type AnyUserSystemDescriptor, descriptorMayWrite } from '@/domains/anzuUser/composables/userSystemDescriptor'\nimport type { AnzuUser, BaseUser } from '@/shared/types/AnzuUser'\nimport type { IntegerId } from '@/shared/types/common'\nimport { UserSystemRefreshHookKey, type UserSystemRefreshHook } from '@/domains/anzuUser/composables/userSystemProbe'\nimport { OTHER_SYSTEMS_TAB } from '@/domains/anzuUser/utils/userTabs'\n\nconst props = withDefaults(\n defineProps<{\n userId: IntegerId\n /** Which tab carries the owning form, i.e. gets the slot. */\n owner: string\n /**\n * The tabs in draw order. This component appends \"other systems\".\n * A prop, not derived from descriptors, because it depends on the route. admin-inhouse\n * owns four systems but has two tabs, since the system is part of the path.\n */\n ownedTabs: string[]\n /** Every system this admin can reach. The \"other systems\" tab lists the ones not in a tab. */\n descriptors: AnyUserSystemDescriptor[]\n /**\n * After a 401, refresh once and retry.\n * Each app refreshes differently (inhouse `refreshSession`, cms and contentHub a\n * `refresh-token` call), so the library cannot do it. Without it an expired token shows as \"no\n * account in this system\", which decision 16 forbids. Every panel in this shell receives it.\n */\n refreshHook?: UserSystemRefreshHook | undefined\n readonly?: boolean\n /**\n * Whether the owning form has unsaved edits.\n * It drives the dot on the owning tab. The Save button stays visible\n * everywhere, because a hidden button would read as read-only.\n * It also drives the leave guard. Switching tabs is not navigation,\n * so nothing else asks before a panel button leaves the page.\n */\n unsavedChanges?: boolean\n tabQueryKey?: string\n }>(),\n {\n refreshHook: undefined,\n readonly: false,\n unsavedChanges: false,\n tabQueryKey: 'tab',\n }\n)\n\nconst emit = defineEmits<{\n /** After an account was created in another system, so a page can react if it wants to. */\n (e: 'created', descriptor: AnyUserSystemDescriptor): void\n}>()\n\nconst activeTab = defineModel<string>('activeTab', { required: false, default: '' })\n\nconst { t } = useI18n()\nconst route = useRoute()\nconst router = useRouter()\n\nconst bySystem = computed(() => new Map(props.descriptors.map((item) => [item.system, item])))\n\nconst tabs = computed(() => [...props.ownedTabs, OTHER_SYSTEMS_TAB])\n\nconst otherDescriptors = computed(() => props.descriptors.filter((item) => !props.ownedTabs.includes(item.system)))\n\nconst labelFor = (system: string) => bySystem.value.get(system)?.label ?? system\n\nconst isValidTab = (value: unknown): value is string => typeof value === 'string' && tabs.value.includes(value)\n\nonMounted(() => {\n const fromUrl = route.query[props.tabQueryKey]\n // An unknown tab, for example a system removed from the configuration\n // since the link was sent, is ignored silently and the owning tab opens.\n activeTab.value = isValidTab(fromUrl) ? fromUrl : props.owner\n})\n\nwatch(activeTab, (value) => {\n if (!isValidTab(value)) return\n // `replace`, not `push`: with `push` the back button would walk through the tabs instead of\n // leaving the page.\n void router.replace({ query: { ...route.query, [props.tabQueryKey]: value } })\n})\n\n/**\n * Registered here, not in the page, because an internal \"manage in X\" link inside a\n * panel leaves from here and `onBeforeRouteLeave` must be bound inside the route.\n * An external link opens a new tab and needs no guard.\n */\nconst unsavedSource = computed(() => props.unsavedChanges)\nconst { hasUnsavedChanges, dirtyLabels, promptOpen, resolvePrompt } = useUnsavedChangesGuard({\n sources: [unsavedSource],\n})\n\nconst otherSystems = ref<InstanceType<typeof AUserOtherSystemsTable> | null>(null)\nconst ownedPanels = ref<InstanceType<typeof AUserSystemPanel>[]>([])\n\n/**\n * Creating this person's account in another system.\n * Handled here because the panel offering it lives here and the\n * operation belongs to the library. The page would only pass it through.\n */\nconst writes = useUserCrossSystemWrites()\nconst { createAnzuUser } = useAnzuUserFactory()\nconst { showError, showRecordWas } = useAlerts()\n\n// Provide only when present. Providing `undefined` explicitly would signal a hook to code that only checks for the key.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nif (!isUndefined(props.refreshHook)) provide(UserSystemRefreshHookKey, props.refreshHook)\n\nconst ownerDescriptor = computed(() => bySystem.value.get(props.owner))\n/**\n * The owning system's record as the server holds it, not as the form does.\n * Read together with the panels, so the owning tab costs nothing, and read again before each POST. An unsaved\n * switch in the form must not be copied, because in blog and forum it would mean a working public account.\n */\nconst sourceUser = ref<AnzuUser | null>(null)\nconst creatingSystem = ref<string | null>(null)\n\nconst loadSource = async () => {\n const descriptor = ownerDescriptor.value\n if (isUndefined(descriptor)) return\n sourceUser.value = await writes.readSourceUser(descriptor, props.userId)\n}\n\n/** Copying a person into another system copies whether they are switched on. Roles stay empty. */\nconst createEnabled = computed(() => sourceUser.value?.enabled === true)\n\nconst onCreate = async (descriptor: AnyUserSystemDescriptor, metadata: BaseUser) => {\n const owner = ownerDescriptor.value\n if (isUndefined(owner)) return\n creatingSystem.value = descriptor.system\n try {\n const source = await writes.readSourceUser(owner, props.userId)\n if (isNull(source)) {\n showError(t('common.userSystem.create.sourceUnreadable', { system: labelFor(owner.system) }))\n return\n }\n // The dialog already promised \"created ready to use\" or \"created switched off\" from the earlier read. If the\n // server now disagrees, the promise was wrong, and in blog and forum that means a working public account.\n // Usually the first read failed, leaving `sourceUser` null and the dialog saying \"disabled\"\n // for an enabled account. Nothing is written until the corrected row is confirmed again.\n if (source.enabled !== createEnabled.value) {\n sourceUser.value = source\n showError(t('common.userSystem.create.sourceChanged'))\n return\n }\n // The create right may have been lost while the source was read. Nothing is offered then, so nothing is reported.\n if (!descriptorMayWrite(descriptor, 'create')) return\n // Built by the library factory, never by hand. A body of base fields\n // alone makes the backend add `ROLE_USER`, a role nobody granted.\n // Metadata comes from the dialog, validated against the target's profile. The source may leave fields empty\n // (blog never fills `person`) that the target requires. The id and `enabled` come from the fresh read.\n const body = createAnzuUser(descriptor.system)\n body.id = source.id\n body.email = metadata.email\n body.person = cloneDeep(metadata.person)\n body.avatar = cloneDeep(metadata.avatar)\n body.enabled = source.enabled\n const result = await writes.createInSystem(descriptor, body)\n if (result.outcome !== BulkOutcome.Done) {\n // Without this message the failure looked like success: the\n // re-probed row still said \"absent\" with no explanation.\n showError(labelFor(descriptor.system) + ': ' + t('common.userSystem.bulk.outcome.' + result.outcome))\n return\n }\n showRecordWas('created')\n emit('created', descriptor)\n otherSystems.value?.refreshSystem(descriptor.system)\n ownedPanels.value.forEach((panel) => panel?.refresh())\n } finally {\n creatingSystem.value = null\n }\n}\n\n/**\n * Called by the page after the owning form saved.\n * `VWindowItem` hides panels with `v-show`, so a mounted panel never re-fetches by itself. Without\n * this it shows pre-save data, and create-in-another-system would copy that stale snapshot.\n * Not a refetch on every tab activation: that would cost eight calls per tab switch.\n */\nconst refresh = () => {\n void loadSource()\n otherSystems.value?.refresh()\n ownedPanels.value.forEach((panel) => panel?.refresh())\n}\n\n// Read on the first activation of a non-owning tab, so the owning tab makes no foreign call.\nwatch(\n activeTab,\n (value) => {\n // `isValidTab` first: before mount settles, the model is an empty string.\n // Treating it as a non-owning tab would fetch on the owning tab too.\n if (!isValidTab(value) || value === props.owner) return\n if (isNull(sourceUser.value)) void loadSource()\n },\n { immediate: true }\n)\n\ndefineExpose({ refresh })\n</script>\n\n<template>\n <div>\n <!--\n No tab navigates. Tabs only switch content, and leaving the page is done by the Manage\n anchor inside a panel. `VTab` renders `role=\"tab\"` and cannot carry navigation semantically.\n -->\n <VTabs\n v-model=\"activeTab\"\n data-cy=\"user-tabs\"\n >\n <VTab\n v-for=\"tab in tabs\"\n :key=\"tab\"\n :value=\"tab\"\n :data-cy=\"`user-tab-${tab}`\"\n >\n {{ tab === OTHER_SYSTEMS_TAB ? t('common.userSystem.tab.otherSystems') : labelFor(tab) }}\n <!-- The owning tab says it holds unsaved work; the Save button itself is always visible. -->\n <VIcon\n v-if=\"tab === owner && hasUnsavedChanges\"\n class=\"ml-1\"\n size=\"x-small\"\n color=\"warning\"\n icon=\"mdi-circle\"\n data-cy=\"user-tab-unsaved\"\n />\n </VTab>\n </VTabs>\n <VWindow\n v-model=\"activeTab\"\n class=\"mt-4\"\n >\n <VWindowItem\n v-for=\"tab in ownedTabs\"\n :key=\"tab\"\n :value=\"tab\"\n >\n <!-- The owning system of the current route: the full form. -->\n <slot v-if=\"tab === owner\" />\n <!--\n Another system this admin owns whose route is not open: a probe\n with a summary and a Manage button, like any other system.\n -->\n <AUserSystemPanel\n v-else-if=\"!isUndefined(bySystem.get(tab))\"\n ref=\"ownedPanels\"\n :descriptor=\"bySystem.get(tab)!\"\n :user-id=\"userId\"\n :readonly=\"readonly\"\n :create-enabled=\"createEnabled\"\n :source=\"sourceUser\"\n :creating=\"creatingSystem === tab\"\n @create=\"onCreate\"\n />\n </VWindowItem>\n <VWindowItem :value=\"OTHER_SYSTEMS_TAB\">\n <!-- `VWindowItem` renders content on first activation, so opening a user makes no foreign calls. -->\n <AUserOtherSystemsTable\n ref=\"otherSystems\"\n :descriptors=\"otherDescriptors\"\n :user-id=\"userId\"\n :readonly=\"readonly\"\n :create-enabled=\"createEnabled\"\n :source=\"sourceUser\"\n :creating-system=\"creatingSystem\"\n @create=\"onCreate\"\n />\n </VWindowItem>\n </VWindow>\n <AUnsavedConfirmDialog\n v-model=\"promptOpen\"\n :dirty-labels=\"dirtyLabels\"\n @resolve=\"resolvePrompt\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,IAAM6B,IAAQC,GAuCRC,IAAOH,GAKPI,IAAYhC,EAAmB8B,GAAC,WAA6C,GAE7E,EAAE,SAAMI,GAAQ,GAChBC,IAAQC,EAAS,GACjBC,IAASC,EAAU,GAEnBC,IAAWC,QAAe,IAAI,IAAIX,EAAM,YAAY,KAAK,MAAS,CAACY,EAAK,QAAQA,CAAI,CAAC,CAAC,CAAC,GAEvFC,IAAOF,QAAe,CAAC,GAAGX,EAAM,WAAWc,CAAiB,CAAC,GAE7DC,IAAmBJ,QAAeX,EAAM,YAAY,QAAQ,MAAS,CAACA,EAAM,UAAU,SAASY,EAAK,MAAM,CAAC,CAAC,GAE5GI,KAAY,MAAmBN,EAAS,MAAM,IAAIO,CAAM,CAAC,EAAE,SAASA,GAEpEC,KAAc,MAAoC,OAAOC,KAAU,YAAYN,EAAK,MAAM,SAASM,CAAK;EAS9G,AAPAC,SAAgB;GACd,IAAMC,IAAUf,EAAM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,SAAA;MAAJ,KAAIoC;MACH,aAAaV,EAAA;MACb,WAASd,EAAA;MACT,UAAUA,EAAA;MACV,kBAAgBuC,EAAA;MAChB,QAAQJ,EAAA;MACR,mBAAiBC,EAAA;MACT;;;;;;;;;;;;;GAIf/D,EAIEgB,GAAA;IAHS,YAAAP,EAAA+F,CAAA;IAAA,uBAAA,AAAAlB,EAAA,QAAA,MAAArE,EAAAuF,CAAA,IAAA,EAAU,QAAAjB,IAAA;IAClB,gBAAc9E,EAAAiG,EAAA;IACd,WAASjG,EAAAkG,EAAA"}
|
|
1
|
+
{"version":3,"file":"AUserTabsShell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createVNode","_component_VTabs","_withCtx","_Fragment","_renderList","_createBlock","_component_VTab","_createTextVNode","_toDisplayString","_unref","_component_VIcon","_createElementVNode","_renderSlot","AUnsavedConfirmDialog","_isRef","AUnsavedConfirmDialog_default","_hoisted_1","AUserTabsShell_vue_vue_type_script_setup_true_lang_default","props","__props","useI18n","bySystem","computed","item","labelFor","system","unsavedSource","useUnsavedChangesGuard","isUndefined","provide","UserSystemRefreshHookKey","openBlock","createElementBlock","createVNode","VTabs","withCtx","Fragment","renderList","createBlock","VTab","tab","createTextVNode","toDisplayString","unref","hasUnsavedChanges","VIcon","createCommentVNode","OTHER_SYSTEMS_TAB","t","createElementVNode","renderSlot","_ctx","promptOpen","_cache","isRef","$event","dirtyLabels","resolvePrompt"],"sources":["../../../../src/domains/anzuUser/components/AUserTabsShell.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, provide } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport type { RouteLocationRaw } from 'vue-router'\nimport AUnsavedConfirmDialog from '@/domains/unsavedGuard/components/AUnsavedConfirmDialog.vue'\nimport { useUnsavedChangesGuard } from '@/domains/unsavedGuard/composables/useUnsavedChangesGuard'\nimport type { AnyUserSystemDescriptor } from '@/domains/anzuUser/composables/userSystemDescriptor'\nimport { UserSystemRefreshHookKey, type UserSystemRefreshHook } from '@/domains/anzuUser/composables/userSystemProbe'\nimport { OTHER_SYSTEMS_TAB, type UserSystemTab } from '@/domains/anzuUser/utils/userTabs'\nimport { isUndefined } from '@/shared/utils/common'\n\nconst props = withDefaults(\n defineProps<{\n /**\n * One per system this admin manages and the operator may open, in draw order.\n * Each links to that system's user page in the page's mode (detail or edit); the admin decides which are shown.\n */\n tabs: UserSystemTab[]\n /** The \"other systems\" page. Without it the tab is not drawn. */\n otherSystemsTo?: RouteLocationRaw | undefined\n /** The tab of the page shown: a system of `tabs` or `OTHER_SYSTEMS_TAB`. */\n active: string\n /** For the tab labels. */\n descriptors: AnyUserSystemDescriptor[]\n /**\n * After a 401, refresh once and retry.\n * Each app refreshes differently (inhouse `refreshSession`, cms and contentHub a\n * `refresh-token` call), so the library cannot do it. Without it an expired token shows as \"no\n * account in this system\", which decision 16 forbids. Every panel in the slot receives it.\n */\n refreshHook?: UserSystemRefreshHook | undefined\n /**\n * Whether the page's form has unsaved edits.\n * It drives the dot on the active tab and the leave guard, which asks before a tab leaves the page.\n */\n unsavedChanges?: boolean\n }>(),\n {\n otherSystemsTo: undefined,\n refreshHook: undefined,\n unsavedChanges: false,\n }\n)\n\nconst { t } = useI18n()\n\nconst bySystem = computed(() => new Map(props.descriptors.map((item) => [item.system, item])))\n\nconst labelFor = (system: string) => bySystem.value.get(system)?.label ?? system\n\n/** Registered here, not in the page: every user page has the shell, and a tab is a link out of it. */\nconst unsavedSource = computed(() => props.unsavedChanges)\nconst { hasUnsavedChanges, dirtyLabels, promptOpen, resolvePrompt } = useUnsavedChangesGuard({\n sources: [unsavedSource],\n})\n\n// Provide only when present. Providing `undefined` explicitly would signal a hook to code that only checks for the key.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nif (!isUndefined(props.refreshHook)) provide(UserSystemRefreshHookKey, props.refreshHook)\n</script>\n\n<template>\n <div>\n <!-- `exact` on each tab: an active link selects its tab, and without it a link is also active on nested routes. -->\n <VTabs\n :model-value=\"active\"\n data-cy=\"user-tabs\"\n >\n <VTab\n v-for=\"tab in tabs\"\n :key=\"tab.system\"\n :value=\"tab.system\"\n :to=\"tab.to\"\n exact\n :data-cy=\"`user-tab-${tab.system}`\"\n >\n {{ labelFor(tab.system) }}\n <VIcon\n v-if=\"tab.system === active && hasUnsavedChanges\"\n class=\"ml-1\"\n size=\"x-small\"\n color=\"warning\"\n icon=\"mdi-circle\"\n data-cy=\"user-tab-unsaved\"\n />\n </VTab>\n <VTab\n v-if=\"!isUndefined(otherSystemsTo)\"\n :value=\"OTHER_SYSTEMS_TAB\"\n :to=\"otherSystemsTo\"\n exact\n :data-cy=\"`user-tab-${OTHER_SYSTEMS_TAB}`\"\n >\n {{ t('common.userSystem.tab.otherSystems') }}\n </VTab>\n </VTabs>\n <div class=\"mt-4\">\n <slot />\n </div>\n <AUnsavedConfirmDialog\n v-model=\"promptOpen\"\n :dirty-labels=\"dirtyLabels\"\n @resolve=\"resolvePrompt\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,IAAMoB,IAAQC,GAiCR,EAAE,SAAMC,EAAQ,GAEhBC,IAAWC,QAAe,IAAI,IAAIJ,EAAM,YAAY,KAAK,MAAS,CAACK,EAAK,QAAQA,CAAI,CAAC,CAAC,CAAC,GAEvFC,KAAY,MAAmBH,EAAS,MAAM,IAAII,CAAM,CAAC,EAAE,SAASA,GAGpEC,IAAgBJ,QAAeJ,EAAM,cAAc,GACnD,EAAE,sBAAmB,gBAAa,eAAY,qBAAkBS,EAAuB,EAC3F,SAAS,CAACD,CAAa,EACzB,CAAC;E,OAIIE,EAAYV,EAAM,WAAW,KAAGW,EAAQC,GAA0BZ,EAAM,WAAW,I,UAItFpB,EAAA,GAAAC,EA0CM,OAAA,MAAA;GAxCJC,EA+BQC,GAAA;IA9BL,eAAakB,EAAA;IACd,WAAQ;;IAGN,SAAAjB,QAAmB,EADrBJ,EAAA,EAAA,GAAAC,EAiBOI,GAAA,MAAAC,EAhBSe,EAAA,OAAP,OADTrB,EAAA,GAAAO,EAiBOC,GAAA;KAfJ,KAAKkC,EAAI;KACT,OAAOA,EAAI;KACX,IAAIA,EAAI;KACT,OAAA;KACC,WAAO,YAAcA,EAAI;;KAE1B,SAAAtC,QAA0B,CAAvBK,EAAAC,EAAAgB,EAASgB,EAAI,MAAM,CAAA,IAAI,KAC1B,CAAA,GACQA,EAAI,WAAWrB,EAAA,UAAUV,EAAAmC,CAAA,KADjC9C,EAAA,GAAAO,EAOEK,GAAA;;MALA,OAAM;MACN,MAAK;MACL,OAAM;MACN,MAAK;MACL,WAAQ;;;;;;;I,aAIHD,EAAAmB,CAAA,CAAW,CAACT,EAAA,cAAc,I,aADnCrB,EAAA,GAAAO,EAQOC,GAAA;;KANJ,OAAOG,EAAAsC,CAAA;KACP,IAAI5B,EAAA;KACL,OAAA;KACC,WAAO,YAAcV,EAAAsC,CAAA;;KAEtB,SAAA7C,QAA6C,CAA1CK,EAAAC,EAAAC,EAAAuC,CAAA,CAAC,CAAA,oCAAA,CAAA,GAAA,CAAA,C;;;;;;;;;GAGRrC,EAEM,OAFNK,GAEM,CADJJ,EAAQuC,EAAA,QAAA,SAAA,C;GAEVnD,EAIEa,GAAA;IAHS,YAAAJ,EAAA2C,CAAA;IAAA,uBAAA,AAAAC,EAAA,QAAA,MAAAvC,EAAAsC,CAAA,IAAA,EAAU,QAAAG,IAAA;IAClB,gBAAc9C,EAAA+C,CAAA;IACd,WAAS/C,EAAAgD,CAAA"}
|
|
@@ -134,8 +134,10 @@ export declare const useAnzuUserActions: (params: AnzuUserActionsParams) => {
|
|
|
134
134
|
};
|
|
135
135
|
}>;
|
|
136
136
|
loadingAnzuUser: Ref<boolean, boolean>;
|
|
137
|
+
anzuUserNotFound: Ref<boolean, boolean>;
|
|
137
138
|
fetchAnzuUser: (id: IntegerId, options?: {
|
|
138
139
|
signal?: AbortSignal;
|
|
140
|
+
keepOnNotFound?: boolean;
|
|
139
141
|
}) => Promise<boolean | undefined>;
|
|
140
142
|
createAnzuUser: () => Promise<AnzuUser | null>;
|
|
141
143
|
updateAnzuUser: () => Promise<boolean>;
|