From 4c7e7df19606cf1c487bae0988f571c0614a74df Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 2 Nov 2023 12:33:47 -0400 Subject: [PATCH] Reworked routing for the app --- components/next-page.vue | 8 ++++++-- components/tool-navbar.vue | 19 +++++-------------- .../page/my_happy_annotation-page_tests.cy.js | 7 +------ store/index.js | 5 +++++ 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/components/next-page.vue b/components/next-page.vue index 7d59deb3..f3815146 100644 --- a/components/next-page.vue +++ b/components/next-page.vue @@ -18,9 +18,8 @@ class="float-right" data-cy="button-nextpage" :disabled="!isPageAccessible(pageData[getNextPage].pageName)" - :to="'/' + pageData[getNextPage].location" :variant="nextPageButtonColor" - @click="setCurrentPage(getNextPage)"> + @click="navigateToPage(getNextPage);"> {{ uiText.button[currentPage] }} @@ -39,6 +38,8 @@ // Fields listed in mapState below can be found in the store (index.js) import { mapState } from "vuex"; + import { mapActions } from "vuex"; + export default { data() { @@ -90,6 +91,9 @@ ...mapMutations([ "setCurrentPage" + ]), + ...mapActions([ + "navigateToPage" ]) } }; diff --git a/components/tool-navbar.vue b/components/tool-navbar.vue index e45a7ff5..920beb09 100644 --- a/components/tool-navbar.vue +++ b/components/tool-navbar.vue @@ -2,6 +2,7 @@
+ @@ -31,8 +32,7 @@ :data-cy="'menu-item-' + navItem.pageName" :disabled="!isPageAccessible(navItem.pageName)" :key="navItem.pageName" - :to="navItem.location" - @click="setCurrentPage(navItem.pageName)"> + @click="navigateToPage(navItem.pageName)"> {{ navItem.fullName }} | @@ -71,14 +71,7 @@