diff options
Diffstat (limited to 'app/assets/javascripts/design_management/router')
3 files changed, 17 insertions, 36 deletions
diff --git a/app/assets/javascripts/design_management/router/constants.js b/app/assets/javascripts/design_management/router/constants.js index abeef520e33..dd2ee8d8689 100644 --- a/app/assets/javascripts/design_management/router/constants.js +++ b/app/assets/javascripts/design_management/router/constants.js @@ -1,3 +1,2 @@ -export const ROOT_ROUTE_NAME = 'root'; export const DESIGNS_ROUTE_NAME = 'designs'; export const DESIGN_ROUTE_NAME = 'design'; diff --git a/app/assets/javascripts/design_management/router/index.js b/app/assets/javascripts/design_management/router/index.js index 7494da002c8..cbeb2f7ce42 100644 --- a/app/assets/javascripts/design_management/router/index.js +++ b/app/assets/javascripts/design_management/router/index.js @@ -1,4 +1,3 @@ -import $ from 'jquery'; import Vue from 'vue'; import VueRouter from 'vue-router'; import routes from './routes'; @@ -16,9 +15,7 @@ export default function createRouter(base) { }); const pageEl = getPageLayoutElement(); - router.beforeEach(({ meta: { el }, name }, _, next) => { - $(`#${el}`).tab('show'); - + router.beforeEach(({ name }, _, next) => { // apply a fullscreen layout style in Design View (a.k.a design detail) if (pageEl) { if (name === DESIGN_ROUTE_NAME) { diff --git a/app/assets/javascripts/design_management/router/routes.js b/app/assets/javascripts/design_management/router/routes.js index 788910e5514..d888b856611 100644 --- a/app/assets/javascripts/design_management/router/routes.js +++ b/app/assets/javascripts/design_management/router/routes.js @@ -1,44 +1,29 @@ import Home from '../pages/index.vue'; import DesignDetail from '../pages/design/index.vue'; -import { ROOT_ROUTE_NAME, DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from './constants'; +import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from './constants'; export default [ { - name: ROOT_ROUTE_NAME, + name: DESIGNS_ROUTE_NAME, path: '/', component: Home, - meta: { - el: 'discussion', - }, + alias: '/designs', }, { - name: DESIGNS_ROUTE_NAME, - path: '/designs', - component: Home, - meta: { - el: 'designs', - }, - children: [ + name: DESIGN_ROUTE_NAME, + path: '/designs/:id', + component: DesignDetail, + beforeEnter( { - name: DESIGN_ROUTE_NAME, - path: ':id', - component: DesignDetail, - meta: { - el: 'designs', - }, - beforeEnter( - { - params: { id }, - }, - from, - next, - ) { - if (typeof id === 'string') { - next(); - } - }, - props: ({ params: { id } }) => ({ id }), + params: { id }, }, - ], + _, + next, + ) { + if (typeof id === 'string') { + next(); + } + }, + props: ({ params: { id } }) => ({ id }), }, ]; |