From 3776173d40137fb372ea3c81fa4e2cef69ce12b5 Mon Sep 17 00:00:00 2001 From: Patrick Schmidt Date: Wed, 3 Jul 2024 14:16:46 +0200 Subject: [PATCH] feat: added refresh button to all pages except home page Signed-off-by: Patrick Schmidt --- .../src/app/components/header/header.component.html | 8 +++++++- .../src/app/components/header/header.component.ts | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/app/components/header/header.component.html b/apps/frontend/src/app/components/header/header.component.html index 62270c08..339f97b4 100644 --- a/apps/frontend/src/app/components/header/header.component.html +++ b/apps/frontend/src/app/components/header/header.component.html @@ -7,7 +7,7 @@ alt="Siemens logo" /> - + Powered by Siemens Xcelerator @@ -22,6 +22,12 @@ } + @if (!isHomePage()){ +
+ Refresh +
+ } + Home Facilities diff --git a/apps/frontend/src/app/components/header/header.component.ts b/apps/frontend/src/app/components/header/header.component.ts index a6f6311b..31490a48 100644 --- a/apps/frontend/src/app/components/header/header.component.ts +++ b/apps/frontend/src/app/components/header/header.component.ts @@ -56,6 +56,11 @@ export class HeaderComponent { return breadcrumbs; }); + readonly isHomePage = computed(() => { + this.routerEvents(); + return this._activatedRoute.snapshot.firstChild?.routeConfig?.path === ''; + }); + /** * from the right cut the current url until a '/' is reached n times * So for /cases/10/abc, goBack(1) yields /cases/10 @@ -86,4 +91,8 @@ export class HeaderComponent { } return "sun"; } + + refresh() { + window.location.reload(); + } }