From 5fa5a2349ef26474cf28a31f00c73fba0a44f24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 17 Sep 2024 17:05:15 +0200 Subject: [PATCH] Add FileIcon.vue and refactor DropFile.vue to use it Introduced `FileIcon.vue` to handle file type icons centrally. Refactored `DropFile.vue` to utilize the new `FileIcon` component, improving code clarity and maintainability. --- .../public/vuejs/DropFileWidget/DropFile.vue | 12 ++------- .../Resources/public/vuejs/FileIcon.vue | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue index 464a689f8..99fc31524 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue @@ -3,6 +3,7 @@ import {StoredObject, StoredObjectVersionCreated} from "../../types"; import {encryptFile, fetchNewStoredObject, uploadVersion} from "../../js/async-upload/uploader"; import {computed, ref, Ref} from "vue"; +import FileIcon from "ChillDocStoreAssets/vuejs/FileIcon.vue"; interface DropFileConfig { existingDoc?: StoredObject, @@ -111,16 +112,7 @@ const handleFile = async (file: File): Promise => {

- - - - - - - - - - +

{{ display_filename }}

diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue new file mode 100644 index 000000000..437d6bdc8 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/FileIcon.vue @@ -0,0 +1,25 @@ + + + + +