From 6a6e29570cea1ccda47268e1f7f74fc95fd45009 Mon Sep 17 00:00:00 2001 From: Shijun Sun <30999793+AllForNothing@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:23:57 +0800 Subject: [PATCH] Show OIDC provider name on the OIDC login button (#19581) 1. Related issue #13198 Signed-off-by: AllForNothing --- .../account/sign-in/sign-in.component.html | 22 +++++++++++++++++-- .../account/sign-in/sign-in.component.scss | 4 ++++ .../app/account/sign-in/sign-in.component.ts | 3 +++ src/portal/src/app/services/app-config.ts | 2 ++ src/portal/src/i18n/lang/de-de-lang.json | 1 + src/portal/src/i18n/lang/en-us-lang.json | 3 ++- src/portal/src/i18n/lang/es-es-lang.json | 1 + src/portal/src/i18n/lang/fr-fr-lang.json | 1 + src/portal/src/i18n/lang/pt-br-lang.json | 1 + src/portal/src/i18n/lang/tr-tr-lang.json | 1 + src/portal/src/i18n/lang/zh-cn-lang.json | 1 + src/portal/src/i18n/lang/zh-tw-lang.json | 1 + 12 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/portal/src/app/account/sign-in/sign-in.component.html b/src/portal/src/app/account/sign-in/sign-in.component.html index eeab0c0af..5108d4316 100644 --- a/src/portal/src/app/account/sign-in/sign-in.component.html +++ b/src/portal/src/app/account/sign-in/sign-in.component.html @@ -26,8 +26,26 @@
diff --git a/src/portal/src/app/account/sign-in/sign-in.component.scss b/src/portal/src/app/account/sign-in/sign-in.component.scss index 8067e84ad..acf69b42d 100644 --- a/src/portal/src/app/account/sign-in/sign-in.component.scss +++ b/src/portal/src/app/account/sign-in/sign-in.component.scss @@ -103,3 +103,7 @@ text-align: right; padding-top: 2rem; } + +.oidc-login-button { + text-transform: unset !important; +} diff --git a/src/portal/src/app/account/sign-in/sign-in.component.ts b/src/portal/src/app/account/sign-in/sign-in.component.ts index 98dbf2b87..3cb75368e 100644 --- a/src/portal/src/app/account/sign-in/sign-in.component.ts +++ b/src/portal/src/app/account/sign-in/sign-in.component.ts @@ -151,6 +151,9 @@ export class SignInComponent implements AfterViewChecked, OnInit { CONFIG_AUTH_MODE.OIDC_AUTH ); } + getOIDCProviderName(): string { + return this.appConfigService.getConfig()?.oidc_provider_name || null; + } clickRememberMe($event: any): void { if ($event && $event.target) { this.rememberMe = $event.target.checked; diff --git a/src/portal/src/app/services/app-config.ts b/src/portal/src/app/services/app-config.ts index 0235ffa1a..5c397ef98 100644 --- a/src/portal/src/app/services/app-config.ts +++ b/src/portal/src/app/services/app-config.ts @@ -31,6 +31,7 @@ export class AppConfig { show_popular_repo: boolean; banner_message: string; current_time: string; + oidc_provider_name: string; constructor() { // Set default value @@ -52,5 +53,6 @@ export class AppConfig { this.read_only = false; this.show_popular_repo = false; this.banner_message = ''; + this.oidc_provider_name = ''; } } diff --git a/src/portal/src/i18n/lang/de-de-lang.json b/src/portal/src/i18n/lang/de-de-lang.json index 83a02b344..90380b501 100644 --- a/src/portal/src/i18n/lang/de-de-lang.json +++ b/src/portal/src/i18n/lang/de-de-lang.json @@ -28,6 +28,7 @@ "DELETE": "LÖSCHEN", "LOG_IN": "EINLOGGEN", "LOG_IN_OIDC": "Über OIDC Provider einloggen", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Neuen Account registrieren", "SIGN_UP": "Registrieren", "CONFIRM": "BESTÄTIGEN", diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index bece1ab76..03142a54c 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -27,7 +27,8 @@ "OK": "OK", "DELETE": "DELETE", "LOG_IN": "LOG IN", - "LOG_IN_OIDC": "Login via OIDC provider", + "LOG_IN_OIDC": "LOGIN VIA OIDC PROVIDER", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Sign up for an account", "SIGN_UP": "SIGN UP", "CONFIRM": "CONFIRM", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 161268d57..36261ed53 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -28,6 +28,7 @@ "DELETE": "ELIMINAR", "LOG_IN": "IDENTIFICARSE", "LOG_IN_OIDC": "Login Via OIDC proveedor", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Registrar una cuenta", "SIGN_UP": "REGISTRARSE", "CONFIRM": "CONFIRMAR", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index c217779aa..2caa07108 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -28,6 +28,7 @@ "DELETE": "Supprimer", "LOG_IN": "S'identifier", "LOG_IN_OIDC": "Connexion via fournisseur OIDC", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Ouvrir un compte", "SIGN_UP": "S'inscrire", "CONFIRM": "Confirmer", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 98bc450a9..af2369035 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -28,6 +28,7 @@ "DELETE": "REMOVER", "LOG_IN": "ENTRAR", "LOG_IN_OIDC": "Entrar com provedor OIDC", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Criar uma nova conta", "SIGN_UP": "CADASTRO", "CONFIRM": "CONFIRMAR", diff --git a/src/portal/src/i18n/lang/tr-tr-lang.json b/src/portal/src/i18n/lang/tr-tr-lang.json index 29cbba0ee..71fd013dc 100644 --- a/src/portal/src/i18n/lang/tr-tr-lang.json +++ b/src/portal/src/i18n/lang/tr-tr-lang.json @@ -28,6 +28,7 @@ "DELETE": "SİL", "LOG_IN": "OTURUM AÇ", "LOG_IN_OIDC": "OIDC sağlayıcı üzerinden giriş yapın", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "Bir hesap için kayıt olun", "SIGN_UP": "KAYIT OL", "CONFIRM": "ONAYLA", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index b64ab4926..b80848762 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -28,6 +28,7 @@ "DELETE": "删除", "LOG_IN": "登录", "LOG_IN_OIDC": "通过OIDC提供商登录", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "通过 {{providerName}} 登录", "SIGN_UP_LINK": "注册账号", "SIGN_UP": "注册", "CONFIRM": "确定", diff --git a/src/portal/src/i18n/lang/zh-tw-lang.json b/src/portal/src/i18n/lang/zh-tw-lang.json index 8a8bef052..8618e88e8 100644 --- a/src/portal/src/i18n/lang/zh-tw-lang.json +++ b/src/portal/src/i18n/lang/zh-tw-lang.json @@ -28,6 +28,7 @@ "DELETE": "刪除", "LOG_IN": "登入", "LOG_IN_OIDC": "透過 OIDC 提供者登入", + "LOG_IN_OIDC_WITH_PROVIDER_NAME": "LOGIN WITH {{providerName}}", "SIGN_UP_LINK": "註冊帳號", "SIGN_UP": "註冊", "CONFIRM": "確認",