diff --git a/src/extensions/registries/page-registry.ts b/src/extensions/registries/page-registry.ts index 996f62e346..5604538a91 100644 --- a/src/extensions/registries/page-registry.ts +++ b/src/extensions/registries/page-registry.ts @@ -26,7 +26,6 @@ import { observer } from "mobx-react"; import { BaseRegistry } from "./base-registry"; import { LensExtension, LensExtensionId, sanitizeExtensionName } from "../lens-extension"; import { createPageParam, PageParam, PageParamInit, searchParamsOptions } from "../../renderer/navigation"; -import { computed, observable } from "mobx"; export interface PageRegistration { /** @@ -93,8 +92,6 @@ export function getExtensionPageUrl(target: PageTarget): string { } class PageRegistry extends BaseRegistry { - protected knownUrls = observable.set(); - protected getRegisteredItem(page: PageRegistration, ext: LensExtension): RegisteredPage { const { id: pageId } = page; const extensionId = ext.name; @@ -102,8 +99,6 @@ class PageRegistry extends BaseRegistry { const components = this.normalizeComponents(page.components, params); const url = getExtensionPageUrl({ extensionId, pageId }); - this.knownUrls.add(url); - return { id: pageId, extensionId, params, components, url, }; @@ -154,13 +149,6 @@ class PageRegistry extends BaseRegistry { return normalizedParams; } - /** - * Get the list of all known URLS that have been registered with this registry. - */ - @computed get redirectEntries() { - return [...this.knownUrls]; - } - getByPageTarget(target: PageTarget): RegisteredPage | null { return this.getItems().find(page => page.extensionId === target.extensionId && page.id === target.pageId) || null; } diff --git a/src/renderer/cluster-frame.tsx b/src/renderer/cluster-frame.tsx index 49c5e0d118..949146232b 100755 --- a/src/renderer/cluster-frame.tsx +++ b/src/renderer/cluster-frame.tsx @@ -23,7 +23,6 @@ import { observable, makeObservable } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; import { Redirect, Route, Router, Switch } from "react-router"; import { history } from "./navigation"; -import { NotFound } from "./components/+404"; import { UserManagement } from "./components/+user-management/user-management"; import { ConfirmDialog } from "./components/confirm-dialog"; import { ClusterOverview } from "./components/+cluster/cluster-overview"; @@ -211,13 +210,11 @@ export class ClusterFrame extends React.Component { {this.renderExtensionTabLayoutRoutes()} {this.renderExtensionRoutes()} - { - ClusterPageRegistry - .getInstance() - .redirectEntries - .map(url => ) - } - + { + Notifications.error(`Unknown location ${location.pathname}, redirecting to main page.`); + + return ; + }} /> diff --git a/src/renderer/components/+404/index.ts b/src/renderer/components/+404/index.ts deleted file mode 100644 index f0b33889c2..0000000000 --- a/src/renderer/components/+404/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2021 OpenLens Authors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -export * from "./not-found"; diff --git a/src/renderer/components/+404/not-found.tsx b/src/renderer/components/+404/not-found.tsx deleted file mode 100644 index 25f8756afd..0000000000 --- a/src/renderer/components/+404/not-found.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2021 OpenLens Authors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -import React from "react"; -import { TabLayout } from "../layout/tab-layout"; - -export class NotFound extends React.Component { - render() { - return ( - -

- Page not found -

-
- ); - } -}