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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Authentik takes security very seriously. We follow the rules of [responsible dis
| --------- | ------------------ | | --------- | ------------------ |
| 2022.12.x | :white_check_mark: | | 2022.12.x | :white_check_mark: |
| 2023.1.x | :white_check_mark: | | 2023.1.x | :white_check_mark: |
| 2023.2.x | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability

View File

@ -31,6 +31,17 @@ export class InitialServiceConnectionWizardPage extends WizardPage {
} }
sidebarLabel = () => t`Select type`; 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;
}
});
};
render(): TemplateResult { render(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">
${this.connectionTypes.map((type) => { ${this.connectionTypes.map((type) => {

View File

@ -37,6 +37,17 @@ export class InitialPolicyWizardPage extends WizardPage {
} }
sidebarLabel = () => t`Select type`; 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;
}
});
};
render(): TemplateResult { render(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">
${this.policyTypes.map((type) => { ${this.policyTypes.map((type) => {

View File

@ -34,6 +34,17 @@ export class InitialPropertyMappingWizardPage extends WizardPage {
} }
sidebarLabel = () => t`Select type`; 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;
}
});
};
render(): TemplateResult { render(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">
${this.mappingTypes.map((type) => { ${this.mappingTypes.map((type) => {

View File

@ -36,6 +36,17 @@ export class InitialProviderWizardPage extends WizardPage {
} }
sidebarLabel = () => t`Select type`; 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 { renderHint(): TemplateResult {
return html`<div class="pf-c-hint"> return html`<div class="pf-c-hint">
<div class="pf-c-hint__title">${t`Try the new application wizard`}</div> <div class="pf-c-hint__title">${t`Try the new application wizard`}</div>

View File

@ -33,6 +33,17 @@ export class InitialSourceWizardPage extends WizardPage {
} }
sidebarLabel = () => t`Select type`; 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;
}
});
};
render(): TemplateResult { render(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">
${this.sourceTypes.map((type) => { ${this.sourceTypes.map((type) => {

View File

@ -50,6 +50,17 @@ export class InitialStageWizardPage extends WizardPage {
return [PFBase, PFForm, PFButton, AKGlobal, PFRadio]; return [PFBase, PFForm, PFButton, AKGlobal, PFRadio];
} }
activeCallback: () => Promise<void> = async () => {
this.host.isValid = false;
this.shadowRoot
?.querySelectorAll<HTMLInputElement>("input[type=radio]")
.forEach((radio) => {
if (radio.checked) {
this.host.isValid = true;
}
});
};
render(): TemplateResult { render(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal"> return html`<form class="pf-c-form pf-m-horizontal">
${this.stageTypes.map((type) => { ${this.stageTypes.map((type) => {