From 1240905008e81d641e67b4ef4d6e239c9d3e3e9b Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Tue, 28 Jun 2022 13:13:11 +0200 Subject: [PATCH] Revert "Show dedicated Notfound page for invalid routes (#2070)" This reverts commit ae8f3ee346cb8a3acf6637f501f8e6b68456082c. --- gradle/changelog/404.yaml | 2 - scm-ui/ui-extensions/src/binder.ts | 2 +- .../ui-webapp/public/locales/de/commons.json | 3 +- .../ui-webapp/public/locales/en/commons.json | 3 +- .../ui-webapp/src/containers/NotFoundPage.tsx | 37 ------------------- scm-ui/ui-webapp/src/index.tsx | 2 - 6 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 gradle/changelog/404.yaml delete mode 100644 scm-ui/ui-webapp/src/containers/NotFoundPage.tsx diff --git a/gradle/changelog/404.yaml b/gradle/changelog/404.yaml deleted file mode 100644 index d33a421fa3..0000000000 --- a/gradle/changelog/404.yaml +++ /dev/null @@ -1,2 +0,0 @@ -- type: added - description: Show dedicated notfound page for invalid routes ([#2070](https://github.com/scm-manager/scm-manager/pull/2070)) diff --git a/scm-ui/ui-extensions/src/binder.ts b/scm-ui/ui-extensions/src/binder.ts index 9afd0a2f34..a41de04a14 100644 --- a/scm-ui/ui-extensions/src/binder.ts +++ b/scm-ui/ui-extensions/src/binder.ts @@ -133,7 +133,7 @@ export class Binder { predicate, extension, extensionName: extensionName ? extensionName : "", - priority: priority || 0, + priority, } as ExtensionRegistration; this.extensionPoints[extensionPoint].push(registration); } diff --git a/scm-ui/ui-webapp/public/locales/de/commons.json b/scm-ui/ui-webapp/public/locales/de/commons.json index ebd0278c70..fb1c740342 100644 --- a/scm-ui/ui-webapp/public/locales/de/commons.json +++ b/scm-ui/ui-webapp/public/locales/de/commons.json @@ -260,6 +260,5 @@ }, "tag": { "delete": "Löschen" - }, - "pageNotFound": "Die angefragte Seite existiert nicht." + } } diff --git a/scm-ui/ui-webapp/public/locales/en/commons.json b/scm-ui/ui-webapp/public/locales/en/commons.json index 465a41b789..8665937830 100644 --- a/scm-ui/ui-webapp/public/locales/en/commons.json +++ b/scm-ui/ui-webapp/public/locales/en/commons.json @@ -261,6 +261,5 @@ }, "tag": { "delete": "Delete" - }, - "pageNotFound": "The requested page does not exist." + } } diff --git a/scm-ui/ui-webapp/src/containers/NotFoundPage.tsx b/scm-ui/ui-webapp/src/containers/NotFoundPage.tsx deleted file mode 100644 index 44c600d71e..0000000000 --- a/scm-ui/ui-webapp/src/containers/NotFoundPage.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2020-present Cloudogu GmbH and Contributors - * - * 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, { FC } from "react"; -import { Notification, Page } from "@scm-manager/ui-components"; -import { useTranslation } from "react-i18next"; - -const NotFoundPage: FC = () => { - const [t] = useTranslation("commons"); - return ( - - 404: {t("pageNotFound")} - - ); -}; -export default NotFoundPage; diff --git a/scm-ui/ui-webapp/src/index.tsx b/scm-ui/ui-webapp/src/index.tsx index ffacb27003..95cef5f44e 100644 --- a/scm-ui/ui-webapp/src/index.tsx +++ b/scm-ui/ui-webapp/src/index.tsx @@ -36,10 +36,8 @@ import ChangesetShortLink from "./repos/components/changesets/ChangesetShortLink import "./tokenExpired"; import { ApiProvider } from "@scm-manager/ui-api"; -import NotFoundPage from "./containers/NotFoundPage"; binder.bind("changeset.description.tokens", ChangesetShortLink); -binder.bind("main.route", NotFoundPage, { priority: -1 }); const root = document.getElementById("root"); if (!root) {