web: Clean up browser-only module imports that crash WebDriverIO. (#14330)
* web: Clean up browser-only module imports that crash WebDriverIO. * web: Clarify slug format output.
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { BasePolicyForm } from "@goauthentik/admin/policies/BasePolicyForm";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { first } from "@goauthentik/common/utils";
|
||||
import "@goauthentik/elements/forms/FormGroup";
|
||||
import "@goauthentik/elements/forms/HorizontalFormElement";
|
||||
|
||||
@ -56,7 +55,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.lengthMin, 10)}"
|
||||
value="${this.instance?.lengthMin ?? 10}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -68,7 +67,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.amountUppercase, 2)}"
|
||||
value="${this.instance?.amountUppercase ?? 2}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -80,7 +79,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.amountLowercase, 2)}"
|
||||
value="${this.instance?.amountLowercase ?? 2}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -92,7 +91,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.amountDigits, 2)}"
|
||||
value="${this.instance?.amountDigits ?? 2}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -104,7 +103,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.amountSymbols, 2)}"
|
||||
value="${this.instance?.amountSymbols ?? 2}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -154,7 +153,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.hibpAllowedCount, 0)}"
|
||||
value="${this.instance?.hibpAllowedCount ?? 0}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -179,7 +178,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
value="${first(this.instance?.zxcvbnScoreThreshold, 0)}"
|
||||
value="${this.instance?.zxcvbnScoreThreshold ?? 0}"
|
||||
class="pf-c-form-control"
|
||||
required
|
||||
/>
|
||||
@ -236,7 +235,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
<input
|
||||
class="pf-c-switch__input"
|
||||
type="checkbox"
|
||||
?checked=${first(this.instance?.executionLogging, false)}
|
||||
?checked=${this.instance?.executionLogging ?? false}
|
||||
/>
|
||||
<span class="pf-c-switch__toggle">
|
||||
<span class="pf-c-switch__toggle-icon">
|
||||
@ -272,7 +271,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
<input
|
||||
class="pf-c-switch__input"
|
||||
type="checkbox"
|
||||
?checked=${first(this.instance?.checkStaticRules, true)}
|
||||
?checked=${this.instance?.checkStaticRules ?? true}
|
||||
@change=${(ev: Event) => {
|
||||
const el = ev.target as HTMLInputElement;
|
||||
this.showStatic = el.checked;
|
||||
@ -291,7 +290,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
<input
|
||||
class="pf-c-switch__input"
|
||||
type="checkbox"
|
||||
?checked=${first(this.instance?.checkHaveIBeenPwned, true)}
|
||||
?checked=${this.instance?.checkHaveIBeenPwned ?? true}
|
||||
@change=${(ev: Event) => {
|
||||
const el = ev.target as HTMLInputElement;
|
||||
this.showHIBP = el.checked;
|
||||
@ -316,7 +315,7 @@ export class PasswordPolicyForm extends BasePolicyForm<PasswordPolicy> {
|
||||
<input
|
||||
class="pf-c-switch__input"
|
||||
type="checkbox"
|
||||
?checked=${first(this.instance?.checkZxcvbn, true)}
|
||||
?checked=${this.instance?.checkZxcvbn ?? true}
|
||||
@change=${(ev: Event) => {
|
||||
const el = ev.target as HTMLInputElement;
|
||||
this.showZxcvbn = el.checked;
|
||||
|
||||
Reference in New Issue
Block a user