web/admin: fix authenticatior_valiation stage not setting correct fields

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-09 19:38:54 +02:00
parent d4379ecd31
commit 7834146efc

View file

@ -16,13 +16,13 @@ export class AuthenticatorValidateStageForm extends ModelForm<AuthenticatorValid
return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateRetrieve({
stageUuid: pk,
}).then(stage => {
this.showConfigureFlow = stage.notConfiguredAction === NotConfiguredActionEnum.Configure;
this.showConfigurationStage = stage.notConfiguredAction === NotConfiguredActionEnum.Configure;
return stage;
});
}
@property({ type: Boolean })
showConfigureFlow = false;
showConfigurationStage = true;
getSuccessMessage(): string {
if (this.instance) {
@ -74,9 +74,9 @@ export class AuthenticatorValidateStageForm extends ModelForm<AuthenticatorValid
<select class="pf-c-form-control" @change=${(ev: Event) => {
const target = ev.target as HTMLSelectElement;
if (target.selectedOptions[0].value === NotConfiguredActionEnum.Configure) {
this.showConfigureFlow = true;
this.showConfigurationStage = true;
} else {
this.showConfigureFlow = false;
this.showConfigurationStage = false;
}
}}>
<option value=${NotConfiguredActionEnum.Configure} ?selected=${this.instance?.notConfiguredAction === NotConfiguredActionEnum.Configure}>
@ -111,11 +111,11 @@ export class AuthenticatorValidateStageForm extends ModelForm<AuthenticatorValid
<p class="pf-c-form__helper-text">${t`Device classes which can be used to authenticate.`}</p>
<p class="pf-c-form__helper-text">${t`Hold control/command to select multiple items.`}</p>
</ak-form-element-horizontal>
${this.showConfigureFlow ? html`
${this.showConfigurationStage ? html`
<ak-form-element-horizontal
label=${t`Configuration flow`}
label=${t`Configuration stage`}
?required=${true}
name="configureFlow">
name="configurationStage">
<select class="pf-c-form-control">
<option value="" ?selected=${this.instance?.configurationStage === undefined}>---------</option>
${until(new StagesApi(DEFAULT_CONFIG).stagesAllList({