@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.
- package/dist/AnzuSystemsCommonAdmin.d.ts +10 -4
- package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
- package/dist/common-admin.js +255 -254
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js +1 -4
- package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js +93 -86
- package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js +30 -25
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/api/damAssetApi.d.ts +5 -0
- package/dist/domains/dam/api/damAssetApi.js +39 -34
- package/dist/domains/dam/api/damAssetApi.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/api/damPodcastApi.d.ts +2 -2
- package/dist/domains/dam/assetSelect/api/damPodcastApi.js +4 -4
- package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js +152 -153
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +3 -0
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js +80 -72
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +3 -0
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js +88 -80
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue.d.ts +3 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue_vue_type_script_setup_true_lang.js +42 -60
- package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.vue_vue_type_script_setup_true_lang.js +7 -9
- package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.js +6 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue.d.ts +3 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectLicencePresetBar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js +127 -106
- package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue.d.ts +3 -1
- package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js +32 -30
- package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js +96 -96
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.d.ts +22 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.js +44 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectPresetControl.js.map +1 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectPresets.d.ts +28 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectPresets.js +32 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectPresets.js.map +1 -0
- package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.d.ts +19 -6
- package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.js +9 -5
- package/dist/domains/dam/assetSelect/composables/podcastFilterAndActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/store/assetSelectStore.d.ts +5 -1
- package/dist/domains/dam/assetSelect/store/assetSelectStore.js +97 -80
- package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js +3 -3
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +3 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js +3 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/types/AssetLicence.d.ts +6 -6
- package/dist/domains/dam/types/AssetListView.d.ts +10 -0
- package/dist/domains/dam/types/DamCurrentUser.d.ts +3 -0
- package/dist/domains/dam/user/api/assetListViewApi.d.ts +7 -0
- package/dist/domains/dam/user/api/assetListViewApi.js +21 -0
- package/dist/domains/dam/user/api/assetListViewApi.js.map +1 -0
- package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue.d.ts +3 -0
- package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +18 -14
- package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/user/components/DamAssetLicenceRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/domains/dam/user/components/DamAssetLicenceRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.js +6 -0
- package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.js.map +1 -0
- package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue.d.ts +36 -0
- package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/domains/dam/user/components/DamAssetListViewRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/user/composables/assetListViewActions.d.ts +10 -0
- package/dist/domains/dam/user/composables/assetListViewActions.js +15 -0
- package/dist/domains/dam/user/composables/assetListViewActions.js.map +1 -0
- package/dist/domains/dam/user/composables/cachedAssetLicences.d.ts +3 -3
- package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.d.ts +14 -4
- package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.js +3 -0
- package/dist/domains/dam/user/filter/AssetLicenceGroupFilter.js.map +1 -1
- package/dist/domains/dam/user/filter/AssetListViewFilter.d.ts +24 -0
- package/dist/domains/dam/user/filter/AssetListViewFilter.js +25 -0
- package/dist/domains/dam/user/filter/AssetListViewFilter.js.map +1 -0
- package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js +28 -32
- package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/lib.d.ts +4 -2
- package/dist/locales/cs/common/anzuUser.js +4 -4
- package/dist/locales/cs/common/assetSelect.js +26 -0
- package/dist/locales/cs/common/assetSelect.js.map +1 -1
- package/dist/locales/cs.d.ts +5 -0
- package/dist/locales/en/common/anzuUser.js +4 -4
- package/dist/locales/en/common/assetSelect.js +26 -0
- package/dist/locales/en/common/assetSelect.js.map +1 -1
- package/dist/locales/en.d.ts +5 -0
- package/dist/locales/sk/common/anzuUser.js +4 -4
- package/dist/locales/sk/common/assetSelect.js +26 -0
- package/dist/locales/sk/common/assetSelect.js.map +1 -1
- package/dist/locales/sk.d.ts +5 -0
- package/dist/plugins/i18n.d.ts +5 -0
- package/package.json +15 -15
- package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.js +0 -6
- package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.js.map +0 -1
- package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue.d.ts +0 -25
- package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue_vue_type_script_setup_true_lang.js +0 -67
- 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":"assetSelectListActions.js","names":["usePagination","SORT_BY_SCORE_DATE","detailLoading","ref","listController","detailRequest","listTurn","scrolledTo","element","button","overflowY","useAssetSelectActions","useCommonAdminCoreDamOptions","configName","failedInListTurn","scrolledAtLeave","assetSelectStore","useAssetSelectStore","storeToRefs","assetDetailStore","useAssetDetailStore","useSidebar","useDisplay","useAlerts","useAssetListFilter","resolveTypeFilter","inPodcast","DamAssetType","assetType","forgetAssetNotShown","isNull","item","startListAnew","hasNextPage","pagination","readListAfterPause","useDebounceFn","fetchAssetList","fetchAssetListDebounced","useFetchAssetList","damClient","endPointAsset","controller","items","execute","filterData","filterConfig","error","showErrorsDefault","fetchNextPage","page","fetchNextPageInView","entries","isIntersecting","useDamCachedAuthors","useDamCachedKeywords","useDamCachedUsers","onItemClick","useExtSystemIdForCached","mdAndDown","openSidebarRight","data","extSystem","request","fetchAsset","addToCachedAuthors","asset","addToCachedKeywords","showFileInfoEnabled","addToCachedUsers","fetchCachedAuthors","fetchCachedKeywords","fetchCachedUsers","readActiveItemAgain","shown","assetId","useFilterClearHelpers","resetAssetList","clearAll","giveUpDetailRead","selectConfig","singleMode","minCount","maxCount"],"sources":["../../../../../src/domains/dam/assetSelect/composables/assetSelectListActions.ts"],"sourcesContent":["import { useAssetListFilter } from '@/domains/dam/assetSelect/filter/AssetFilter'\nimport { type AssetSelectListItem, useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport { storeToRefs } from 'pinia'\nimport type { Ref } from 'vue'\nimport { ref } from 'vue'\nimport { DamAssetType, type DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { fetchAsset, useFetchAssetList } from '@/domains/dam/api/damAssetApi'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { useDamCachedAuthors } from '@/domains/dam/author/composables/cachedAuthors'\nimport { useDamCachedKeywords } from '@/domains/dam/keyword/composables/cachedKeywords'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { isNull } from '@/shared/utils/common'\nimport { useDamCachedUsers } from '@/domains/dam/author/composables/cachedUsers'\nimport { useSidebar } from '@/domains/dam/assetSelect/composables/assetSelectFilterSidebar'\nimport { SORT_BY_SCORE_DATE } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { useDebounceFn } from '@vueuse/core'\nimport { useDisplay } from 'vuetify'\n\nconst { pagination } = usePagination(SORT_BY_SCORE_DATE)\nconst detailLoading = ref(false)\n// Shared like the pagination: every asset select part requests through here, and only the last request counts.\nlet listController: AbortController | undefined\nlet detailRequest = 0\n// Counts list restarts, so a failed further page is tracked per list.\nlet listTurn = 0\n\n/**\n * Scroll position of the scroll container of the \"Load more\" button: the nearest scrollable ancestor, else the page.\n * A layout change moves the button without changing it.\n */\nconst scrolledTo = (button: Element | undefined) => {\n for (let element = button?.parentElement; element; element = element.parentElement) {\n const { overflowY } = getComputedStyle(element)\n if ((overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight) {\n return element.scrollTop\n }\n }\n return document.scrollingElement?.scrollTop ?? 0\n}\n\nexport function useAssetSelectActions(configName: string) {\n const { damClient, endPointAsset, showFileInfoEnabled } = useCommonAdminCoreDamOptions(configName)\n // A further page of this list failed (list `failedInListTurn`). The\n // button then does not request it again just by coming into view.\n // A press does, or coming into view again after the list was scrolled while the button was hidden.\n // A page-wide flag made the button retry when only a layout change (a side panel) had hidden it.\n let failedInListTurn: number | null = null\n let scrolledAtLeave: number | null = null\n\n const assetSelectStore = useAssetSelectStore()\n const { selectedCount, selectedAssets, assetListItems, loader } = storeToRefs(assetSelectStore)\n const assetDetailStore = useAssetDetailStore()\n const { openSidebarRight } = useSidebar()\n const { mdAndDown } = useDisplay()\n\n const { showErrorsDefault } = useAlerts()\n const { filterData, filterConfig } = useAssetListFilter()\n\n const resolveTypeFilter = (assetType: DamAssetTypeType, inPodcast: boolean | null) => {\n if (inPodcast === true) {\n filterData.type = [DamAssetType.Audio]\n filterData.inPodcast = true\n return\n }\n filterData.type = [assetType]\n filterData.inPodcast = null\n }\n\n /**\n * Forgets the remembered active asset once the side panel shows none\n * and the list has no item for it, so a later list marks no item.\n * Not while a read is pending, which may still show that asset, nor while a detail is open, whose close rereads it.\n * Called where this may have become true: a list is set, or the last requested read has ended.\n */\n const forgetAssetNotShown = () => {\n if (detailLoading.value || !isNull(assetDetailStore.asset) || !isNull(assetDetailStore.dialog)) return\n if (assetSelectStore.assetListItems.some((item) => item.active)) return\n assetSelectStore.forgetActiveAsset()\n }\n\n /**\n * Starts a new list: new order, filter or type, a reopened list or picker, or a reload after applying an upload.\n * The pending list request is aborted. Its rows would land in a replaced list and re-flag a further page.\n * The new list reads from page one and has no further page until it arrives.\n * \"Load more\" auto-requests when in view. Without this it requested page two before page one.\n */\n const startListAnew = () => {\n // Aborted and released: its end does not turn the loader off. The new list keeps it on until read.\n // Turning it off during the debounce let an empty list show \"nothing found\".\n listController?.abort()\n listController = undefined\n listTurn++\n const hasNextPage = isNull(pagination.value.hasNextPage) ? null : false\n pagination.value = { ...pagination.value, page: 1, hasNextPage }\n }\n\n const readListAfterPause = useDebounceFn(async () => {\n await fetchAssetList()\n })\n\n /** Every list reload goes through here: it restarts at once and is read after a debounce. */\n const fetchAssetListDebounced = () => {\n startListAnew()\n return readListAfterPause()\n }\n\n const fetchAssetList = async () => {\n if (assetSelectStore.selectedLicenceId <= 0) {\n // Nothing is read, so the loader of the abandoned list is turned off.\n if (!listController) assetSelectStore.hideLoader()\n return\n }\n resolveTypeFilter(assetSelectStore.assetType, assetSelectStore.inPodcast)\n const { execute } = useFetchAssetList(damClient, endPointAsset, assetSelectStore.selectedLicenceId)\n // Restart again as the read starts, covering anything requested during the debounce.\n startListAnew()\n const controller = (listController = new AbortController())\n try {\n assetSelectStore.showLoader()\n const items = await execute(pagination, filterData, filterConfig, { signal: controller.signal })\n if (controller.signal.aborted) return\n assetSelectStore.setList(items)\n forgetAssetNotShown()\n } catch (error) {\n if (!controller.signal.aborted) showErrorsDefault(error)\n } finally {\n if (listController === controller) assetSelectStore.hideLoader()\n }\n }\n\n const fetchNextPage = async () => {\n if (assetSelectStore.loader) return\n failedInListTurn = null\n const page = pagination.value.page\n pagination.value.page = page + 1\n resolveTypeFilter(assetSelectStore.assetType, assetSelectStore.inPodcast)\n const { execute } = useFetchAssetList(damClient, endPointAsset, assetSelectStore.selectedLicenceId)\n // A new list (filter submit) aborts this page too: appended, it would be the old filter's page.\n listController?.abort()\n const controller = (listController = new AbortController())\n try {\n assetSelectStore.showLoader()\n const items = await execute(pagination, filterData, filterConfig, { signal: controller.signal })\n if (controller.signal.aborted) return\n assetSelectStore.appendList(items)\n } catch (error) {\n if (controller.signal.aborted) return\n // Not when something has put the page back meanwhile: rolling back would overwrite that.\n if (pagination.value.page === page + 1) pagination.value.page = page\n failedInListTurn = listTurn\n scrolledAtLeave = null\n showErrorsDefault(error)\n } finally {\n if (listController === controller) assetSelectStore.hideLoader()\n }\n }\n\n /**\n * \"Load more\" requests the next page itself when it comes into\n * view. Its directive fires again on every re-render while in view.\n * After a failure it used to retry at once and on each failure, with an error each time.\n * After a failure it no longer auto-requests while in view. A press does, or reappearing\n * after the list was scrolled while it was hidden. A new list auto-requests as before.\n */\n const fetchNextPageInView = (isIntersecting: boolean, entries?: IntersectionObserverEntry[]) => {\n const button = entries?.[0]?.target\n if (!isIntersecting) {\n scrolledAtLeave = scrolledTo(button)\n return\n }\n if (failedInListTurn === listTurn) {\n if (isNull(scrolledAtLeave) || scrolledTo(button) === scrolledAtLeave) return\n failedInListTurn = null\n }\n scrolledAtLeave = null\n if (pagination.value.hasNextPage !== true) return\n fetchNextPage()\n }\n\n const { addToCachedAuthors, fetchCachedAuthors } = useDamCachedAuthors(configName)\n const { addToCachedKeywords, fetchCachedKeywords } = useDamCachedKeywords(configName)\n const { addToCachedUsers, fetchCachedUsers } = useDamCachedUsers(configName)\n\n const onItemClick = async (data: { assetId: DocId; index: number }, extSystem: IntegerId) => {\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n if (!mdAndDown.value) openSidebarRight()\n assetSelectStore.toggleSelectedByIndex(data.index)\n assetSelectStore.setActiveByIndex(data.index)\n // Set the ext system for author names at the click, where it is known, not after the read.\n // A pick confirmed before the answer drops the read, and the picked image dialog then used the previous ext system.\n cachedExtSystemId.value = extSystem\n detailLoading.value = true\n const request = ++detailRequest\n try {\n // Not applied over an open detail. A queue row detail may have\n // opened since the click and would show and save into this asset.\n await assetDetailStore.readBesideDetail(\n () => fetchAsset(damClient, endPointAsset, data.assetId),\n () => request === detailRequest,\n (asset) => {\n // Set again for the shown read. The value is per configuration, and another\n // widget may have overwritten it since the click when its upload or copy ended.\n cachedExtSystemId.value = extSystem\n addToCachedAuthors(asset.authors)\n addToCachedKeywords(asset.keywords)\n if (showFileInfoEnabled) {\n addToCachedUsers(asset.modifiedBy, asset.createdBy)\n }\n fetchCachedAuthors()\n fetchCachedKeywords()\n if (showFileInfoEnabled) {\n fetchCachedUsers()\n }\n }\n )\n } catch (e) {\n if (request === detailRequest) {\n showErrorsDefault(e)\n // Mark the item of the asset the side panel still shows, or none. The\n // clicked item was marked beside a panel showing another asset or none.\n assetSelectStore.setActiveByAssetId(assetDetailStore.asset?.id ?? null)\n }\n } finally {\n if (request === detailRequest) {\n detailLoading.value = false\n forgetAssetNotShown()\n }\n }\n }\n\n /**\n * Rereads the active item's asset for the side panel after its detail closed.\n * Ordered with click reads: only the latest is applied and turns the panel loading off.\n * Otherwise a stale answer showed the closed detail's asset beside another active item.\n * Uses the remembered asset even if the current list lacks its item. Reading\n * by the active item alone emptied the panel after editing that asset.\n * `shown`: the asset the closed detail showed when the panel opened it. It is read\n * and made active, because after a failed click read the remembered asset differs.\n */\n const readActiveItemAgain = async (shown: DocId | null = null) => {\n if (!isNull(shown)) assetSelectStore.setActiveByAssetId(shown)\n const assetId = assetSelectStore.getActiveAssetId()\n // Nothing to read: the list remembers no asset, so the panel emptied by the closing detail stays empty.\n if (isNull(assetId)) return\n detailLoading.value = true\n const request = ++detailRequest\n try {\n // Not applied over an open detail. A queue row detail closes itself when\n // its asset cannot be read, and can reopen before this read answers.\n await assetDetailStore.readBesideDetail(\n () => fetchAsset(damClient, endPointAsset, assetId),\n () => request === detailRequest\n )\n } catch (e) {\n if (request === detailRequest) showErrorsDefault(e)\n } finally {\n if (request === detailRequest) {\n detailLoading.value = false\n forgetAssetNotShown()\n }\n }\n }\n\n const { clearAll } = useFilterClearHelpers()\n\n const resetAssetList = async () => {\n clearAll(filterData, filterConfig)\n resolveTypeFilter(assetSelectStore.assetType, assetSelectStore.inPodcast)\n await fetchAssetListDebounced()\n }\n\n /** Drops a pending detail read: its answer is not shown, and loading stops. */\n const giveUpDetailRead = () => {\n detailRequest++\n detailLoading.value = false\n }\n\n const reset = async () => {\n clearAll(filterData, filterConfig)\n // The next opened list starts fresh, without this list's paging state.\n startListAnew()\n assetSelectStore.reset(true)\n // Otherwise its answer would be written into the store emptied here.\n giveUpDetailRead()\n assetDetailStore.reset()\n }\n\n const initStoreContext = (\n selectConfig: DamConfigLicenceExtSystemReturnType[],\n assetType: DamAssetTypeType,\n inPodcast: boolean | null,\n singleMode: boolean,\n minCount: number,\n maxCount: number\n ): void => {\n assetSelectStore.clearSelected()\n assetSelectStore.setAssetType(assetType)\n assetSelectStore.setSelectConfig(selectConfig)\n assetSelectStore.setSingleMode(singleMode)\n assetSelectStore.setMinCount(minCount)\n assetSelectStore.setMaxCount(maxCount)\n assetSelectStore.inPodcast = inPodcast\n }\n\n return {\n damClient,\n filterData,\n filterConfig,\n selectedCount,\n selectedAssets,\n pagination,\n loader,\n detailLoading,\n assetListItems: assetListItems as Ref<Array<AssetSelectListItem>>,\n getSelectedData: assetSelectStore.getSelectedData,\n onItemClick,\n readActiveItemAgain,\n giveUpDetailRead,\n fetchAssetListDebounced,\n fetchNextPage,\n fetchNextPageInView,\n resetAssetList,\n reset,\n initStoreContext,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,EAAE,kBAAeA,EAAcC,CAAkB,GACjDC,IAAgBC,EAAI,EAAK,GAE3BC,GACAC,IAAgB,GAEhBC,IAAW,GAMTC,KAAc,MAAgC;CAClD,KAAK,IAAIC,IAAUC,GAAQ,eAAeD,GAAS,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,EAAO4C,CAAK,KAAG1D,EAAiB,mBAAmB0D,CAAK;EAC7D,IAAMC,IAAU3D,EAAiB,iBAAiB;EAElD,IAAIc,EAAO6C,CAAO,GAAG;EACrB,EAAc,QAAQ;EACtB,IAAMZ,IAAU,EAAE1D;EAClB,IAAI;GAGF,MAAMc,EAAiB,uBACf6C,EAAWxB,GAAWC,GAAekC,CAAO,SAC5CZ,MAAY1D,CACpB;EACF,SAAS,GAAG;GACV,AAAI0D,MAAY1D,KAAe2C,EAAkB,CAAC;EACpD,UAAU;GACR,AAAIe,MAAY1D,MACd,EAAc,QAAQ,IACtBwB,EAAoB;EAExB;CACF,GAEM,EAAE,gBAAa+C,EAAsB,GAErCC,KAAiB,YAAY;EAGjC,AAFAC,EAASjC,GAAYC,CAAY,GACjCrB,EAAkBT,EAAiB,WAAWA,EAAiB,SAAS,GACxE,MAAMsB,EAAwB;CAChC,GAGMyC,UAAyB;EAE7B,AADA,KACA,EAAc,QAAQ;CACxB;CA6BA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACgB;EAChB,iBAAiB/D,EAAiB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBA7CwB;GAOxB,AANA8D,EAASjC,GAAYC,CAAY,GAEjCd,EAAc,GACdhB,EAAiB,MAAM,EAAI,GAE3B+D,EAAiB,GACjB5D,EAAiB,MAAM;EACzB;EAsCE,mBAnCA,GACA,GACA,GACA,GACA,GACA,MACS;GAOT,AANAH,EAAiB,cAAc,GAC/BA,EAAiB,aAAaY,CAAS,GACvCZ,EAAiB,gBAAgBgE,CAAY,GAC7ChE,EAAiB,cAAciE,CAAU,GACzCjE,EAAiB,YAAYkE,CAAQ,GACrClE,EAAiB,YAAYmE,CAAQ,GACrC,EAAiB,YAAYzD;EAC/B;CAsBA;AACF"}
|
|
1
|
+
{"version":3,"file":"assetSelectListActions.js","names":["usePagination","SORT_BY_SCORE_DATE","detailLoading","ref","listController","detailRequest","listTurn","readListAfterPause","useDebounceFn","read","scrolledTo","element","button","overflowY","useAssetSelectActions","useCommonAdminCoreDamOptions","configName","failedInListTurn","scrolledAtLeave","assetSelectStore","useAssetSelectStore","storeToRefs","assetDetailStore","useAssetDetailStore","useSidebar","useDisplay","useAlerts","useAssetListFilter","resolveTypeFilter","inPodcast","DamAssetType","assetType","forgetAssetNotShown","isNull","item","startListAnew","hasNextPage","pagination","fetchAssetListDebounced","fetchAssetList","listRead","licenceIds","useFetchAssetList","damClient","endPointAsset","useFetchAssetListByLicences","execute","controller","items","filterData","filterConfig","error","showErrorsDefault","fetchNextPage","page","fetchNextPageInView","entries","isIntersecting","useDamCachedAuthors","useDamCachedKeywords","useDamCachedUsers","onItemClick","useExtSystemIdForCached","mdAndDown","openSidebarRight","data","extSystem","request","fetchAsset","addToCachedAuthors","asset","addToCachedKeywords","showFileInfoEnabled","addToCachedUsers","fetchCachedAuthors","fetchCachedKeywords","fetchCachedUsers","readActiveItemAgain","shown","assetId","useFilterClearHelpers","resetAssetList","clearAll","giveUpDetailRead","selectConfig","singleMode","minCount","maxCount"],"sources":["../../../../../src/domains/dam/assetSelect/composables/assetSelectListActions.ts"],"sourcesContent":["import { useAssetListFilter } from '@/domains/dam/assetSelect/filter/AssetFilter'\nimport { type AssetSelectListItem, useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport { storeToRefs } from 'pinia'\nimport type { Ref } from 'vue'\nimport { ref } from 'vue'\nimport { DamAssetType, type DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport { usePagination } from '@/domains/api/composables/pagination'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { fetchAsset, useFetchAssetList, useFetchAssetListByLicences } from '@/domains/dam/api/damAssetApi'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { useDamCachedAuthors } from '@/domains/dam/author/composables/cachedAuthors'\nimport { useDamCachedKeywords } from '@/domains/dam/keyword/composables/cachedKeywords'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { isNull } from '@/shared/utils/common'\nimport { useDamCachedUsers } from '@/domains/dam/author/composables/cachedUsers'\nimport { useSidebar } from '@/domains/dam/assetSelect/composables/assetSelectFilterSidebar'\nimport { SORT_BY_SCORE_DATE } from '@/domains/filters/datatable/utils/datatableColumns'\nimport { useFilterClearHelpers } from '@/domains/filters/composables/filterFactory'\nimport { useDebounceFn } from '@vueuse/core'\nimport { useDisplay } from 'vuetify'\n\nconst { pagination } = usePagination(SORT_BY_SCORE_DATE)\nconst detailLoading = ref(false)\n// Shared like the pagination: every asset select part requests through here, and only the last request counts.\nlet listController: AbortController | undefined\nlet detailRequest = 0\n// Counts list restarts, so a failed further page is tracked per list.\nlet listTurn = 0\n// One debounce for every asset select part, like the pagination: the filter's mount and the picker's licence choice\n// ask for the first listing in the same tick, and only one search goes out.\nconst readListAfterPause = useDebounceFn((read: () => Promise<void>) => read())\n\n/**\n * Scroll position of the scroll container of the \"Load more\" button: the nearest scrollable ancestor, else the page.\n * A layout change moves the button without changing it.\n */\nconst scrolledTo = (button: Element | undefined) => {\n for (let element = button?.parentElement; element; element = element.parentElement) {\n const { overflowY } = getComputedStyle(element)\n if ((overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight) {\n return element.scrollTop\n }\n }\n return document.scrollingElement?.scrollTop ?? 0\n}\n\nexport function useAssetSelectActions(configName: string) {\n const { damClient, endPointAsset, showFileInfoEnabled } = useCommonAdminCoreDamOptions(configName)\n // A further page of this list failed (list `failedInListTurn`). The\n // button then does not request it again just by coming into view.\n // A press does, or coming into view again after the list was scrolled while the button was hidden.\n // A page-wide flag made the button retry when only a layout change (a side panel) had hidden it.\n let failedInListTurn: number | null = null\n let scrolledAtLeave: number | null = null\n\n const assetSelectStore = useAssetSelectStore()\n const { selectedCount, selectedAssets, assetListItems, loader } = storeToRefs(assetSelectStore)\n const assetDetailStore = useAssetDetailStore()\n const { openSidebarRight } = useSidebar()\n const { mdAndDown } = useDisplay()\n\n const { showErrorsDefault } = useAlerts()\n const { filterData, filterConfig } = useAssetListFilter()\n\n const resolveTypeFilter = (assetType: DamAssetTypeType, inPodcast: boolean | null) => {\n if (inPodcast === true) {\n filterData.type = [DamAssetType.Audio]\n filterData.inPodcast = true\n return\n }\n filterData.type = [assetType]\n filterData.inPodcast = null\n }\n\n /**\n * Forgets the remembered active asset once the side panel shows none\n * and the list has no item for it, so a later list marks no item.\n * Not while a read is pending, which may still show that asset, nor while a detail is open, whose close rereads it.\n * Called where this may have become true: a list is set, or the last requested read has ended.\n */\n const forgetAssetNotShown = () => {\n if (detailLoading.value || !isNull(assetDetailStore.asset) || !isNull(assetDetailStore.dialog)) return\n if (assetSelectStore.assetListItems.some((item) => item.active)) return\n assetSelectStore.forgetActiveAsset()\n }\n\n /**\n * Starts a new list: new order, filter or type, a reopened list or picker, or a reload after applying an upload.\n * The pending list request is aborted. Its rows would land in a replaced list and re-flag a further page.\n * The new list reads from page one and has no further page until it arrives.\n * \"Load more\" auto-requests when in view. Without this it requested page two before page one.\n */\n const startListAnew = () => {\n // Aborted and released: its end does not turn the loader off. The new list keeps it on until read.\n // Turning it off during the debounce let an empty list show \"nothing found\".\n listController?.abort()\n listController = undefined\n listTurn++\n const hasNextPage = isNull(pagination.value.hasNextPage) ? null : false\n pagination.value = { ...pagination.value, page: 1, hasNextPage }\n }\n\n /** Every list reload goes through here: it restarts at once and is read after a debounce. */\n const fetchAssetListDebounced = () => {\n startListAnew()\n return readListAfterPause(fetchAssetList)\n }\n\n /**\n * The list read of the chosen licences, or `undefined` without one. One licence is read at its own endpoint\n * (`/licence/:licenceId`), which every DAM has, the UGC proxy too. Several, the licences of a list view, in one\n * search at `/licence` with the filter `licences`.\n */\n const listRead = () => {\n const licenceIds = assetSelectStore.selectedLicenceIds\n if (licenceIds.length === 0) return undefined\n resolveTypeFilter(assetSelectStore.assetType, assetSelectStore.inPodcast)\n if (licenceIds.length === 1) {\n filterData.licences = []\n return useFetchAssetList(damClient, endPointAsset, licenceIds[0]!).execute\n }\n filterData.licences = [...licenceIds]\n return useFetchAssetListByLicences(damClient, endPointAsset).execute\n }\n\n const fetchAssetList = async () => {\n const execute = listRead()\n if (!execute) {\n // Nothing is read, so the loader of the abandoned list is turned off.\n if (!listController) assetSelectStore.hideLoader()\n return\n }\n // Restart again as the read starts, covering anything requested during the debounce.\n startListAnew()\n const controller = (listController = new AbortController())\n try {\n assetSelectStore.showLoader()\n const items = await execute(pagination, filterData, filterConfig, { signal: controller.signal })\n if (controller.signal.aborted) return\n assetSelectStore.setList(items)\n forgetAssetNotShown()\n } catch (error) {\n if (!controller.signal.aborted) showErrorsDefault(error)\n } finally {\n if (listController === controller) assetSelectStore.hideLoader()\n }\n }\n\n const fetchNextPage = async () => {\n if (assetSelectStore.loader) return\n // Without a licence there is no list to continue.\n const execute = listRead()\n if (!execute) return\n failedInListTurn = null\n const page = pagination.value.page\n pagination.value.page = page + 1\n // A new list (filter submit) aborts this page too: appended, it would be the old filter's page.\n listController?.abort()\n const controller = (listController = new AbortController())\n try {\n assetSelectStore.showLoader()\n const items = await execute(pagination, filterData, filterConfig, { signal: controller.signal })\n if (controller.signal.aborted) return\n assetSelectStore.appendList(items)\n } catch (error) {\n if (controller.signal.aborted) return\n // Not when something has put the page back meanwhile: rolling back would overwrite that.\n if (pagination.value.page === page + 1) pagination.value.page = page\n failedInListTurn = listTurn\n scrolledAtLeave = null\n showErrorsDefault(error)\n } finally {\n if (listController === controller) assetSelectStore.hideLoader()\n }\n }\n\n /**\n * \"Load more\" requests the next page itself when it comes into\n * view. Its directive fires again on every re-render while in view.\n * After a failure it used to retry at once and on each failure, with an error each time.\n * After a failure it no longer auto-requests while in view. A press does, or reappearing\n * after the list was scrolled while it was hidden. A new list auto-requests as before.\n */\n const fetchNextPageInView = (isIntersecting: boolean, entries?: IntersectionObserverEntry[]) => {\n const button = entries?.[0]?.target\n if (!isIntersecting) {\n scrolledAtLeave = scrolledTo(button)\n return\n }\n if (failedInListTurn === listTurn) {\n if (isNull(scrolledAtLeave) || scrolledTo(button) === scrolledAtLeave) return\n failedInListTurn = null\n }\n scrolledAtLeave = null\n if (pagination.value.hasNextPage !== true) return\n fetchNextPage()\n }\n\n const { addToCachedAuthors, fetchCachedAuthors } = useDamCachedAuthors(configName)\n const { addToCachedKeywords, fetchCachedKeywords } = useDamCachedKeywords(configName)\n const { addToCachedUsers, fetchCachedUsers } = useDamCachedUsers(configName)\n\n const onItemClick = async (data: { assetId: DocId; index: number }, extSystem: IntegerId) => {\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n if (!mdAndDown.value) openSidebarRight()\n assetSelectStore.toggleSelectedByIndex(data.index)\n assetSelectStore.setActiveByIndex(data.index)\n // Set the ext system for author names at the click, where it is known, not after the read.\n // A pick confirmed before the answer drops the read, and the picked image dialog then used the previous ext system.\n cachedExtSystemId.value = extSystem\n detailLoading.value = true\n const request = ++detailRequest\n try {\n // Not applied over an open detail. A queue row detail may have\n // opened since the click and would show and save into this asset.\n await assetDetailStore.readBesideDetail(\n () => fetchAsset(damClient, endPointAsset, data.assetId),\n () => request === detailRequest,\n (asset) => {\n // Set again for the shown read. The value is per configuration, and another\n // widget may have overwritten it since the click when its upload or copy ended.\n cachedExtSystemId.value = extSystem\n addToCachedAuthors(asset.authors)\n addToCachedKeywords(asset.keywords)\n if (showFileInfoEnabled) {\n addToCachedUsers(asset.modifiedBy, asset.createdBy)\n }\n fetchCachedAuthors()\n fetchCachedKeywords()\n if (showFileInfoEnabled) {\n fetchCachedUsers()\n }\n }\n )\n } catch (e) {\n if (request === detailRequest) {\n showErrorsDefault(e)\n // Mark the item of the asset the side panel still shows, or none. The\n // clicked item was marked beside a panel showing another asset or none.\n assetSelectStore.setActiveByAssetId(assetDetailStore.asset?.id ?? null)\n }\n } finally {\n if (request === detailRequest) {\n detailLoading.value = false\n forgetAssetNotShown()\n }\n }\n }\n\n /**\n * Rereads the active item's asset for the side panel after its detail closed.\n * Ordered with click reads: only the latest is applied and turns the panel loading off.\n * Otherwise a stale answer showed the closed detail's asset beside another active item.\n * Uses the remembered asset even if the current list lacks its item. Reading\n * by the active item alone emptied the panel after editing that asset.\n * `shown`: the asset the closed detail showed when the panel opened it. It is read\n * and made active, because after a failed click read the remembered asset differs.\n */\n const readActiveItemAgain = async (shown: DocId | null = null) => {\n if (!isNull(shown)) assetSelectStore.setActiveByAssetId(shown)\n const assetId = assetSelectStore.getActiveAssetId()\n // Nothing to read: the list remembers no asset, so the panel emptied by the closing detail stays empty.\n if (isNull(assetId)) return\n detailLoading.value = true\n const request = ++detailRequest\n try {\n // Not applied over an open detail. A queue row detail closes itself when\n // its asset cannot be read, and can reopen before this read answers.\n await assetDetailStore.readBesideDetail(\n () => fetchAsset(damClient, endPointAsset, assetId),\n () => request === detailRequest\n )\n } catch (e) {\n if (request === detailRequest) showErrorsDefault(e)\n } finally {\n if (request === detailRequest) {\n detailLoading.value = false\n forgetAssetNotShown()\n }\n }\n }\n\n const { clearAll } = useFilterClearHelpers()\n\n const resetAssetList = async () => {\n clearAll(filterData, filterConfig)\n resolveTypeFilter(assetSelectStore.assetType, assetSelectStore.inPodcast)\n await fetchAssetListDebounced()\n }\n\n /** Drops a pending detail read: its answer is not shown, and loading stops. */\n const giveUpDetailRead = () => {\n detailRequest++\n detailLoading.value = false\n }\n\n const reset = async () => {\n clearAll(filterData, filterConfig)\n // The next opened list starts fresh, without this list's paging state.\n startListAnew()\n assetSelectStore.reset(true)\n // Otherwise its answer would be written into the store emptied here.\n giveUpDetailRead()\n assetDetailStore.reset()\n }\n\n const initStoreContext = (\n selectConfig: DamConfigLicenceExtSystemReturnType[],\n assetType: DamAssetTypeType,\n inPodcast: boolean | null,\n singleMode: boolean,\n minCount: number,\n maxCount: number\n ): void => {\n assetSelectStore.clearSelected()\n assetSelectStore.setAssetType(assetType)\n assetSelectStore.setSelectConfig(selectConfig)\n assetSelectStore.setSingleMode(singleMode)\n assetSelectStore.setMinCount(minCount)\n assetSelectStore.setMaxCount(maxCount)\n assetSelectStore.inPodcast = inPodcast\n }\n\n return {\n damClient,\n filterData,\n filterConfig,\n selectedCount,\n selectedAssets,\n pagination,\n loader,\n detailLoading,\n assetListItems: assetListItems as Ref<Array<AssetSelectListItem>>,\n getSelectedData: assetSelectStore.getSelectedData,\n onItemClick,\n readActiveItemAgain,\n giveUpDetailRead,\n fetchAssetListDebounced,\n fetchNextPage,\n fetchNextPageInView,\n resetAssetList,\n reset,\n initStoreContext,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,EAAE,kBAAeA,EAAcC,CAAkB,GACjDC,IAAgBC,EAAI,EAAK,GAE3BC,GACAC,IAAgB,GAEhBC,IAAW,GAGTC,IAAqBC,GAAe,MAA8BC,EAAK,CAAC,GAMxEC,KAAc,MAAgC;CAClD,KAAK,IAAIC,IAAUC,GAAQ,eAAeD,GAAS,IAAUA,EAAQ,eAAe;EAClF,IAAM,EAAE,iBAAc,iBAAiBA,CAAO;EAC9C,KAAKE,MAAc,UAAUA,MAAc,aAAaF,EAAQ,eAAeA,EAAQ,cACrF,OAAOA,EAAQ;CAEnB;CACA,OAAO,SAAS,kBAAkB,aAAa;AACjD;AAEA,SAAgBG,EAAsB,GAAoB;CACxD,IAAM,EAAE,cAAW,kBAAe,2BAAwBC,EAA6BC,CAAU,GAK7FC,IAAkC,MAClCC,IAAiC,MAE/BC,IAAmBC,EAAoB,GACvC,EAAE,mBAAe,oBAAgB,mBAAgB,cAAWC,EAAYF,CAAgB,GACxFG,IAAmBC,EAAoB,GACvC,EAAE,wBAAqBC,EAAW,GAClC,EAAE,iBAAcC,EAAW,GAE3B,EAAE,yBAAsBC,EAAU,GAClC,EAAE,eAAY,oBAAiBC,EAAmB,GAElDC,KAAqB,GAA6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KAAiB,YAAY;EAGjC,AAFAC,EAASjC,GAAYC,CAAY,GACjCtB,EAAkBT,EAAiB,WAAWA,EAAiB,SAAS,GACxE,MAAMmB,EAAwB;CAChC,GAGM6C,UAAyB;EAE7B,AADA,KACA,EAAc,QAAQ;CACxB;CA6BA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACgB;EAChB,iBAAiBhE,EAAiB;EAClC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBA7CwB;GAOxB,AANA+D,EAASjC,GAAYC,CAAY,GAEjCf,EAAc,GACdhB,EAAiB,MAAM,EAAI,GAE3BgE,EAAiB,GACjB7D,EAAiB,MAAM;EACzB;EAsCE,mBAnCA,GACA,GACA,GACA,GACA,GACA,MACS;GAOT,AANAH,EAAiB,cAAc,GAC/BA,EAAiB,aAAaY,CAAS,GACvCZ,EAAiB,gBAAgBiE,CAAY,GAC7CjE,EAAiB,cAAckE,CAAU,GACzClE,EAAiB,YAAYmE,CAAQ,GACrCnE,EAAiB,YAAYoE,CAAQ,GACrC,EAAiB,YAAY1D;EAC/B;CAsBA;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IntegerId } from '../../../../shared/types/common';
|
|
2
|
+
import { AssetSelectPreset, AssetSelectPresetKey } from './assetSelectPresets';
|
|
3
|
+
/** The remembered preset if it is still offered, else the first licence. */
|
|
4
|
+
export declare const resolveInitialPresetKey: (presets: AssetSelectPreset[], storedPresetKey: AssetSelectPresetKey) => AssetSelectPresetKey | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* The "Search in" choice of an asset select: list views of the host (`listViews`) and its licences. Call it in the setup
|
|
7
|
+
* of a part that mounts after the select put the licences into the store. On mount it applies the remembered choice of
|
|
8
|
+
* the DAM user, else the first licence, and so sets the licences the list is read from.
|
|
9
|
+
* `showPresets` is the one place that decides whether the choice is shown.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useAssetSelectPresetControl(listViews: IntegerId[], configName: string): {
|
|
12
|
+
items: import('vue').ComputedRef<({
|
|
13
|
+
value: string;
|
|
14
|
+
title: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "subheader";
|
|
17
|
+
title: string;
|
|
18
|
+
})[]>;
|
|
19
|
+
showPresets: import('vue').ComputedRef<boolean>;
|
|
20
|
+
selectedPresetKey: import('vue').Ref<string, string>;
|
|
21
|
+
applyPreset: (key: AssetSelectPresetKey | undefined) => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { assetSelectPresetStorageKey as e, useAssetSelectPresets as t } from "./assetSelectPresets.js";
|
|
2
|
+
import { useAssetSelectStore as n } from "../store/assetSelectStore.js";
|
|
3
|
+
import { computed as r, onMounted as i, ref as a } from "vue";
|
|
4
|
+
import { useI18n as o } from "vue-i18n";
|
|
5
|
+
import { useStorage as s } from "@vueuse/core";
|
|
6
|
+
import { storeToRefs as c } from "pinia";
|
|
7
|
+
// src/domains/dam/assetSelect/composables/assetSelectPresetControl.ts
|
|
8
|
+
var l = (e, t) => {
|
|
9
|
+
let n = e.find((e) => e.key === t);
|
|
10
|
+
return n ? n.key : e.find((e) => e.group === "licence")?.key;
|
|
11
|
+
};
|
|
12
|
+
function u(u, d) {
|
|
13
|
+
let { t: f } = o(), { buildPresets: p, damCurrentUser: m } = t(d), h = n(), { selectedPresetKey: g } = c(h), _ = h.selectConfig.map((e) => e.licence), v = m.value?.id, y = v ? s(e(v, _, u, d), "", localStorage, { writeDefaults: !1 }) : a(""), b = r(() => p(_, u, h.licenceTitle)), x = r(() => b.value.length > 1), S = r(() => {
|
|
14
|
+
let e = b.value.filter((e) => e.group === "listView"), t = b.value.filter((e) => e.group === "licence"), n = (e) => ({
|
|
15
|
+
value: e.key,
|
|
16
|
+
title: e.title
|
|
17
|
+
});
|
|
18
|
+
return [
|
|
19
|
+
...e.length > 0 ? [{
|
|
20
|
+
type: "subheader",
|
|
21
|
+
title: f("common.assetSelect.preset.groupListViews")
|
|
22
|
+
}, ...e.map(n)] : [],
|
|
23
|
+
{
|
|
24
|
+
type: "subheader",
|
|
25
|
+
title: f("common.assetSelect.preset.groupLicences")
|
|
26
|
+
},
|
|
27
|
+
...t.map(n)
|
|
28
|
+
];
|
|
29
|
+
}), C = (e) => {
|
|
30
|
+
let t = b.value.find((t) => t.key === e);
|
|
31
|
+
t && (h.setSelectedPresetKey(t.key), h.setSelectedLicenceIds(t.licenceIds), y.value = t.key);
|
|
32
|
+
};
|
|
33
|
+
return i(() => {
|
|
34
|
+
g.value === "" && C(l(b.value, y.value));
|
|
35
|
+
}), {
|
|
36
|
+
items: S,
|
|
37
|
+
showPresets: x,
|
|
38
|
+
selectedPresetKey: g,
|
|
39
|
+
applyPreset: C
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export { l as resolveInitialPresetKey, u as useAssetSelectPresetControl };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=assetSelectPresetControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetSelectPresetControl.js","names":["resolveInitialPresetKey","storedPreset","presets","preset","storedPresetKey","useAssetSelectPresetControl","useI18n","useAssetSelectPresets","configName","assetSelectStore","useAssetSelectStore","storeToRefs","selectLicences","config","damUserId","damCurrentUser","useStorage","assetSelectPresetStorageKey","listViews","ref","computed","buildPresets","showPresets","items","listViewPresets","licencePresets","asItem","t","applyPreset","item","key","onMounted","selectedPresetKey"],"sources":["../../../../../src/domains/dam/assetSelect/composables/assetSelectPresetControl.ts"],"sourcesContent":["import { computed, onMounted, ref } from 'vue'\nimport { useStorage } from '@vueuse/core'\nimport { storeToRefs } from 'pinia'\nimport { useI18n } from 'vue-i18n'\nimport type { IntegerId } from '@/shared/types/common'\nimport {\n type AssetSelectPreset,\n type AssetSelectPresetKey,\n assetSelectPresetStorageKey,\n useAssetSelectPresets,\n} from '@/domains/dam/assetSelect/composables/assetSelectPresets'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\n\n/** The remembered preset if it is still offered, else the first licence. */\nexport const resolveInitialPresetKey = (\n presets: AssetSelectPreset[],\n storedPresetKey: AssetSelectPresetKey\n): AssetSelectPresetKey | undefined => {\n const storedPreset = presets.find((preset) => preset.key === storedPresetKey)\n if (storedPreset) return storedPreset.key\n return presets.find((preset) => preset.group === 'licence')?.key\n}\n\n/**\n * The \"Search in\" choice of an asset select: list views of the host (`listViews`) and its licences. Call it in the setup\n * of a part that mounts after the select put the licences into the store. On mount it applies the remembered choice of\n * the DAM user, else the first licence, and so sets the licences the list is read from.\n * `showPresets` is the one place that decides whether the choice is shown.\n */\nexport function useAssetSelectPresetControl(listViews: IntegerId[], configName: string) {\n const { t } = useI18n()\n const { buildPresets, damCurrentUser } = useAssetSelectPresets(configName)\n const assetSelectStore = useAssetSelectStore()\n const { selectedPresetKey } = storeToRefs(assetSelectStore)\n // The select puts only the licences the user may read into the store before its content mounts.\n // DAM refuses the whole search when even one requested licence is unreadable.\n const selectLicences = assetSelectStore.selectConfig.map((config) => config.licence)\n // Without a DAM user there is nobody to remember the choice for.\n const damUserId = damCurrentUser.value?.id\n const storedPresetKey = damUserId\n ? useStorage<AssetSelectPresetKey>(\n assetSelectPresetStorageKey(damUserId, selectLicences, listViews, configName),\n '',\n localStorage,\n { writeDefaults: false }\n )\n : ref<AssetSelectPresetKey>('')\n\n const presets = computed(() => buildPresets(selectLicences, listViews, assetSelectStore.licenceTitle))\n const showPresets = computed(() => presets.value.length > 1)\n\n const items = computed(() => {\n const listViewPresets = presets.value.filter((preset) => preset.group === 'listView')\n const licencePresets = presets.value.filter((preset) => preset.group === 'licence')\n const asItem = (preset: AssetSelectPreset) => ({\n value: preset.key,\n title: preset.title,\n })\n\n return [\n ...(listViewPresets.length > 0\n ? [\n { type: 'subheader' as const, title: t('common.assetSelect.preset.groupListViews') },\n ...listViewPresets.map(asItem),\n ]\n : []),\n { type: 'subheader' as const, title: t('common.assetSelect.preset.groupLicences') },\n ...licencePresets.map(asItem),\n ]\n })\n\n const applyPreset = (key: AssetSelectPresetKey | undefined) => {\n const preset = presets.value.find((item) => item.key === key)\n if (!preset) return\n\n assetSelectStore.setSelectedPresetKey(preset.key)\n assetSelectStore.setSelectedLicenceIds(preset.licenceIds)\n storedPresetKey.value = preset.key\n }\n\n onMounted(() => {\n if (selectedPresetKey.value !== '') return\n applyPreset(resolveInitialPresetKey(presets.value, storedPresetKey.value))\n })\n\n return {\n items,\n showPresets,\n selectedPresetKey,\n applyPreset,\n }\n}\n"],"mappings":";;;;;;;AAcA,IAAaA,KACX,GACA,MACqC;CACrC,IAAMC,IAAeC,EAAQ,MAAM,MAAWC,EAAO,QAAQC,CAAe;CAE5E,OADIH,IAAqBA,EAAa,MAC/BC,EAAQ,MAAM,MAAWC,EAAO,UAAU,SAAS,CAAC,EAAE;AAC/D;AAQA,SAAgBE,EAA4B,GAAwB,GAAoB;CACtF,IAAM,EAAE,SAAMC,EAAQ,GAChB,EAAE,iBAAc,sBAAmBC,EAAsBC,CAAU,GACnEC,IAAmBC,EAAoB,GACvC,EAAE,yBAAsBC,EAAYF,CAAgB,GAGpDG,IAAiBH,EAAiB,aAAa,KAAK,MAAWI,EAAO,OAAO,GAE7EC,IAAYC,EAAe,OAAO,IAClCX,IAAkBU,IACpBE,EACEC,EAA4BH,GAAWF,GAAgBM,GAAWV,CAAU,GAC5E,IACA,cACA,EAAE,eAAe,GAAM,CACzB,IACAW,EAA0B,EAAE,GAE1BjB,IAAUkB,QAAeC,EAAaT,GAAgBM,GAAWT,EAAiB,YAAY,CAAC,GAC/Fa,IAAcF,QAAelB,EAAQ,MAAM,SAAS,CAAC,GAErDqB,IAAQH,QAAe;EAC3B,IAAMI,IAAkBtB,EAAQ,MAAM,QAAQ,MAAWC,EAAO,UAAU,UAAU,GAC9EsB,IAAiBvB,EAAQ,MAAM,QAAQ,MAAWC,EAAO,UAAU,SAAS,GAC5EuB,KAAU,OAA+B;GAC7C,OAAOvB,EAAO;GACd,OAAOA,EAAO;EAChB;EAEA,OAAO;GACL,GAAIqB,EAAgB,SAAS,IACzB,CACE;IAAE,MAAM;IAAsB,OAAOG,EAAE,0CAA0C;GAAE,GACnF,GAAGH,EAAgB,IAAIE,CAAM,CAC/B,IACA,CAAC;GACL;IAAE,MAAM;IAAsB,OAAOC,EAAE,yCAAyC;GAAE;GAClF,GAAGF,EAAe,IAAIC,CAAM;EAC9B;CACF,CAAC,GAEKE,KAAe,MAA0C;EAC7D,IAAMzB,IAASD,EAAQ,MAAM,MAAM,MAAS2B,EAAK,QAAQC,CAAG;EAC5D,AAAK3B,MAELM,EAAiB,qBAAqBN,EAAO,GAAG,GAChDM,EAAiB,sBAAsBN,EAAO,UAAU,GACxD,EAAgB,QAAQA,EAAO;CACjC;CAOA,OALA4B,QAAgB;EACd,AAAIC,EAAkB,UAAU,MAChCJ,EAAY5B,EAAwBE,EAAQ,OAAOE,EAAgB,KAAK,CAAC;CAC3E,CAAC,GAEM;EACL;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IntegerId } from '../../../../shared/types/common';
|
|
2
|
+
import { DamCurrentUserDto } from '../../types/DamCurrentUser';
|
|
3
|
+
export type AssetSelectPresetKey = string;
|
|
4
|
+
type AssetSelectPresetGroup = 'listView' | 'licence';
|
|
5
|
+
export interface AssetSelectPreset {
|
|
6
|
+
key: AssetSelectPresetKey;
|
|
7
|
+
title: string;
|
|
8
|
+
licenceIds: IntegerId[];
|
|
9
|
+
group: AssetSelectPresetGroup;
|
|
10
|
+
}
|
|
11
|
+
export declare const assetSelectSingleLicenceKey: (licenceId: IntegerId) => AssetSelectPresetKey;
|
|
12
|
+
/**
|
|
13
|
+
* The presets of an asset select: the host's list views the DAM user has, each narrowed to the host's licences (one
|
|
14
|
+
* without a common licence is left out), then each host licence on its own.
|
|
15
|
+
* The DAM user is the current user of the system `currentUser` of the configuration `configName`. Without one
|
|
16
|
+
* (`currentUser: false`, nobody logged in) only the licences are offered.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useAssetSelectPresets(configName: string): {
|
|
19
|
+
buildPresets: (selectLicences: IntegerId[], listViews: IntegerId[], licenceTitle: (licenceId: IntegerId) => string) => AssetSelectPreset[];
|
|
20
|
+
damCurrentUser: import('vue').ComputedRef<DamCurrentUserDto | undefined>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Key of the remembered preset. Common-admin has no notion of a site group, so the sorted host ids stand in for it: a
|
|
24
|
+
* changed site group configuration gets a new key. The DAM user is part of the key, so the next user in the same browser
|
|
25
|
+
* starts fresh. A named DAM configuration adds its name; `default` keeps the key of 1.50.0.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assetSelectPresetStorageKey(damUserId: IntegerId, selectLicences: IntegerId[], listViews: IntegerId[], configName?: string): string;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineAuth as e } from "../../../auth/composables/defineAuth.js";
|
|
2
|
+
import { useCommonAdminCoreDamOptions as t } from "../../composables/commonAdminCoreDamOptions.js";
|
|
3
|
+
import { computed as n } from "vue";
|
|
4
|
+
// src/domains/dam/assetSelect/composables/assetSelectPresets.ts
|
|
5
|
+
var r = (e) => `licence:${e}`;
|
|
6
|
+
function i(i) {
|
|
7
|
+
let { currentUser: a } = t(i), o = a === !1 ? void 0 : e(a).useCurrentUser(a).currentUser, s = n(() => o?.value);
|
|
8
|
+
return {
|
|
9
|
+
buildPresets: (e, t, n) => {
|
|
10
|
+
let i = new Set(e), a = new Set(t);
|
|
11
|
+
return [...(s.value?.listViews ?? []).filter((e) => a.has(e.id)).map((e) => ({
|
|
12
|
+
key: `listView:${e.id}`,
|
|
13
|
+
title: e.name,
|
|
14
|
+
licenceIds: e.licences.filter((e) => i.has(e)),
|
|
15
|
+
group: "listView"
|
|
16
|
+
})).filter((e) => e.licenceIds.length > 0), ...e.map((e) => ({
|
|
17
|
+
key: r(e),
|
|
18
|
+
title: n(e),
|
|
19
|
+
licenceIds: [e],
|
|
20
|
+
group: "licence"
|
|
21
|
+
}))];
|
|
22
|
+
},
|
|
23
|
+
damCurrentUser: s
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function a(e, t, n, r = "default") {
|
|
27
|
+
let i = [...t].sort((e, t) => e - t).join("-"), a = [...n].sort((e, t) => e - t).join("-");
|
|
28
|
+
return `common.assetSelect.preset.${r === "default" ? "" : `${r}.`}${e}.${i}.${a}`;
|
|
29
|
+
}
|
|
30
|
+
export { a as assetSelectPresetStorageKey, r as assetSelectSingleLicenceKey, i as useAssetSelectPresets };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=assetSelectPresets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetSelectPresets.js","names":["assetSelectSingleLicenceKey","licenceId","useAssetSelectPresets","system","useCommonAdminCoreDamOptions","configName","currentUser","defineAuth","damCurrentUser","computed","selectLicencesSet","selectLicences","allowedListViewIds","listViews","listView","id","preset","licenceTitle","assetSelectPresetStorageKey","licencesPart","a","b","listViewsPart","damUserId"],"sources":["../../../../../src/domains/dam/assetSelect/composables/assetSelectPresets.ts"],"sourcesContent":["import type { IntegerId } from '@/shared/types/common'\nimport type { DamAssetListViewResolved } from '@/domains/dam/types/AssetListView'\nimport type { DamCurrentUserDto } from '@/domains/dam/types/DamCurrentUser'\nimport { defineAuth } from '@/domains/auth/composables/defineAuth'\nimport type { AclValue } from '@/domains/auth/types/Permission'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { computed } from 'vue'\n\nexport type AssetSelectPresetKey = string\n\ntype AssetSelectPresetGroup = 'listView' | 'licence'\n\nexport interface AssetSelectPreset {\n key: AssetSelectPresetKey\n title: string\n licenceIds: IntegerId[]\n group: AssetSelectPresetGroup\n}\n\nexport const assetSelectSingleLicenceKey = (licenceId: IntegerId): AssetSelectPresetKey => `licence:${licenceId}`\n\n/**\n * The presets of an asset select: the host's list views the DAM user has, each narrowed to the host's licences (one\n * without a common licence is left out), then each host licence on its own.\n * The DAM user is the current user of the system `currentUser` of the configuration `configName`. Without one\n * (`currentUser: false`, nobody logged in) only the licences are offered.\n */\nexport function useAssetSelectPresets(configName: string) {\n const { currentUser: system } = useCommonAdminCoreDamOptions(configName)\n const currentUser =\n system === false ? undefined : defineAuth<AclValue>(system).useCurrentUser<DamCurrentUserDto>(system).currentUser\n const damCurrentUser = computed<DamCurrentUserDto | undefined>(() => currentUser?.value)\n\n const buildPresets = (\n selectLicences: IntegerId[],\n listViews: IntegerId[],\n licenceTitle: (licenceId: IntegerId) => string\n ): AssetSelectPreset[] => {\n const selectLicencesSet = new Set(selectLicences)\n const allowedListViewIds = new Set(listViews)\n // A DAM before list views sends none.\n const userListViews: DamAssetListViewResolved[] = damCurrentUser.value?.listViews ?? []\n\n const listViewPresets: AssetSelectPreset[] = userListViews\n .filter((listView) => allowedListViewIds.has(listView.id))\n .map((listView) => ({\n key: `listView:${listView.id}`,\n title: listView.name,\n licenceIds: listView.licences.filter((id) => selectLicencesSet.has(id)),\n group: 'listView' as const,\n }))\n .filter((preset) => preset.licenceIds.length > 0)\n\n return [\n ...listViewPresets,\n ...selectLicences.map((licenceId) => ({\n key: assetSelectSingleLicenceKey(licenceId),\n title: licenceTitle(licenceId),\n licenceIds: [licenceId],\n group: 'licence' as const,\n })),\n ]\n }\n\n return {\n buildPresets,\n damCurrentUser,\n }\n}\n\n/**\n * Key of the remembered preset. Common-admin has no notion of a site group, so the sorted host ids stand in for it: a\n * changed site group configuration gets a new key. The DAM user is part of the key, so the next user in the same browser\n * starts fresh. A named DAM configuration adds its name; `default` keeps the key of 1.50.0.\n */\nexport function assetSelectPresetStorageKey(\n damUserId: IntegerId,\n selectLicences: IntegerId[],\n listViews: IntegerId[],\n configName = 'default'\n): string {\n const licencesPart = [...selectLicences].sort((a, b) => a - b).join('-')\n const listViewsPart = [...listViews].sort((a, b) => a - b).join('-')\n const configPart = configName === 'default' ? '' : `${configName}.`\n return `common.asset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,EAAa,GAAGG;AAChF"}
|
|
@@ -3,23 +3,36 @@ import { Ref } from 'vue';
|
|
|
3
3
|
import { Pagination } from '../../../api/composables/pagination';
|
|
4
4
|
import { ValueObjectOption } from '../../../../shared/types/ValueObject';
|
|
5
5
|
import { DocId, IntegerId } from '../../../../shared/types/common';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/** `licenceIds`: the browsed licences of one ext system; only their podcasts are listed. */
|
|
7
|
+
export declare function usePodcastInnerFilter(licenceIds: IntegerId[]): {
|
|
8
|
+
filterConfig: FilterConfig<({
|
|
8
9
|
name: "title";
|
|
9
10
|
variant: "startsWith";
|
|
10
11
|
default: null;
|
|
11
12
|
type: "string";
|
|
12
13
|
apiName: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
14
|
+
} | {
|
|
15
|
+
name: "licence";
|
|
16
|
+
variant: "in";
|
|
17
|
+
default: number[];
|
|
18
|
+
type?: undefined;
|
|
19
|
+
apiName?: undefined;
|
|
20
|
+
})[]>;
|
|
21
|
+
filterData: FilterData<({
|
|
15
22
|
name: "title";
|
|
16
23
|
variant: "startsWith";
|
|
17
24
|
default: null;
|
|
18
25
|
type: "string";
|
|
19
26
|
apiName: string;
|
|
20
|
-
}
|
|
27
|
+
} | {
|
|
28
|
+
name: "licence";
|
|
29
|
+
variant: "in";
|
|
30
|
+
default: number[];
|
|
31
|
+
type?: undefined;
|
|
32
|
+
apiName?: undefined;
|
|
33
|
+
})[]>;
|
|
21
34
|
};
|
|
22
|
-
export declare const usePodcastSelectActions: (
|
|
35
|
+
export declare const usePodcastSelectActions: (extSystemId: IntegerId, configName: string) => {
|
|
23
36
|
fetchItems: (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => Promise<ValueObjectOption<string>[]>;
|
|
24
37
|
fetchItemsByIds: (ids: DocId[]) => Promise<ValueObjectOption<string>[]>;
|
|
25
38
|
};
|
|
@@ -3,20 +3,24 @@ import { SYSTEM_CORE_DAM as n } from "../../api/damConstants.js";
|
|
|
3
3
|
import { useCommonAdminCoreDamOptions as r } from "../../composables/commonAdminCoreDamOptions.js";
|
|
4
4
|
import { fetchDamPodcastListByIds as i, useFetchDamPodcastList as a } from "../api/damPodcastApi.js";
|
|
5
5
|
// src/domains/dam/assetSelect/composables/podcastFilterAndActions.ts
|
|
6
|
-
function o() {
|
|
7
|
-
let
|
|
6
|
+
function o(r) {
|
|
7
|
+
let i = [{
|
|
8
8
|
name: "title",
|
|
9
9
|
variant: "startsWith",
|
|
10
10
|
default: null,
|
|
11
11
|
type: "string",
|
|
12
12
|
apiName: "texts.title"
|
|
13
|
-
}
|
|
13
|
+
}, {
|
|
14
|
+
name: "licence",
|
|
15
|
+
variant: "in",
|
|
16
|
+
default: r
|
|
17
|
+
}], { filterConfig: a, filterData: o } = e(i, t(i), {
|
|
14
18
|
system: n,
|
|
15
19
|
subject: "podcast"
|
|
16
20
|
});
|
|
17
21
|
return {
|
|
18
|
-
filterConfig:
|
|
19
|
-
filterData:
|
|
22
|
+
filterConfig: a,
|
|
23
|
+
filterData: o
|
|
20
24
|
};
|
|
21
25
|
}
|
|
22
26
|
var s = (e, t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podcastFilterAndActions.js","names":["usePodcastInnerFilter","filterFieldsInner","createFilter","createFilterStore","SYSTEM_CORE_DAM","usePodcastSelectActions","useCommonAdminCoreDamOptions","configName","useFetchDamPodcastList","damClient","
|
|
1
|
+
{"version":3,"file":"podcastFilterAndActions.js","names":["usePodcastInnerFilter","filterFieldsInner","licenceIds","createFilter","createFilterStore","SYSTEM_CORE_DAM","usePodcastSelectActions","useCommonAdminCoreDamOptions","configName","useFetchDamPodcastList","damClient","extSystemId","endPointPodcast","execute","pagination","filterData","filterConfig","podcast","fetchDamPodcastListByIds","ids"],"sources":["../../../../../src/domains/dam/assetSelect/composables/podcastFilterAndActions.ts"],"sourcesContent":["import {\n createFilter,\n createFilterStore,\n type FilterConfig,\n type FilterData,\n type MakeFilterOption,\n} from '@/domains/filters/composables/filterFactory'\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport type { Ref } from 'vue'\nimport type { Pagination } from '@/domains/api/composables/pagination'\nimport type { ValueObjectOption } from '@/shared/types/ValueObject'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { fetchDamPodcastListByIds, useFetchDamPodcastList } from '@/domains/dam/assetSelect/api/damPodcastApi'\n\n/** `licenceIds`: the browsed licences of one ext system; only their podcasts are listed. */\nexport function usePodcastInnerFilter(licenceIds: IntegerId[]) {\n const filterFieldsInner = [\n {\n name: 'title' as const,\n variant: 'startsWith',\n default: null,\n type: 'string',\n apiName: 'texts.title',\n },\n { name: 'licence' as const, variant: 'in', default: licenceIds },\n ] satisfies readonly MakeFilterOption[]\n\n const { filterConfig, filterData } = createFilter(filterFieldsInner, createFilterStore(filterFieldsInner), {\n system: SYSTEM_CORE_DAM,\n subject: 'podcast',\n })\n\n return {\n filterConfig,\n filterData,\n }\n}\n\nexport const usePodcastSelectActions = (extSystemId: IntegerId, configName: string) => {\n const { damClient, endPointPodcast } = useCommonAdminCoreDamOptions(configName)\n const { execute } = useFetchDamPodcastList(damClient, extSystemId, endPointPodcast)\n\n const fetchItems = async (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => {\n const podcasts = await execute(pagination, filterData, filterConfig)\n\n return podcasts.map((podcast: DamPodcastAware) => ({\n title: podcast.texts.title,\n value: podcast.id,\n })) as ValueObjectOption<DocId>[]\n }\n\n const fetchItemsByIds = async (ids: DocId[]) => {\n const podcasts = await fetchDamPodcastListByIds(damClient, extSystemId, ids, endPointPodcast)\n\n return podcasts.map((podcast: DamPodcastAware) => ({\n title: podcast.texts.title,\n value: podcast.id,\n })) as ValueObjectOption<DocId>[]\n }\n\n return {\n fetchItems,\n fetchItemsByIds,\n }\n}\n\nexport interface DamPodcastAware {\n id: DocId\n texts: {\n title: string\n description: string\n }\n}\n"],"mappings":";;;;;AAgBA,SAAgBA,EAAsB,GAAyB;CAC7D,IAAMC,IAAoB,CACxB;EACE,MAAM;EACN,SAAS;EACT,SAAS;EACT,MAAM;EACN,SAAS;CACX,GACA;EAAE,MAAM;EAAoB,SAAS;EAAM,SAASC;CAAW,CACjE,GAEM,EAAE,iBAAc,kBAAeC,EAAaF,GAAmBG,EAAkBH,CAAiB,GAAG;EACzG,QAAQI;EACR,SAAS;CACX,CAAC;CAED,OAAO;EACL;EACA;CACF;AACF;AAEA,IAAaC,KAA2B,GAAwB,MAAuB;CACrF,IAAM,EAAE,cAAW,uBAAoBC,EAA6BC,CAAU,GACxE,EAAE,eAAYC,EAAuBC,GAAWC,GAAaC,CAAe;CAoBlF,OAAO;EACL,mBAnBwB,GAA6B,GAAwB,OAGtE,MAFgBC,EAAQC,GAAYC,GAAYC,CAAY,EAAA,CAEnD,KAAK,OAA8B;GACjD,OAAOC,EAAQ,MAAM;GACrB,OAAOA,EAAQ;EACjB,EAAE;EAcF,wBAX6B,OAGtB,MAFgBC,EAAyBR,GAAWC,GAAaQ,GAAKP,CAAe,EAAA,CAE5E,KAAK,OAA8B;GACjD,OAAOK,EAAQ,MAAM;GACrB,OAAOA,EAAQ;EACjB,EAAE;CAMJ;AACF"}
|
|
@@ -8,7 +8,8 @@ export interface AssetSelectListItem {
|
|
|
8
8
|
active: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const useAssetSelectStore: import('pinia').SetupStoreDefinition<"commonAdminCoreDamAssetSelectStore", {
|
|
11
|
-
|
|
11
|
+
selectedLicenceIds: import('vue').Ref<number[], number[]>;
|
|
12
|
+
selectedPresetKey: import('vue').Ref<string, string>;
|
|
12
13
|
selectConfig: import('vue').Ref<{
|
|
13
14
|
licence: IntegerId;
|
|
14
15
|
extSystem: IntegerId;
|
|
@@ -1744,6 +1745,9 @@ export declare const useAssetSelectStore: import('pinia').SetupStoreDefinition<"
|
|
|
1744
1745
|
getSelectedData: (type: AssetSelectReturnTypeType, copyToLicence: undefined | IntegerId) => AssetSelectReturnData;
|
|
1745
1746
|
setAssetType: (value: DamAssetTypeType) => void;
|
|
1746
1747
|
setSelectConfig: (value: DamConfigLicenceExtSystemReturnType[]) => void;
|
|
1748
|
+
setSelectedLicenceIds: (ids: IntegerId[]) => void;
|
|
1749
|
+
licenceTitle: (licenceId: IntegerId) => string;
|
|
1750
|
+
setSelectedPresetKey: (key: string) => void;
|
|
1747
1751
|
setSingleMode: (value: boolean) => void;
|
|
1748
1752
|
setMinCount: (value: number) => void;
|
|
1749
1753
|
setMaxCount: (value: number) => void;
|