Skip to content

Commit

Permalink
Refactor copying URL functionality in assets
Browse files Browse the repository at this point in the history
Removed the "copyUrlShort" text in both English and Slovak localization files. Replaced the ATableCopyIdButton component with the simpler ACopyText component in AssetFileMainRoute.vue, ensuring the copy URL function now uses an icon with a tooltip instead. This should help improve
  • Loading branch information
Tomas Hermanek committed Jan 5, 2024
1 parent e59845a commit 49057b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/locales/en/coreDam/asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
"makePublic": "Make public",
"openOnNewTab": "Open",
"copyUrl": "Copy URL",
"copyUrlShort": "LN",
"notify": "URL copied"
},
"status": {
Expand Down
1 change: 0 additions & 1 deletion src/locales/sk/coreDam/asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
"makePublic": "Nastaviť ako verejné",
"openOnNewTab": "Otvoriť",
"copyUrl": "Kopírovať URL",
"copyUrlShort": "LN",
"notify": "URL skopírovaná"
},
"status": {
Expand Down
28 changes: 22 additions & 6 deletions src/views/coreDam/assetFileRoute/components/AssetFileMainRoute.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import {
ACopyText,
type AssetFile,
type AssetFileMainRouteAware,
ATableCopyIdButton,
type DamAssetType,
type DocId,
useAlerts,
Expand All @@ -12,6 +12,7 @@ import { ref } from 'vue'
import AssetFileRouteMakePublicDialog from '@/views/coreDam/assetFileRoute/components/AssetFileRouteMakePublicDialog.vue'
import { makePrivateFile } from '@/services/api/coreDam/fileApi'
import AssetFileRouteChangeBtn from '@/views/coreDam/assetFileRoute/components/AssetFileRouteChangeBtn.vue'
import { useI18n } from 'vue-i18n'
const props = withDefaults(
defineProps<{
Expand Down Expand Up @@ -51,6 +52,7 @@ const makePrivate = async () => {
}
loading.value = false
}
const { t } = useI18n()
</script>

<template>
Expand Down Expand Up @@ -80,11 +82,25 @@ const makePrivate = async () => {
@after-update="emit('mainRouteChanged')"
/>

<ATableCopyIdButton
<ACopyText
v-if="assetFile.mainRoute"
:id="assetFile.mainRoute.publicUrl"
button-t="coreDam.asset.assetFilePublicLink.actions.copyUrl"
icon-t="coreDam.asset.assetFilePublicLink.actions.copyUrlShort"
notify-t="coreDam.asset.assetFilePublicLink.actions.notify"
/>
:value="assetFile.mainRoute.publicUrl"
>
<template #activator="{ props: copyButtonProps }">
<VBtn
icon
size="x-small"
v-bind="copyButtonProps"
>
<VIcon icon="mdi-content-copy" />
<VTooltip
activator="parent"
location="bottom"
>
{{ t('coreDam.asset.assetFilePublicLink.actions.copyUrl') }}
</VTooltip>
</VBtn>
</template>
</ACopyText>
</template>

0 comments on commit 49057b6

Please sign in to comment.