diff --git a/src/main/webapp/src/App.vue b/src/main/webapp/src/App.vue index 1ad58f00..f094b542 100644 --- a/src/main/webapp/src/App.vue +++ b/src/main/webapp/src/App.vue @@ -7,12 +7,15 @@ import { errorHandler } from '@/utils/axiosUtils.ts'; import { usePreferredDark } from '@vueuse/core'; import { storeToRefs } from 'pinia'; import { computed, onBeforeMount, watch } from 'vue'; +import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import { useTheme } from 'vuetify'; +const { t } = useI18n(); + const configurationStore = useConfigurationStore(); const { refresh, resetState } = configurationStore; -const { lastNavigation, currentFile, isConfirmation } = storeToRefs(configurationStore); +const { lastNavigation, currentFile, isConfirmation, confirmationTitle } = storeToRefs(configurationStore); const router = useRouter(); @@ -94,9 +97,12 @@ const deleteItem = async (result: Response): Promise => { diff --git a/src/main/webapp/src/components/dialogs/ConfirmationDialog.vue b/src/main/webapp/src/components/dialogs/ConfirmationDialog.vue index 160c1353..25172ff4 100644 --- a/src/main/webapp/src/components/dialogs/ConfirmationDialog.vue +++ b/src/main/webapp/src/components/dialogs/ConfirmationDialog.vue @@ -12,6 +12,8 @@ const props = defineProps<{ yesValue: string; noValue: string; cancelable?: boolean; + noColor?: string; + yesColor?: string; }>(); const emit = defineEmits<{ @@ -52,8 +54,8 @@ const yes = (): void => { - - + + diff --git a/src/main/webapp/src/locales/en/dialogs.json b/src/main/webapp/src/locales/en/dialogs.json index c61a5beb..dc9bdad6 100644 --- a/src/main/webapp/src/locales/en/dialogs.json +++ b/src/main/webapp/src/locales/en/dialogs.json @@ -6,6 +6,9 @@ "file": { "title": "New File", "description": "File type" + }, + "delete": { + "title": "Are you sure to delete?" } } } diff --git a/src/main/webapp/src/locales/fr/dialogs.json b/src/main/webapp/src/locales/fr/dialogs.json index f0c75dab..987c9ae5 100644 --- a/src/main/webapp/src/locales/fr/dialogs.json +++ b/src/main/webapp/src/locales/fr/dialogs.json @@ -6,6 +6,9 @@ "file": { "title": "Nouveau fichier", "description": "Type de fichier" + }, + "delete": { + "title": "Êtes-vous sûr d'effecer ?" } } } diff --git a/src/main/webapp/src/stores/configurationStore.ts b/src/main/webapp/src/stores/configurationStore.ts index 0d372fb2..5152dc47 100644 --- a/src/main/webapp/src/stores/configurationStore.ts +++ b/src/main/webapp/src/stores/configurationStore.ts @@ -95,6 +95,9 @@ export const useConfigurationStore = defineStore('configuration', () => { const isInfo = ref(false); const currentTab = ref(Tabs.Information); const isConfirmation = ref(false); + const confirmationTitle = computed(() => + currentFile.value ? `"${currentFile.value.title}"` : undefined, + ); const isNew = ref(false); const resetState = (): void => { @@ -124,6 +127,7 @@ export const useConfigurationStore = defineStore('configuration', () => { isInfo, currentTab, isConfirmation, + confirmationTitle, isNew, resetState, isGrid,