From c27bd8f6677a27b47b6951e752d56a4c86d33775 Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Mon, 12 Feb 2024 16:31:34 -0800 Subject: [PATCH 01/17] fix: side panel closing confirmation & logic in child component The issue here was that the logic for whether or not the panel should be closed or whether or not we need to show a confirmation modal was initially built into the SectionSidePanel component. This component is a wrapper component and now that the workingResourcePool lives solely within the ResourceSelection component, there is no access to it in the parent. The solution was to pass a prop into each child component which will need to be handled in all of the child components (section edit, question replacement). This prop tells the child that we're trying to close the side panel. This allows each child component then to define its own logic and messaging around confirming the panels closure with the user. This results in the child component also needing to emit two events which tell the SectionSidePanel if the panel should actuall be closed, resulting in the user being returned to the root quiz creation route. --- .../ConfirmCancellationModal.vue | 7 --- .../plan/CreateExamPage/ResourceSelection.vue | 49 +++++++++++++++++-- .../plan/CreateExamPage/SectionSidePanel.vue | 47 +++++++----------- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ConfirmCancellationModal.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ConfirmCancellationModal.vue index 38497c9b06..e60e3640bb 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ConfirmCancellationModal.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ConfirmCancellationModal.vue @@ -48,16 +48,9 @@ export default { name: 'ConfirmCancellationModal', mixins: [commonCoreStrings], - props: { - closePanelRoute: { - type: Object, - required: true, - }, - }, methods: { handleContinueAction() { this.$emit('continue'); - this.$router.replace(this.closePanelRoute); }, closeModal() { this.$emit('cancel'); diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue index d11589743b..bbcd66d596 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue @@ -112,6 +112,11 @@ + @@ -120,9 +125,10 @@