From 5567e91472f13b398c3479c78e735e9157fb776f Mon Sep 17 00:00:00 2001 From: Steven Buccini Date: Mon, 16 Jun 2025 17:22:14 -0400 Subject: [PATCH] Add success modal to login page for logout redirection Adds a success modal that renders on the login page when redirecting after logging out. This modal is triggered by a URL query parameter. This commit also adds a new message contain the text to be rendered in the modal. All other languages besides English were machine translated. Signed-off-by: Steven Buccini --- src/containers/DefaultHeaderProfileDropdown.vue | 2 +- src/i18n/locales/de.json | 1 + src/i18n/locales/en.json | 1 + src/i18n/locales/es.json | 1 + src/i18n/locales/fr.json | 1 + src/i18n/locales/hi.json | 1 + src/i18n/locales/it.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/pl.json | 1 + src/i18n/locales/pt-BR.json | 1 + src/i18n/locales/pt.json | 1 + src/i18n/locales/ru.json | 1 + src/i18n/locales/uk-UA.json | 1 + src/i18n/locales/zh.json | 1 + src/views/pages/Login.vue | 5 +++++ 15 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/containers/DefaultHeaderProfileDropdown.vue b/src/containers/DefaultHeaderProfileDropdown.vue index 3e4459bff..a7d4c1214 100644 --- a/src/containers/DefaultHeaderProfileDropdown.vue +++ b/src/containers/DefaultHeaderProfileDropdown.vue @@ -61,7 +61,7 @@ export default { localStorage.removeItem('sessionInvalidate'); // Removes the token from session storage and reload EventBus.$emit('authenticated', null); - this.$router.replace({ name: 'Login' }); + this.$router.replace({ name: 'Login', query: { "fromLogout": "true" }}); }, canChangePassword: function () { return this.identityProvider == 'LOCAL'; diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 78df10fa6..c95ae5838 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -601,6 +601,7 @@ "login_more_options": "Mehr Optionen", "login_unauthorized": "ungültiger Benutzername oder Passwort", "logout": "Ausloggen", + "logout_confirmation": "Sie haben sich erfolgreich abgemeldet.", "manufacturer": "Hersteller", "manufacturer_name": "Herstellername", "manufacturer_name_desc": "Die Organisation, die die im Projekt beschriebene Komponente hergestellt hat", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 2582ce737..3258f1a75 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -601,6 +601,7 @@ "login_more_options": "More options", "login_unauthorized": "Invalid username or password", "logout": "Logout", + "logout_confirmation": "You have logged out successfully.", "manufacturer": "Manufacturer", "manufacturer_name": "Manufacturer name", "manufacturer_name_desc": "The organization that manufactured the component that the project describes", diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 0826dca08..0b9246072 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -601,6 +601,7 @@ "login_more_options": "Mas opciones", "login_unauthorized": "usuario o contraseña invalido", "logout": "Cerrar sesión", + "logout_confirmation": "Has cerrado sesión exitosamente.", "manufacturer": "Fabricante", "manufacturer_name": "Nombre del Fabricante", "manufacturer_name_desc": "La organización que fabricó el componente que describe el proyecto.", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index f314c2b7e..8f8096201 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -601,6 +601,7 @@ "login_more_options": "Plus d'options", "login_unauthorized": "Nom d'utilisateur ou mot de passe invalide", "logout": "Se déconnecter", + "logout_confirmation": "Vous vous êtes déconnecté avec succès.", "manufacturer": "Fabricant", "manufacturer_name": "Nom du Fabricant", "manufacturer_name_desc": "L'organisation qui a fabriqué le composant décrit par le projet", diff --git a/src/i18n/locales/hi.json b/src/i18n/locales/hi.json index aa8b3dd12..adc06f07d 100644 --- a/src/i18n/locales/hi.json +++ b/src/i18n/locales/hi.json @@ -601,6 +601,7 @@ "login_more_options": "अधिक विकल्प", "login_unauthorized": "अमान्य उपयोगकर्ता नाम या पासवर्ड", "logout": "लॉग आउट", + "logout_confirmation": "आपने सफलतापूर्वक लॉग आउट कर लिया है।", "manufacturer": "उत्पादक", "manufacturer_name": "निर्माता नाम", "manufacturer_name_desc": "वह संगठन जिसने परियोजना में वर्णित घटक का निर्माण किया", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 84d3cf6e6..7e98571a7 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -601,6 +601,7 @@ "login_more_options": "Più opzioni", "login_unauthorized": "Nome utente o password errati", "logout": "Disconnettersi", + "logout_confirmation": "Hai effettuato correttamente il logout.", "manufacturer": "Produttore", "manufacturer_name": "Nome del produttore", "manufacturer_name_desc": "L'organizzazione che ha prodotto il componente descritto dal progetto", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index 8268a2cac..c68912451 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -601,6 +601,7 @@ "login_more_options": "より多くのオプション", "login_unauthorized": "ユーザー名かパスワードが無効", "logout": "ログアウト", + "logout_confirmation": "ログアウトに成功しました。", "manufacturer": "メーカー", "manufacturer_name": "メーカー名", "manufacturer_name_desc": "プロジェクトで説明されているコンポーネントを製造した組織", diff --git a/src/i18n/locales/pl.json b/src/i18n/locales/pl.json index e98c1b516..298422b2c 100644 --- a/src/i18n/locales/pl.json +++ b/src/i18n/locales/pl.json @@ -601,6 +601,7 @@ "login_more_options": "Więcej możliwości", "login_unauthorized": "Nieprawidłowa nazwa użytkownika lub hasło", "logout": "Wyloguj", + "logout_confirmation": "Wylogowano pomyślnie.", "manufacturer": "Producent", "manufacturer_name": "Nazwa producenta", "manufacturer_name_desc": "Organizacja, która wyprodukowała komponent opisany w projekcie", diff --git a/src/i18n/locales/pt-BR.json b/src/i18n/locales/pt-BR.json index 0dcc6dab0..de60f47e6 100644 --- a/src/i18n/locales/pt-BR.json +++ b/src/i18n/locales/pt-BR.json @@ -601,6 +601,7 @@ "login_more_options": "Mais opções", "login_unauthorized": "nome de usuário ou senha inválidos", "logout": "Sair", + "logout_confirmation": "Você efetuou logout com sucesso.", "manufacturer": "Fabricante", "manufacturer_name": "Nome do fabricante", "manufacturer_name_desc": "A organização que fabricou o componente que o projeto descreve", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index 07d4eff35..bb61bfa8b 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -601,6 +601,7 @@ "login_more_options": "Mais opções", "login_unauthorized": "nome de utilizador ou palavra passe inválidos", "logout": "Sair", + "logout_confirmation": "Efetuou logout com sucesso.", "manufacturer": "Fabricante", "manufacturer_name": "Nome do fabricante", "manufacturer_name_desc": "A organização que fabricou o componente que o projeto descreve", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 367bd4056..f34c64043 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -601,6 +601,7 @@ "login_more_options": "Больше опций", "login_unauthorized": "Неверное имя пользователя или пароль", "logout": "Выход", + "logout_confirmation": "Вы успешно вышли из системы.", "manufacturer": "Производитель", "manufacturer_name": "Имя производителя", "manufacturer_name_desc": "Организация, которая произвела компонент, описанный проектом", diff --git a/src/i18n/locales/uk-UA.json b/src/i18n/locales/uk-UA.json index 5c6b58e43..a1463c9bb 100644 --- a/src/i18n/locales/uk-UA.json +++ b/src/i18n/locales/uk-UA.json @@ -601,6 +601,7 @@ "login_more_options": "Більше варіантів", "login_unauthorized": "Неправильне ім'я користувача або пароль", "logout": "Вийти", + "logout_confirmation": "Ви успішно вийшли з системи.", "manufacturer": "Виробник", "manufacturer_name": "Назва виробника", "manufacturer_name_desc": "Організація, яка виготовила компонент, описаний у проекті", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 69ddea501..2c6c2b624 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -601,6 +601,7 @@ "login_more_options": "更多的选择", "login_unauthorized": "用户名或密码无效", "logout": "登出", + "logout_confirmation": "您已成功退出。", "manufacturer": "厂商", "manufacturer_name": "厂商名称", "manufacturer_name_desc": "制造项目所述组件的组织", diff --git a/src/views/pages/Login.vue b/src/views/pages/Login.vue index 1455c0bf0..b4ae59c88 100644 --- a/src/views/pages/Login.vue +++ b/src/views/pages/Login.vue @@ -121,6 +121,7 @@ export default { }, data() { return { + isFromLogout: false, isWelcomeMessage: true, welcomeMessage: '', loginError: '', @@ -146,6 +147,7 @@ export default { }; }, beforeMount() { + this.isFromLogout = this.$route.query.fromLogout === 'true'; let enabled_url = `${this.$api.BASE_URL}/${this.$api.URL_CONFIG_PROPERTY}/public/general/welcome.message.enabled`; axios .get(enabled_url) @@ -252,6 +254,9 @@ export default { }, }, mounted() { + if (this.isFromLogout) { + this.$toastr.s(this.$t('message.logout_confirmation')); + } this.checkOidcAvailability() .then((oidcAvailable) => { this.oidcAvailable = oidcAvailable;