web/admin: use radio for client type (#5499)

* web/admin: use radio for client type

also fix search select not correctly passing all items in .selected callback

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* include unrelated typo fix

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-05-06 00:11:27 +02:00 committed by GitHub
parent 95a679ab3b
commit 36bd4b1e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 119 additions and 43 deletions

View File

@ -167,34 +167,30 @@ export class OAuth2ProviderFormPage extends ModelForm<OAuth2Provider, number> {
?required=${true}
name="clientType"
>
<select
class="pf-c-form-control"
@change=${(ev: Event) => {
const target = ev.target as HTMLSelectElement;
if (target.selectedOptions[0].value === ClientTypeEnum.Public) {
<ak-radio
@change=${(ev: CustomEvent<ClientTypeEnum>) => {
if (ev.detail === ClientTypeEnum.Public) {
this.showClientSecret = false;
} else {
this.showClientSecret = true;
}
}}
.options=${[
{
label: t`Confidential`,
value: ClientTypeEnum.Confidential,
default: true,
description: html`${t`Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets`}`,
},
{
label: t`Public`,
value: ClientTypeEnum.Public,
description: html`${t`Public clients are incapable of maintaining the confidentiality and should use methods like PKCE. `}`,
},
]}
.value=${this.instance?.clientType}
>
<option
value=${ClientTypeEnum.Confidential}
?selected=${this.instance?.clientType ===
ClientTypeEnum.Confidential}
>
${t`Confidential`}
</option>
<option
value=${ClientTypeEnum.Public}
?selected=${this.instance?.clientType === ClientTypeEnum.Public}
>
${t`Public`}
</option>
</select>
<p class="pf-c-form__helper-text">
${t`Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable.`}
</p>
</ak-radio>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${t`Client ID`}

View File

@ -110,7 +110,7 @@ export class SearchSelect<T> extends AKElement {
this.isFetchingData = true;
this.fetchObjects(this.query).then((objects) => {
objects.forEach((obj) => {
if (this.selected && this.selected(obj, this.objects || [])) {
if (this.selected && this.selected(obj, objects || [])) {
this.selectedObject = obj;
}
});

View File

@ -1415,8 +1415,12 @@ msgid "Confidential"
msgstr "Vertraulich"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Vertrauenswürde Clients sind in der Lage, die Vertraulichkeit ihrer Anmeldedaten zu wahren. Öffentliche Clients sind dazu nicht in der Lage."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Vertrauenswürde Clients sind in der Lage, die Vertraulichkeit ihrer Anmeldedaten zu wahren. Öffentliche Clients sind dazu nicht in der Lage."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5050,6 +5054,10 @@ msgstr "Proxy-Details"
msgid "Public"
msgstr "Öffentlich"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Öffentlicher Schlüssel"

View File

@ -1412,8 +1412,12 @@ msgid "Confidential"
msgstr "Confidential"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5150,6 +5154,10 @@ msgstr "Proxy details"
msgid "Public"
msgstr "Public"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Public Key"

View File

@ -1391,8 +1391,12 @@ msgid "Confidential"
msgstr "Confidencial"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Los clientes confidenciales son capaces de mantener la confidencialidad de sus credenciales. Los clientes públicos son incapaces."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Los clientes confidenciales son capaces de mantener la confidencialidad de sus credenciales. Los clientes públicos son incapaces."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5026,6 +5030,10 @@ msgstr ""
msgid "Public"
msgstr "Público"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Clave pública"

View File

@ -1396,8 +1396,12 @@ msgid "Confidential"
msgstr "Confidentiel"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Les clients confidentiels sont capable de maintenir la confidentialité de leurs identifiants. Le clients publics n'en sont pas capables."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Les clients confidentiels sont capable de maintenir la confidentialité de leurs identifiants. Le clients publics n'en sont pas capables."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5027,6 +5031,10 @@ msgstr "Informations du proxy"
msgid "Public"
msgstr "Public"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Clé publique"

View File

@ -1397,8 +1397,12 @@ msgid "Confidential"
msgstr "Poufny"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Poufni klienci są w stanie zachować poufność swoich danych uwierzytelniających. Klienci publiczni są niezdolni."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Poufni klienci są w stanie zachować poufność swoich danych uwierzytelniających. Klienci publiczni są niezdolni."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5036,6 +5040,10 @@ msgstr "Dane proxy"
msgid "Public"
msgstr "Publiczny"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Klucz publiczny"

View File

@ -1400,9 +1400,13 @@ msgid "Confidential"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr ""
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
msgstr ""
@ -5118,6 +5122,10 @@ msgstr ""
msgid "Public"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr ""

View File

@ -1391,8 +1391,12 @@ msgid "Confidential"
msgstr "Gizli"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "Gizli müşteriler kimlik bilgilerinin gizliliğini koruyabilir. Kamu müşterileri aciz."
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "Gizli müşteriler kimlik bilgilerinin gizliliğini koruyabilir. Kamu müşterileri aciz."
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5026,6 +5030,10 @@ msgstr ""
msgid "Public"
msgstr "Kamu"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "Genel Anahtar"

View File

@ -1365,8 +1365,12 @@ msgid "Confidential"
msgstr "机密"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "机密客户能够对其凭据进行保密。公共客户端无此能力。"
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "机密客户能够对其凭据进行保密。公共客户端无此能力。"
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -4976,6 +4980,10 @@ msgstr "代理详情"
msgid "Public"
msgstr "公开"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "公钥"

View File

@ -1399,8 +1399,12 @@ msgid "Confidential"
msgstr "机密"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "机密客户能够对其凭据进行保密。公共客户端无能为力。"
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "机密客户能够对其凭据进行保密。公共客户端无能为力。"
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5034,6 +5038,10 @@ msgstr "代理详情"
msgid "Public"
msgstr "公开"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "公钥"

View File

@ -1399,8 +1399,12 @@ msgid "Confidential"
msgstr "机密"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
msgstr "机密客户能够对其凭据进行保密。公共客户端无能为力。"
msgid "Confidential clients are capable of maintaining the confidentiality of their credentials such as client secrets"
msgstr ""
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
#~ msgid "Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable."
#~ msgstr "机密客户能够对其凭据进行保密。公共客户端无能为力。"
#: src/admin/outposts/OutpostForm.ts
msgid "Configuration"
@ -5034,6 +5038,10 @@ msgstr "代理详情"
msgid "Public"
msgstr "公开"
#: src/admin/providers/oauth2/OAuth2ProviderForm.ts
msgid "Public clients are incapable of maintaining the confidentiality and should use methods like PKCE."
msgstr ""
#: src/admin/stages/captcha/CaptchaStageForm.ts
msgid "Public Key"
msgstr "公钥"