diff --git a/package.json b/package.json index 3855855e..446d62bb 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "@kyvg/vue3-notification": "^3.4.1", "@mdi/font": "^7.4.47", "@shikijs/vitepress-twoslash": "^1.24.2", - "@stylistic/eslint-plugin": "^2.12.0", + "@stylistic/eslint-plugin": "^2.12.1", "@tsconfig/node18": "^18.2.4", - "@types/node": "^22.10.1", + "@types/node": "^22.10.2", "@types/rusha": "^0.8.3", "@types/sortablejs": "^1.15.8", "@types/webfontloader": "^1.6.38", @@ -77,7 +77,7 @@ "stylelint-config-recommended-vue": "^1.5.0", "stylelint-config-standard-scss": "^14.0.0", "typescript": "5.6.3", - "unplugin": "2.0.0", + "unplugin": "2.1.0", "uuid": "^11.0.3", "vite": "6.0.3", "vite-plugin-dts": "4.3.0", diff --git a/src/components/damImage/uploadQueue/components/ImageMassOperations.vue b/src/components/damImage/uploadQueue/components/ImageMassOperations.vue index d80d4e6f..51c42d1f 100644 --- a/src/components/damImage/uploadQueue/components/ImageMassOperations.vue +++ b/src/components/damImage/uploadQueue/components/ImageMassOperations.vue @@ -5,22 +5,33 @@ import AFormTextarea from '@/components/form/AFormTextarea.vue' import { computed, ref } from 'vue' import useVuelidate from '@vuelidate/core' import { useValidate } from '@/validators/vuelidate/useValidate' +import { useImageStore } from '@/components/damImage/uploadQueue/composables/imageStore' +import ASystemEntityScope from '@/components/form/ASystemEntityScope.vue' +import AuthorRemoteAutocompleteWithCached from '@/components/damImage/uploadQueue/author/AuthorRemoteAutocompleteWithCached.vue' +import { useExtSystemIdForCached } from '@/components/damImage/uploadQueue/composables/extSystemIdForCached' +import { storeToRefs } from 'pinia' -const texts = ref({ description: '', source: '' }) +const texts = ref({ description: '', source: '', authors: [] }) -const { replaceEmptyDescription, replaceEmptySource } = useImageMassOperations() +const imageStore = useImageStore() +const { images } = storeToRefs(imageStore) +const { replaceEmptyDescription, replaceEmptySource, replaceEmptyAuthors } = useImageMassOperations() const { t } = useI18n() const fillAll = (forceReplace: boolean) => { replaceEmptyDescription(texts.value.description, forceReplace) replaceEmptySource(texts.value.source, forceReplace) + replaceEmptyAuthors(texts.value.authors, forceReplace) } const clearForm = () => { texts.value.description = '' texts.value.source = '' + texts.value.authors = [] } +const { cachedExtSystemId } = useExtSystemIdForCached() + const { maxLength } = useValidate() const rules = computed(() => ({ @@ -34,6 +45,14 @@ const rules = computed(() => ({ }, })) const v$ = useVuelidate(rules, { texts }, { $scope: false }) + +const showDamAuthorsAtLeastOne = computed(() => { + if (images.value.length === 0) return false + return ( + images.value.length && + images.value.some((item) => item?.showDamAuthors) + ) +})