@anzusystems/common-admin 2.0.0-rc.30 → 2.0.0-rc.31
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/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +4 -2
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.js +4 -4
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +3 -2
- package/dist/domains/anzuUser/components/AAnzuUserForm.vue.js +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserForm.vue.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +5 -4
- package/dist/domains/anzuUser/components/AUserMetadataForm.vue.js +113 -108
- package/dist/domains/anzuUser/components/AUserMetadataForm.vue.js.map +1 -1
- package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +3 -2
- package/dist/domains/anzuUser/composables/anzuUserValidations.js +1 -1
- package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
- package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +4 -3
- package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
- package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +1 -2
- package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue.js +84 -84
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue.js.map +1 -1
- package/dist/domains/filters/composables/filterFactory.js +53 -52
- package/dist/domains/filters/composables/filterFactory.js.map +1 -1
- package/dist/domains/listEditor/composables/useKeyboardNav.js +3 -3
- package/dist/domains/listEditor/composables/useKeyboardNav.js.map +1 -1
- package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js +25 -21
- package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
- package/dist/lib.d.ts +2 -2
- package/package.json +2 -2
|
@@ -31,10 +31,11 @@ type __VLS_Props = {
|
|
|
31
31
|
*/
|
|
32
32
|
impersonate?: ((user: AnzuUser) => void) | undefined;
|
|
33
33
|
canImpersonate?: boolean;
|
|
34
|
+
/** What "Most recent" and "Oldest" sort by; dam's ids come from the SSO, not in creation order. */
|
|
35
|
+
orderingVariant?: 'id' | 'createdAt';
|
|
34
36
|
/**
|
|
35
37
|
* Filter fields this system adds to the shared three.
|
|
36
|
-
* Not
|
|
37
|
-
* cms uses `memberOf`, dam uses `custom`, and `allowedSites` exists only in cms.
|
|
38
|
+
* Not shared: each system adds its own fields and picks its groups (`memberOf`) from its own backend.
|
|
38
39
|
* A plain field is drawn by the generic renderer. A field that
|
|
39
40
|
* needs a remote autocomplete comes in through `#filter.<name>`.
|
|
40
41
|
*/
|
|
@@ -95,6 +96,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
95
96
|
title: string;
|
|
96
97
|
})[];
|
|
97
98
|
canImpersonate: boolean;
|
|
99
|
+
orderingVariant: "id" | "createdAt";
|
|
98
100
|
filterFields: readonly MakeFilterOption<string>[];
|
|
99
101
|
filterClient: () => AxiosInstance;
|
|
100
102
|
filterUserId: IntegerIdNullable;
|
|
@@ -6,7 +6,6 @@ import ae from "../../filters/datatable/components/ADatatableConfigButton2.vue.j
|
|
|
6
6
|
import C from "../../ui/datetime/components/ADatetime2.vue.js";
|
|
7
7
|
import oe from "../../ui/buttons/table/components/ATableCopyIdButton2.vue.js";
|
|
8
8
|
import se from "../../cached/components/ACachedChip3.vue.js";
|
|
9
|
-
import "../../filters/datatable/utils/datatableColumns.js";
|
|
10
9
|
import ce from "../../filters/datatable/components/ADatatableOrdering2.vue.js";
|
|
11
10
|
import le from "../../filters/datatable/components/ADatatablePagination3.vue.js";
|
|
12
11
|
import { createDatatableColumnsConfig as ue } from "../../filters/datatable/composables/createDatatableColumnsConfig.js";
|
|
@@ -51,6 +50,7 @@ var z = { class: "d-flex align-center" }, B = {
|
|
|
51
50
|
type: Boolean,
|
|
52
51
|
default: !1
|
|
53
52
|
},
|
|
53
|
+
orderingVariant: { default: "id" },
|
|
54
54
|
filterFields: { default: () => [] },
|
|
55
55
|
filterClient: {
|
|
56
56
|
type: Function,
|
|
@@ -75,7 +75,7 @@ var z = { class: "d-flex align-center" }, B = {
|
|
|
75
75
|
client: U.client,
|
|
76
76
|
system: U.system,
|
|
77
77
|
endPoint: U.permissionGroupEndPoint
|
|
78
|
-
}), { resetFilter: Se, submitFilter: Ce, loadStoredFilters: we } = de(K, G, { storeFiltersLocalStorage: A(U.system) }), { pagination: J } = E(
|
|
78
|
+
}), { resetFilter: Se, submitFilter: Ce, loadStoredFilters: we } = de(K, G, { storeFiltersLocalStorage: A(U.system) }), { pagination: J } = E(U.orderingVariant);
|
|
79
79
|
h(fe, J);
|
|
80
80
|
let { columnsVisible: Y, columnsAll: Te, columnsHidden: X } = ue([
|
|
81
81
|
{ key: "id" },
|
|
@@ -123,9 +123,9 @@ var z = { class: "d-flex align-center" }, B = {
|
|
|
123
123
|
]), a("div", null, [a("div", z, [
|
|
124
124
|
c(R),
|
|
125
125
|
c(ce, {
|
|
126
|
-
variant:
|
|
126
|
+
variant: l.orderingVariant,
|
|
127
127
|
onSortByChange: Q
|
|
128
|
-
}),
|
|
128
|
+
}, null, 8, ["variant"]),
|
|
129
129
|
c(ae, {
|
|
130
130
|
"columns-hidden": y(X),
|
|
131
131
|
"onUpdate:columnsHidden": f[1] ||= (e) => u(X) ? X.value = e : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AAnzuUserDatatable.vue.js","names":["$slots","_openBlock","_createElementBlock","_createVNode","AAnzuUserFilter","_unref","_isRef","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createElementVNode","_component_VSpacer","ADatatableOrdering","ADatatableConfigButton","_component_VDataTableServer","ABooleanValue","_Fragment","_createBlock","_component_VChip","_createTextVNode","_toDisplayString","ACachedChip","ADatetime","ATableCopyIdButton","_component_VBtn","_withModifiers","ADatatablePagination","Fragment","computed","createBlock","createCommentVNode","createElementBlock","createElementVNode","createSlots","createTextVNode","createVNode","defineComponent","guardReactiveProps","isRef","normalizeProps","onBeforeUnmount","onMounted","openBlock","provide","renderList","renderSlot","toDisplayString","unref","useSlots","watch","withCtx","withModifiers","useI18n","useDebounceFn","ABooleanValue_default","ADatatableConfigButton_default","ADatetime_default","ATableCopyIdButton_default","ACachedChip_default","ADatatableOrdering_default","ADatatablePagination_default","createDatatableColumnsConfig","useFilterHelpers","DatatablePaginationKey","FilterConfigKey","FilterDataKey","usePagination","AAnzuUserFilter_default","useAnzuUserActions","ANZU_USER_ENTITY","anzuUserFilterStorageKey","useAnzuUserListFilter","usePermissionConfigActions","useCachedPermissionGroups","PERMISSION_GROUP_ENDPOINT","VBtn","VChip","VDataTableServer","VSpacer","_hoisted_1","_hoisted_2","FILTER_SLOT_PREFIX","AAnzuUserDatatable_vue_vue_type_script_setup_true_lang_default","__props","__expose","__emit","props","emit","t","filterConfig","filterData","fetchAnzuUserList","cancelAnzuUserList","anzuUserList","loadingAnzuUserList","datatableHiddenColumns","translatePermission","addToCachedPermissionGroups","fetchCachedPermissionGroups","getCachedPermissionGroup","resetFilter","submitFilter","loadStoredFilters","pagination","columnsVisible","columnsAll","columnsHidden","column","getList","users","user","systemColumnKeys","slots","filterSlotNames","name","submitFilterAction","resetFilterAction","onRowClick","_event","item","_ctx","_cache","$event","slotProps","role","permissionGroupId"],"sources":["../../../../src/domains/anzuUser/components/AAnzuUserDatatable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, onBeforeUnmount, onMounted, provide, useSlots, watch } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport type { AxiosInstance } from 'axios'\nimport { useDebounceFn } from '@vueuse/core'\nimport ABooleanValue from '@/domains/ui/components/ABooleanValue.vue'\nimport ADatatableConfigButton from '@/domains/filters/datatable/components/ADatatableConfigButton.vue'\nimport ADatetime from '@/domains/ui/datetime/components/ADatetime.vue'\nimport ATableCopyIdButton from '@/domains/ui/buttons/table/components/ATableCopyIdButton.vue'\nimport ACachedChip from '@/domains/cached/components/ACachedChip.vue'\nimport { SORT_BY_ID } from '@/domains/filters/datatable/utils/datatableColumns'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport ADatatableOrdering from '@/domains/filters/datatable/components/ADatatableOrdering.vue'\nimport ADatatablePagination from '@/domains/filters/datatable/components/ADatatablePagination.vue'\nimport { createDatatableColumnsConfig } from '@/domains/filters/datatable/composables/createDatatableColumnsConfig'\nimport {\n useFilterHelpers,\n type FilterStoreIdentifier,\n type MakeFilterOption,\n} from '@/domains/filters/composables/filterFactory'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport AAnzuUserFilter from '@/domains/anzuUser/components/AAnzuUserFilter.vue'\nimport { useAnzuUserActions } from '@/domains/anzuUser/composables/anzuUserActions'\nimport { ANZU_USER_ENTITY } from '@/domains/anzuUser/api/anzuUserApi'\nimport { anzuUserFilterStorageKey, useAnzuUserListFilter } from '@/domains/anzuUser/filter/anzuUserFilter'\nimport { usePermissionConfigActions } from '@/domains/permission/config/composables/permissionConfigActions'\nimport { useCachedPermissionGroups } from '@/domains/permission/group/composables/cachedPermissionGroups'\nimport { PERMISSION_GROUP_ENDPOINT } from '@/domains/permission/group/api/permissionGroupApi'\nimport type { AnzuUser } from '@/shared/types/AnzuUser'\nimport type { IntegerIdNullable } from '@/shared/types/common'\n\ntype DatatableItem = AnzuUser\n\nconst props = withDefaults(\n defineProps<{\n client: AxiosClientFn\n system: string\n entity?: string | undefined\n endPoint?: string | undefined\n detailRoute: (user: AnzuUser) => RouteLocationRaw\n editRoute: (user: AnzuUser) => RouteLocationRaw\n /** Already-evaluated ACL of the owning system. */\n canUpdate?: boolean\n /** The permission-group endpoint, which is not the user one. */\n permissionGroupEndPoint?: string\n /**\n * Extra columns the app draws through `#systemColumns`, appended after the shared ones.\n * A bare key takes its header from `common.anzuUser.model.*`, which has\n * no system keys. So a system column passes its title already translated.\n */\n systemColumns?: Array<string | { key: string; title: string }>\n /**\n * Optional impersonation. Left unset, nothing is drawn.\n * A callback rather than a path, because the mechanisms differ: cms posts to `/adm/users/{id}/impersonate` and\n * gets a JWT, blog opens the public site with `window.open`. Only the cms one reaches this shared component.\n */\n impersonate?: ((user: AnzuUser) => void) | undefined\n canImpersonate?: boolean\n /**\n * Filter fields this system adds to the shared three.\n * Not part of the shared list because the same filter is a different query per system:\n * cms uses `memberOf`, dam uses `custom`, and `allowedSites` exists only in cms.\n * A plain field is drawn by the generic renderer. A field that\n * needs a remote autocomplete comes in through `#filter.<name>`.\n */\n filterFields?: readonly MakeFilterOption[]\n /**\n * Saved filters are stored per user, so both props are needed for the button to appear. Only cms and dam use them.\n */\n filterClient?: (() => AxiosInstance) | undefined\n filterUserId?: IntegerIdNullable | undefined\n /** Where the filter files its saved bookmarks. */\n filterStore?: FilterStoreIdentifier | undefined\n }>(),\n {\n entity: undefined,\n endPoint: undefined,\n permissionGroupEndPoint: PERMISSION_GROUP_ENDPOINT,\n canUpdate: false,\n systemColumns: () => [],\n impersonate: undefined,\n canImpersonate: false,\n filterFields: () => [],\n filterClient: undefined,\n filterUserId: undefined,\n filterStore: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'rowClick', user: AnzuUser): void\n}>()\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { t } = useI18n()\nconst { filterConfig, filterData } = useAnzuUserListFilter(props.system, props.filterFields)\nprovide(FilterConfigKey, filterConfig)\nprovide(FilterDataKey, filterData)\n\nconst { fetchAnzuUserList, cancelAnzuUserList, anzuUserList, loadingAnzuUserList, datatableHiddenColumns } =\n useAnzuUserActions({\n client: props.client,\n system: props.system,\n entity: props.entity,\n endPoint: props.endPoint,\n })\n\n// No `entity` here on purpose: this one reads the permission config, which is its own resource.\n// `props.entity` names the user.\nconst { translatePermission } = usePermissionConfigActions({\n client: props.client,\n system: props.system,\n})\n\n/**\n * Group titles for the column, resolved against this system's own cache.\n * Drawn here rather than left to a slot, so the column is not left empty in every app.\n * The cache is keyed per system because the same id is a different group in each backend.\n * An app can still override the chip through the slot.\n */\nconst { addToCachedPermissionGroups, fetchCachedPermissionGroups, getCachedPermissionGroup } =\n useCachedPermissionGroups({\n client: props.client,\n system: props.system,\n endPoint: props.permissionGroupEndPoint,\n })\n\nconst { resetFilter, submitFilter, loadStoredFilters } = useFilterHelpers(filterData, filterConfig, {\n storeFiltersLocalStorage: anzuUserFilterStorageKey(props.system),\n})\n\nconst { pagination } = usePagination(SORT_BY_ID)\nprovide(DatatablePaginationKey, pagination)\n\nconst { columnsVisible, columnsAll, columnsHidden } = createDatatableColumnsConfig(\n [\n { key: 'id' },\n { key: 'email' },\n { key: 'enabled' },\n { key: 'roles' },\n { key: 'permissionGroups' },\n { key: 'permissions' },\n ...props.systemColumns.map((column) => (typeof column === 'string' ? { key: column } : column)),\n { key: 'createdAt' },\n { key: 'modifiedAt' },\n ],\n datatableHiddenColumns,\n 'common',\n ANZU_USER_ENTITY,\n { storeColumnsLocalStorage: `table_common_anzuUser_${props.system}` }\n)\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst getList = useDebounceFn(async () => {\n await fetchAnzuUserList(pagination, filterData, filterConfig)\n})\n\nwatch(anzuUserList, (users) => {\n users.forEach((user) => addToCachedPermissionGroups(user.permissionGroups))\n void fetchCachedPermissionGroups()\n})\n\nconst systemColumnKeys = computed(() =>\n props.systemColumns.map((column) => (typeof column === 'string' ? column : column.key))\n)\n\n// `#filter.allowedSites` here becomes `#item.allowedSites` inside the\n// filter. That is the name `AFilterWrapper` renders a field's widget under.\n// The prefix keeps field slots apart from this table's own `item.*` columns.\nconst slots = useSlots()\nconst FILTER_SLOT_PREFIX = 'filter.'\nconst filterSlotNames = computed(() =>\n Object.keys(slots)\n .filter((name) => name.startsWith(FILTER_SLOT_PREFIX))\n .map((name) => name.slice(FILTER_SLOT_PREFIX.length))\n)\n\nconst submitFilterAction = () => submitFilter(pagination, getList)\nconst resetFilterAction = () => resetFilter(pagination, getList)\n\nconst onRowClick = (_event: unknown, { item }: { item: DatatableItem }) => {\n if (item.id) emit('rowClick', item)\n}\n\nonMounted(() => {\n loadStoredFilters(pagination, getList)\n})\n\nonBeforeUnmount(() => {\n getList.cancel()\n cancelAnzuUserList()\n})\n\ndefineExpose({\n refresh: getList,\n resetFilter: resetFilterAction,\n submitFilter: submitFilterAction,\n})\n</script>\n\n<template>\n <div>\n <AAnzuUserFilter\n v-model:datatable-hidden-columns=\"columnsHidden\"\n :client=\"filterClient\"\n :user-id=\"filterUserId\"\n :store=\"filterStore\"\n @submit=\"submitFilterAction\"\n @reset=\"resetFilterAction\"\n >\n <template\n v-for=\"name in filterSlotNames\"\n :key=\"name\"\n #[`item.${name}`]=\"slotProps\"\n >\n <slot\n :name=\"`${FILTER_SLOT_PREFIX}${name}`\"\n v-bind=\"slotProps ?? {}\"\n />\n </template>\n </AAnzuUserFilter>\n <div>\n <div class=\"d-flex align-center\">\n <VSpacer />\n <ADatatableOrdering\n variant=\"id\"\n @sort-by-change=\"submitFilterAction\"\n />\n <ADatatableConfigButton\n v-model:columns-hidden=\"columnsHidden\"\n :columns-all=\"columnsAll\"\n />\n </div>\n <VDataTableServer\n class=\"a-datatable\"\n :headers=\"columnsVisible\"\n :items=\"anzuUserList\"\n :items-length=\"anzuUserList.length\"\n :loading=\"loadingAnzuUserList\"\n item-value=\"id\"\n @click:row=\"onRowClick\"\n >\n <template #item.enabled=\"{ item }: { item: DatatableItem }\">\n <ABooleanValue\n chip\n :value=\"item.enabled\"\n />\n </template>\n <template #item.roles=\"{ item }: { item: DatatableItem }\">\n <VChip\n v-for=\"role in item.roles\"\n :key=\"role\"\n class=\"mr-1 mb-1\"\n >\n {{ translatePermission('roles', role) }}\n </VChip>\n </template>\n <template #item.permissionGroups=\"{ item }: { item: DatatableItem }\">\n <slot\n name=\"permissionGroups\"\n :ids=\"item.permissionGroups\"\n >\n <ACachedChip\n v-for=\"permissionGroupId in item.permissionGroups\"\n :id=\"permissionGroupId\"\n :key=\"permissionGroupId\"\n container-class=\"d-inline-flex mr-1 mb-1\"\n :get-cached-fn=\"getCachedPermissionGroup\"\n display-text-path=\"title\"\n route=\"\"\n disable-click\n />\n </slot>\n </template>\n <template #item.permissions=\"{ item }: { item: DatatableItem }\">\n <VChip>{{ Object.keys(item.permissions).length }}</VChip>\n </template>\n <template\n v-for=\"column in systemColumnKeys\"\n :key=\"column\"\n #[`item.${column}`]=\"{ item }: { item: DatatableItem }\"\n >\n <slot\n name=\"systemColumns\"\n :column=\"column\"\n :user=\"item\"\n />\n </template>\n <template #item.createdAt=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.createdAt\" />\n <template v-if=\"$slots.createdBy\">\n <br />\n <slot\n :id=\"item.createdBy\"\n name=\"createdBy\"\n />\n </template>\n </template>\n <template #item.modifiedAt=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.modifiedAt\" />\n <template v-if=\"$slots.modifiedBy\">\n <br />\n <slot\n :id=\"item.modifiedBy\"\n name=\"modifiedBy\"\n />\n </template>\n </template>\n <template #item.actions=\"{ item }: { item: DatatableItem }\">\n <div\n v-if=\"item.id\"\n class=\"d-flex justify-end\"\n >\n <ATableCopyIdButton :id=\"item.id\" />\n <VBtn\n :to=\"detailRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-information-outline\"\n :aria-label=\"t('common.button.detail')\"\n size=\"x-small\"\n variant=\"text\"\n />\n <VBtn\n v-if=\"canUpdate\"\n :to=\"editRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-pencil\"\n :aria-label=\"t('common.button.edit')\"\n size=\"x-small\"\n variant=\"text\"\n />\n <!-- A disabled account cannot sign in, so it cannot be signed in as either. -->\n <VBtn\n v-if=\"impersonate && canImpersonate\"\n :disabled=\"!item.enabled\"\n class=\"ml-1\"\n icon=\"mdi-account-switch\"\n :aria-label=\"t('common.anzuUser.table.impersonate')\"\n size=\"x-small\"\n variant=\"text\"\n data-cy=\"user-impersonate\"\n @click.stop=\"impersonate(item)\"\n />\n <slot\n name=\"rowActions\"\n :user=\"item\"\n />\n </div>\n </template>\n <template #bottom>\n <ADatatablePagination @change=\"getList\" />\n </template>\n </VDataTableServer>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GA4KMmF,IAAqB,W;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAzI3B,IAAMK,IAAQH,GAwDRI,KAAOF,GAKP,EAAEG,SAAMpC,GAAQ,GAChB,EAAEqC,iBAAcC,kBAAenB,EAAsBe,EAAM,QAAQA,EAAM,YAAY;EAC3F3C,EAAQqB,GAAiByB,CAAY,GACrC9C,EAAQsB,GAAeyB,CAAU;EAEjC,IAAM,EAAEC,uBAAmBC,wBAAoBC,iBAAcC,yBAAqBC,+BAChF3B,EAAmB;GACjB,QAAQkB,EAAM;GACd,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,CAAC,GAIG,EAAEU,4BAAwBxB,EAA2B;GACzD,QAAQc,EAAM;GACd,QAAQA,EAAM;EAChB,CAAC,GAQK,EAAEW,iCAA6BC,iCAA6BC,iCAChE1B,EAA0B;GACxB,QAAQa,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,CAAC,GAEG,EAAEc,iBAAaC,kBAAcC,0BAAsBxC,GAAiB4B,GAAYD,GAAc,EAClG,0BAA0BnB,EAAyBgB,EAAM,MAAM,EACjE,CAAC,GAEK,EAAEiB,kBAAerC,EAAA,IAAwB;EAC/CvB,EAAQoB,IAAwBwC,CAAU;EAE1C,IAAM,EAAEC,mBAAgBC,gBAAYC,qBAAkB7C,GACpD;GACE,EAAE,KAAK,KAAK;GACZ,EAAE,KAAK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rB,OAAM;KACN,MAAK;KACJ,cAAYpH,EAAAqF,CAAA,CAAC,CAAA,sBAAA;KACd,MAAK;KACL,SAAQ;;IAGFL,EAAA,aADRpF,EAAA,GAAAkB,EAQEO,GAAA;;KANC,IAAI2D,EAAA,UAAUoC,CAAI;KACnB,OAAM;KACN,MAAK;KACJ,cAAYpH,EAAAqF,CAAA,CAAC,CAAA,oBAAA;KACd,MAAK;KACL,SAAQ;;IAIFL,EAAA,eAAeA,EAAA,kBADvBpF,EAAA,GAAAkB,EAUEO,GAAA;;KARC,UAAQ,CAAG+F,EAAK;KACjB,OAAM;KACN,MAAK;KACJ,cAAYpH,EAAAqF,CAAA,CAAC,CAAA,mCAAA;KACd,MAAK;KACL,SAAQ;KACR,WAAQ;KACP,SAAK/D,IAAAiG,MAAOvC,EAAA,YAAYoC,CAAI,GAAA,CAAA,MAAA,CAAA;;;;;;IAE/BhH,EAGEiH,EAAA,QAAA,cAAA,EADC,MAAMD,EAAI,CAAA;;GAIN,QAAMjH,QAC2B,CAA1CL,EAA0CyB,IAAA,EAAnB,UAAQvB,EAAAyG,CAAA,EAAO,GAAA,MAAA,GAAA,CAAA,UAAA,CAAA,C;;E,IAxErBvG,EAAA0G,GAAA,QAAVJ,O;GAEE,MAAA,QAAAA;GAET,IAAArG,GAIE,EANqBiH,cAAI,CAE3BhH,EAIEiH,EAAA,QAAA,iBAAA;IAFSb;IACR,MAAMY"}
|
|
1
|
+
{"version":3,"file":"AAnzuUserDatatable.vue.js","names":["$slots","_openBlock","_createElementBlock","_createVNode","AAnzuUserFilter","_unref","_isRef","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createElementVNode","_component_VSpacer","ADatatableOrdering","ADatatableConfigButton","_component_VDataTableServer","ABooleanValue","_Fragment","_createBlock","_component_VChip","_createTextVNode","_toDisplayString","ACachedChip","ADatetime","ATableCopyIdButton","_component_VBtn","_withModifiers","ADatatablePagination","Fragment","computed","createBlock","createCommentVNode","createElementBlock","createElementVNode","createSlots","createTextVNode","createVNode","defineComponent","guardReactiveProps","isRef","normalizeProps","onBeforeUnmount","onMounted","openBlock","provide","renderList","renderSlot","toDisplayString","unref","useSlots","watch","withCtx","withModifiers","useI18n","useDebounceFn","ABooleanValue_default","ADatatableConfigButton_default","ADatetime_default","ATableCopyIdButton_default","ACachedChip_default","ADatatableOrdering_default","ADatatablePagination_default","createDatatableColumnsConfig","useFilterHelpers","DatatablePaginationKey","FilterConfigKey","FilterDataKey","usePagination","AAnzuUserFilter_default","useAnzuUserActions","ANZU_USER_ENTITY","anzuUserFilterStorageKey","useAnzuUserListFilter","usePermissionConfigActions","useCachedPermissionGroups","PERMISSION_GROUP_ENDPOINT","VBtn","VChip","VDataTableServer","VSpacer","_hoisted_1","_hoisted_2","FILTER_SLOT_PREFIX","AAnzuUserDatatable_vue_vue_type_script_setup_true_lang_default","__props","__expose","__emit","props","emit","t","filterConfig","filterData","fetchAnzuUserList","cancelAnzuUserList","anzuUserList","loadingAnzuUserList","datatableHiddenColumns","translatePermission","addToCachedPermissionGroups","fetchCachedPermissionGroups","getCachedPermissionGroup","resetFilter","submitFilter","loadStoredFilters","pagination","columnsVisible","columnsAll","columnsHidden","column","getList","users","user","systemColumnKeys","slots","filterSlotNames","name","submitFilterAction","resetFilterAction","onRowClick","_event","item","_ctx","_cache","$event","slotProps","role","permissionGroupId"],"sources":["../../../../src/domains/anzuUser/components/AAnzuUserDatatable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, onBeforeUnmount, onMounted, provide, useSlots, watch } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\nimport type { AxiosInstance } from 'axios'\nimport { useDebounceFn } from '@vueuse/core'\nimport ABooleanValue from '@/domains/ui/components/ABooleanValue.vue'\nimport ADatatableConfigButton from '@/domains/filters/datatable/components/ADatatableConfigButton.vue'\nimport ADatetime from '@/domains/ui/datetime/components/ADatetime.vue'\nimport ATableCopyIdButton from '@/domains/ui/buttons/table/components/ATableCopyIdButton.vue'\nimport ACachedChip from '@/domains/cached/components/ACachedChip.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport ADatatableOrdering from '@/domains/filters/datatable/components/ADatatableOrdering.vue'\nimport ADatatablePagination from '@/domains/filters/datatable/components/ADatatablePagination.vue'\nimport { createDatatableColumnsConfig } from '@/domains/filters/datatable/composables/createDatatableColumnsConfig'\nimport {\n useFilterHelpers,\n type FilterStoreIdentifier,\n type MakeFilterOption,\n} from '@/domains/filters/composables/filterFactory'\nimport { DatatablePaginationKey, FilterConfigKey, FilterDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport AAnzuUserFilter from '@/domains/anzuUser/components/AAnzuUserFilter.vue'\nimport { useAnzuUserActions } from '@/domains/anzuUser/composables/anzuUserActions'\nimport { ANZU_USER_ENTITY } from '@/domains/anzuUser/api/anzuUserApi'\nimport { anzuUserFilterStorageKey, useAnzuUserListFilter } from '@/domains/anzuUser/filter/anzuUserFilter'\nimport { usePermissionConfigActions } from '@/domains/permission/config/composables/permissionConfigActions'\nimport { useCachedPermissionGroups } from '@/domains/permission/group/composables/cachedPermissionGroups'\nimport { PERMISSION_GROUP_ENDPOINT } from '@/domains/permission/group/api/permissionGroupApi'\nimport type { AnzuUser } from '@/shared/types/AnzuUser'\nimport type { IntegerIdNullable } from '@/shared/types/common'\n\ntype DatatableItem = AnzuUser\n\nconst props = withDefaults(\n defineProps<{\n client: AxiosClientFn\n system: string\n entity?: string | undefined\n endPoint?: string | undefined\n detailRoute: (user: AnzuUser) => RouteLocationRaw\n editRoute: (user: AnzuUser) => RouteLocationRaw\n /** Already-evaluated ACL of the owning system. */\n canUpdate?: boolean\n /** The permission-group endpoint, which is not the user one. */\n permissionGroupEndPoint?: string\n /**\n * Extra columns the app draws through `#systemColumns`, appended after the shared ones.\n * A bare key takes its header from `common.anzuUser.model.*`, which has\n * no system keys. So a system column passes its title already translated.\n */\n systemColumns?: Array<string | { key: string; title: string }>\n /**\n * Optional impersonation. Left unset, nothing is drawn.\n * A callback rather than a path, because the mechanisms differ: cms posts to `/adm/users/{id}/impersonate` and\n * gets a JWT, blog opens the public site with `window.open`. Only the cms one reaches this shared component.\n */\n impersonate?: ((user: AnzuUser) => void) | undefined\n canImpersonate?: boolean\n /** What \"Most recent\" and \"Oldest\" sort by; dam's ids come from the SSO, not in creation order. */\n orderingVariant?: 'id' | 'createdAt'\n /**\n * Filter fields this system adds to the shared three.\n * Not shared: each system adds its own fields and picks its groups (`memberOf`) from its own backend.\n * A plain field is drawn by the generic renderer. A field that\n * needs a remote autocomplete comes in through `#filter.<name>`.\n */\n filterFields?: readonly MakeFilterOption[]\n /**\n * Saved filters are stored per user, so both props are needed for the button to appear. Only cms and dam use them.\n */\n filterClient?: (() => AxiosInstance) | undefined\n filterUserId?: IntegerIdNullable | undefined\n /** Where the filter files its saved bookmarks. */\n filterStore?: FilterStoreIdentifier | undefined\n }>(),\n {\n entity: undefined,\n endPoint: undefined,\n permissionGroupEndPoint: PERMISSION_GROUP_ENDPOINT,\n canUpdate: false,\n systemColumns: () => [],\n impersonate: undefined,\n canImpersonate: false,\n orderingVariant: 'id',\n filterFields: () => [],\n filterClient: undefined,\n filterUserId: undefined,\n filterStore: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'rowClick', user: AnzuUser): void\n}>()\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { t } = useI18n()\nconst { filterConfig, filterData } = useAnzuUserListFilter(props.system, props.filterFields)\nprovide(FilterConfigKey, filterConfig)\nprovide(FilterDataKey, filterData)\n\nconst { fetchAnzuUserList, cancelAnzuUserList, anzuUserList, loadingAnzuUserList, datatableHiddenColumns } =\n useAnzuUserActions({\n client: props.client,\n system: props.system,\n entity: props.entity,\n endPoint: props.endPoint,\n })\n\n// No `entity` here on purpose: this one reads the permission config, which is its own resource.\n// `props.entity` names the user.\nconst { translatePermission } = usePermissionConfigActions({\n client: props.client,\n system: props.system,\n})\n\n/**\n * Group titles for the column, resolved against this system's own cache.\n * Drawn here rather than left to a slot, so the column is not left empty in every app.\n * The cache is keyed per system because the same id is a different group in each backend.\n * An app can still override the chip through the slot.\n */\nconst { addToCachedPermissionGroups, fetchCachedPermissionGroups, getCachedPermissionGroup } =\n useCachedPermissionGroups({\n client: props.client,\n system: props.system,\n endPoint: props.permissionGroupEndPoint,\n })\n\nconst { resetFilter, submitFilter, loadStoredFilters } = useFilterHelpers(filterData, filterConfig, {\n storeFiltersLocalStorage: anzuUserFilterStorageKey(props.system),\n})\n\nconst { pagination } = usePagination(props.orderingVariant)\nprovide(DatatablePaginationKey, pagination)\n\nconst { columnsVisible, columnsAll, columnsHidden } = createDatatableColumnsConfig(\n [\n { key: 'id' },\n { key: 'email' },\n { key: 'enabled' },\n { key: 'roles' },\n { key: 'permissionGroups' },\n { key: 'permissions' },\n ...props.systemColumns.map((column) => (typeof column === 'string' ? { key: column } : column)),\n { key: 'createdAt' },\n { key: 'modifiedAt' },\n ],\n datatableHiddenColumns,\n 'common',\n ANZU_USER_ENTITY,\n { storeColumnsLocalStorage: `table_common_anzuUser_${props.system}` }\n)\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst getList = useDebounceFn(async () => {\n await fetchAnzuUserList(pagination, filterData, filterConfig)\n})\n\nwatch(anzuUserList, (users) => {\n users.forEach((user) => addToCachedPermissionGroups(user.permissionGroups))\n void fetchCachedPermissionGroups()\n})\n\nconst systemColumnKeys = computed(() =>\n props.systemColumns.map((column) => (typeof column === 'string' ? column : column.key))\n)\n\n// `#filter.allowedSites` here becomes `#item.allowedSites` inside the\n// filter. That is the name `AFilterWrapper` renders a field's widget under.\n// The prefix keeps field slots apart from this table's own `item.*` columns.\nconst slots = useSlots()\nconst FILTER_SLOT_PREFIX = 'filter.'\nconst filterSlotNames = computed(() =>\n Object.keys(slots)\n .filter((name) => name.startsWith(FILTER_SLOT_PREFIX))\n .map((name) => name.slice(FILTER_SLOT_PREFIX.length))\n)\n\nconst submitFilterAction = () => submitFilter(pagination, getList)\nconst resetFilterAction = () => resetFilter(pagination, getList)\n\nconst onRowClick = (_event: unknown, { item }: { item: DatatableItem }) => {\n if (item.id) emit('rowClick', item)\n}\n\nonMounted(() => {\n loadStoredFilters(pagination, getList)\n})\n\nonBeforeUnmount(() => {\n getList.cancel()\n cancelAnzuUserList()\n})\n\ndefineExpose({\n refresh: getList,\n resetFilter: resetFilterAction,\n submitFilter: submitFilterAction,\n})\n</script>\n\n<template>\n <div>\n <AAnzuUserFilter\n v-model:datatable-hidden-columns=\"columnsHidden\"\n :client=\"filterClient\"\n :user-id=\"filterUserId\"\n :store=\"filterStore\"\n @submit=\"submitFilterAction\"\n @reset=\"resetFilterAction\"\n >\n <template\n v-for=\"name in filterSlotNames\"\n :key=\"name\"\n #[`item.${name}`]=\"slotProps\"\n >\n <slot\n :name=\"`${FILTER_SLOT_PREFIX}${name}`\"\n v-bind=\"slotProps ?? {}\"\n />\n </template>\n </AAnzuUserFilter>\n <div>\n <div class=\"d-flex align-center\">\n <VSpacer />\n <ADatatableOrdering\n :variant=\"orderingVariant\"\n @sort-by-change=\"submitFilterAction\"\n />\n <ADatatableConfigButton\n v-model:columns-hidden=\"columnsHidden\"\n :columns-all=\"columnsAll\"\n />\n </div>\n <VDataTableServer\n class=\"a-datatable\"\n :headers=\"columnsVisible\"\n :items=\"anzuUserList\"\n :items-length=\"anzuUserList.length\"\n :loading=\"loadingAnzuUserList\"\n item-value=\"id\"\n @click:row=\"onRowClick\"\n >\n <template #item.enabled=\"{ item }: { item: DatatableItem }\">\n <ABooleanValue\n chip\n :value=\"item.enabled\"\n />\n </template>\n <template #item.roles=\"{ item }: { item: DatatableItem }\">\n <VChip\n v-for=\"role in item.roles\"\n :key=\"role\"\n class=\"mr-1 mb-1\"\n >\n {{ translatePermission('roles', role) }}\n </VChip>\n </template>\n <template #item.permissionGroups=\"{ item }: { item: DatatableItem }\">\n <slot\n name=\"permissionGroups\"\n :ids=\"item.permissionGroups\"\n >\n <ACachedChip\n v-for=\"permissionGroupId in item.permissionGroups\"\n :id=\"permissionGroupId\"\n :key=\"permissionGroupId\"\n container-class=\"d-inline-flex mr-1 mb-1\"\n :get-cached-fn=\"getCachedPermissionGroup\"\n display-text-path=\"title\"\n route=\"\"\n disable-click\n />\n </slot>\n </template>\n <template #item.permissions=\"{ item }: { item: DatatableItem }\">\n <VChip>{{ Object.keys(item.permissions).length }}</VChip>\n </template>\n <template\n v-for=\"column in systemColumnKeys\"\n :key=\"column\"\n #[`item.${column}`]=\"{ item }: { item: DatatableItem }\"\n >\n <slot\n name=\"systemColumns\"\n :column=\"column\"\n :user=\"item\"\n />\n </template>\n <template #item.createdAt=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.createdAt\" />\n <template v-if=\"$slots.createdBy\">\n <br />\n <slot\n :id=\"item.createdBy\"\n name=\"createdBy\"\n />\n </template>\n </template>\n <template #item.modifiedAt=\"{ item }: { item: DatatableItem }\">\n <ADatetime :date-time=\"item.modifiedAt\" />\n <template v-if=\"$slots.modifiedBy\">\n <br />\n <slot\n :id=\"item.modifiedBy\"\n name=\"modifiedBy\"\n />\n </template>\n </template>\n <template #item.actions=\"{ item }: { item: DatatableItem }\">\n <div\n v-if=\"item.id\"\n class=\"d-flex justify-end\"\n >\n <ATableCopyIdButton :id=\"item.id\" />\n <VBtn\n :to=\"detailRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-information-outline\"\n :aria-label=\"t('common.button.detail')\"\n size=\"x-small\"\n variant=\"text\"\n />\n <VBtn\n v-if=\"canUpdate\"\n :to=\"editRoute(item)\"\n class=\"ml-1\"\n icon=\"mdi-pencil\"\n :aria-label=\"t('common.button.edit')\"\n size=\"x-small\"\n variant=\"text\"\n />\n <!-- A disabled account cannot sign in, so it cannot be signed in as either. -->\n <VBtn\n v-if=\"impersonate && canImpersonate\"\n :disabled=\"!item.enabled\"\n class=\"ml-1\"\n icon=\"mdi-account-switch\"\n :aria-label=\"t('common.anzuUser.table.impersonate')\"\n size=\"x-small\"\n variant=\"text\"\n data-cy=\"user-impersonate\"\n @click.stop=\"impersonate(item)\"\n />\n <slot\n name=\"rowActions\"\n :user=\"item\"\n />\n </div>\n </template>\n <template #bottom>\n <ADatatablePagination @change=\"getList\" />\n </template>\n </VDataTableServer>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GA6KMmF,IAAqB,W;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3I3B,IAAMK,IAAQH,GA0DRI,KAAOF,GAKP,EAAEG,SAAMpC,GAAQ,GAChB,EAAEqC,iBAAcC,kBAAenB,EAAsBe,EAAM,QAAQA,EAAM,YAAY;EAC3F3C,EAAQqB,GAAiByB,CAAY,GACrC9C,EAAQsB,GAAeyB,CAAU;EAEjC,IAAM,EAAEC,uBAAmBC,wBAAoBC,iBAAcC,yBAAqBC,+BAChF3B,EAAmB;GACjB,QAAQkB,EAAM;GACd,QAAQA,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,CAAC,GAIG,EAAEU,4BAAwBxB,EAA2B;GACzD,QAAQc,EAAM;GACd,QAAQA,EAAM;EAChB,CAAC,GAQK,EAAEW,iCAA6BC,iCAA6BC,iCAChE1B,EAA0B;GACxB,QAAQa,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,CAAC,GAEG,EAAEc,iBAAaC,kBAAcC,0BAAsBxC,GAAiB4B,GAAYD,GAAc,EAClG,0BAA0BnB,EAAyBgB,EAAM,MAAM,EACjE,CAAC,GAEK,EAAEiB,kBAAerC,EAAcoB,EAAM,eAAe;EAC1D3C,EAAQoB,IAAwBwC,CAAU;EAE1C,IAAM,EAAEC,mBAAgBC,gBAAYC,qBAAkB7C,GACpD;GACE,EAAE,KAAK,KAAK;GACZ,EAAE,KAAK,QAAQ;GACf,EAAE,KAAK,UAAU;GACjB,EAAE,KAAK,QAAQ;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AAC,CAAA,sBAAA;KACd,MAAK;KACL,SAAQ;;IAGFL,EAAA,aADRpF,EAAA,GAAAkB,EAQEO,GAAA;;KANC,IAAI2D,EAAA,UAAUoC,CAAI;KACnB,OAAM;KACN,MAAK;KACJ,cAAYpH,EAAAqF,CAAA,CAAC,CAAA,oBAAA;KACd,MAAK;KACL,SAAQ;;IAIFL,EAAA,eAAeA,EAAA,kBADvBpF,EAAA,GAAAkB,EAUEO,GAAA;;KARC,UAAQ,CAAG+F,EAAK;KACjB,OAAM;KACN,MAAK;KACJ,cAAYpH,EAAAqF,CAAA,CAAC,CAAA,mCAAA;KACd,MAAK;KACL,SAAQ;KACR,WAAQ;KACP,SAAK/D,IAAAiG,MAAOvC,EAAA,YAAYoC,CAAI,GAAA,CAAA,MAAA,CAAA;;;;;;IAE/BhH,EAGEiH,EAAA,QAAA,cAAA,EADC,MAAMD,EAAI,CAAA;;GAIN,QAAMjH,QAC2B,CAA1CL,EAA0CyB,IAAA,EAAnB,UAAQvB,EAAAyG,CAAA,EAAO,GAAA,MAAA,GAAA,CAAA,UAAA,CAAA,C;;E,IAxErBvG,EAAA0G,GAAA,QAAVJ,O;GAEE,MAAA,QAAAA;GAET,IAAArG,GAIE,EANqBiH,cAAI,CAE3BhH,EAIEiH,EAAA,QAAA,iBAAA;IAFSb;IACR,MAAMY"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosClientFn } from '../../api/utils/client';
|
|
2
2
|
import { AnzuUser } from '../../../shared/types/AnzuUser';
|
|
3
|
+
import { UserIdInput } from '../composables/userSystemDescriptor';
|
|
3
4
|
type __VLS_Props = {
|
|
4
5
|
client: AxiosClientFn;
|
|
5
6
|
system: string;
|
|
@@ -17,7 +18,7 @@ type __VLS_Props = {
|
|
|
17
18
|
isEdit?: boolean;
|
|
18
19
|
/** From the system's descriptor. */
|
|
19
20
|
requiredMetadata?: boolean;
|
|
20
|
-
idInput?:
|
|
21
|
+
idInput?: UserIdInput;
|
|
21
22
|
randomColor?: boolean;
|
|
22
23
|
enabledNote?: string | undefined;
|
|
23
24
|
metadataNote?: string | undefined;
|
|
@@ -50,7 +51,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
50
51
|
isEdit: boolean;
|
|
51
52
|
randomColor: boolean;
|
|
52
53
|
permissionGroupEndPoint: string;
|
|
53
|
-
idInput:
|
|
54
|
+
idInput: UserIdInput;
|
|
54
55
|
requiredMetadata: boolean;
|
|
55
56
|
enabledNote: string;
|
|
56
57
|
metadataNote: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AAnzuUserForm.vue.js","names":["$slots","_useModel","_openBlock","_createBlock","ASystemEntityScope","_unref","_withCtx","_createVNode","_component_VRow","_component_VCol","AUserEnabledSwitch","AUserMetadataForm","_renderSlot","AAnzuUserRoleAutocomplete","APermissionGroupRemoteAutocomplete","APermissionEditor","computed","createBlock","createCommentVNode","createVNode","defineComponent","mergeModels","openBlock","renderSlot","unref","useModel","withCtx","useI18n","ASystemEntityScope_default","AUserEnabledSwitch_default","AUserMetadataForm_default","AAnzuUserRoleAutocomplete_default","ANZU_USER_ENTITY","APermissionEditor_default","usePermissionActions","APermissionGroupRemoteAutocomplete_default","PERMISSION_GROUP_ENDPOINT","VCol","VRow","AAnzuUserForm_vue_vue_type_script_setup_true_lang_default","\"user\"","\"userModifiers\"","__props","props","user","t","resolvePermissions","resolvedPermissions","_ctx","_cache","$event"],"sources":["../../../../src/domains/anzuUser/components/AAnzuUserForm.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport AUserEnabledSwitch from '@/domains/anzuUser/components/AUserEnabledSwitch.vue'\nimport AUserMetadataForm from '@/domains/anzuUser/components/AUserMetadataForm.vue'\nimport AAnzuUserRoleAutocomplete from '@/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue'\nimport { ANZU_USER_ENTITY } from '@/domains/anzuUser/api/anzuUserApi'\nimport APermissionEditor from '@/domains/permission/components/APermissionEditor.vue'\nimport { usePermissionActions } from '@/domains/permission/composables/permissionActions'\nimport APermissionGroupRemoteAutocomplete from '@/domains/permission/group/components/APermissionGroupRemoteAutocomplete.vue'\nimport { PERMISSION_GROUP_ENDPOINT } from '@/domains/permission/group/api/permissionGroupApi'\nimport type { AnzuUser } from '@/shared/types/AnzuUser'\n\nconst props = withDefaults(\n defineProps<{\n client: AxiosClientFn\n system: string\n /**\n * The permission-group endpoint, which is not the user one.\n * There is deliberately no `entity` prop. `entity` names the resource that server validation\n * errors are filed under. Passing the user's down would file group errors under user labels.\n */\n permissionGroupEndPoint?: string\n /**\n * One component for detail and edit (decision 27). Two components drift:\n * a field added to one and forgotten in the other fails silently.\n */\n readonly?: boolean\n isEdit?: boolean\n /** From the system's descriptor. */\n requiredMetadata?: boolean\n idInput?:
|
|
1
|
+
{"version":3,"file":"AAnzuUserForm.vue.js","names":["$slots","_useModel","_openBlock","_createBlock","ASystemEntityScope","_unref","_withCtx","_createVNode","_component_VRow","_component_VCol","AUserEnabledSwitch","AUserMetadataForm","_renderSlot","AAnzuUserRoleAutocomplete","APermissionGroupRemoteAutocomplete","APermissionEditor","computed","createBlock","createCommentVNode","createVNode","defineComponent","mergeModels","openBlock","renderSlot","unref","useModel","withCtx","useI18n","ASystemEntityScope_default","AUserEnabledSwitch_default","AUserMetadataForm_default","AAnzuUserRoleAutocomplete_default","ANZU_USER_ENTITY","APermissionEditor_default","usePermissionActions","APermissionGroupRemoteAutocomplete_default","PERMISSION_GROUP_ENDPOINT","VCol","VRow","AAnzuUserForm_vue_vue_type_script_setup_true_lang_default","\"user\"","\"userModifiers\"","__props","props","user","t","resolvePermissions","resolvedPermissions","_ctx","_cache","$event"],"sources":["../../../../src/domains/anzuUser/components/AAnzuUserForm.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport AUserEnabledSwitch from '@/domains/anzuUser/components/AUserEnabledSwitch.vue'\nimport AUserMetadataForm from '@/domains/anzuUser/components/AUserMetadataForm.vue'\nimport AAnzuUserRoleAutocomplete from '@/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue'\nimport { ANZU_USER_ENTITY } from '@/domains/anzuUser/api/anzuUserApi'\nimport APermissionEditor from '@/domains/permission/components/APermissionEditor.vue'\nimport { usePermissionActions } from '@/domains/permission/composables/permissionActions'\nimport APermissionGroupRemoteAutocomplete from '@/domains/permission/group/components/APermissionGroupRemoteAutocomplete.vue'\nimport { PERMISSION_GROUP_ENDPOINT } from '@/domains/permission/group/api/permissionGroupApi'\nimport type { AnzuUser } from '@/shared/types/AnzuUser'\nimport type { UserIdInput } from '@/domains/anzuUser/composables/userSystemDescriptor'\n\nconst props = withDefaults(\n defineProps<{\n client: AxiosClientFn\n system: string\n /**\n * The permission-group endpoint, which is not the user one.\n * There is deliberately no `entity` prop. `entity` names the resource that server validation\n * errors are filed under. Passing the user's down would file group errors under user labels.\n */\n permissionGroupEndPoint?: string\n /**\n * One component for detail and edit (decision 27). Two components drift:\n * a field added to one and forgotten in the other fails silently.\n */\n readonly?: boolean\n isEdit?: boolean\n /** From the system's descriptor. */\n requiredMetadata?: boolean\n idInput?: UserIdInput\n randomColor?: boolean\n enabledNote?: string | undefined\n metadataNote?: string | undefined\n }>(),\n {\n permissionGroupEndPoint: PERMISSION_GROUP_ENDPOINT,\n readonly: false,\n isEdit: false,\n requiredMetadata: false,\n idInput: true,\n randomColor: false,\n enabledNote: undefined,\n metadataNote: undefined,\n }\n)\n\nconst user = defineModel<AnzuUser>('user', { required: true })\n\nconst { t } = useI18n()\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { resolvePermissions } = usePermissionActions({\n client: props.client,\n system: props.system,\n endPoint: props.permissionGroupEndPoint,\n})\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\n/**\n * Grants the account would have if saved now: those of the ticked groups plus the user's own.\n * Computed locally so ticking a group shows its effect without a round\n * trip. The server's `resolvedPermissions` reflects the record as loaded.\n */\nconst resolvedPermissions = computed(() => resolvePermissions(user.value))\n</script>\n\n<template>\n <ASystemEntityScope\n system=\"common\"\n :subject=\"ANZU_USER_ENTITY\"\n >\n <VRow>\n <VCol cols=\"12\">\n <AUserEnabledSwitch\n v-model=\"user.enabled\"\n :readonly=\"readonly\"\n :note=\"enabledNote\"\n />\n </VCol>\n <VCol cols=\"12\">\n <AUserMetadataForm\n v-model:user=\"user\"\n :required=\"requiredMetadata\"\n :id-input=\"idInput\"\n :is-edit=\"isEdit\"\n :readonly=\"readonly\"\n :random-color=\"randomColor\"\n :note=\"metadataNote\"\n />\n </VCol>\n <VCol\n v-if=\"isEdit && !readonly && $slots.copyPermissions\"\n cols=\"12\"\n >\n <!-- Copying roles and grants from another account. Only cms offers it today. -->\n <slot name=\"copyPermissions\" />\n </VCol>\n <VCol\n v-if=\"$slots.systemFields\"\n cols=\"12\"\n >\n <!--\n The system's own fields: autocompletes over that backend's entities, which the library\n cannot build. They get the same `readonly`, so the app can swap autocompletes for chips.\n -->\n <slot\n name=\"systemFields\"\n :readonly=\"readonly\"\n :is-edit=\"isEdit\"\n />\n </VCol>\n <VCol cols=\"12\">\n <AAnzuUserRoleAutocomplete\n v-model=\"user.roles\"\n :client=\"client\"\n :system=\"system\"\n :readonly=\"readonly\"\n />\n </VCol>\n <VCol cols=\"12\">\n <APermissionGroupRemoteAutocomplete\n v-model=\"user.permissionGroups\"\n :client=\"client\"\n :system=\"system\"\n :end-point=\"permissionGroupEndPoint\"\n :label=\"t('common.anzuUser.model.permissionGroups')\"\n :readonly=\"readonly\"\n multiple\n clearable\n />\n </VCol>\n <VCol\n v-if=\"$slots.actions\"\n cols=\"12\"\n >\n <slot\n name=\"actions\"\n :user=\"user\"\n />\n </VCol>\n <VCol cols=\"12\">\n <APermissionEditor\n v-model=\"user.permissions\"\n :resolved-permissions=\"resolvedPermissions\"\n :roles=\"user.roles\"\n :client=\"client\"\n :system=\"system\"\n :readonly=\"readonly\"\n />\n </VCol>\n </VRow>\n </ASystemEntityScope>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,IAAM2C,IAAQD,GAmCRE,IAAO3C,EAAqByC,GAAC,MAA0B,GAEvD,EAAEG,SAAMlB,EAAQ,GAGhB,EAAEmB,0BAAuBZ,EAAqB;GAClD,QAAQS,EAAM;GACd,QAAQA,EAAM;GACd,UAAUA,EAAM;EAClB,CAAC,GAQKI,IAAsB/B,QAAe8B,EAAmBF,EAAK,KAAK,CAAC;E,kBAIvE1C,EAAA,GAAAC,EAoFqBC,GAAA;GAnFnB,QAAO;GACN,SAASC,EAAA2B,CAAA;;GAEV,SAAA1B,QA+EO,CA/EPC,EA+EOC,GAAA,MAAA;IA9EL,SAAAF,QAMO;KANPC,EAMOE,GAAA,EAND,MAAK,KAAI,GAAA;MACb,SAAAH,QAIE,CAJFC,EAIEG,GAAA;OAHS,YAAAkC,EAAA,MAAK;OAAL,uBAAAK,EAAA,QAAAC,MAAAN,EAAA,MAAK,UAAOM;OACpB,UAAUR,EAAA;OACV,MAAMA,EAAA;;;;;;;;KAGXnC,EAUOE,GAAA,EAVD,MAAK,KAAI,GAAA;MACb,SAAAH,QAQE,CARFC,EAQEI,GAAA;OAPQ,MAAMiC,EAAA;OAAA,iBAAAK,EAAA,QAAAC,MAAAN,EAAI,QAAAM;OACjB,UAAUR,EAAA;OACV,YAAUA,EAAA;OACV,WAASA,EAAA;OACT,UAAUA,EAAA;OACV,gBAAcA,EAAA;OACd,MAAMA,EAAA;;;;;;;;;;;;KAIHA,EAAA,UAAM,CAAKA,EAAA,YAAY1C,EAAAA,OAAO,mBADtCE,EA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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseUser } from '../../../shared/types/AnzuUser';
|
|
2
|
+
import { UserIdInput } from '../composables/userSystemDescriptor';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/**
|
|
4
5
|
* The system's validation profile (`requiredMetadata`).
|
|
@@ -7,10 +8,10 @@ type __VLS_Props = {
|
|
|
7
8
|
*/
|
|
8
9
|
required?: boolean;
|
|
9
10
|
/**
|
|
10
|
-
* Whether the id is entered at all
|
|
11
|
-
*
|
|
11
|
+
* Whether the id is entered at all; see `UserIdInput`. With `isEdit` this gives states that `readonly` alone
|
|
12
|
+
* cannot: not drawn, editable, or read-only.
|
|
12
13
|
*/
|
|
13
|
-
idInput?:
|
|
14
|
+
idInput?: UserIdInput;
|
|
14
15
|
isEdit?: boolean;
|
|
15
16
|
readonly?: boolean;
|
|
16
17
|
/**
|
|
@@ -42,7 +43,7 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
42
43
|
isEdit: boolean;
|
|
43
44
|
randomColor: boolean;
|
|
44
45
|
validationScope: string | false | symbol;
|
|
45
|
-
idInput:
|
|
46
|
+
idInput: UserIdInput;
|
|
46
47
|
scopeSystem: string;
|
|
47
48
|
scopeSubject: string;
|
|
48
49
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { ANZU_USER_ENTITY as
|
|
9
|
-
import { useUserMetadataValidation as
|
|
10
|
-
import { VAlert as
|
|
11
|
-
import { VCol as
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, onMounted as c, openBlock as l, ref as u, toDisplayString as d, unref as f, useModel as p, watch as m, withCtx as h } from "vue";
|
|
2
|
+
import { useI18n as g } from "vue-i18n";
|
|
3
|
+
import _ from "../../ui/components/AAvatarColorPicker3.vue.js";
|
|
4
|
+
import v from "../../ui/components/ACopyText3.vue.js";
|
|
5
|
+
import y from "../../ui/components/ARow2.vue.js";
|
|
6
|
+
import b from "../../form/components/AFormTextField2.vue.js";
|
|
7
|
+
import x from "../../form/components/ASystemEntityScope2.vue.js";
|
|
8
|
+
import { ANZU_USER_ENTITY as S } from "../api/anzuUserApi.js";
|
|
9
|
+
import { useUserMetadataValidation as C } from "../composables/anzuUserValidations.js";
|
|
10
|
+
import { VAlert as w } from "vuetify/components/VAlert";
|
|
11
|
+
import { VCol as T, VRow as E } from "vuetify/components/VGrid";
|
|
12
12
|
// src/domains/anzuUser/components/AUserMetadataForm.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
-
var
|
|
13
|
+
var D = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "text-error text-body-small"
|
|
16
|
-
},
|
|
16
|
+
}, O = /*@__PURE__*/ o({
|
|
17
17
|
__name: "AUserMetadataForm",
|
|
18
|
-
props: /*@__PURE__*/
|
|
18
|
+
props: /*@__PURE__*/ s({
|
|
19
19
|
required: {
|
|
20
20
|
type: Boolean,
|
|
21
21
|
default: !1
|
|
22
22
|
},
|
|
23
23
|
idInput: {
|
|
24
|
-
type: Boolean,
|
|
24
|
+
type: [Boolean, String],
|
|
25
25
|
default: !0
|
|
26
26
|
},
|
|
27
27
|
isEdit: {
|
|
@@ -38,7 +38,7 @@ var E = {
|
|
|
38
38
|
},
|
|
39
39
|
note: { default: void 0 },
|
|
40
40
|
scopeSystem: { default: "common" },
|
|
41
|
-
scopeSubject: { default:
|
|
41
|
+
scopeSubject: { default: S },
|
|
42
42
|
validationScope: {
|
|
43
43
|
type: [
|
|
44
44
|
String,
|
|
@@ -52,138 +52,143 @@ var E = {
|
|
|
52
52
|
userModifiers: {}
|
|
53
53
|
}),
|
|
54
54
|
emits: ["update:user"],
|
|
55
|
-
setup(
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}), k = ()
|
|
62
|
-
|
|
55
|
+
setup(o) {
|
|
56
|
+
let s = o, S = p(o, "user"), O = e({
|
|
57
|
+
get: () => S.value.id,
|
|
58
|
+
set: (e) => {
|
|
59
|
+
S.value.id = e === "" ? null : e;
|
|
60
|
+
}
|
|
61
|
+
}), { t: k } = g(), { v$: A } = C(S, {
|
|
62
|
+
required: () => s.required,
|
|
63
|
+
idInput: () => s.idInput,
|
|
64
|
+
isEdit: () => s.isEdit,
|
|
65
|
+
scope: s.validationScope
|
|
66
|
+
}), j = () => {
|
|
67
|
+
let { firstName: e, lastName: t } = S.value.person;
|
|
63
68
|
return e.length === 0 || t.length === 0 ? "" : e + " " + t;
|
|
64
|
-
},
|
|
65
|
-
let { firstName: e, lastName: t } =
|
|
69
|
+
}, M = () => {
|
|
70
|
+
let { firstName: e, lastName: t } = S.value.person;
|
|
66
71
|
return e.length === 0 || t.length === 0 ? "" : e.slice(0, 1) + t.slice(0, 1);
|
|
67
|
-
},
|
|
68
|
-
|
|
72
|
+
}, N = u(!1), P = u(!1), F = () => {
|
|
73
|
+
N.value = S.value.person.fullName.length > 0 && S.value.person.fullName !== j(), P.value = S.value.avatar.text.length > 0 && S.value.avatar.text !== M();
|
|
69
74
|
};
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
}), (
|
|
73
|
-
system:
|
|
74
|
-
subject:
|
|
75
|
+
return c(F), m(() => S.value, () => F()), m(() => `${S.value.person.firstName}\u0000${S.value.person.lastName}`, (e, t) => {
|
|
76
|
+
s.readonly || e === t || (N.value || (S.value.person.fullName = j()), P.value || (S.value.avatar.text = M()));
|
|
77
|
+
}), (e, s) => (l(), t(x, {
|
|
78
|
+
system: o.scopeSystem,
|
|
79
|
+
subject: o.scopeSubject
|
|
75
80
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
default:
|
|
78
|
-
default:
|
|
79
|
-
|
|
81
|
+
default: h(() => [a(E, null, {
|
|
82
|
+
default: h(() => [a(T, { cols: "12" }, {
|
|
83
|
+
default: h(() => [
|
|
84
|
+
o.note ? (l(), t(w, {
|
|
80
85
|
key: 0,
|
|
81
86
|
type: "info",
|
|
82
87
|
variant: "tonal",
|
|
83
88
|
density: "compact",
|
|
84
89
|
class: "mb-4"
|
|
85
90
|
}, {
|
|
86
|
-
default:
|
|
91
|
+
default: h(() => [i(d(o.note), 1)]),
|
|
87
92
|
_: 1
|
|
88
|
-
})) :
|
|
89
|
-
|
|
90
|
-
default:
|
|
93
|
+
})) : n("", !0),
|
|
94
|
+
a(E, null, {
|
|
95
|
+
default: h(() => [a(T, {
|
|
91
96
|
cols: "12",
|
|
92
97
|
sm: "3"
|
|
93
98
|
}, {
|
|
94
|
-
default:
|
|
99
|
+
default: h(() => [o.idInput && !o.isEdit && !o.readonly ? (l(), t(b, {
|
|
95
100
|
key: 0,
|
|
96
|
-
modelValue:
|
|
97
|
-
"onUpdate:modelValue": s[0] ||= (e) =>
|
|
101
|
+
modelValue: O.value,
|
|
102
|
+
"onUpdate:modelValue": s[0] ||= (e) => O.value = e,
|
|
98
103
|
modelModifiers: { number: !0 },
|
|
99
104
|
type: "number",
|
|
100
|
-
v:
|
|
101
|
-
label:
|
|
102
|
-
hint:
|
|
105
|
+
v: f(A).user.id,
|
|
106
|
+
label: f(k)("common.anzuUser.model.id"),
|
|
107
|
+
hint: f(k)("common.anzuUser.hint.idReadonlyOnEdit"),
|
|
103
108
|
"persistent-hint": ""
|
|
104
109
|
}, null, 8, [
|
|
105
110
|
"modelValue",
|
|
106
111
|
"v",
|
|
107
112
|
"label",
|
|
108
113
|
"hint"
|
|
109
|
-
])) :
|
|
114
|
+
])) : S.value.id ? (l(), t(y, {
|
|
110
115
|
key: 1,
|
|
111
|
-
title:
|
|
116
|
+
title: f(k)("common.anzuUser.model.id")
|
|
112
117
|
}, {
|
|
113
|
-
default:
|
|
118
|
+
default: h(() => [a(v, { value: S.value.id }, null, 8, ["value"])]),
|
|
114
119
|
_: 1
|
|
115
|
-
}, 8, ["title"])) :
|
|
120
|
+
}, 8, ["title"])) : n("", !0)]),
|
|
116
121
|
_: 1
|
|
117
|
-
}),
|
|
122
|
+
}), a(T, {
|
|
118
123
|
cols: "12",
|
|
119
124
|
sm: "9"
|
|
120
125
|
}, {
|
|
121
|
-
default:
|
|
126
|
+
default: h(() => [o.readonly ? (l(), t(y, {
|
|
122
127
|
key: 0,
|
|
123
|
-
title:
|
|
124
|
-
value:
|
|
125
|
-
}, null, 8, ["title", "value"])) : (
|
|
128
|
+
title: f(k)("common.anzuUser.model.email"),
|
|
129
|
+
value: S.value.email
|
|
130
|
+
}, null, 8, ["title", "value"])) : (l(), t(b, {
|
|
126
131
|
key: 1,
|
|
127
|
-
modelValue:
|
|
128
|
-
"onUpdate:modelValue": s[1] ||= (e) =>
|
|
129
|
-
v:
|
|
132
|
+
modelValue: S.value.email,
|
|
133
|
+
"onUpdate:modelValue": s[1] ||= (e) => S.value.email = e,
|
|
134
|
+
v: f(A).user.email,
|
|
130
135
|
"data-cy": "user-email"
|
|
131
136
|
}, null, 8, ["modelValue", "v"]))]),
|
|
132
137
|
_: 1
|
|
133
138
|
})]),
|
|
134
139
|
_: 1
|
|
135
140
|
}),
|
|
136
|
-
|
|
137
|
-
default:
|
|
138
|
-
|
|
141
|
+
a(E, null, {
|
|
142
|
+
default: h(() => [
|
|
143
|
+
a(T, {
|
|
139
144
|
cols: "12",
|
|
140
145
|
sm: "3"
|
|
141
146
|
}, {
|
|
142
|
-
default:
|
|
147
|
+
default: h(() => [o.readonly ? (l(), t(y, {
|
|
143
148
|
key: 0,
|
|
144
|
-
title:
|
|
145
|
-
value:
|
|
146
|
-
}, null, 8, ["title", "value"])) : (
|
|
149
|
+
title: f(k)("common.anzuUser.model.person.firstName"),
|
|
150
|
+
value: S.value.person.firstName
|
|
151
|
+
}, null, 8, ["title", "value"])) : (l(), t(b, {
|
|
147
152
|
key: 1,
|
|
148
|
-
modelValue:
|
|
149
|
-
"onUpdate:modelValue": s[2] ||= (e) =>
|
|
150
|
-
v:
|
|
153
|
+
modelValue: S.value.person.firstName,
|
|
154
|
+
"onUpdate:modelValue": s[2] ||= (e) => S.value.person.firstName = e,
|
|
155
|
+
v: f(A).user.person.firstName,
|
|
151
156
|
"data-cy": "user-firstName"
|
|
152
157
|
}, null, 8, ["modelValue", "v"]))]),
|
|
153
158
|
_: 1
|
|
154
159
|
}),
|
|
155
|
-
|
|
160
|
+
a(T, {
|
|
156
161
|
cols: "12",
|
|
157
162
|
sm: "3"
|
|
158
163
|
}, {
|
|
159
|
-
default:
|
|
164
|
+
default: h(() => [o.readonly ? (l(), t(y, {
|
|
160
165
|
key: 0,
|
|
161
|
-
title:
|
|
162
|
-
value:
|
|
163
|
-
}, null, 8, ["title", "value"])) : (
|
|
166
|
+
title: f(k)("common.anzuUser.model.person.lastName"),
|
|
167
|
+
value: S.value.person.lastName
|
|
168
|
+
}, null, 8, ["title", "value"])) : (l(), t(b, {
|
|
164
169
|
key: 1,
|
|
165
|
-
modelValue:
|
|
166
|
-
"onUpdate:modelValue": s[3] ||= (e) =>
|
|
167
|
-
v:
|
|
170
|
+
modelValue: S.value.person.lastName,
|
|
171
|
+
"onUpdate:modelValue": s[3] ||= (e) => S.value.person.lastName = e,
|
|
172
|
+
v: f(A).user.person.lastName,
|
|
168
173
|
"data-cy": "user-lastName"
|
|
169
174
|
}, null, 8, ["modelValue", "v"]))]),
|
|
170
175
|
_: 1
|
|
171
176
|
}),
|
|
172
|
-
|
|
177
|
+
a(T, {
|
|
173
178
|
cols: "12",
|
|
174
179
|
sm: "6"
|
|
175
180
|
}, {
|
|
176
|
-
default:
|
|
181
|
+
default: h(() => [o.readonly ? (l(), t(y, {
|
|
177
182
|
key: 0,
|
|
178
|
-
title:
|
|
179
|
-
value:
|
|
180
|
-
}, null, 8, ["title", "value"])) : (
|
|
183
|
+
title: f(k)("common.anzuUser.model.person.fullName"),
|
|
184
|
+
value: S.value.person.fullName
|
|
185
|
+
}, null, 8, ["title", "value"])) : (l(), t(b, {
|
|
181
186
|
key: 1,
|
|
182
|
-
modelValue:
|
|
183
|
-
"onUpdate:modelValue": [s[4] ||= (e) =>
|
|
184
|
-
v:
|
|
185
|
-
hint:
|
|
186
|
-
"persistent-hint": !
|
|
187
|
+
modelValue: S.value.person.fullName,
|
|
188
|
+
"onUpdate:modelValue": [s[4] ||= (e) => S.value.person.fullName = e, s[5] ||= (e) => N.value = !0],
|
|
189
|
+
v: f(A).user.person.fullName,
|
|
190
|
+
hint: N.value ? void 0 : f(k)("common.anzuUser.hint.derivedFromName"),
|
|
191
|
+
"persistent-hint": !N.value,
|
|
187
192
|
"data-cy": "user-fullName"
|
|
188
193
|
}, null, 8, [
|
|
189
194
|
"modelValue",
|
|
@@ -196,42 +201,42 @@ var E = {
|
|
|
196
201
|
]),
|
|
197
202
|
_: 1
|
|
198
203
|
}),
|
|
199
|
-
|
|
200
|
-
default:
|
|
204
|
+
a(E, null, {
|
|
205
|
+
default: h(() => [a(T, {
|
|
201
206
|
cols: "12",
|
|
202
207
|
sm: "3"
|
|
203
208
|
}, {
|
|
204
|
-
default:
|
|
205
|
-
modelValue:
|
|
206
|
-
"onUpdate:modelValue": s[6] ||= (e) =>
|
|
207
|
-
label:
|
|
208
|
-
readonly:
|
|
209
|
-
required:
|
|
210
|
-
"random-color":
|
|
209
|
+
default: h(() => [a(_, {
|
|
210
|
+
modelValue: S.value.avatar.color,
|
|
211
|
+
"onUpdate:modelValue": s[6] ||= (e) => S.value.avatar.color = e,
|
|
212
|
+
label: f(k)("common.anzuUser.model.avatar.color"),
|
|
213
|
+
readonly: o.readonly,
|
|
214
|
+
required: o.required,
|
|
215
|
+
"random-color": o.randomColor
|
|
211
216
|
}, null, 8, [
|
|
212
217
|
"modelValue",
|
|
213
218
|
"label",
|
|
214
219
|
"readonly",
|
|
215
220
|
"required",
|
|
216
221
|
"random-color"
|
|
217
|
-
]),
|
|
222
|
+
]), f(A).user.avatar.color.$error ? (l(), r("div", D, d(f(A).user.avatar.color.$errors[0]?.$message), 1)) : n("", !0)]),
|
|
218
223
|
_: 1
|
|
219
|
-
}),
|
|
224
|
+
}), a(T, {
|
|
220
225
|
cols: "12",
|
|
221
226
|
sm: "3"
|
|
222
227
|
}, {
|
|
223
|
-
default:
|
|
228
|
+
default: h(() => [o.readonly ? (l(), t(y, {
|
|
224
229
|
key: 0,
|
|
225
|
-
title:
|
|
226
|
-
value:
|
|
227
|
-
}, null, 8, ["title", "value"])) : (
|
|
230
|
+
title: f(k)("common.anzuUser.model.avatar.text"),
|
|
231
|
+
value: S.value.avatar.text
|
|
232
|
+
}, null, 8, ["title", "value"])) : (l(), t(b, {
|
|
228
233
|
key: 1,
|
|
229
|
-
modelValue:
|
|
230
|
-
"onUpdate:modelValue": [s[7] ||= (e) =>
|
|
231
|
-
v:
|
|
234
|
+
modelValue: S.value.avatar.text,
|
|
235
|
+
"onUpdate:modelValue": [s[7] ||= (e) => S.value.avatar.text = e, s[8] ||= (e) => P.value = !0],
|
|
236
|
+
v: f(A).user.avatar.text,
|
|
232
237
|
maxlength: 3,
|
|
233
|
-
hint:
|
|
234
|
-
"persistent-hint": !
|
|
238
|
+
hint: P.value ? void 0 : f(k)("common.anzuUser.hint.derivedFromName"),
|
|
239
|
+
"persistent-hint": !P.value,
|
|
235
240
|
"data-cy": "user-avatarText"
|
|
236
241
|
}, null, 8, [
|
|
237
242
|
"modelValue",
|
|
@@ -252,6 +257,6 @@ var E = {
|
|
|
252
257
|
}, 8, ["system", "subject"]));
|
|
253
258
|
}
|
|
254
259
|
});
|
|
255
|
-
export {
|
|
260
|
+
export { O as default };
|
|
256
261
|
|
|
257
262
|
//# sourceMappingURL=AUserMetadataForm.vue.js.map
|