diff --git a/src/components/Page/Navigation.vue b/src/components/Page/Navigation.vue index 92b2b9350..c67527411 100644 --- a/src/components/Page/Navigation.vue +++ b/src/components/Page/Navigation.vue @@ -18,7 +18,7 @@ v-for="(page, pageIndex) in pages" :key="pageIndex" class="moj-side-navigation__item" - :class="{'moj-side-navigation__item--active': page.on}" + :class="{'moj-side-navigation__item--active': isActive(page)}" > ['edit','list','back'].indexOf(i) !== -1)) { + // check the names match + return page.name.split('-')[2] == this.$route.name.split('-')[2]; + } else { + return this.$route.name == page.name; + } + }, + }, + }; diff --git a/src/router.js b/src/router.js index 9d77ebb41..9342e22fb 100644 --- a/src/router.js +++ b/src/router.js @@ -243,6 +243,16 @@ const router = new Router({ requiresAuth: true, title: 'Exercise Details | Applications', }, + }, + // this route enables side navigation to show active state for :status + { + path: 'applications/:status/application/:applicationId', + component: ExerciseApplication, + name: 'exercise-applications-application', + meta: { + requiresAuth: true, + title: 'Exercise Application', + }, }, { path: 'application/:applicationId', diff --git a/src/views/Exercises/Applications/Application.vue b/src/views/Exercises/Applications/Application.vue index 8bdaf0b8c..6df6b5339 100644 --- a/src/views/Exercises/Applications/Application.vue +++ b/src/views/Exercises/Applications/Application.vue @@ -1729,8 +1729,8 @@ export default { if (this.applications[i].id === this.applicationId) { if (i < len) { this.$router.replace({ - name: 'exercise-application', - params: { applicationId: this.applications[i+1].id }, + name: 'exercise-applications-application', + params: { applicationId: this.applications[i+1].id, status: this.applications[i+1].status }, }); } break; @@ -1744,8 +1744,8 @@ export default { if (this.applications[i].id === this.applicationId) { if (i > 0) { this.$router.replace({ - name: 'exercise-application', - params: { applicationId: this.applications[i-1].id }, + name: 'exercise-applications-application', + params: { applicationId: this.applications[i-1].id, status: this.applications[i+1].status }, }); } break; diff --git a/src/views/Exercises/Show.vue b/src/views/Exercises/Show.vue index 9b57d56a3..d6da13e76 100644 --- a/src/views/Exercises/Show.vue +++ b/src/views/Exercises/Show.vue @@ -42,12 +42,12 @@