Skip to content

Commit

Permalink
update route
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC committed May 12, 2023
1 parent ca0f1e9 commit ce5bd74
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/components/PanelPacks/PanelPacks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<template #row="{row}">
<TableCell :title="tableColumns[0].title">
<RouterLink
:to="{ name: `exercise-tasks-${row.type}-view`, params: { panelId: row.id } }"
:to="{ name: `exercise-reports-${row.type}-view`, params: { panelId: row.id } }"
>
{{ row.name }}
</RouterLink>
Expand Down Expand Up @@ -251,11 +251,11 @@ export default {
createNewPanel() {
let routeName = '';
if (this.type === 'sift') {
routeName = 'exercise-tasks-sift-new';
routeName = 'exercise-reports-sift-new';
} else if (this.type === 'scenario') {
routeName = 'exercise-tasks-scenario-new';
routeName = 'exercise-reports-scenario-new';
} else {
routeName = 'exercise-tasks-selection-new';
routeName = 'exercise-reports-selection-new';
}
this.$router.push({ name: routeName });
},
Expand Down
10 changes: 5 additions & 5 deletions src/views/Exercise/Reports/PanelsNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ export default {
computed: {
isSift() {
// TODO: add this from store panel.js
const route = this.$route.fullPath.includes('/tasks/sift/');
const route = this.$route.fullPath.includes('/reports/sift/');
return route;
},
isSelectionDay() {
// TODO: add this from store panel.js
const route = this.$route.fullPath.includes('/tasks/selection/');
const route = this.$route.fullPath.includes('/reports/selection/');
return route;
},
isScenario() {
return this.$route.fullPath.includes('/tasks/scenario/');
return this.$route.fullPath.includes('/reports/scenario/');
},
title() {
let returnTitle = 'New Panel for';
Expand Down Expand Up @@ -123,13 +123,13 @@ export default {
};
await this.$store.dispatch('panels/create', data);
this.$router.push({
name: `exercise-tasks-${this.type}`,
name: `exercise-reports-${this.type}`,
});
}
},
cancel() {
this.$router.push({
name: `exercise-tasks-${this.type}`,
name: `exercise-reports-${this.type}`,
});
},
},
Expand Down
14 changes: 7 additions & 7 deletions src/views/Exercise/Reports/PanelsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="govuk-grid-column-one-half">
<router-link
class="govuk-back-link"
:to="{ name: `exercise-tasks-${panel.type}` }"
:to="{ name: `exercise-reports-${panel.type}` }"
>
Back
</router-link>
Expand Down Expand Up @@ -371,12 +371,12 @@ export default {
// Redirect if page Reload
if (!this.panel) {
let nextRoute = '';
if (this.$route.fullPath.includes('/tasks/selection/')) {
nextRoute = 'exercise-tasks-selection';
} else if (this.$route.fullPath.includes('/tasks/scenario')) {
nextRoute = 'exercise-tasks-scenario';
if (this.$route.fullPath.includes('/reports/selection/')) {
nextRoute = 'exercise-reports-selection';
} else if (this.$route.fullPath.includes('/reports/scenario')) {
nextRoute = 'exercise-reports-scenario';
} else {
nextRoute = 'exercise-tasks-sift';
nextRoute = 'exercise-reports-sift';
}
this.$router.push({
name: nextRoute,
Expand Down Expand Up @@ -426,7 +426,7 @@ export default {
await this.$store.dispatch('panels/removePanelApplications', { panelType: this.panel.type, applicationIds: this.selectedItems });
},
async deletePanel(){
const redirectTo = `exercise-tasks-${this.panel.type}`;
const redirectTo = `exercise-reports-${this.panel.type}`;
await this.$store.dispatch('panels/deletePanel', this.panelId );
this.$router.push({ name: redirectTo });
},
Expand Down

0 comments on commit ce5bd74

Please sign in to comment.