web/admin: set valid correctly when opened and radio is already selected (#4821)

closes #4813

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-03-01 16:14:32 +01:00
committed by GitHub
parent 87fa50c492
commit 2eb7c16a9a
7 changed files with 68 additions and 1 deletions

View File

@ -36,6 +36,17 @@ export class InitialProviderWizardPage extends WizardPage {
}
sidebarLabel = () => t`Select type`;
activeCallback: () => Promise<void> = async () => {
this.host.isValid = false;
this.shadowRoot
?.querySelectorAll<HTMLInputElement>("input[type=radio]")
.forEach((radio) => {
if (radio.checked) {
this.host.isValid = true;
}
});
};
renderHint(): TemplateResult {
return html`<div class="pf-c-hint">
<div class="pf-c-hint__title">${t`Try the new application wizard`}</div>
@ -56,7 +67,7 @@ export class InitialProviderWizardPage extends WizardPage {
}
render(): TemplateResult {
return html` <form class="pf-c-form pf-m-horizontal">
return html`<form class="pf-c-form pf-m-horizontal">
${this.providerTypes.map((type) => {
return html`<div class="pf-c-radio">
<input