From 23580769145a638327d2fba3d86fa4fb286dae29 Mon Sep 17 00:00:00 2001 From: Quentin Guillemin Date: Fri, 29 Sep 2023 12:56:38 +0200 Subject: [PATCH] feat: files requested automatic and files refresh --- src/main/webapp/src/App.vue | 9 ++-- .../src/components/BottomNavigation.vue | 12 +++-- .../components/drawers/NavigationDrawer.vue | 5 ++ .../src/components/layouts/FilesLayout.vue | 1 - src/main/webapp/src/router/index.ts | 17 +++--- .../webapp/src/stores/configurationStore.ts | 52 +++++++++++++++++++ src/main/webapp/src/types/enums/Navigation.ts | 6 +++ .../webapp/src/views/home/FavoritesView.vue | 14 ++--- .../webapp/src/views/home/ProjectsView.vue | 14 ++--- src/main/webapp/src/views/home/PublicView.vue | 14 ++--- src/main/webapp/src/views/home/SharedView.vue | 14 ++--- 11 files changed, 102 insertions(+), 56 deletions(-) create mode 100644 src/main/webapp/src/types/enums/Navigation.ts diff --git a/src/main/webapp/src/App.vue b/src/main/webapp/src/App.vue index bb21e80c..d5c923c6 100644 --- a/src/main/webapp/src/App.vue +++ b/src/main/webapp/src/App.vue @@ -12,13 +12,15 @@ import { useRouter } from 'vue-router'; import { useTheme } from 'vuetify'; const configurationStore = useConfigurationStore(); -const { resetState } = configurationStore; -const { selectedFile, isSelectedFile, isConfirmation } = storeToRefs(configurationStore); +const { refresh, resetState } = configurationStore; +const { lastNavigation, selectedFile, isSelectedFile, isConfirmation } = storeToRefs(configurationStore); const router = useRouter(); -router.beforeEach(() => { +router.beforeEach((to) => { resetState(); + if (to.name != undefined && to.name != null) lastNavigation.value = to.name as string; + refresh(true, true); }); const theme = useTheme(); @@ -52,6 +54,7 @@ const deleteItem = async (result: Response) => { if (result == Response.yes && isSelectedFile.value) { try { await deleteFile(selectedFile.value!); + refresh(true); } catch (e) { errorHandler(e); } diff --git a/src/main/webapp/src/components/BottomNavigation.vue b/src/main/webapp/src/components/BottomNavigation.vue index 8d2856a5..eb8065c8 100644 --- a/src/main/webapp/src/components/BottomNavigation.vue +++ b/src/main/webapp/src/components/BottomNavigation.vue @@ -1,26 +1,30 @@