@anzusystems/common-admin 2.0.0-rc.12 → 2.0.0-rc.14

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.
Files changed (129) hide show
  1. package/dist/AnzuSystemsCommonAdmin.d.ts +10 -4
  2. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  3. package/dist/common-admin.js +255 -254
  4. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js +1 -2
  5. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js +1 -4
  7. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js +93 -86
  9. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js +30 -25
  11. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/domains/dam/api/damAssetApi.d.ts +5 -0
  13. package/dist/domains/dam/api/damAssetApi.js +39 -34
  14. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  15. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/domains/dam/assetSelect/api/damPodcastApi.d.ts +2 -2
  17. package/dist/domains/dam/assetSelect/api/damPodcastApi.js +4 -4
  18. package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
  19. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js +152 -153
  20. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +3 -0
  22. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js +80 -72
  23. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +3 -0
  25. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js +88 -80
  26. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue.d.ts +3 -0
  28. package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue_vue_type_script_setup_true_lang.js +42 -60
  29. package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.vue_vue_type_script_setup_true_lang.js +7 -9
  31. package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.js +6 -0
  33. package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.js.map +1 -0
  34. package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue.d.ts +3 -0
  35. package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue_vue_type_script_setup_true_lang.js +27 -0
  36. package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  37. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js +127 -106
  38. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  39. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js +1 -1
  40. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue.d.ts +3 -1
  42. package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +3 -2
  43. package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js +32 -30
  45. package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js.map +1 -1
  46. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js +96 -96
  47. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  48. package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.d.ts +22 -0
  49. package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.js +44 -0
  50. package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.js.map +1 -0
  51. package/dist/domains/dam/assetSelect/composables/assetSelectPresets.d.ts +28 -0
  52. package/dist/domains/dam/assetSelect/composables/assetSelectPresets.js +32 -0
  53. package/dist/domains/dam/assetSelect/composables/assetSelectPresets.js.map +1 -0
  54. package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.d.ts +19 -6
  55. package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.js +9 -5
  56. package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.js.map +1 -1
  57. package/dist/domains/dam/assetSelect/store/assetSelectStore.d.ts +5 -1
  58. package/dist/domains/dam/assetSelect/store/assetSelectStore.js +97 -80
  59. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  60. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js +3 -3
  61. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  62. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue.d.ts +3 -0
  63. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js +1 -0
  64. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  65. package/dist/domains/dam/imageWidget/components/AImageWidget.vue.d.ts +3 -0
  66. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js +1 -0
  67. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue.d.ts +3 -0
  69. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js +1 -0
  70. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +3 -0
  72. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js +3 -0
  73. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  74. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +3 -0
  75. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js +3 -0
  76. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  77. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +3 -0
  78. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js +3 -0
  79. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  80. package/dist/domains/dam/types/AssetLicence.d.ts +6 -6
  81. package/dist/domains/dam/types/AssetListView.d.ts +10 -0
  82. package/dist/domains/dam/types/DamCurrentUser.d.ts +3 -0
  83. package/dist/domains/dam/user/api/assetListViewApi.d.ts +7 -0
  84. package/dist/domains/dam/user/api/assetListViewApi.js +21 -0
  85. package/dist/domains/dam/user/api/assetListViewApi.js.map +1 -0
  86. package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue.d.ts +3 -0
  87. package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +18 -14
  88. package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  89. package/dist/domains/dam/user/components/DamAssetLicenceRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +31 -31
  90. package/dist/domains/dam/user/components/DamAssetLicenceRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.js +6 -0
  92. package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.js.map +1 -0
  93. package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue.d.ts +36 -0
  94. package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +83 -0
  95. package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -0
  96. package/dist/domains/dam/user/composables/assetListViewActions.d.ts +10 -0
  97. package/dist/domains/dam/user/composables/assetListViewActions.js +15 -0
  98. package/dist/domains/dam/user/composables/assetListViewActions.js.map +1 -0
  99. package/dist/domains/dam/user/composables/cachedAssetLicences.d.ts +3 -3
  100. package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.d.ts +14 -4
  101. package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.js +3 -0
  102. package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.js.map +1 -1
  103. package/dist/domains/dam/user/filter/AssetListViewFilter.d.ts +24 -0
  104. package/dist/domains/dam/user/filter/AssetListViewFilter.js +25 -0
  105. package/dist/domains/dam/user/filter/AssetListViewFilter.js.map +1 -0
  106. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js +28 -32
  107. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js +1 -1
  109. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/lib.d.ts +4 -2
  111. package/dist/locales/cs/common/anzuUser.js +4 -4
  112. package/dist/locales/cs/common/assetSelect.js +26 -0
  113. package/dist/locales/cs/common/assetSelect.js.map +1 -1
  114. package/dist/locales/cs.d.ts +5 -0
  115. package/dist/locales/en/common/anzuUser.js +4 -4
  116. package/dist/locales/en/common/assetSelect.js +26 -0
  117. package/dist/locales/en/common/assetSelect.js.map +1 -1
  118. package/dist/locales/en.d.ts +5 -0
  119. package/dist/locales/sk/common/anzuUser.js +4 -4
  120. package/dist/locales/sk/common/assetSelect.js +26 -0
  121. package/dist/locales/sk/common/assetSelect.js.map +1 -1
  122. package/dist/locales/sk.d.ts +5 -0
  123. package/dist/plugins/i18n.d.ts +5 -0
  124. package/package.json +15 -15
  125. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.js +0 -6
  126. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.js.map +0 -1
  127. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue.d.ts +0 -25
  128. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue_vue_type_script_setup_true_lang.js +0 -67
  129. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue_vue_type_script_setup_true_lang.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AUserSystemOverview.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createVNode","_component_VCard","_withCtx","_component_VCardText","_createElementVNode","_component_VTextField","_unref","_withKeys","_withModifiers","_createTextVNode","_toDisplayString","_createBlock","_component_VAlert","_Fragment","_renderList","AUserSystemStatusChip","_component_VChip","_component_VSpacer","_component_VBtn","AUserManageButton","AUserCreateInSystemButton","AUserBulkActionDialog","AUserMetadataRepairDialog","_component_VDialog","ADialogToolbar","_component_VSelect","AUserMetadataForm","_component_VCardActions","ADialogToolbar_default","AUserBulkActionDialog_default","AUserCreateInSystemButton_default","AUserManageButton_default","AUserMetadataForm_default","AUserMetadataRepairDialog_default","AUserSystemStatusChip_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","AUserSystemOverview_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","useI18n","useAlerts","store","useUserCrossSystemStore","useAnzuUserFactory","writes","useUserCrossSystemWrites","v$","useUserCrossSystemSearch","term","ref","rowBusy","runSearch","value","search","records","computed","map","descriptor","user","differences","findMetadataDifferences","foundAnywhere","anyFoundWritable","item","descriptorMayWrite","searchDone","CrossSystemPhase","searchedByEmail","isEmailTerm","canOfferCreateAnywhere","unresolvedSystems","blockedByConflict","labelFor","manageTargetFor","isUndefined","isNull","extraStateFor","EXTRA_STATE_COLOR","reportOutcome","outcome","BulkOutcome","showError","label","t","detailFor","fields","withRowBusy","system","run","next","toggleOne","id","result","enabled","refreshSystem","createFromSource","sourceSystem","source","sourceEnabled","body","createAnzuUser","metadata","cloneDeep","prefillSource","first","bulkOpen","bulkAction","BulkAction","repairOpen","openBulk","action","writableSystems","systems","runBulk","requested","runRepair","payload","seenBefore","createAnywhereOpen","createAnywhereSystem","createAnywhereUser","createAnywhereChecking","createAnywhereConflict","createAnywhereError","left","openCreateAnywhere","confirmCreateAnywhere","createAnywhereRequiredMetadata","createAnywhereNote","createSystemOptions","onBeforeUnmount","cancel","_component_ABtnPrimary","resolveComponent","_component_ABtnTertiary","openBlock","createElementBlock","createVNode","VCard","withCtx","VCardText","createElementVNode","VTextField","_cache","$event","unref","withKeys","withModifiers","createTextVNode","toDisplayString","createCommentVNode","createBlock","VAlert","Fragment","renderList","VChip","VSpacer","isActionable","VBtn","difference","systemValue","VDialog","VSelect","VCardActions"],"sources":["../../../../src/domains/anzuUser/components/AUserSystemOverview.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport { useI18n } from 'vue-i18n'\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useAnzuUserFactory } from '@/domains/anzuUser/factory/AnzuUserFactory'\nimport AUserBulkActionDialog from '@/domains/anzuUser/components/AUserBulkActionDialog.vue'\nimport AUserCreateInSystemButton from '@/domains/anzuUser/components/AUserCreateInSystemButton.vue'\nimport AUserManageButton from '@/domains/anzuUser/components/AUserManageButton.vue'\nimport AUserMetadataForm from '@/domains/anzuUser/components/AUserMetadataForm.vue'\nimport AUserMetadataRepairDialog from '@/domains/anzuUser/components/AUserMetadataRepairDialog.vue'\nimport AUserSystemStatusChip from '@/domains/anzuUser/components/AUserSystemStatusChip.vue'\nimport {\n BulkAction,\n BulkOutcome,\n CrossSystemPhase,\n useUserCrossSystemStore,\n type BulkActionType,\n type BulkOutcomeType,\n} from '@/domains/anzuUser/store/userCrossSystemStore'\nimport { isEmailTerm, useUserCrossSystemSearch } from '@/domains/anzuUser/composables/userCrossSystemSearch'\nimport { useUserCrossSystemWrites } from '@/domains/anzuUser/composables/userCrossSystemWrites'\nimport { findMetadataDifferences, type UserMetadataField } from '@/domains/anzuUser/utils/userMetadataDiff'\nimport { type AnyUserSystemDescriptor, descriptorMayWrite } from '@/domains/anzuUser/composables/userSystemDescriptor'\nimport type { UserSystemRefreshHook } from '@/domains/anzuUser/composables/userSystemProbe'\nimport { isActionable } from '@/domains/anzuUser/utils/userSystemState'\nimport type { AnzuUser, BaseUser } from '@/shared/types/AnzuUser'\nimport { cloneDeep, isNull, isUndefined } from '@/shared/utils/common'\n\nconst props = defineProps<{\n /** Order matters twice: the order of the rows, and the priority when pre-filling. */\n descriptors: AnyUserSystemDescriptor[]\n refreshHook?: UserSystemRefreshHook | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'searched', term: string): void\n}>()\n\nconst { t } = useI18n()\nconst { showError } = useAlerts()\nconst store = useUserCrossSystemStore()\nconst { createAnzuUser } = useAnzuUserFactory()\nconst writes = useUserCrossSystemWrites()\n\n// Collector for the metadata form in the create dialog. Without it the rules register\n// on some ancestor, and the dialog cannot validate the fields before sending.\nconst v$ = useVuelidate()\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { search, refreshSystem, unresolvedSystems, cancel } = useUserCrossSystemSearch({\n descriptors: props.descriptors,\n refreshHook: props.refreshHook,\n})\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst term = ref('')\nconst rowBusy = ref(new Set<string>())\n\nconst runSearch = async () => {\n const value = term.value.trim()\n if (value.length === 0) return\n emit('searched', value)\n await search(value)\n}\n\nconst records = computed(() => {\n const map = new Map<string, BaseUser>()\n for (const descriptor of props.descriptors) {\n const user = store.results.get(descriptor.system)?.user\n if (user) map.set(descriptor.system, user)\n }\n return map\n})\n\nconst differences = computed(() => findMetadataDifferences(records.value))\n\nconst foundAnywhere = computed(() => records.value.size > 0)\n\n/** Bulk actions only write where the person was found, so offer them when at least one of those systems is writable. */\nconst anyFoundWritable = computed(() =>\n props.descriptors.some((item) => records.value.has(item.system) && descriptorMayWrite(item, 'update'))\n)\nconst searchDone = computed(() => store.phase === CrossSystemPhase.Done)\n\nconst searchedByEmail = computed(() => isEmailTerm(store.searchTerm))\n\n/**\n * When to offer creating an account after a search that found nobody.\n * By id: only if every relevant probe returned an authoritative 404. An\n * unreadable record may exist, and a duplicate identity cannot be deleted.\n * By e-mail: always. An address search cannot prove absence, and the dialog\n * asks for the id and runs its own authoritative check before writing.\n * Refusing here would block the decision 21 flow for the search people actually use, since they do not know the id yet.\n */\nconst canOfferCreateAnywhere = computed(\n () =>\n searchDone.value &&\n !foundAnywhere.value &&\n (searchedByEmail.value || unresolvedSystems.value.length === 0) &&\n props.descriptors.some((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))\n)\n\n/** A conflict is not a state to act from: writes would land on somebody else's account. */\nconst blockedByConflict = computed(() => store.identityConflict !== null)\n\nconst labelFor = (descriptor: AnyUserSystemDescriptor) => descriptor.label ?? descriptor.system\n\nconst manageTargetFor = (descriptor: AnyUserSystemDescriptor) => {\n const user = store.results.get(descriptor.system)?.user\n if (isUndefined(user) || isNull(user) || isUndefined(descriptor.manage)) return null\n return descriptor.manage(user)\n}\n\nconst extraStateFor = (descriptor: AnyUserSystemDescriptor) => {\n const user = store.results.get(descriptor.system)?.user\n if (isUndefined(user) || isNull(user) || isUndefined(descriptor.extraState)) return null\n return descriptor.extraState(user)\n}\n\nconst EXTRA_STATE_COLOR = { ok: 'success', warn: 'warning', error: 'error' } as const\n\n/**\n * Report a failed row action to the user.\n * Without this a 403 on Vypnúť leaves a spinner and an unchanged row, because the api helpers only write to the logger.\n */\nconst reportOutcome = (label: string, outcome: BulkOutcomeType) => {\n if (outcome === BulkOutcome.Done) return\n showError(label + ': ' + t('common.userSystem.bulk.outcome.' + outcome))\n}\n\nconst detailFor = (fields: UserMetadataField[] | undefined) =>\n isUndefined(fields) || fields.length === 0\n ? undefined\n : t('common.userSystem.bulk.concurrentChange', { fields: fields.join(', ') })\n\nconst withRowBusy = async (system: string, run: () => Promise<void>) => {\n rowBusy.value = new Set([...rowBusy.value, system])\n try {\n await run()\n } finally {\n const next = new Set(rowBusy.value)\n next.delete(system)\n rowBusy.value = next\n }\n}\n\n/** The touched row is read again after every write. Otherwise it keeps showing the old state. */\nconst toggleOne = async (descriptor: AnyUserSystemDescriptor, enabled: boolean) => {\n const id = store.resolvedId\n if (isNull(id)) return\n await withRowBusy(descriptor.system, async () => {\n const result = await writes.setEnabled(descriptor, id, enabled)\n reportOutcome(labelFor(descriptor), result.outcome)\n await refreshSystem(descriptor.system)\n })\n}\n\nconst createFromSource = async (descriptor: AnyUserSystemDescriptor, metadata: BaseUser) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const sourceSystem = props.descriptors.find((item) => records.value.has(item.system))\n if (isUndefined(sourceSystem)) return\n\n await withRowBusy(descriptor.system, async () => {\n // Read from the server, never from search results or a form's store.\n // An unsaved switch would otherwise be copied into a system where it means a working public account.\n const source = await writes.readSourceUser(sourceSystem, id)\n if (isNull(source)) {\n showError(t('common.userSystem.create.sourceUnreadable', { system: labelFor(sourceSystem) }))\n return\n }\n // The dialog already told the operator whether the account will be switched on, based on the search result.\n // If the server disagrees now, someone changed it. In blog and forum that means a working public account.\n if (source.enabled !== sourceEnabled.value) {\n // Re-read instead of patching the record. The chip uses the probe's axes, so\n // replacing only the user leaves the chip stale next to an updated toggle.\n await refreshSystem(sourceSystem.system)\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 // Metadata comes from the dialog, which was validated against the target's profile.\n // The source may leave `person` empty (blog never fills it) where the target requires it.\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 // Copying a person into another system copies whether they are switched on. Roles stay empty.\n body.enabled = source.enabled\n const result = await writes.createInSystem(descriptor, body)\n reportOutcome(labelFor(descriptor), result.outcome)\n await refreshSystem(descriptor.system)\n })\n}\n\n/** The record the create form is prefilled from: the first configured system that has one. */\nconst prefillSource = computed(() => {\n const first = props.descriptors.find((item) => records.value.has(item.system))\n return isUndefined(first) ? null : (records.value.get(first.system) ?? null)\n})\n\nconst sourceEnabled = computed(() => {\n const first = props.descriptors.find((item) => records.value.has(item.system))\n if (isUndefined(first)) return false\n return store.results.get(first.system)?.user?.enabled === true\n})\n\nconst bulkOpen = ref(false)\nconst bulkAction = ref<BulkActionType>(BulkAction.Disable)\nconst repairOpen = ref(false)\n\nconst openBulk = (action: BulkActionType) => {\n bulkAction.value = action\n bulkOpen.value = true\n}\n\n/** Every bulk write passes through here, retries included. A system the descriptor refuses is not written. */\nconst writableSystems = (systems: string[]) =>\n systems.filter((system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n return !isUndefined(descriptor) && descriptorMayWrite(descriptor, 'update')\n })\n\nconst runBulk = async (requested: string[]) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const systems = writableSystems(requested)\n if (systems.length === 0) return\n const enabled = bulkAction.value === BulkAction.Enable\n store.startBulk(bulkAction.value, systems, id)\n await Promise.allSettled(\n systems.map(async (system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor)) return\n store.setBulkEntry(system, BulkOutcome.Running)\n const result = await writes.setEnabled(descriptor, id, enabled)\n store.setBulkEntry(system, result.outcome)\n await refreshSystem(system)\n })\n )\n store.finishBulk()\n}\n\nconst runRepair = async (payload: { target: BaseUser; systems: string[] }) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const systems = writableSystems(payload.systems)\n if (systems.length === 0) return\n store.startBulk(BulkAction.Metadata, systems, id)\n // Captured before any write, so the comparison uses the values the operator saw, not a row a sibling write refreshed.\n const seenBefore = new Map(records.value)\n await Promise.allSettled(\n systems.map(async (system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor)) return\n store.setBulkEntry(system, BulkOutcome.Running)\n const result = await writes.writeMetadata(\n descriptor,\n id,\n payload.target,\n undefined,\n seenBefore.get(system) ?? null\n )\n store.setBulkEntry(system, result.outcome, detailFor(result.concurrentFields))\n await refreshSystem(system)\n })\n )\n store.finishBulk()\n}\n\nconst createAnywhereOpen = ref(false)\nconst createAnywhereSystem = ref<string | null>(null)\nconst createAnywhereUser = ref<AnzuUser>(createAnzuUser())\nconst createAnywhereChecking = ref(false)\nconst createAnywhereConflict = ref<string[]>([])\nconst createAnywhereError = ref<string | null>(null)\n\n/** Set when the page goes away, so work that finishes afterwards does not refill it. */\nlet left = false\n\nconst openCreateAnywhere = () => {\n // Pick the first enabled system, not the first listed. A system disabled in the configuration\n // is not an option, and preselecting it would POST through a client with no base URL.\n createAnywhereSystem.value =\n props.descriptors.find((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))?.system ?? null\n createAnywhereUser.value = createAnzuUser(createAnywhereSystem.value ?? '')\n createAnywhereConflict.value = []\n createAnywhereError.value = null\n createAnywhereOpen.value = true\n}\n\n/**\n * Before creating, the typed id is looked up across the systems.\n * cms, dam and contentHub skip the SSO lookup for a numeric id, and the validators check id and e-mail separately. A\n * typo would create an account with one person's id and another's e-mail, and later fan-outs follow the wrong identity.\n * If a probe answers 401, 403 or nothing, creating is blocked, because the id's owner is unknown.\n */\nconst confirmCreateAnywhere = async () => {\n const id = createAnywhereUser.value.id\n const system = createAnywhereSystem.value\n createAnywhereConflict.value = []\n createAnywhereError.value = null\n if (isNull(system)) return\n // The id is checked here, not only by the form. A term the search refuses probes\n // nothing, and that empty result would read as \"this id belongs to nobody\".\n if (isNull(id) || isUndefined(id) || !Number.isInteger(id) || id <= 0) {\n createAnywhereError.value = t('common.userSystem.create.invalidId')\n return\n }\n if (!(await v$.value.$validate())) return\n createAnywhereChecking.value = true\n try {\n if (!(await search(String(id)))) {\n createAnywhereError.value = t('common.userSystem.create.invalidId')\n return\n }\n if (left) return\n if (records.value.size > 0) {\n createAnywhereConflict.value = [...records.value.keys()]\n return\n }\n if (unresolvedSystems.value.length > 0) {\n createAnywhereConflict.value = unresolvedSystems.value\n return\n }\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor) || !descriptor.isEnabled() || !descriptorMayWrite(descriptor, 'create')) return\n const body = createAnzuUser(system)\n body.id = id\n body.email = createAnywhereUser.value.email\n body.person = cloneDeep(createAnywhereUser.value.person)\n body.avatar = cloneDeep(createAnywhereUser.value.avatar)\n // Nobody to copy from, so the account is created switched off, as on an ordinary new-user page.\n body.enabled = false\n const result = await writes.createInSystem(descriptor, body)\n reportOutcome(labelFor(descriptor), result.outcome)\n if (result.outcome !== BulkOutcome.Done) return\n // The dialog is not persistent, so the operator can navigate away while the POST is pending.\n // The following search takes a fresh generation that `cancel()`\n // cannot stop, and would refill the store the unmount just emptied.\n if (left) return\n createAnywhereOpen.value = false\n await search(String(id))\n } finally {\n createAnywhereChecking.value = false\n }\n}\n\n/**\n * Uses the chosen target's own profile, not a blanket strict one.\n * The repair dialog is strict because it writes to nine systems. This creates one account\n * in one system, and strict would demand an avatar colour that blog does not require.\n */\nconst createAnywhereRequiredMetadata = computed(\n () => props.descriptors.find((item) => item.system === createAnywhereSystem.value)?.requiredMetadata ?? true\n)\n\n/** What is special about an account in the chosen system. For blog and forum it is a public one. */\nconst createAnywhereNote = computed(\n () => props.descriptors.find((item) => item.system === createAnywhereSystem.value)?.createNote\n)\n\nconst createSystemOptions = computed(() =>\n props.descriptors\n .filter((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))\n .map((item) => ({ value: item.system, title: labelFor(item) }))\n)\n\n// The store exists so a closed dialog does not stop a running bulk action, not to keep a person across navigation.\n// Without this reset, returning through the menu showed the last\n// person's rows and live buttons under an empty search box.\nonBeforeUnmount(() => {\n left = true\n cancel()\n store.reset()\n})\n\ndefineExpose({\n search: async (value: string) => {\n term.value = value\n await runSearch()\n },\n})\n</script>\n\n<template>\n <div>\n <VCard variant=\"flat\">\n <VCardText>\n <div class=\"d-flex align-center ga-2\">\n <VTextField\n v-model=\"term\"\n :label=\"t('common.userSystem.search.label')\"\n :hint=\"t('common.userSystem.search.hint')\"\n persistent-hint\n density=\"compact\"\n data-cy=\"cross-system-search\"\n @keyup.enter=\"runSearch\"\n />\n <ABtnPrimary\n data-cy=\"cross-system-search-submit\"\n @click.stop=\"runSearch\"\n >\n {{ t('common.userSystem.search.submit') }}\n </ABtnPrimary>\n </div>\n <!--\n The two rounds are named while they run. Between them a row is neither present nor absent.\n Showing \"no account here\" would invite a Create for an account that exists under another address.\n -->\n <div\n v-if=\"store.phase === CrossSystemPhase.MatchingEmail\"\n class=\"text-body-small mt-2\"\n >\n {{ t('common.userSystem.search.phase.matchingEmail') }}\n </div>\n <div\n v-else-if=\"store.phase === CrossSystemPhase.VerifyingById\"\n class=\"text-body-small mt-2\"\n >\n {{ t('common.userSystem.search.phase.verifyingById') }}\n </div>\n </VCardText>\n </VCard>\n\n <VAlert\n v-if=\"store.identityConflict\"\n type=\"error\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"my-3\"\n data-cy=\"identity-conflict\"\n >\n {{ t('common.userSystem.search.identityConflict') }}\n </VAlert>\n\n <!-- Neither an address nor an id. The previous person's rows are gone, and this says why. -->\n <VAlert\n v-if=\"store.termRejected\"\n type=\"warning\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"my-3\"\n data-cy=\"cross-system-term-rejected\"\n >\n {{ t('common.userSystem.search.termRejected') }}\n </VAlert>\n\n <VCard\n v-if=\"searchDone\"\n variant=\"flat\"\n class=\"mt-3\"\n >\n <VCardText class=\"d-flex flex-column ga-3\">\n <div\n v-for=\"descriptor in descriptors\"\n :key=\"descriptor.system\"\n class=\"d-flex align-center flex-wrap ga-2\"\n :data-cy=\"`cross-system-row-${descriptor.system}`\"\n >\n <div\n class=\"font-weight-medium\"\n style=\"min-width: 8rem\"\n >\n {{ labelFor(descriptor) }}\n </div>\n <AUserSystemStatusChip\n v-if=\"store.results.get(descriptor.system)\"\n :axes=\"store.results.get(descriptor.system)!.axes\"\n />\n <VChip\n v-if=\"extraStateFor(descriptor)\"\n :color=\"EXTRA_STATE_COLOR[extraStateFor(descriptor)!.tone]\"\n label\n size=\"small\"\n >\n {{ extraStateFor(descriptor)!.label }}: {{ extraStateFor(descriptor)!.value }}\n </VChip>\n <div class=\"text-body-small text-medium-emphasis\">\n {{ store.results.get(descriptor.system)?.user?.person.fullName }}\n <template v-if=\"store.results.get(descriptor.system)?.user\">\n · {{ store.results.get(descriptor.system)?.user?.email }}\n </template>\n </div>\n <VSpacer />\n <template\n v-if=\"store.results.get(descriptor.system) && isActionable(store.results.get(descriptor.system)!.axes)\"\n >\n <VBtn\n v-if=\"descriptorMayWrite(descriptor, 'update')\"\n size=\"small\"\n variant=\"text\"\n :loading=\"rowBusy.has(descriptor.system)\"\n :disabled=\"blockedByConflict\"\n :data-cy=\"`cross-system-toggle-${descriptor.system}`\"\n @click=\"toggleOne(descriptor, !store.results.get(descriptor.system)!.user!.enabled)\"\n >\n {{\n store.results.get(descriptor.system)!.user!.enabled\n ? t('common.userSystem.bulk.disable.title')\n : t('common.userSystem.bulk.enable.title')\n }}\n </VBtn>\n <AUserManageButton\n v-if=\"manageTargetFor(descriptor) && descriptorMayWrite(descriptor, 'update')\"\n :target=\"manageTargetFor(descriptor)!\"\n :system-label=\"labelFor(descriptor)\"\n />\n </template>\n <!--\n Create is offered only when the person exists somewhere. That is the only way their global id is known.\n -->\n <AUserCreateInSystemButton\n v-else-if=\"\n foundAnywhere &&\n store.results.get(descriptor.system) &&\n store.results.get(descriptor.system)!.axes.presence === 'absent' &&\n descriptorMayWrite(descriptor, 'create')\n \"\n :system-label=\"labelFor(descriptor)\"\n :create-note=\"descriptor.createNote\"\n :will-be-enabled=\"sourceEnabled\"\n :loading=\"rowBusy.has(descriptor.system)\"\n :disabled=\"blockedByConflict\"\n :required-metadata=\"descriptor.requiredMetadata\"\n :user-id=\"store.resolvedId\"\n :source=\"prefillSource\"\n @confirm=\"(user) => createFromSource(descriptor, user)\"\n />\n </div>\n </VCardText>\n </VCard>\n\n <VCard\n v-if=\"differences.length > 0\"\n variant=\"flat\"\n class=\"mt-3\"\n data-cy=\"cross-system-differences\"\n >\n <VCardText>\n <div class=\"text-label-large\">{{ t('common.userSystem.inconsistency.title') }}</div>\n <div\n v-for=\"difference in differences\"\n :key=\"difference.field\"\n class=\"text-body-small\"\n >\n <strong>{{ difference.field }}</strong>\n <span\n v-for=\"[system, systemValue] in difference.values\"\n :key=\"system\"\n class=\"ml-2\"\n >\n {{ system }}: {{ systemValue || '—' }}\n </span>\n </div>\n </VCardText>\n </VCard>\n\n <div\n v-if=\"searchDone && foundAnywhere && anyFoundWritable\"\n class=\"d-flex ga-2 mt-3\"\n >\n <!-- All three open a dialog. None of them acts straight away. -->\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-disable\"\n @click=\"openBulk(BulkAction.Disable)\"\n >\n {{ t('common.userSystem.bulk.openDisable') }}\n </ABtnTertiary>\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-enable\"\n @click=\"openBulk(BulkAction.Enable)\"\n >\n {{ t('common.userSystem.bulk.openEnable') }}\n </ABtnTertiary>\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-metadata\"\n @click=\"repairOpen = true\"\n >\n {{ t('common.userSystem.bulk.openMetadata') }}\n </ABtnTertiary>\n <div\n v-if=\"store.bulkRunning\"\n class=\"text-body-small align-self-center\"\n >\n {{ t('common.userSystem.bulk.runningElsewhere') }}\n </div>\n </div>\n\n <VCard\n v-if=\"searchDone && !foundAnywhere\"\n variant=\"flat\"\n class=\"mt-3\"\n >\n <VCardText>\n <div data-cy=\"cross-system-not-found\">{{ t('common.userSystem.search.notFound') }}</div>\n <ABtnPrimary\n v-if=\"canOfferCreateAnywhere\"\n class=\"mt-2\"\n data-cy=\"cross-system-create-anywhere\"\n @click=\"openCreateAnywhere\"\n >\n {{ t('common.userSystem.search.createAnywhere') }}\n </ABtnPrimary>\n <!-- Not offered for want of a create right: then nothing is left unconfirmed to retry. -->\n <template v-else-if=\"!searchedByEmail && unresolvedSystems.length > 0\">\n <div class=\"text-body-small mt-2\">\n {{ t('common.userSystem.create.notAuthoritative', { systems: unresolvedSystems.join(', ') }) }}\n </div>\n <ABtnTertiary\n class=\"mt-2\"\n data-cy=\"cross-system-retry-search\"\n @click=\"runSearch\"\n >\n {{ t('common.userSystem.button.retry') }}\n </ABtnTertiary>\n </template>\n </VCardText>\n </VCard>\n\n <AUserBulkActionDialog\n v-model:open=\"bulkOpen\"\n :action=\"bulkAction\"\n :descriptors=\"descriptors\"\n @run=\"runBulk\"\n />\n\n <AUserMetadataRepairDialog\n v-model:open=\"repairOpen\"\n :descriptors=\"descriptors\"\n @confirm=\"runRepair\"\n />\n\n <VDialog\n v-model=\"createAnywhereOpen\"\n :max-width=\"720\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"createAnywhereOpen = false\">\n {{ t('common.userSystem.search.createAnywhere') }}\n </ADialogToolbar>\n <VCardText>\n <VSelect\n v-model=\"createAnywhereSystem\"\n :items=\"createSystemOptions\"\n :label=\"t('common.userSystem.table.system')\"\n density=\"compact\"\n data-cy=\"create-anywhere-system\"\n />\n <!-- Id and e-mail are both asked for: the e-mail is required by the backend. -->\n <AUserMetadataForm\n v-model:user=\"createAnywhereUser\"\n :required=\"createAnywhereRequiredMetadata\"\n id-input\n />\n <p\n v-if=\"createAnywhereNote\"\n class=\"mt-2\"\n >\n {{ createAnywhereNote }}\n </p>\n <VAlert\n v-if=\"createAnywhereError\"\n type=\"error\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"mt-2\"\n data-cy=\"create-anywhere-error\"\n >\n {{ createAnywhereError }}\n </VAlert>\n <VAlert\n v-if=\"createAnywhereConflict.length > 0\"\n type=\"warning\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"mt-2\"\n data-cy=\"create-anywhere-conflict\"\n >\n {{ t('common.userSystem.create.notAuthoritative', { systems: createAnywhereConflict.join(', ') }) }}\n </VAlert>\n <p class=\"mt-2\">{{ t('common.userSystem.create.note') }}</p>\n <p>{{ t('common.userSystem.create.willBeDisabled') }}</p>\n </VCardText>\n <VCardActions>\n <ABtnTertiary @click.stop=\"createAnywhereOpen = false\">\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <VSpacer />\n <ABtnPrimary\n :loading=\"createAnywhereChecking\"\n data-cy=\"create-anywhere-confirm\"\n @click.stop=\"confirmCreateAnywhere\"\n >\n {{ t('common.button.confirm') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,IAAMsD,IAAQC,GAMRC,KAAOH,IAIP,EAAE,SAAMI,GAAQ,GAChB,EAAE,iBAAcC,EAAU,GAC1BC,IAAQC,EAAwB,GAChC,EAAE,sBAAmBC,EAAmB,GACxCC,IAASC,GAAyB,GAIlCC,KAAK3B,GAAa,GAGlB,EAAE,YAAQ,kBAAe,sBAAmB,eAAW4B,GAAyB;GACpF,aAAaX,EAAM;GACnB,aAAaA,EAAM;EACrB,CAAC,GAGKY,IAAOC,EAAI,EAAE,GACbC,IAAUD,kBAAI,IAAI,IAAY,CAAC,GAE/BE,IAAY,YAAY;GAC5B,IAAMC,IAAQJ,EAAK,MAAM,KAAK;GAC9B,AAAII,EAAM,WAAW,MACrBd,GAAK,YAAYc,CAAK,GACtB,MAAMC,GAAOD,CAAK;EACpB,GAEME,IAAUC,QAAe;GAC7B,IAAMC,oBAAM,IAAI,IAAsB;GACtC,KAAK,IAAMC,KAAcrB,EAAM,aAAa;IAC1C,IAAMsB,IAAOjB,EAAM,QAAQ,IAAIgB,EAAW,MAAM,CAAC,EAAE;IACnD,AAAIC,KAAMF,EAAI,IAAIC,EAAW,QAAQC,CAAI;GAC3C;GACA,OAAOF;EACT,CAAC,GAEKG,KAAcJ,QAAeK,GAAwBN,EAAQ,KAAK,CAAC,GAEnEO,IAAgBN,QAAeD,EAAQ,MAAM,OAAO,CAAC,GAGrDQ,KAAmBP,QACvBnB,EAAM,YAAY,MAAM,MAASkB,EAAQ,MAAM,IAAIS,EAAK,MAAM,KAAK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5BO,EAAAC,EAAAJ,EAAA6F,CAAA,CAAC,CAAA,sBAAA,CAAA,GAAA,CAAA,C;;;SAENnG,EAAWiB,EAAA;SACXjB,EAMcoJ,GAAA;UALX,SAASX,EAAA;UACV,WAAQ;UACP,SAAKjI,GAAOsI,IAAqB,CAAA,MAAA,CAAA;;UAElC,SAAA5I,QAAgC,CAA7BO,EAAAC,EAAAJ,EAAA6F,CAAA,CAAC,CAAA,uBAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"AUserSystemOverview.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createVNode","_component_VCard","_withCtx","_component_VCardText","_createElementVNode","_component_VTextField","_unref","_withKeys","_withModifiers","_createTextVNode","_toDisplayString","_createBlock","_component_VAlert","_Fragment","_renderList","AUserSystemStatusChip","_component_VChip","_component_VSpacer","_component_VBtn","AUserManageButton","AUserCreateInSystemButton","AUserBulkActionDialog","AUserMetadataRepairDialog","_component_VDialog","ADialogToolbar","_component_VSelect","AUserMetadataForm","_component_VCardActions","ADialogToolbar_default","AUserBulkActionDialog_default","AUserCreateInSystemButton_default","AUserManageButton_default","AUserMetadataForm_default","AUserMetadataRepairDialog_default","AUserSystemStatusChip_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","AUserSystemOverview_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","useI18n","useAlerts","store","useUserCrossSystemStore","useAnzuUserFactory","writes","useUserCrossSystemWrites","v$","useUserCrossSystemSearch","term","ref","rowBusy","runSearch","value","search","records","computed","map","descriptor","user","differences","findMetadataDifferences","foundAnywhere","anyFoundWritable","item","descriptorMayWrite","searchDone","CrossSystemPhase","searchedByEmail","isEmailTerm","canOfferCreateAnywhere","unresolvedSystems","blockedByConflict","labelFor","manageTargetFor","isUndefined","isNull","extraStateFor","EXTRA_STATE_COLOR","reportOutcome","outcome","BulkOutcome","showError","label","t","detailFor","fields","withRowBusy","system","run","next","toggleOne","id","result","enabled","refreshSystem","createFromSource","sourceSystem","source","sourceEnabled","body","createAnzuUser","metadata","cloneDeep","prefillSource","first","bulkOpen","bulkAction","BulkAction","repairOpen","openBulk","action","writableSystems","systems","runBulk","requested","runRepair","payload","seenBefore","createAnywhereOpen","createAnywhereSystem","createAnywhereUser","createAnywhereChecking","createAnywhereConflict","createAnywhereError","left","openCreateAnywhere","confirmCreateAnywhere","createAnywhereRequiredMetadata","createAnywhereNote","createSystemOptions","onBeforeUnmount","cancel","_component_ABtnPrimary","resolveComponent","_component_ABtnTertiary","openBlock","createElementBlock","createVNode","VCard","withCtx","VCardText","createElementVNode","VTextField","_cache","$event","unref","withKeys","withModifiers","createTextVNode","toDisplayString","createCommentVNode","createBlock","VAlert","Fragment","renderList","VChip","VSpacer","isActionable","VBtn","difference","systemValue","VDialog","VSelect","VCardActions"],"sources":["../../../../src/domains/anzuUser/components/AUserSystemOverview.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, onBeforeUnmount, ref } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport { useI18n } from 'vue-i18n'\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { useAnzuUserFactory } from '@/domains/anzuUser/factory/AnzuUserFactory'\nimport AUserBulkActionDialog from '@/domains/anzuUser/components/AUserBulkActionDialog.vue'\nimport AUserCreateInSystemButton from '@/domains/anzuUser/components/AUserCreateInSystemButton.vue'\nimport AUserManageButton from '@/domains/anzuUser/components/AUserManageButton.vue'\nimport AUserMetadataForm from '@/domains/anzuUser/components/AUserMetadataForm.vue'\nimport AUserMetadataRepairDialog from '@/domains/anzuUser/components/AUserMetadataRepairDialog.vue'\nimport AUserSystemStatusChip from '@/domains/anzuUser/components/AUserSystemStatusChip.vue'\nimport {\n BulkAction,\n BulkOutcome,\n CrossSystemPhase,\n useUserCrossSystemStore,\n type BulkActionType,\n type BulkOutcomeType,\n} from '@/domains/anzuUser/store/userCrossSystemStore'\nimport { isEmailTerm, useUserCrossSystemSearch } from '@/domains/anzuUser/composables/userCrossSystemSearch'\nimport { useUserCrossSystemWrites } from '@/domains/anzuUser/composables/userCrossSystemWrites'\nimport { findMetadataDifferences, type UserMetadataField } from '@/domains/anzuUser/utils/userMetadataDiff'\nimport { type AnyUserSystemDescriptor, descriptorMayWrite } from '@/domains/anzuUser/composables/userSystemDescriptor'\nimport type { UserSystemRefreshHook } from '@/domains/anzuUser/composables/userSystemProbe'\nimport { isActionable } from '@/domains/anzuUser/utils/userSystemState'\nimport type { AnzuUser, BaseUser } from '@/shared/types/AnzuUser'\nimport { cloneDeep, isNull, isUndefined } from '@/shared/utils/common'\n\nconst props = defineProps<{\n /** Order matters twice: the order of the rows, and the priority when pre-filling. */\n descriptors: AnyUserSystemDescriptor[]\n refreshHook?: UserSystemRefreshHook | undefined\n}>()\n\nconst emit = defineEmits<{\n (e: 'searched', term: string): void\n}>()\n\nconst { t } = useI18n()\nconst { showError } = useAlerts()\nconst store = useUserCrossSystemStore()\nconst { createAnzuUser } = useAnzuUserFactory()\nconst writes = useUserCrossSystemWrites()\n\n// Collector for the metadata form in the create dialog. Without it the rules register\n// on some ancestor, and the dialog cannot validate the fields before sending.\nconst v$ = useVuelidate()\n\n/* eslint-disable vue/no-setup-props-reactivity-loss */\nconst { search, refreshSystem, unresolvedSystems, cancel } = useUserCrossSystemSearch({\n descriptors: props.descriptors,\n refreshHook: props.refreshHook,\n})\n/* eslint-enable vue/no-setup-props-reactivity-loss */\n\nconst term = ref('')\nconst rowBusy = ref(new Set<string>())\n\nconst runSearch = async () => {\n const value = term.value.trim()\n if (value.length === 0) return\n emit('searched', value)\n await search(value)\n}\n\nconst records = computed(() => {\n const map = new Map<string, BaseUser>()\n for (const descriptor of props.descriptors) {\n const user = store.results.get(descriptor.system)?.user\n if (user) map.set(descriptor.system, user)\n }\n return map\n})\n\nconst differences = computed(() => findMetadataDifferences(records.value))\n\nconst foundAnywhere = computed(() => records.value.size > 0)\n\n/** Bulk actions only write where the person was found, so offer them when at least one of those systems is writable. */\nconst anyFoundWritable = computed(() =>\n props.descriptors.some((item) => records.value.has(item.system) && descriptorMayWrite(item, 'update'))\n)\nconst searchDone = computed(() => store.phase === CrossSystemPhase.Done)\n\nconst searchedByEmail = computed(() => isEmailTerm(store.searchTerm))\n\n/**\n * When to offer creating an account after a search that found nobody.\n * By id: only if every relevant probe returned an authoritative 404. An\n * unreadable record may exist, and a duplicate identity cannot be deleted.\n * By e-mail: always. An address search cannot prove absence, and the dialog\n * asks for the id and runs its own authoritative check before writing.\n * Refusing here would block the decision 21 flow for the search people actually use, since they do not know the id yet.\n */\nconst canOfferCreateAnywhere = computed(\n () =>\n searchDone.value &&\n !foundAnywhere.value &&\n (searchedByEmail.value || unresolvedSystems.value.length === 0) &&\n props.descriptors.some((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))\n)\n\n/** A conflict is not a state to act from: writes would land on somebody else's account. */\nconst blockedByConflict = computed(() => store.identityConflict !== null)\n\nconst labelFor = (descriptor: AnyUserSystemDescriptor) => descriptor.label ?? descriptor.system\n\nconst manageTargetFor = (descriptor: AnyUserSystemDescriptor) => {\n const user = store.results.get(descriptor.system)?.user\n if (isUndefined(user) || isNull(user) || isUndefined(descriptor.manage)) return null\n return descriptor.manage(user)\n}\n\nconst extraStateFor = (descriptor: AnyUserSystemDescriptor) => {\n const user = store.results.get(descriptor.system)?.user\n if (isUndefined(user) || isNull(user) || isUndefined(descriptor.extraState)) return null\n return descriptor.extraState(user)\n}\n\nconst EXTRA_STATE_COLOR = { ok: 'success', warn: 'warning', error: 'error' } as const\n\n/**\n * Report a failed row action to the user.\n * Without this a 403 on Vypnúť leaves a spinner and an unchanged row, because the api helpers only write to the logger.\n */\nconst reportOutcome = (label: string, outcome: BulkOutcomeType) => {\n if (outcome === BulkOutcome.Done) return\n showError(label + ': ' + t('common.userSystem.bulk.outcome.' + outcome))\n}\n\nconst detailFor = (fields: UserMetadataField[] | undefined) =>\n isUndefined(fields) || fields.length === 0\n ? undefined\n : t('common.userSystem.bulk.concurrentChange', { fields: fields.join(', ') })\n\nconst withRowBusy = async (system: string, run: () => Promise<void>) => {\n rowBusy.value = new Set([...rowBusy.value, system])\n try {\n await run()\n } finally {\n const next = new Set(rowBusy.value)\n next.delete(system)\n rowBusy.value = next\n }\n}\n\n/** The touched row is read again after every write. Otherwise it keeps showing the old state. */\nconst toggleOne = async (descriptor: AnyUserSystemDescriptor, enabled: boolean) => {\n const id = store.resolvedId\n if (isNull(id)) return\n await withRowBusy(descriptor.system, async () => {\n const result = await writes.setEnabled(descriptor, id, enabled)\n reportOutcome(labelFor(descriptor), result.outcome)\n await refreshSystem(descriptor.system)\n })\n}\n\nconst createFromSource = async (descriptor: AnyUserSystemDescriptor, metadata: BaseUser) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const sourceSystem = props.descriptors.find((item) => records.value.has(item.system))\n if (isUndefined(sourceSystem)) return\n\n await withRowBusy(descriptor.system, async () => {\n // Read from the server, never from search results or a form's store.\n // An unsaved switch would otherwise be copied into a system where it means a working public account.\n const source = await writes.readSourceUser(sourceSystem, id)\n if (isNull(source)) {\n showError(t('common.userSystem.create.sourceUnreadable', { system: labelFor(sourceSystem) }))\n return\n }\n // The dialog already told the operator whether the account will be switched on, based on the search result.\n // If the server disagrees now, someone changed it. In blog and forum that means a working public account.\n if (source.enabled !== sourceEnabled.value) {\n // Re-read instead of patching the record. The chip uses the probe's axes, so\n // replacing only the user leaves the chip stale next to an updated toggle.\n await refreshSystem(sourceSystem.system)\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 // Metadata comes from the dialog, which was validated against the target's profile.\n // The source may leave `person` empty (blog never fills it) where the target requires it.\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 // Copying a person into another system copies whether they are switched on. Roles stay empty.\n body.enabled = source.enabled\n const result = await writes.createInSystem(descriptor, body)\n reportOutcome(labelFor(descriptor), result.outcome)\n await refreshSystem(descriptor.system)\n })\n}\n\n/** The record the create form is prefilled from: the first configured system that has one. */\nconst prefillSource = computed(() => {\n const first = props.descriptors.find((item) => records.value.has(item.system))\n return isUndefined(first) ? null : (records.value.get(first.system) ?? null)\n})\n\nconst sourceEnabled = computed(() => {\n const first = props.descriptors.find((item) => records.value.has(item.system))\n if (isUndefined(first)) return false\n return store.results.get(first.system)?.user?.enabled === true\n})\n\nconst bulkOpen = ref(false)\nconst bulkAction = ref<BulkActionType>(BulkAction.Disable)\nconst repairOpen = ref(false)\n\nconst openBulk = (action: BulkActionType) => {\n bulkAction.value = action\n bulkOpen.value = true\n}\n\n/** Every bulk write passes through here, retries included. A system the descriptor refuses is not written. */\nconst writableSystems = (systems: string[]) =>\n systems.filter((system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n return !isUndefined(descriptor) && descriptorMayWrite(descriptor, 'update')\n })\n\nconst runBulk = async (requested: string[]) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const systems = writableSystems(requested)\n if (systems.length === 0) return\n const enabled = bulkAction.value === BulkAction.Enable\n store.startBulk(bulkAction.value, systems, id)\n await Promise.allSettled(\n systems.map(async (system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor)) return\n store.setBulkEntry(system, BulkOutcome.Running)\n const result = await writes.setEnabled(descriptor, id, enabled)\n store.setBulkEntry(system, result.outcome)\n await refreshSystem(system)\n })\n )\n store.finishBulk()\n}\n\nconst runRepair = async (payload: { target: BaseUser; systems: string[] }) => {\n const id = store.resolvedId\n if (isNull(id)) return\n const systems = writableSystems(payload.systems)\n if (systems.length === 0) return\n store.startBulk(BulkAction.Metadata, systems, id)\n // Captured before any write, so the comparison uses the values the operator saw, not a row a sibling write refreshed.\n const seenBefore = new Map(records.value)\n await Promise.allSettled(\n systems.map(async (system) => {\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor)) return\n store.setBulkEntry(system, BulkOutcome.Running)\n const result = await writes.writeMetadata(\n descriptor,\n id,\n payload.target,\n undefined,\n seenBefore.get(system) ?? null\n )\n store.setBulkEntry(system, result.outcome, detailFor(result.concurrentFields))\n await refreshSystem(system)\n })\n )\n store.finishBulk()\n}\n\nconst createAnywhereOpen = ref(false)\nconst createAnywhereSystem = ref<string | null>(null)\nconst createAnywhereUser = ref<AnzuUser>(createAnzuUser())\nconst createAnywhereChecking = ref(false)\nconst createAnywhereConflict = ref<string[]>([])\nconst createAnywhereError = ref<string | null>(null)\n\n/** Set when the page goes away, so work that finishes afterwards does not refill it. */\nlet left = false\n\nconst openCreateAnywhere = () => {\n // Pick the first enabled system, not the first listed. A system disabled in the configuration\n // is not an option, and preselecting it would POST through a client with no base URL.\n createAnywhereSystem.value =\n props.descriptors.find((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))?.system ?? null\n createAnywhereUser.value = createAnzuUser(createAnywhereSystem.value ?? '')\n createAnywhereConflict.value = []\n createAnywhereError.value = null\n createAnywhereOpen.value = true\n}\n\n/**\n * Before creating, the typed id is looked up across the systems.\n * cms, dam and contentHub skip the SSO lookup for a numeric id, and the validators check id and e-mail separately. A\n * typo would create an account with one person's id and another's e-mail, and later fan-outs follow the wrong identity.\n * If a probe answers 401, 403 or nothing, creating is blocked, because the id's owner is unknown.\n */\nconst confirmCreateAnywhere = async () => {\n const id = createAnywhereUser.value.id\n const system = createAnywhereSystem.value\n createAnywhereConflict.value = []\n createAnywhereError.value = null\n if (isNull(system)) return\n // The id is checked here, not only by the form. A term the search refuses probes\n // nothing, and that empty result would read as \"this id belongs to nobody\".\n if (isNull(id) || isUndefined(id) || !Number.isInteger(id) || id <= 0) {\n createAnywhereError.value = t('common.userSystem.create.invalidId')\n return\n }\n if (!(await v$.value.$validate())) return\n createAnywhereChecking.value = true\n try {\n if (!(await search(String(id)))) {\n createAnywhereError.value = t('common.userSystem.create.invalidId')\n return\n }\n if (left) return\n if (records.value.size > 0) {\n createAnywhereConflict.value = [...records.value.keys()]\n return\n }\n if (unresolvedSystems.value.length > 0) {\n createAnywhereConflict.value = unresolvedSystems.value\n return\n }\n const descriptor = props.descriptors.find((item) => item.system === system)\n if (isUndefined(descriptor) || !descriptor.isEnabled() || !descriptorMayWrite(descriptor, 'create')) return\n const body = createAnzuUser(system)\n body.id = id\n body.email = createAnywhereUser.value.email\n body.person = cloneDeep(createAnywhereUser.value.person)\n body.avatar = cloneDeep(createAnywhereUser.value.avatar)\n // Nobody to copy from, so the account is created switched off, as on an ordinary new-user page.\n body.enabled = false\n const result = await writes.createInSystem(descriptor, body)\n reportOutcome(labelFor(descriptor), result.outcome)\n if (result.outcome !== BulkOutcome.Done) return\n // The dialog is not persistent, so the operator can navigate away while the POST is pending.\n // The following search takes a fresh generation that `cancel()`\n // cannot stop, and would refill the store the unmount just emptied.\n if (left) return\n createAnywhereOpen.value = false\n await search(String(id))\n } finally {\n createAnywhereChecking.value = false\n }\n}\n\n/**\n * Uses the chosen target's own profile, not a blanket strict one.\n * The repair dialog is strict because it writes to nine systems. This creates one account\n * in one system, and strict would demand an avatar colour that blog does not require.\n */\nconst createAnywhereRequiredMetadata = computed(\n () => props.descriptors.find((item) => item.system === createAnywhereSystem.value)?.requiredMetadata ?? true\n)\n\n/** What is special about an account in the chosen system. For blog and forum it is a public one. */\nconst createAnywhereNote = computed(\n () => props.descriptors.find((item) => item.system === createAnywhereSystem.value)?.createNote\n)\n\nconst createSystemOptions = computed(() =>\n props.descriptors\n .filter((item) => item.isEnabled() && descriptorMayWrite(item, 'create'))\n .map((item) => ({ value: item.system, title: labelFor(item) }))\n)\n\n// The store exists so a closed dialog does not stop a running bulk action, not to keep a person across navigation.\n// Without this reset, returning through the menu showed the last\n// person's rows and live buttons under an empty search box.\nonBeforeUnmount(() => {\n left = true\n cancel()\n store.reset()\n})\n\ndefineExpose({\n search: async (value: string) => {\n term.value = value\n await runSearch()\n },\n})\n</script>\n\n<template>\n <div>\n <VCard variant=\"flat\">\n <VCardText>\n <div class=\"d-flex align-center ga-2\">\n <VTextField\n v-model=\"term\"\n :label=\"t('common.userSystem.search.label')\"\n :hint=\"t('common.userSystem.search.hint')\"\n persistent-hint\n density=\"compact\"\n data-cy=\"cross-system-search\"\n @keyup.enter=\"runSearch\"\n />\n <ABtnPrimary\n data-cy=\"cross-system-search-submit\"\n @click.stop=\"runSearch\"\n >\n {{ t('common.userSystem.search.submit') }}\n </ABtnPrimary>\n </div>\n <!--\n The two rounds are named while they run. Between them a row is neither present nor absent.\n Showing \"no account here\" would invite a Create for an account that exists under another address.\n -->\n <div\n v-if=\"store.phase === CrossSystemPhase.MatchingEmail\"\n class=\"text-body-small mt-2\"\n >\n {{ t('common.userSystem.search.phase.matchingEmail') }}\n </div>\n <div\n v-else-if=\"store.phase === CrossSystemPhase.VerifyingById\"\n class=\"text-body-small mt-2\"\n >\n {{ t('common.userSystem.search.phase.verifyingById') }}\n </div>\n </VCardText>\n </VCard>\n\n <VAlert\n v-if=\"store.identityConflict\"\n type=\"error\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"my-3\"\n data-cy=\"identity-conflict\"\n >\n {{ t('common.userSystem.search.identityConflict') }}\n </VAlert>\n\n <!-- Neither an address nor an id. The previous person's rows are gone, and this says why. -->\n <VAlert\n v-if=\"store.termRejected\"\n type=\"warning\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"my-3\"\n data-cy=\"cross-system-term-rejected\"\n >\n {{ t('common.userSystem.search.termRejected') }}\n </VAlert>\n\n <VCard\n v-if=\"searchDone\"\n variant=\"flat\"\n class=\"mt-3\"\n >\n <VCardText class=\"d-flex flex-column ga-3\">\n <div\n v-for=\"descriptor in descriptors\"\n :key=\"descriptor.system\"\n class=\"d-flex align-center flex-wrap ga-2\"\n :data-cy=\"`cross-system-row-${descriptor.system}`\"\n >\n <div\n class=\"font-weight-medium\"\n style=\"min-width: 8rem\"\n >\n {{ labelFor(descriptor) }}\n </div>\n <AUserSystemStatusChip\n v-if=\"store.results.get(descriptor.system)\"\n :axes=\"store.results.get(descriptor.system)!.axes\"\n />\n <VChip\n v-if=\"extraStateFor(descriptor)\"\n :color=\"EXTRA_STATE_COLOR[extraStateFor(descriptor)!.tone]\"\n label\n size=\"small\"\n >\n {{ extraStateFor(descriptor)!.label }}: {{ extraStateFor(descriptor)!.value }}\n </VChip>\n <div class=\"text-body-small text-medium-emphasis\">\n {{ store.results.get(descriptor.system)?.user?.person.fullName }}\n <template v-if=\"store.results.get(descriptor.system)?.user\">\n · {{ store.results.get(descriptor.system)?.user?.email }}\n </template>\n </div>\n <VSpacer />\n <template\n v-if=\"store.results.get(descriptor.system) && isActionable(store.results.get(descriptor.system)!.axes)\"\n >\n <template v-if=\"descriptorMayWrite(descriptor, 'update')\">\n <VBtn\n size=\"small\"\n variant=\"text\"\n :loading=\"rowBusy.has(descriptor.system)\"\n :disabled=\"blockedByConflict\"\n :data-cy=\"`cross-system-toggle-${descriptor.system}`\"\n @click=\"toggleOne(descriptor, !store.results.get(descriptor.system)!.user!.enabled)\"\n >\n {{\n store.results.get(descriptor.system)!.user!.enabled\n ? t('common.userSystem.bulk.disable.title')\n : t('common.userSystem.bulk.enable.title')\n }}\n </VBtn>\n <AUserManageButton\n v-if=\"manageTargetFor(descriptor)\"\n :target=\"manageTargetFor(descriptor)!\"\n :system-label=\"labelFor(descriptor)\"\n />\n </template>\n <span\n v-else\n class=\"text-body-small text-medium-emphasis\"\n :data-cy=\"`cross-system-no-write-${descriptor.system}`\"\n >\n {{ t('common.userSystem.state.noWriteRight') }}\n </span>\n </template>\n <!--\n Create is offered only when the person exists somewhere. That is the only way their global id is known.\n -->\n <template\n v-else-if=\"\n foundAnywhere &&\n store.results.get(descriptor.system) &&\n store.results.get(descriptor.system)!.axes.presence === 'absent'\n \"\n >\n <AUserCreateInSystemButton\n v-if=\"descriptorMayWrite(descriptor, 'create')\"\n :system-label=\"labelFor(descriptor)\"\n :create-note=\"descriptor.createNote\"\n :will-be-enabled=\"sourceEnabled\"\n :loading=\"rowBusy.has(descriptor.system)\"\n :disabled=\"blockedByConflict\"\n :required-metadata=\"descriptor.requiredMetadata\"\n :user-id=\"store.resolvedId\"\n :source=\"prefillSource\"\n @confirm=\"(user) => createFromSource(descriptor, user)\"\n />\n <span\n v-else\n class=\"text-body-small text-medium-emphasis\"\n :data-cy=\"`cross-system-no-write-${descriptor.system}`\"\n >\n {{ t('common.userSystem.state.noWriteRight') }}\n </span>\n </template>\n </div>\n </VCardText>\n </VCard>\n\n <VCard\n v-if=\"differences.length > 0\"\n variant=\"flat\"\n class=\"mt-3\"\n data-cy=\"cross-system-differences\"\n >\n <VCardText>\n <div class=\"text-label-large\">{{ t('common.userSystem.inconsistency.title') }}</div>\n <div\n v-for=\"difference in differences\"\n :key=\"difference.field\"\n class=\"text-body-small\"\n >\n <strong>{{ difference.field }}</strong>\n <span\n v-for=\"[system, systemValue] in difference.values\"\n :key=\"system\"\n class=\"ml-2\"\n >\n {{ system }}: {{ systemValue || '—' }}\n </span>\n </div>\n </VCardText>\n </VCard>\n\n <div\n v-if=\"searchDone && foundAnywhere && anyFoundWritable\"\n class=\"d-flex ga-2 mt-3\"\n >\n <!-- All three open a dialog. None of them acts straight away. -->\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-disable\"\n @click=\"openBulk(BulkAction.Disable)\"\n >\n {{ t('common.userSystem.bulk.openDisable') }}\n </ABtnTertiary>\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-enable\"\n @click=\"openBulk(BulkAction.Enable)\"\n >\n {{ t('common.userSystem.bulk.openEnable') }}\n </ABtnTertiary>\n <ABtnTertiary\n :disabled=\"store.bulkRunning || blockedByConflict\"\n data-cy=\"cross-system-bulk-metadata\"\n @click=\"repairOpen = true\"\n >\n {{ t('common.userSystem.bulk.openMetadata') }}\n </ABtnTertiary>\n <div\n v-if=\"store.bulkRunning\"\n class=\"text-body-small align-self-center\"\n >\n {{ t('common.userSystem.bulk.runningElsewhere') }}\n </div>\n </div>\n\n <VCard\n v-if=\"searchDone && !foundAnywhere\"\n variant=\"flat\"\n class=\"mt-3\"\n >\n <VCardText>\n <div data-cy=\"cross-system-not-found\">{{ t('common.userSystem.search.notFound') }}</div>\n <ABtnPrimary\n v-if=\"canOfferCreateAnywhere\"\n class=\"mt-2\"\n data-cy=\"cross-system-create-anywhere\"\n @click=\"openCreateAnywhere\"\n >\n {{ t('common.userSystem.search.createAnywhere') }}\n </ABtnPrimary>\n <!-- Not offered for want of a create right: then nothing is left unconfirmed to retry. -->\n <template v-else-if=\"!searchedByEmail && unresolvedSystems.length > 0\">\n <div class=\"text-body-small mt-2\">\n {{ t('common.userSystem.create.notAuthoritative', { systems: unresolvedSystems.join(', ') }) }}\n </div>\n <ABtnTertiary\n class=\"mt-2\"\n data-cy=\"cross-system-retry-search\"\n @click=\"runSearch\"\n >\n {{ t('common.userSystem.button.retry') }}\n </ABtnTertiary>\n </template>\n </VCardText>\n </VCard>\n\n <AUserBulkActionDialog\n v-model:open=\"bulkOpen\"\n :action=\"bulkAction\"\n :descriptors=\"descriptors\"\n @run=\"runBulk\"\n />\n\n <AUserMetadataRepairDialog\n v-model:open=\"repairOpen\"\n :descriptors=\"descriptors\"\n @confirm=\"runRepair\"\n />\n\n <VDialog\n v-model=\"createAnywhereOpen\"\n :max-width=\"720\"\n >\n <VCard>\n <ADialogToolbar @cancel=\"createAnywhereOpen = false\">\n {{ t('common.userSystem.search.createAnywhere') }}\n </ADialogToolbar>\n <VCardText>\n <VSelect\n v-model=\"createAnywhereSystem\"\n :items=\"createSystemOptions\"\n :label=\"t('common.userSystem.table.system')\"\n density=\"compact\"\n data-cy=\"create-anywhere-system\"\n />\n <!-- Id and e-mail are both asked for: the e-mail is required by the backend. -->\n <AUserMetadataForm\n v-model:user=\"createAnywhereUser\"\n :required=\"createAnywhereRequiredMetadata\"\n id-input\n />\n <p\n v-if=\"createAnywhereNote\"\n class=\"mt-2\"\n >\n {{ createAnywhereNote }}\n </p>\n <VAlert\n v-if=\"createAnywhereError\"\n type=\"error\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"mt-2\"\n data-cy=\"create-anywhere-error\"\n >\n {{ createAnywhereError }}\n </VAlert>\n <VAlert\n v-if=\"createAnywhereConflict.length > 0\"\n type=\"warning\"\n variant=\"tonal\"\n density=\"compact\"\n class=\"mt-2\"\n data-cy=\"create-anywhere-conflict\"\n >\n {{ t('common.userSystem.create.notAuthoritative', { systems: createAnywhereConflict.join(', ') }) }}\n </VAlert>\n <p class=\"mt-2\">{{ t('common.userSystem.create.note') }}</p>\n <p>{{ t('common.userSystem.create.willBeDisabled') }}</p>\n </VCardText>\n <VCardActions>\n <ABtnTertiary @click.stop=\"createAnywhereOpen = false\">\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <VSpacer />\n <ABtnPrimary\n :loading=\"createAnywhereChecking\"\n data-cy=\"create-anywhere-confirm\"\n @click.stop=\"confirmCreateAnywhere\"\n >\n {{ t('common.button.confirm') }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,IAAMwD,IAAQC,GAMRC,KAAOH,IAIP,EAAE,SAAMI,GAAQ,GAChB,EAAE,iBAAcC,EAAU,GAC1BC,IAAQC,EAAwB,GAChC,EAAE,sBAAmBC,EAAmB,GACxCC,IAASC,GAAyB,GAIlCC,KAAK7B,GAAa,GAGlB,EAAE,YAAQ,kBAAe,sBAAmB,eAAW8B,GAAyB;GACpF,aAAaX,EAAM;GACnB,aAAaA,EAAM;EAC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,CAAA;;UAElC,SAAA9I,QAAgC,CAA7BO,EAAAC,EAAAJ,EAAA+F,CAAA,CAAC,CAAA,uBAAA,CAAA,GAAA,CAAA,C"}
@@ -17,7 +17,11 @@ var A = ["data-cy"], j = { class: "font-weight-medium" }, M = {
17
17
  }, N = {
18
18
  key: 2,
19
19
  class: "text-body-small text-medium-emphasis w-100"
20
- }, P = /*@__PURE__*/ _({
20
+ }, P = {
21
+ key: 5,
22
+ class: "text-body-small text-medium-emphasis",
23
+ "data-cy": "user-system-no-write"
24
+ }, F = /*@__PURE__*/ _({
21
25
  __name: "AUserSystemPanel",
22
26
  props: {
23
27
  descriptor: {},
@@ -37,48 +41,48 @@ var A = ["data-cy"], j = { class: "font-weight-medium" }, M = {
37
41
  }
38
42
  },
39
43
  emits: ["create"],
40
- setup(_, { expose: P, emit: F }) {
41
- let I = _, L = F, { t: R } = E(), z = v(i, void 0), { axes: B, user: V, probe: H, cancel: U } = a({
42
- descriptor: I.descriptor,
43
- refreshHook: z
44
- }), W = u(() => I.descriptor.label ?? I.descriptor.system), G = u(() => B.value.load === s.Loaded && V.value !== null && !l(I.descriptor.manage) && r(I.descriptor, "update")), K = u(() => !I.readonly && c(B.value) && r(I.descriptor, "create")), q = u(() => V.value === null || l(I.descriptor.manage) ? null : I.descriptor.manage(V.value)), J = u(() => V.value === null || l(I.descriptor.extraState) ? null : I.descriptor.extraState(V.value)), Y = {
44
+ setup(_, { expose: F, emit: I }) {
45
+ let L = _, R = I, { t: z } = E(), B = v(i, void 0), { axes: V, user: H, probe: U, cancel: W } = a({
46
+ descriptor: L.descriptor,
47
+ refreshHook: B
48
+ }), G = u(() => L.descriptor.label ?? L.descriptor.system), K = u(() => V.value.load === s.Loaded && H.value !== null && !l(L.descriptor.manage) && r(L.descriptor, "update")), q = u(() => !L.readonly && c(V.value) && r(L.descriptor, "create")), J = u(() => V.value.load === s.Loaded && H.value !== null && !l(L.descriptor.manage) && !r(L.descriptor, "update") || !L.readonly && c(V.value) && !r(L.descriptor, "create")), Y = u(() => H.value === null || l(L.descriptor.manage) ? null : L.descriptor.manage(H.value)), X = u(() => H.value === null || l(L.descriptor.extraState) ? null : L.descriptor.extraState(H.value)), Z = {
45
49
  ok: "success",
46
50
  warn: "warning",
47
51
  error: "error"
48
- }, X = u(() => B.value.access === o.Unavailable || B.value.access === o.Unauthenticated), Z = () => H(I.userId);
49
- return b(Z), w(() => I.userId, Z), y(U), P({ refresh: Z }), (r, i) => (x(), p("div", {
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", {
50
54
  class: "d-flex align-center flex-wrap ga-2",
51
55
  "data-cy": `user-system-panel-${_.descriptor.system}`
52
56
  }, [
53
- m("div", j, S(W.value), 1),
54
- g(n, { axes: C(B) }, null, 8, ["axes"]),
55
- J.value ? (x(), d(D, {
57
+ m("div", j, S(G.value), 1),
58
+ g(n, { axes: C(V) }, null, 8, ["axes"]),
59
+ X.value ? (x(), d(D, {
56
60
  key: 0,
57
- color: Y[J.value.tone],
61
+ color: Z[X.value.tone],
58
62
  label: "",
59
63
  size: "small"
60
64
  }, {
61
- default: T(() => [h(S(J.value.label) + ": " + S(J.value.value), 1)]),
65
+ default: T(() => [h(S(X.value.label) + ": " + S(X.value.value), 1)]),
62
66
  _: 1
63
67
  }, 8, ["color"])) : f("", !0),
64
- C(V) ? (x(), p("div", M, S(C(V).person.fullName) + " · " + S(C(V).email), 1)) : f("", !0),
68
+ C(H) ? (x(), p("div", M, S(C(H).person.fullName) + " · " + S(C(H).email), 1)) : f("", !0),
65
69
  _.descriptor.enabledNote ? (x(), p("div", N, S(_.descriptor.enabledNote), 1)) : f("", !0),
66
70
  g(O),
67
- G.value && q.value ? (x(), d(t, {
71
+ K.value && Y.value ? (x(), d(t, {
68
72
  key: 3,
69
- target: q.value,
70
- "system-label": W.value
73
+ target: Y.value,
74
+ "system-label": G.value
71
75
  }, null, 8, ["target", "system-label"])) : f("", !0),
72
- K.value ? (x(), d(e, {
76
+ q.value ? (x(), d(e, {
73
77
  key: 4,
74
- "system-label": W.value,
78
+ "system-label": G.value,
75
79
  "create-note": _.descriptor.createNote,
76
80
  "will-be-enabled": _.createEnabled,
77
81
  loading: _.creating,
78
82
  "required-metadata": _.descriptor.requiredMetadata,
79
83
  "user-id": _.userId,
80
84
  source: _.source,
81
- onConfirm: i[0] ||= (e) => L("create", _.descriptor, e)
85
+ onConfirm: i[0] ||= (e) => R("create", _.descriptor, e)
82
86
  }, null, 8, [
83
87
  "system-label",
84
88
  "create-note",
@@ -88,19 +92,20 @@ var A = ["data-cy"], j = { class: "font-weight-medium" }, M = {
88
92
  "user-id",
89
93
  "source"
90
94
  ])) : f("", !0),
91
- X.value ? (x(), d(k, {
92
- key: 5,
95
+ J.value ? (x(), p("span", P, S(C(z)("common.userSystem.state.noWriteRight")), 1)) : f("", !0),
96
+ Q.value ? (x(), d(k, {
97
+ key: 6,
93
98
  size: "small",
94
99
  variant: "text",
95
100
  "data-cy": "user-system-retry",
96
- onClick: Z
101
+ onClick: $
97
102
  }, {
98
- default: T(() => [h(S(C(R)("common.userSystem.button.retry")), 1)]),
103
+ default: T(() => [h(S(C(z)("common.userSystem.button.retry")), 1)]),
99
104
  _: 1
100
105
  })) : f("", !0)
101
106
  ], 8, A));
102
107
  }
103
108
  });
104
- export { P as default };
109
+ export { F as default };
105
110
 
106
111
  //# sourceMappingURL=AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AUserSystemPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","AUserSystemStatusChip","_unref","_createBlock","_component_VChip","_withCtx","_createTextVNode","_component_VSpacer","AUserManageButton","AUserCreateInSystemButton","_component_VBtn","AUserCreateInSystemButton_default","AUserManageButton_default","AUserSystemStatusChip_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","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","manageTarget","extraState","EXTRA_STATE_COLOR","canRetry","UserSystemAccess","run","probe","onMounted","watch","onBeforeUnmount","cancel","openBlock","createElementBlock","createElementVNode","toDisplayString","createVNode","unref","createBlock","VChip","withCtx","createTextVNode","createCommentVNode","VSpacer","_cache","VBtn","t"],"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 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 canRetry = computed(\n () => axes.value.access === UserSystemAccess.Unavailable || axes.value.access === UserSystemAccess.Unauthenticated\n)\n\nconst run = () => probe(props.userId)\n\nonMounted(run)\n\n// The panel is never re-created because `VWindowItem` hides it\n// with `v-show`. A new id has to reach it through this watcher.\nwatch(() => props.userId, run)\n\nonBeforeUnmount(cancel)\n\ndefineExpose({\n refresh: run,\n})\n</script>\n\n<template>\n <div\n class=\"d-flex align-center flex-wrap ga-2\"\n :data-cy=\"`user-system-panel-${descriptor.system}`\"\n >\n <div class=\"font-weight-medium\">{{ label }}</div>\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=\"user\"\n class=\"text-body-small text-medium-emphasis\"\n >\n {{ user.person.fullName }} · {{ user.email }}\n </div>\n <div\n v-if=\"descriptor.enabledNote\"\n class=\"text-body-small text-medium-emphasis w-100\"\n >\n {{ descriptor.enabledNote }}\n </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 <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</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,IAAMyB,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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AAC,KAAK,GAAA,CAAA,K;GAGpCZ,EAAA,WAAW,eADnB1B,EAAA,GAAAC,EAKM,OALNoB,GAKMlB,EADDuB,EAAA,WAAW,WAAW,GAAA,CAAA,K;GAE3BtB,EAAWO,CAAA;GAEHwB,EAAA,SAAcQ,EAAA,SADtB3C,EAAA,GAAAO,EAIEK,GAAA;;IAFC,QAAQ+B,EAAA;IACR,gBAAcV,EAAA;;GAGTQ,EAAA,SADRzC,EAAA,GAAAO,EAUEM,GAAA;;IARC,gBAAcoB,EAAA;IACd,eAAaP,EAAA,WAAW;IACxB,mBAAiBA,EAAA;IACjB,SAASA,EAAA;IACT,qBAAmBA,EAAA,WAAW;IAC9B,WAASA,EAAA;IACT,QAAQA,EAAA;IACR,WAAO,AAAAwC,EAAA,QAAG,MAASvC,EAAI,UAAWD,EAAA,YAAYY,CAAI;;;;;;;;;;GAG7CQ,EAAA,SADR9C,EAAA,GAAAO,EAQOO,GAAA;;IANL,MAAK;IACL,SAAQ;IACR,WAAQ;IACP,SAAOkC;;IAER,SAAAvC,QAAyC,CAAtCC,EAAAP,EAAAG,EAAA8D,CAAA,CAAC,CAAA,gCAAA,CAAA,GAAA,CAAA,C"}
1
+ {"version":3,"file":"AUserSystemPanel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","AUserSystemStatusChip","_unref","_createBlock","_component_VChip","_withCtx","_createTextVNode","_component_VSpacer","AUserManageButton","AUserCreateInSystemButton","_component_VBtn","AUserCreateInSystemButton_default","AUserManageButton_default","AUserSystemStatusChip_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","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","canRetry","UserSystemAccess","run","probe","onMounted","watch","onBeforeUnmount","cancel","openBlock","createElementBlock","createElementVNode","toDisplayString","createVNode","unref","createBlock","VChip","withCtx","createTextVNode","createCommentVNode","VSpacer","_cache","t","VBtn"],"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 canRetry = computed(\n () => axes.value.access === UserSystemAccess.Unavailable || axes.value.access === UserSystemAccess.Unauthenticated\n)\n\nconst run = () => probe(props.userId)\n\nonMounted(run)\n\n// The panel is never re-created because `VWindowItem` hides it\n// with `v-show`. A new id has to reach it through this watcher.\nwatch(() => props.userId, run)\n\nonBeforeUnmount(cancel)\n\ndefineExpose({\n refresh: run,\n})\n</script>\n\n<template>\n <div\n class=\"d-flex align-center flex-wrap ga-2\"\n :data-cy=\"`user-system-panel-${descriptor.system}`\"\n >\n <div class=\"font-weight-medium\">{{ label }}</div>\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=\"user\"\n class=\"text-body-small text-medium-emphasis\"\n >\n {{ user.person.fullName }} · {{ user.email }}\n </div>\n <div\n v-if=\"descriptor.enabledNote\"\n class=\"text-body-small text-medium-emphasis w-100\"\n >\n {{ descriptor.enabledNote }}\n </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</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,IAAM0B,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,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
  }
17
17
  export declare type AssetCustomData = Record<string, any>;
18
18
  export declare const useFetchAssetList: (client: () => AxiosInstance, endPoint: string, licenceId: IntegerId) => import('../../api/composables/useApiFetchList').UseApiFetchListReturnType<AssetSearchListItemDto>;
19
+ /**
20
+ * Assets of several licences in one search, the licences in the filter `licences`. DAM requires them to share an ext
21
+ * system (LicenceCollectionSingleExtSystem). Not every endpoint has it: the UGC proxy of core-dam lists only one licence.
22
+ */
23
+ export declare const useFetchAssetListByLicences: (client: () => AxiosInstance, endPoint: string) => import('../../api/composables/useApiFetchList').UseApiFetchListReturnType<AssetSearchListItemDto>;
19
24
  /**
20
25
  * `options.report: false` keeps a failure of this read out of the api error logger.
21
26
  * Used by the upload queue, which polls the same asset repeatedly and reports only the first failure of a streak.
@@ -17,7 +17,12 @@ var m = 10, h = "asset", g = 50, _ = (e, t, n) => c({
17
17
  entity: h,
18
18
  urlTemplate: t + "/licence/:licenceId",
19
19
  urlParams: { licenceId: n }
20
- }), v = (e, t, n, r = {}) => {
20
+ }), v = (e, t) => c({
21
+ client: e,
22
+ system: a,
23
+ entity: h,
24
+ urlTemplate: t + "/licence"
25
+ }), y = (e, t, n, r = {}) => {
21
26
  let { execute: i } = u({
22
27
  client: e,
23
28
  method: "GET",
@@ -29,7 +34,7 @@ var m = 10, h = "asset", g = 50, _ = (e, t, n) => c({
29
34
  urlParams: { id: n },
30
35
  report: r.report
31
36
  });
32
- }, y = (e, t, n = o) => {
37
+ }, b = (e, t, n = o) => {
33
38
  let { execute: r } = u({
34
39
  client: e,
35
40
  method: "GET",
@@ -38,7 +43,7 @@ var m = 10, h = "asset", g = 50, _ = (e, t, n) => c({
38
43
  urlTemplate: n + "/:id"
39
44
  });
40
45
  return r({ urlParams: { id: t } });
41
- }, b = (e, t, n) => {
46
+ }, x = (e, t, n) => {
42
47
  let { execute: r } = u({
43
48
  client: e,
44
49
  method: "GET",
@@ -47,11 +52,11 @@ var m = 10, h = "asset", g = 50, _ = (e, t, n) => c({
47
52
  urlTemplate: t + "/asset-file/:id"
48
53
  });
49
54
  return r({ urlParams: { id: n } });
50
- }, x = async (e, t, n, r = void 0) => {
51
- let i = n.filter(k), { execute: a } = T(e, t);
52
- return (await O(a, A(i, r), i.map((e) => e.assetType))).flat();
55
+ }, S = async (e, t, n, r = void 0) => {
56
+ let i = n.filter(A), { execute: a } = E(e, t);
57
+ return (await k(a, j(i, r), i.map((e) => e.assetType))).flat();
53
58
  };
54
- async function S(e, t, n, r) {
59
+ async function C(e, t, n, r) {
55
60
  if (n.length === 0) return Promise.resolve([]);
56
61
  let i = Math.ceil(n.length / g), a = [];
57
62
  for (let o = 0; o < i; o++) {
@@ -60,8 +65,8 @@ async function S(e, t, n, r) {
60
65
  }
61
66
  return a;
62
67
  }
63
- var C = (e, t, n, r) => new Promise((i, a) => {
64
- S(e, t, n, r).then((e) => {
68
+ var w = (e, t, n, r) => new Promise((i, a) => {
69
+ C(e, t, n, r).then((e) => {
65
70
  if (n.length === 0) return i([]);
66
71
  if (e.length === 0) a(e);
67
72
  else if (e.every((e) => e.status === 200)) {
@@ -76,17 +81,17 @@ var C = (e, t, n, r) => new Promise((i, a) => {
76
81
  }).catch((e) => {
77
82
  a(e);
78
83
  });
79
- }), w = (e, t) => ({
84
+ }), T = (e, t) => ({
80
85
  client: e,
81
86
  method: "PATCH",
82
87
  system: a,
83
88
  entity: h,
84
89
  urlTemplate: t + "/metadata-bulk-update",
85
90
  options: { validateStatus: (e) => e === 200 }
86
- }), T = (e, t) => d({
87
- ...w(e, t),
91
+ }), E = (e, t) => d({
92
+ ...T(e, t),
88
93
  shape: "array"
89
- }), E = (e, t) => l(w(e, t)), D = class extends n {
94
+ }), D = (e, t) => l(T(e, t)), O = class extends n {
90
95
  requestFields;
91
96
  assetTypes;
92
97
  constructor(e, t) {
@@ -95,19 +100,19 @@ var C = (e, t, n, r) => new Promise((i, a) => {
95
100
  errors: t
96
101
  })), this.assetTypes = t;
97
102
  }
98
- }, O = async (e, t, n) => {
103
+ }, k = async (e, t, n) => {
99
104
  let i = [];
100
105
  for (let a = 0; a < t.length; a += m) try {
101
106
  i.push(await e({ body: t.slice(a, a + m) }));
102
107
  } catch (e) {
103
- throw r(e) && p.isAxiosError(e.cause) ? new D(e.cause, n.slice(a, a + m)) : e;
108
+ throw r(e) && p.isAxiosError(e.cause) ? new O(e.cause, n.slice(a, a + m)) : e;
104
109
  }
105
110
  return i;
106
- }, k = (t) => !e(t.assetId) && t.canEditMetadata;
107
- function A(e, t = void 0) {
111
+ }, A = (t) => !e(t.assetId) && t.canEditMetadata;
112
+ function j(e, t = void 0) {
108
113
  let n = [];
109
114
  return e.forEach((e) => {
110
- k(e) && n.push({
115
+ A(e) && n.push({
111
116
  id: e.assetId,
112
117
  keywords: e.keywords,
113
118
  authors: e.authors,
@@ -117,7 +122,7 @@ function A(e, t = void 0) {
117
122
  });
118
123
  }), n;
119
124
  }
120
- var { showErrorsDefault: j, showUnknownError: M, showApiValidationError: N } = i(), P = (e, n, r, i) => {
125
+ var { showErrorsDefault: M, showUnknownError: N, showApiValidationError: P } = i(), F = (e, n, r, i) => {
121
126
  let a = e.match(/^\[(\d+)\]\.(.+)$/), o = a ? a[2] : e;
122
127
  if (o === "keywords") return f("common.damImage.asset.model.keywords");
123
128
  if (o === "authors") return f("common.damImage.asset.model.authors");
@@ -127,19 +132,19 @@ var { showErrorsDefault: j, showUnknownError: M, showApiValidationError: N } = i
127
132
  if (t) return t.name;
128
133
  }
129
134
  return c;
130
- }, F = (e, t, n) => {
131
- if (e instanceof D) {
135
+ }, I = (e, t, n) => {
136
+ if (e instanceof O) {
132
137
  let r = /* @__PURE__ */ new Map();
133
138
  for (let { field: i, errors: a } of e.requestFields) {
134
- let o = P(i, e.assetTypes, t, n);
139
+ let o = F(i, e.assetTypes, t, n);
135
140
  r.set(o, /* @__PURE__ */ new Set([...r.get(o) ?? [], ...a]));
136
141
  }
137
- N(Array.from(r, ([e, t]) => ({
142
+ P(Array.from(r, ([e, t]) => ({
138
143
  field: e,
139
144
  errors: [...t]
140
145
  })), -1, !0);
141
- } else j(e) || M();
142
- }, I = async (e, t, n, r, i) => {
146
+ } else M(e) || N();
147
+ }, L = async (e, t, n, r, i) => {
143
148
  let a = {
144
149
  id: n.id,
145
150
  keywords: n.keywords,
@@ -147,19 +152,19 @@ var { showErrorsDefault: j, showUnknownError: M, showApiValidationError: N } = i
147
152
  described: !0,
148
153
  customData: n.metadata.customData,
149
154
  mainFileSingleUse: i
150
- }, { execute: o } = E(e, t);
151
- await O(o, [a], [n.attributes.assetType]);
152
- }, L = async (e, t, n) => {
155
+ }, { execute: o } = D(e, t);
156
+ await k(o, [a], [n.attributes.assetType]);
157
+ }, R = async (e, t, n) => {
153
158
  let r = {
154
159
  id: n.id,
155
160
  authors: n.authors,
156
161
  described: !0
157
- }, { execute: i } = E(e, t);
158
- await O(i, [r], [n.attributes.assetType]);
159
- }, R = async (e, t, n) => {
160
- let { execute: r } = E(e, t);
161
- await O(r, n, []);
162
+ }, { execute: i } = D(e, t);
163
+ await k(i, [r], [n.attributes.assetType]);
164
+ }, z = async (e, t, n) => {
165
+ let { execute: r } = D(e, t);
166
+ await k(r, n, []);
162
167
  };
163
- export { h as ENTITY, R as bulkUpdateAssetsAuthors, x as bulkUpdateAssetsMetadata, v as fetchAsset, y as fetchAssetAsCmsMedia, b as fetchAssetByFileId, C as fetchAssetListByIds, k as hasMetadataToSave, F as showMetadataSaveError, L as updateAssetAuthors, I as updateAssetMetadata, _ as useFetchAssetList };
168
+ export { h as ENTITY, z as bulkUpdateAssetsAuthors, S as bulkUpdateAssetsMetadata, y as fetchAsset, b as fetchAssetAsCmsMedia, x as fetchAssetByFileId, w as fetchAssetListByIds, A as hasMetadataToSave, I as showMetadataSaveError, R as updateAssetAuthors, L as updateAssetMetadata, _ as useFetchAssetList, v as useFetchAssetListByLicences };
164
169
 
165
170
  //# sourceMappingURL=damAssetApi.js.map