Skip to content

Commit

Permalink
Resolving router-related warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
  • Loading branch information
rak-phillip authored and cnotv committed Aug 12, 2024
1 parent 9122c95 commit be6588e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions shell/config/router/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { createRouter, createWebHistory } from 'vue-router';
import Routes from '@shell/config/router/routes';
import { installNavigationGuards } from '@shell/config/router/navigation-guards';
import { createRouter, createWebHistory } from 'vue-router';

// TODO: #9539: Add import of this router to app
export const routerOptions = {
history: {
...createWebHistory(),
// Note: router base comes from the ROUTER_BASE env var
base: process.env.routerBase || '/'
},
routes: Routes,
};
export const routerOptions = createRouter({
history: createWebHistory(process.env.routerBase || '/'),
// Note: router base comes from the ROUTER_BASE env var
base: process.env.routerBase || '/',
routes: Routes,
fallback: false,
});

export function extendRouter(config, context) {
const base = (config._app && config._app.basePath) || routerOptions.base;
const router = createRouter({ ...routerOptions, base });
const router = createRouter({
...routerOptions,
base,
});

installNavigationGuards(router, context);

Expand Down
4 changes: 2 additions & 2 deletions shell/core/plugins.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { productsLoaded } from '@shell/store/type-map';
import { clearModelCache } from '@shell/plugins/dashboard-store/model-loader';
import { Plugin } from './plugin';
import { PluginRoutes } from './plugin-routes';
// import { PluginRoutes } from './plugin-routes';
import { UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';
import { ExtensionPoint } from './types';

Expand All @@ -18,7 +18,7 @@ export default function(context, inject, vueApp) {
// Track which plugin loaded what, so we can unload stuff
const plugins = {};

const pluginRoutes = new PluginRoutes(app.router);
// const pluginRoutes = new PluginRoutes(app.router);

const uiConfig = {};

Expand Down
2 changes: 1 addition & 1 deletion shell/initialize/install-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import vSelect from 'vue-select';
import VModal from 'vue-js-modal';
import 'vue-resize/dist/vue-resize.css';

import '@shell/plugins/extend-router';
// import '@shell/plugins/extend-router';
import '@shell/plugins/formatters';
import '@shell/plugins/js-yaml';

Expand Down

0 comments on commit be6588e

Please sign in to comment.