From a92bce322d0eeb049e0eaac75083833d52cf4da3 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 1 Nov 2021 20:54:43 +0100 Subject: [PATCH] web/flows: fix sub_text not rendering for static fields Signed-off-by: Jens Langhammer --- web/src/flows/stages/prompt/PromptStage.ts | 17 ++++++++++++++--- web/src/locales/en.po | 7 +++++++ web/src/locales/fr_FR.po | 7 +++++++ web/src/locales/pseudo-LOCALE.po | 7 +++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/web/src/flows/stages/prompt/PromptStage.ts b/web/src/flows/stages/prompt/PromptStage.ts index 65be0c733..f2c0034ea 100644 --- a/web/src/flows/stages/prompt/PromptStage.ts +++ b/web/src/flows/stages/prompt/PromptStage.ts @@ -99,8 +99,16 @@ export class PromptStage extends BaseStage`; case PromptTypeEnum.Static: return `

${prompt.placeholder}

`; + default: + return `

invalid type '${prompt.type}'

`; } - return ""; + } + + renderPromptHelpText(prompt: StagePrompt): TemplateResult { + if (prompt.subText === "") { + return html``; + } + return html`

${unsafeHTML(prompt.subText)}

`; } render(): TemplateResult { @@ -141,7 +149,10 @@ export class PromptStage extends BaseStage ${unsafeHTML(this.renderPromptInner(prompt))} -

${unsafeHTML(prompt.subText)}

+ ${this.renderPromptHelpText(prompt)} `; })} ${"non_field_errors" in (this.challenge?.responseErrors || {}) diff --git a/web/src/locales/en.po b/web/src/locales/en.po index 50bf73708..ec5155927 100644 --- a/web/src/locales/en.po +++ b/web/src/locales/en.po @@ -202,6 +202,10 @@ msgstr "Addition User DN" msgid "Additional group DN, prepended to the Base DN." msgstr "Additional group DN, prepended to the Base DN." +#: src/pages/providers/proxy/ProxyProviderForm.ts +msgid "Additional scope mappings, which are passed to the proxy." +msgstr "Additional scope mappings, which are passed to the proxy." + #: src/pages/sources/ldap/LDAPSourceForm.ts msgid "Additional settings" msgstr "Additional settings" @@ -2148,6 +2152,7 @@ msgstr "Hide service-accounts" #: src/pages/events/RuleForm.ts #: src/pages/outposts/OutpostForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts @@ -2538,6 +2543,7 @@ msgstr "Loading" #: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts @@ -3774,6 +3780,7 @@ msgstr "Scope which the client can specify to access these properties." #: src/elements/oauth/UserCodeList.ts #: src/elements/oauth/UserRefreshList.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts msgid "Scopes" msgstr "Scopes" diff --git a/web/src/locales/fr_FR.po b/web/src/locales/fr_FR.po index f88c70442..2f25fa47c 100644 --- a/web/src/locales/fr_FR.po +++ b/web/src/locales/fr_FR.po @@ -207,6 +207,10 @@ msgstr "Préfixe DN utilisateurs" msgid "Additional group DN, prepended to the Base DN." msgstr "DN à préfixer au DN de base pour les groupes" +#: src/pages/providers/proxy/ProxyProviderForm.ts +msgid "Additional scope mappings, which are passed to the proxy." +msgstr "" + #: src/pages/sources/ldap/LDAPSourceForm.ts msgid "Additional settings" msgstr "Paramètres supplémentaire" @@ -2131,6 +2135,7 @@ msgstr "Cacher les comptes de service" #: src/pages/events/RuleForm.ts #: src/pages/outposts/OutpostForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts @@ -2519,6 +2524,7 @@ msgstr "Chargement en cours" #: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts @@ -3742,6 +3748,7 @@ msgstr "Portée que le client peut spécifier pour accéder à ces propriétés. #: src/elements/oauth/UserCodeList.ts #: src/elements/oauth/UserRefreshList.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts msgid "Scopes" msgstr "Portées" diff --git a/web/src/locales/pseudo-LOCALE.po b/web/src/locales/pseudo-LOCALE.po index 1777cb1b0..44eb77cc3 100644 --- a/web/src/locales/pseudo-LOCALE.po +++ b/web/src/locales/pseudo-LOCALE.po @@ -202,6 +202,10 @@ msgstr "" msgid "Additional group DN, prepended to the Base DN." msgstr "" +#: src/pages/providers/proxy/ProxyProviderForm.ts +msgid "Additional scope mappings, which are passed to the proxy." +msgstr "" + #: src/pages/sources/ldap/LDAPSourceForm.ts msgid "Additional settings" msgstr "" @@ -2140,6 +2144,7 @@ msgstr "" #: src/pages/events/RuleForm.ts #: src/pages/outposts/OutpostForm.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts @@ -2530,6 +2535,7 @@ msgstr "" #: src/pages/providers/oauth2/OAuth2ProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/proxy/ProxyProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts @@ -3766,6 +3772,7 @@ msgstr "" #: src/elements/oauth/UserCodeList.ts #: src/elements/oauth/UserRefreshList.ts #: src/pages/providers/oauth2/OAuth2ProviderForm.ts +#: src/pages/providers/proxy/ProxyProviderForm.ts msgid "Scopes" msgstr ""