From 1e7b6c24dfbb8d1c9debbd3f39dd2578a35c3db4 Mon Sep 17 00:00:00 2001 From: malkja Date: Fri, 31 May 2024 13:46:20 +0200 Subject: [PATCH] refactor: use 'config' Pinia Store in different components, remove 'config' Vuex Module --- src/components/Notification.vue | 2 - src/components/annotations/AnnotationIcon.vue | 1 + src/components/base/BaseCheckbox.vue | 1 - src/components/base/BaseDropdown.vue | 2 - src/components/header/Language.vue | 2 - src/components/header/PanelsToggle.vue | 2 - src/components/header/TitleBar.vue | 4 +- src/components/header/Tools.vue | 6 +- src/components/metadata/ItemMetadata.vue | 5 +- src/components/metadata/ManifestMetadata.vue | 5 +- src/components/metadata/MetadataItem.vue | 2 +- src/components/metadata/MetadataView.vue | 6 +- src/components/panels/Panel.vue | 4 +- src/components/panels/PanelsWrapper.vue | 2 - src/store/config/actions.js | 376 ------------------ src/store/config/getters.js | 26 -- src/store/config/index.js | 12 - src/store/config/mutations.js | 31 -- src/store/config/state.js | 137 ------- src/store/index.js | 2 - src/stores/config.ts | 121 +++--- src/types.d.ts | 113 ------ 22 files changed, 80 insertions(+), 782 deletions(-) delete mode 100644 src/store/config/actions.js delete mode 100644 src/store/config/getters.js delete mode 100644 src/store/config/index.js delete mode 100644 src/store/config/mutations.js delete mode 100644 src/store/config/state.js diff --git a/src/components/Notification.vue b/src/components/Notification.vue index 7b6c52e1..742cd92f 100644 --- a/src/components/Notification.vue +++ b/src/components/Notification.vue @@ -17,7 +17,6 @@ diff --git a/src/components/base/BaseCheckbox.vue b/src/components/base/BaseCheckbox.vue index 59116499..654dbff3 100644 --- a/src/components/base/BaseCheckbox.vue +++ b/src/components/base/BaseCheckbox.vue @@ -1,6 +1,5 @@ diff --git a/src/components/panels/Panel.vue b/src/components/panels/Panel.vue index 104bffc0..bed3c1eb 100644 --- a/src/components/panels/Panel.vue +++ b/src/components/panels/Panel.vue @@ -95,6 +95,7 @@ import { computed, nextTick, ref, watch, } from 'vue'; import { useStore } from 'vuex'; +import { useConfigStore } from '@/stores/config'; import { useI18n } from 'vue-i18n'; import TabView from 'primevue/tabview'; import TabPanel from 'primevue/tabpanel'; @@ -136,6 +137,7 @@ export default { }, setup(props, { emit }) { const store = useStore(); + const configStore = useConfigStore() const { t } = useI18n(); const tabs = ref([]); @@ -317,7 +319,7 @@ export default { [contentItem] = item.value.content; // TODO: this should be moved to loading time in order dynamically recognize all content types // instead of only the first one - store.dispatch('config/setContentType', contentItem.type.split('type=')[1]); + configStore.setContentType(contentItem.type.split('type=')[1]); } contentItem = item.value.content.find((c) => c.type.split('type=')[1] === type); diff --git a/src/components/panels/PanelsWrapper.vue b/src/components/panels/PanelsWrapper.vue index 72a5af94..49645dd5 100644 --- a/src/components/panels/PanelsWrapper.vue +++ b/src/components/panels/PanelsWrapper.vue @@ -15,12 +15,10 @@