web: set default value for cert select inputs (#3577)

* web: set default value for cert select inputs

* web: remove quotes from cert option values

* check for undefined too

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
Co-authored-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
relative 2022-09-14 17:40:49 -04:00 committed by GitHub
parent 493cdd5c0f
commit 369440652c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 10 deletions

View file

@ -98,7 +98,12 @@ export class ServiceConnectionDockerForm extends ModelForm<DockerServiceConnecti
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.tlsVerification || undefined)}
?selected=${this.instance?.tlsVerification !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">
@ -128,7 +133,12 @@ export class ServiceConnectionDockerForm extends ModelForm<DockerServiceConnecti
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.tlsAuthentication || undefined)}
?selected=${this.instance?.tlsAuthentication !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">

View file

@ -193,7 +193,12 @@ export class LDAPProviderFormPage extends ModelForm<LDAPProvider, number> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.certificate || undefined)}
?selected=${this.instance?.certificate !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">

View file

@ -204,7 +204,12 @@ ${this.instance?.redirectUris}</textarea
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.signingKey || undefined)}
?selected=${this.instance?.signingKey !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">${t`Key used to sign the tokens.`}</p>

View file

@ -357,7 +357,12 @@ export class ProxyProviderFormPage extends ModelForm<ProxyProvider, number> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.certificate || undefined)}
?selected=${this.instance?.certificate !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
</ak-form-element-horizontal>

View file

@ -169,7 +169,12 @@ export class SAMLProviderFormPage extends ModelForm<SAMLProvider, number> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.signingKp || undefined)}
?selected=${this.instance?.signingKp !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">
@ -203,7 +208,12 @@ export class SAMLProviderFormPage extends ModelForm<SAMLProvider, number> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.verificationKp || undefined)}
?selected=${this.instance?.verificationKp !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">

View file

@ -173,7 +173,12 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.peerCertificate || undefined)}
?selected=${this.instance?.peerCertificate !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">

View file

@ -162,7 +162,12 @@ export class SAMLSourceForm extends ModelForm<SAMLSource, string> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.signingKp || undefined)}
?selected=${this.instance?.signingKp !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
<p class="pf-c-form__helper-text">

View file

@ -378,7 +378,12 @@ export class TenantForm extends ModelForm<Tenant, string> {
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
html`<option
value=${ifDefined(this.instance?.webCertificate || undefined)}
?selected=${this.instance?.webCertificate !== undefined}
>
${t`Loading...`}
</option>`,
)}
</select>
</ak-form-element-horizontal>