From a9910ede3668af199cb6379997469bfd1613ac08 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Thu, 12 Sep 2024 15:02:37 +0200 Subject: [PATCH] Navigate to home when clicking on header --- CHANGELOG.md | 1 + .../appSettings/appSettingsInterface.ts | 1 - .../src/components/header/header.tsx | 15 +++++++-------- .../src/pages/admin/admin.tsx | 19 +++++++++++++------ 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cda1281e..c40ca66d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - **BREAKING** Deleted _banner_ and _quickstart_ features. - **BREAKING** Merged `application` and `vendor` properties in Client Settings: - The application name is always _geopilot_. With `name` the application name can be extended, e.g. to _geopilot Test_. + - The url has been removed. As an alternative the link to the organisation can be added to the public files e.g. `info.md`. - There is only one `logo` which is used for the header. - Optionally a separate `faviconDark` can be defined for dark mode of the browser. diff --git a/src/Geopilot.Frontend/src/components/appSettings/appSettingsInterface.ts b/src/Geopilot.Frontend/src/components/appSettings/appSettingsInterface.ts index 5ddef422..f2ce833a 100644 --- a/src/Geopilot.Frontend/src/components/appSettings/appSettingsInterface.ts +++ b/src/Geopilot.Frontend/src/components/appSettings/appSettingsInterface.ts @@ -9,7 +9,6 @@ export interface ClientSettings { authScopes: string[]; application: { name?: string; - url: string; logo: string; favicon: string; faviconDark?: string; diff --git a/src/Geopilot.Frontend/src/components/header/header.tsx b/src/Geopilot.Frontend/src/components/header/header.tsx index b27f20b4..fbdf75fe 100644 --- a/src/Geopilot.Frontend/src/components/header/header.tsx +++ b/src/Geopilot.Frontend/src/components/header/header.tsx @@ -60,13 +60,18 @@ const Header: FC = ({ openSubMenu }) => { flexDirection: "row", justifyContent: "space-between", }}> - + { + navigate("/"); + }}> {hasSubMenu ? ( { + onClick={e => { + e.stopPropagation(); openSubMenu(); }}> @@ -78,9 +83,6 @@ const Header: FC = ({ openSubMenu }) => { src={clientSettings?.application?.logo} alt={`Logo of ${clientSettings?.application?.name}`} style={{ maxHeight: "40px", cursor: "pointer" }} - onClick={() => { - window.open(clientSettings?.application?.url, "_blank"); - }} /> ) @@ -92,9 +94,6 @@ const Header: FC = ({ openSubMenu }) => { src={clientSettings?.application?.logo} alt={`Logo of ${clientSettings?.application?.name}`} style={{ maxHeight: "40px", cursor: "pointer" }} - onClick={() => { - window.open(clientSettings?.application?.url, "_blank"); - }} /> )} diff --git a/src/Geopilot.Frontend/src/pages/admin/admin.tsx b/src/Geopilot.Frontend/src/pages/admin/admin.tsx index ae2ec413..c74e3789 100644 --- a/src/Geopilot.Frontend/src/pages/admin/admin.tsx +++ b/src/Geopilot.Frontend/src/pages/admin/admin.tsx @@ -99,7 +99,11 @@ const Admin: FC = ({ isSubMenuOpen, setIsSubMenuOpen }) => { "& .MuiDrawer-paper": { width: drawerWidth, boxSizing: "border-box" }, }}> <> - + { + navigate("/"); + }}> {clientSettings?.application?.logo && ( = ({ isSubMenuOpen, setIsSubMenuOpen }) => { )} - geopilot + + geopilot  + {clientSettings?.application?.name && ( - {clientSettings?.application?.name} + + {clientSettings?.application?.name} + )}