From b2ac6936cfc10479c1732667160934f3bb502612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Wed, 10 Apr 2024 10:36:04 +0200 Subject: [PATCH] I9870 - Consolidate modal rendering stack (#344) * pkp/pkp-lib#9870 Render legacy modals via Vue.js * pkp/pkp-lib#9870 Update storybook using openSideModal function --- .storybook/preview.js | 6 +- src/components/Container/Page.vue | 2 - src/components/Modal/AjaxModalWrapper.vue | 66 ++- src/components/Modal/Dialog.vue | 18 +- src/components/Modal/ModalManager.vue | 69 +-- src/components/Modal/SideModal.mdx | 40 +- src/components/Modal/SideModal.stories.js | 445 +++++++++--------- src/components/Modal/SideModal.vue | 10 +- src/components/Modal/SideModalBody.vue | 16 +- ...dyAjax.vue => SideModalBodyLegacyAjax.vue} | 6 +- src/composables/useDialog.js | 11 - src/composables/useDialog.mdx | 54 --- src/composables/useModal.js | 15 + src/composables/useModal.mdx | 72 +++ ...eDialog.stories.js => useModal.stories.js} | 10 +- src/pages/submissions/AssignEditorsModal.vue | 23 - .../submissions/SubmissionSummaryModal.vue | 23 +- src/pages/submissions/SubmissionsPage.vue | 26 - .../submissions/submissionSummaryStore.js | 6 +- src/pages/submissions/submissionsPageStore.js | 43 +- src/stores/modalStore.js | 129 ++++- 21 files changed, 613 insertions(+), 477 deletions(-) rename src/components/Modal/{SideModalBodyAjax.vue => SideModalBodyLegacyAjax.vue} (73%) delete mode 100644 src/composables/useDialog.js delete mode 100644 src/composables/useDialog.mdx create mode 100644 src/composables/useModal.js create mode 100644 src/composables/useModal.mdx rename src/composables/{useDialog.stories.js => useModal.stories.js} (92%) delete mode 100644 src/pages/submissions/AssignEditorsModal.vue diff --git a/.storybook/preview.js b/.storybook/preview.js index 7029879d6..645534a61 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -22,7 +22,7 @@ import Tab from '@/components/Tabs/Tab.vue'; import Tabs from '@/components/Tabs/Tabs.vue'; import FloatingVue from 'floating-vue'; -import PkpDialog from '@/components/Modal/Dialog.vue'; +import ModalManager from '@/components/Modal/ModalManager.vue'; import VueScrollTo from 'vue-scrollto'; @@ -116,9 +116,9 @@ const preview = { /** Globally Available Dialog */ (story) => ({ setup() {}, - components: {story, PkpDialog}, + components: {story, ModalManager}, template: `
- +
`, }), diff --git a/src/components/Container/Page.vue b/src/components/Container/Page.vue index d762f98a8..c15ecff97 100644 --- a/src/components/Container/Page.vue +++ b/src/components/Container/Page.vue @@ -1,6 +1,5 @@ diff --git a/src/components/Modal/Dialog.vue b/src/components/Modal/Dialog.vue index acb28f5e0..8246acda6 100644 --- a/src/components/Modal/Dialog.vue +++ b/src/components/Modal/Dialog.vue @@ -1,6 +1,6 @@ diff --git a/src/components/Modal/SideModalBodyAjax.vue b/src/components/Modal/SideModalBodyLegacyAjax.vue similarity index 73% rename from src/components/Modal/SideModalBodyAjax.vue rename to src/components/Modal/SideModalBodyLegacyAjax.vue index 604a6c09b..08560fbf0 100644 --- a/src/components/Modal/SideModalBodyAjax.vue +++ b/src/components/Modal/SideModalBodyLegacyAjax.vue @@ -1,9 +1,9 @@ @@ -115,14 +113,17 @@ import {storeToRefs} from 'pinia'; import PkpButton from '@/components/Button/Button.vue'; import SideModalBody from '@/components/Modal/SideModalBody.vue'; import StageBubble from '@/components/StageBubble/StageBubble.vue'; -import SideModal from '@/components/Modal/SideModal.vue'; -import AssignEditorsModal from '@/pages/submissions/AssignEditorsModal.vue'; + +import {useSubmissionsPageStore} from './submissionsPageStore'; import {useSubmissionSummaryStore} from '@/pages/submissions/submissionSummaryStore'; const pkp = window.pkp; -const summaryStore = useSubmissionSummaryStore(); +const props = defineProps({selectedSubmission: {type: Object, required: true}}); + +const summaryStore = useSubmissionSummaryStore(props); +const dashboardStore = useSubmissionsPageStore(props); const {submission} = storeToRefs(summaryStore); diff --git a/src/pages/submissions/SubmissionsPage.vue b/src/pages/submissions/SubmissionsPage.vue index b0d349bd2..3efa0d6a5 100644 --- a/src/pages/submissions/SubmissionsPage.vue +++ b/src/pages/submissions/SubmissionsPage.vue @@ -50,40 +50,14 @@ - - - - - - - - - -