From 84069e03dc56c7f4bf0b115fbac344d66b97d85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 19 Jul 2024 13:55:22 +0200 Subject: [PATCH] Add filename display on file upload This update introduces a new feature to the DropFile component; now filenames are displayed when they are uploaded. This provides a user-friendly way to view the file being managed. Additionally, some styling adjustments were made to accommodate this new addition. --- .../unreleased/Feature-20240719-135515.yaml | 5 +++++ .../public/vuejs/DropFileWidget/DropFile.vue | 20 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changes/unreleased/Feature-20240719-135515.yaml diff --git a/.changes/unreleased/Feature-20240719-135515.yaml b/.changes/unreleased/Feature-20240719-135515.yaml new file mode 100644 index 000000000..b4fb2fffd --- /dev/null +++ b/.changes/unreleased/Feature-20240719-135515.yaml @@ -0,0 +1,5 @@ +kind: Feature +body: Display filename on file upload within the UI interface +time: 2024-07-19T13:55:15.16139422+02:00 +custom: + Issue: "" diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue index 94b4f02fb..4eb9e09b1 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DropFileWidget/DropFile.vue @@ -16,6 +16,7 @@ const emit = defineEmits<{ const is_dragging: Ref = ref(false); const uploading: Ref = ref(false); +const display_filename: Ref = ref(null); const has_existing_doc = computed(() => { return props.existingDoc !== undefined && props.existingDoc !== null; @@ -79,6 +80,7 @@ const onFileChange = async (event: Event): Promise => { const handleFile = async (file: File): Promise => { uploading.value = true; + display_filename.value = file.name; const type = file.type; const buffer = await file.arrayBuffer(); const [encrypted, iv, jsonWebKey] = await encryptFile(buffer); @@ -103,7 +105,7 @@ const handleFile = async (file: File): Promise => {