From 66f52864ef41762c1e4ad073976ae924e929cada Mon Sep 17 00:00:00 2001 From: Eugen Neuber <eugen.neuber@tugraz.at> Date: Wed, 24 Mar 2021 09:50:48 +0100 Subject: [PATCH] Add a lightweight "page not found" message (en/de) See issue #33 --- packages/app-shell/src/app-shell.js | 6 +++++- packages/app-shell/src/i18n/de/translation.json | 4 +++- packages/app-shell/src/i18n/en/translation.json | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js index 76fd41f4..c6107315 100644 --- a/packages/app-shell/src/app-shell.js +++ b/packages/app-shell/src/app-shell.js @@ -815,7 +815,7 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) { // We hide the app until we are either fully logged in or logged out // At the same time when we hide the main app we show the main slot (e.g. a loading spinner) - const appHidden = (this._loginStatus == 'unknown' || this._loginStatus == 'logging-in'); + const appHidden = (this._loginStatus === 'unknown' || this._loginStatus === 'logging-in'); const mainClassMap = classMap({hidden: appHidden}); const slotClassMap = classMap({hidden: !appHidden}); @@ -885,6 +885,10 @@ export class AppShell extends ScopedElementsMixin(AdapterLitElement) { </aside> <main> + <div style="display: ${this.description === null ? 'none' : 'block'};"> + <h2>${i18n.t('page-not-found')}</h2> + <p>${i18n.t('choose-from-menu')}</p> + </div> <p class="description">${this.description}</p> ${ this._renderActivity() } </main> diff --git a/packages/app-shell/src/i18n/de/translation.json b/packages/app-shell/src/i18n/de/translation.json index d8212b8e..bac3fc0f 100644 --- a/packages/app-shell/src/i18n/de/translation.json +++ b/packages/app-shell/src/i18n/de/translation.json @@ -15,5 +15,7 @@ "headline": "Willkommen bei der Applikation '{{appname}}'." }, "login": "Einloggen", - "logout": "Ausloggen" + "logout": "Ausloggen", + "page-not-found": "Die gewünschte Seite wurde nicht gefunden", + "choose-from-menu": "Bitte wählen Sie eine Aktivität aus dem Menu." } \ No newline at end of file diff --git a/packages/app-shell/src/i18n/en/translation.json b/packages/app-shell/src/i18n/en/translation.json index e1195f11..5a5c20a4 100644 --- a/packages/app-shell/src/i18n/en/translation.json +++ b/packages/app-shell/src/i18n/en/translation.json @@ -15,5 +15,7 @@ "headline": "Welcome to the '{{appname}}' application." }, "login": "Login", - "logout": "Logout" + "logout": "Logout", + "page-not-found": "Requested Page Not Found", + "choose-from-menu": "Please choose an activity from the menu." } -- GitLab