Commit 2b6b62c2 authored by Savas Vedova's avatar Savas Vedova

Reintroduce the missing router

parent f5d90c4d
...@@ -6,6 +6,7 @@ import FirstClassGroupSecurityDashboard from './components/first_class_group_sec ...@@ -6,6 +6,7 @@ import FirstClassGroupSecurityDashboard from './components/first_class_group_sec
import FirstClassInstanceSecurityDashboard from './components/first_class_instance_security_dashboard.vue'; import FirstClassInstanceSecurityDashboard from './components/first_class_instance_security_dashboard.vue';
import UnavailableState from './components/unavailable_state.vue'; import UnavailableState from './components/unavailable_state.vue';
import createStore from './store'; import createStore from './store';
import createRouter from './router';
import projectsPlugin from './store/plugins/projects'; import projectsPlugin from './store/plugins/projects';
import projectSelector from './store/plugins/project_selector'; import projectSelector from './store/plugins/project_selector';
import apolloProvider from './graphql/provider'; import apolloProvider from './graphql/provider';
...@@ -62,6 +63,7 @@ export default ( ...@@ -62,6 +63,7 @@ export default (
props.vulnerabilitiesExportEndpoint = el.dataset.vulnerabilitiesExportEndpoint; props.vulnerabilitiesExportEndpoint = el.dataset.vulnerabilitiesExportEndpoint;
} }
const router = createRouter();
const store = createStore({ const store = createStore({
dashboardType, dashboardType,
plugins: [projectSelector, projectsPlugin], plugins: [projectSelector, projectsPlugin],
...@@ -70,6 +72,7 @@ export default ( ...@@ -70,6 +72,7 @@ export default (
return new Vue({ return new Vue({
el, el,
store, store,
router,
apolloProvider, apolloProvider,
render(createElement) { render(createElement) {
return createElement(component, { props }); return createElement(component, { props });
......
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
// Unfortunately Vue Router doesn't work without at least a fake component
// If you do only data handling
const EmptyRouterComponent = {
render(createElement) {
return createElement('div');
},
};
export default () => {
const routes = [{ path: '/', name: 'dashboard', component: EmptyRouterComponent }];
const router = new VueRouter({
mode: 'history',
base: window.location.pathname,
routes,
});
return router;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment