diff --git a/src/components/ACachedUserChip.vue b/src/components/ACachedUserChip.vue index a20b7f4d..a1bd70d7 100644 --- a/src/components/ACachedUserChip.vue +++ b/src/components/ACachedUserChip.vue @@ -7,17 +7,18 @@ import { isNull, isUndefined } from '@/utils/common' import { COMMON_CONFIG } from '@/model/commonConfig' import AAnzuUserAvatar from '@/components/AAnzuUserAvatar.vue' import { useRouter } from 'vue-router' +import { replaceUrlParameters } from '@/services/api/apiHelper' const props = withDefaults( defineProps<{ id: null | undefined | IntegerId routeName?: string | undefined - externalUrl?: string | undefined + externalUrlTemplate?: string | undefined cachedUsers?: CollabCachedUsersMap | undefined }>(), { routeName: undefined, - externalUrl: undefined, + externalUrlTemplate: undefined, cachedUsers: undefined, } ) @@ -41,7 +42,7 @@ const text = computed(() => { }) const appendIcon = computed(() => { - if (props.externalUrl) { + if (props.externalUrlTemplate) { return COMMON_CONFIG.CHIP.ICON.LINK } if (props.routeName) { @@ -51,8 +52,9 @@ const appendIcon = computed(() => { }) const onClick = () => { - if (props.externalUrl) { - window.open(props.externalUrl, '_blank') + if (props.externalUrlTemplate && props.id) { + const url = replaceUrlParameters(props.externalUrlTemplate, { id: props.id }) + window.open(url, '_blank') return } if (!props.routeName) return @@ -84,6 +86,7 @@ watch( + + diff --git a/src/components/dam/assetSelect/composables/assetSelectListActions.ts b/src/components/dam/assetSelect/composables/assetSelectListActions.ts index cb447ba0..b7b85a1c 100644 --- a/src/components/dam/assetSelect/composables/assetSelectListActions.ts +++ b/src/components/dam/assetSelect/composables/assetSelectListActions.ts @@ -16,6 +16,7 @@ import { useDamCachedAuthors } from '@/components/damImage/uploadQueue/author/ca import { useDamCachedKeywords } from '@/components/damImage/uploadQueue/keyword/cachedKeywords' import { useExtSystemIdForCached } from '@/components/damImage/uploadQueue/composables/extSystemIdForCached' import { isUndefined } from '@/utils/common' +import { useDamCachedUsers } from '@/components/damImage/uploadQueue/author/cachedUsers' const filter = useAssetListFilter() const pagination = usePagination() @@ -24,7 +25,7 @@ const detailLoading = ref(false) export function useAssetSelectActions( configName = 'default', - onDetailLoadedCallback?: ((asset: AssetDetailItemDto) => void) + onDetailLoadedCallback?: (asset: AssetDetailItemDto) => void ) { const { damClient } = useCommonAdminCoreDamOptions(configName) @@ -64,6 +65,7 @@ export function useAssetSelectActions( const { addToCachedAuthors, fetchCachedAuthors } = useDamCachedAuthors() const { addToCachedKeywords, fetchCachedKeywords } = useDamCachedKeywords() + const { addToCachedUsers, fetchCachedUsers } = useDamCachedUsers() const onItemClick = async (data: { assetId: DocId; index: number }, extSystem: IntegerId) => { const { cachedExtSystemId } = useExtSystemIdForCached() @@ -75,8 +77,10 @@ export function useAssetSelectActions( cachedExtSystemId.value = extSystem addToCachedAuthors(asset.authors) addToCachedKeywords(asset.keywords) + addToCachedUsers(asset.modifiedBy, asset.createdBy) fetchCachedAuthors() fetchCachedKeywords() + fetchCachedUsers() if (!isUndefined(onDetailLoadedCallback)) onDetailLoadedCallback(asset) assetDetailStore.setAsset(asset) } catch (e) {