Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Dec 5, 2023
1 parent b484950 commit 0499600
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import AssetFileFailReasonChip from '@/components/damImage/uploadQueue/component
import AuthorRemoteAutocompleteWithCached from '@/components/damImage/uploadQueue/author/AuthorRemoteAutocompleteWithCached.vue'
import { ADamAssetMetadataValidationScopeSymbol } from '@/components/damImage/uploadQueue/composables/uploadValidations'
import KeywordRemoteAutocompleteWithCached from '@/components/damImage/uploadQueue/keyword/KeywordRemoteAutocompleteWithCached.vue'
import { isNull } from '@/utils/common'
const props = withDefaults(
defineProps<{
Expand All @@ -39,6 +40,7 @@ const emit = defineEmits<{
(e: 'update:authors', data: DocId[]): void
(e: 'cancelItem', data: { index: number; item: UploadQueueItem; queueKey: string }): void
(e: 'removeItem', index: number): void
(e: 'showDetail', data: DocId): void
}>()
const IMAGE_ASPECT_RATIO = 16 / 9
Expand Down Expand Up @@ -93,16 +95,16 @@ const uploadProgress = computed(() => {
return props.item.progress.progressPercent
})
const remove = async () => {
if (!props.item.assetId) return
try {
// await deleteAsset(props.item.assetId)
emit('removeItem', props.index)
showRecordWas('deleted')
} catch (error) {
showErrorsDefault(error)
}
}
// const remove = async () => {
// if (!props.item.assetId) return
// try {
// // await deleteAsset(props.item.assetId)
// emit('removeItem', props.index)
// showRecordWas('deleted')
// } catch (error) {
// showErrorsDefault(error)
// }
// }
const imageSrc = computed(() => {
return props.item.imagePreview ? props.item.imagePreview.url : undefined
})
Expand All @@ -125,6 +127,11 @@ const showCancel = computed(() => {
props.item.status
)
})
const showDetail = async () => {
if (isNull(props.item.assetId)) return
emit('showDetail', props.item.assetId)
}
</script>

<template>
Expand Down Expand Up @@ -196,6 +203,7 @@ const showCancel = computed(() => {
size="small"
variant="text"
:disabled="!item.canEditMetadata"
@click.stop="showDetail"
>
{{ t('common.damImage.queueItem.edit') }}
</VBtn>
Expand Down Expand Up @@ -223,12 +231,12 @@ const showCancel = computed(() => {
{{ t('common.button.cancel') }}
</VTooltip>
</VBtn>
<AActionDeleteButton
variant="icon"
:disabled="!item.canEditMetadata && !item.isDuplicate"
button-class=""
@delete-record="remove"
/>
<!-- <AActionDeleteButton-->
<!-- variant="icon"-->
<!-- :disabled="!item.canEditMetadata && !item.isDuplicate"-->
<!-- button-class=""-->
<!-- @delete-record="remove"-->
<!-- />-->
</div>
</div>
</VCol>
Expand Down
2 changes: 1 addition & 1 deletion src/locales/sk/common/damImage.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"queueItem": {
"edit": "Upraviť",
"edit": "Upraviť v DAM",
"displayTitle": "Meno originálu",
"error": "Chyba",
"copyAssetId": "Kopírovať asset ID"
Expand Down

0 comments on commit 0499600

Please sign in to comment.