web/*: fix defaults for booleans to use first()
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
46e0571ed0
commit
8a7c414031
|
@ -10,7 +10,7 @@ import { MessageMiddleware } from "../elements/messages/Middleware";
|
|||
export class LoggingMiddleware implements Middleware {
|
||||
|
||||
post(context: ResponseContext): Promise<Response | void> {
|
||||
console.debug(`authentik/api: ${context.init.method} ${context.url} => ${context.response.status}`);
|
||||
console.debug(`authentik/api: ${context.response.status} ${context.init.method} ${context.url}`);
|
||||
return Promise.resolve(context.response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import { DEFAULT_CONFIG } from "../../api/Config";
|
|||
import { Form } from "../../elements/forms/Form";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../elements/forms/HorizontalFormElement";
|
||||
import { first } from "../../utils";
|
||||
|
||||
@customElement("ak-event-transport-form")
|
||||
export class TransportForm extends Form<NotificationTransport> {
|
||||
|
@ -92,7 +93,7 @@ export class TransportForm extends Form<NotificationTransport> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="sendOnce">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.transport?.sendOnce || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.transport?.sendOnce, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Send once`}
|
||||
</label>
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Form } from "../../elements/forms/Form";
|
|||
import { until } from "lit-html/directives/until";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../elements/forms/HorizontalFormElement";
|
||||
import { groupBy } from "../../utils";
|
||||
import { first, groupBy } from "../../utils";
|
||||
|
||||
@customElement("ak-stage-binding-form")
|
||||
export class StageBindingForm extends Form<FlowStageBinding> {
|
||||
|
@ -104,7 +104,7 @@ export class StageBindingForm extends Form<FlowStageBinding> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="evaluateOnPlan">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.fsb?.evaluateOnPlan || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.fsb?.evaluateOnPlan, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Evaluate on plan`}
|
||||
</label>
|
||||
|
@ -113,7 +113,7 @@ export class StageBindingForm extends Form<FlowStageBinding> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="reEvaluatePolicies">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.fsb?.reEvaluatePolicies || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.fsb?.reEvaluatePolicies, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Re-evaluate policies`}
|
||||
</label>
|
||||
|
|
|
@ -9,6 +9,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../elements/forms/HorizontalFormElement";
|
||||
import "../../elements/CodeMirror";
|
||||
import YAML from "yaml";
|
||||
import { first } from "../../utils";
|
||||
|
||||
@customElement("ak-group-form")
|
||||
export class GroupForm extends Form<Group> {
|
||||
|
@ -47,7 +48,7 @@ export class GroupForm extends Form<Group> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="isSuperuser">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.group?.isSuperuser || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.group?.isSuperuser, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Is superuser`}
|
||||
</label>
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Form } from "../../elements/forms/Form";
|
|||
import { until } from "lit-html/directives/until";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../elements/forms/HorizontalFormElement";
|
||||
import { first } from "../../utils";
|
||||
|
||||
@customElement("ak-service-connection-docker-form")
|
||||
export class ServiceConnectionDockerForm extends Form<DockerServiceConnection> {
|
||||
|
@ -53,7 +54,7 @@ export class ServiceConnectionDockerForm extends Form<DockerServiceConnection> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="local">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.sc?.local || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.sc?.local, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Local`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../elements/forms/HorizontalFormElement";
|
||||
import "../../elements/CodeMirror";
|
||||
import YAML from "yaml";
|
||||
import { first } from "../../utils";
|
||||
|
||||
@customElement("ak-service-connection-kubernetes-form")
|
||||
export class ServiceConnectionKubernetesForm extends Form<KubernetesServiceConnection> {
|
||||
|
@ -54,7 +55,7 @@ export class ServiceConnectionKubernetesForm extends Form<KubernetesServiceConne
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="local">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.sc?.local || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.sc?.local, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Local`}
|
||||
</label>
|
||||
|
|
|
@ -114,7 +114,7 @@ export class PolicyBindingForm extends Form<PolicyBinding> {
|
|||
<input required name="target" type="hidden" value=${ifDefined(this.binding?.target || this.targetPk)}>
|
||||
<ak-form-element-horizontal name="enabled">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.binding?.enabled || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.binding?.enabled, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Enabled`}
|
||||
</label>
|
||||
|
|
|
@ -54,7 +54,7 @@ export class DummyPolicyForm extends Form<DummyPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
@ -68,7 +68,7 @@ export class DummyPolicyForm extends Form<DummyPolicy> {
|
|||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="result">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.result || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.result, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Pass policy?`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import { until } from "lit-html/directives/until";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-policy-event-matcher-form")
|
||||
export class EventMatcherPolicyForm extends Form<EventMatcherPolicy> {
|
||||
|
@ -54,7 +55,7 @@ export class EventMatcherPolicyForm extends Form<EventMatcherPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Form } from "../../../elements/forms/Form";
|
|||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-policy-password-expiry-form")
|
||||
export class PasswordExpiryPolicyForm extends Form<PasswordExpiryPolicy> {
|
||||
|
@ -53,7 +54,7 @@ export class PasswordExpiryPolicyForm extends Form<PasswordExpiryPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
@ -73,7 +74,7 @@ export class PasswordExpiryPolicyForm extends Form<PasswordExpiryPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="denyOnly">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.denyOnly || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.denyOnly, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Only fail the policy, don't set user's password.`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import "../../../elements/CodeMirror";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-policy-expression-form")
|
||||
export class ExpressionPolicyForm extends Form<ExpressionPolicy> {
|
||||
|
@ -54,7 +55,7 @@ export class ExpressionPolicyForm extends Form<ExpressionPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
|
|
@ -54,7 +54,7 @@ export class HaveIBeenPwnedPolicyForm extends Form<HaveIBeenPwendPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
|
|
@ -54,7 +54,7 @@ export class PasswordPolicyForm extends Form<PasswordPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Form } from "../../../elements/forms/Form";
|
|||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-policy-reputation-form")
|
||||
export class ReputationPolicyForm extends Form<ReputationPolicy> {
|
||||
|
@ -53,7 +54,7 @@ export class ReputationPolicyForm extends Form<ReputationPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="executionLogging">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.executionLogging || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.executionLogging, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Execution logging`}
|
||||
</label>
|
||||
|
@ -67,7 +68,7 @@ export class ReputationPolicyForm extends Form<ReputationPolicy> {
|
|||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="checkIp">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.checkIp || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.checkIp, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Check IP`}
|
||||
</label>
|
||||
|
@ -75,7 +76,7 @@ export class ReputationPolicyForm extends Form<ReputationPolicy> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="checkUsername">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.policy?.checkUsername || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.policy?.checkUsername, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Check Username`}
|
||||
</label>
|
||||
|
|
|
@ -205,7 +205,7 @@ export class OAuth2ProviderFormPage extends Form<OAuth2Provider> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="includeClaimsInIdToken">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.provider?.includeClaimsInIdToken || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.provider?.includeClaimsInIdToken, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Include claims in id_token`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import "../../../elements/forms/FormGroup";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { until } from "lit-html/directives/until";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-source-ldap-form")
|
||||
export class LDAPSourceForm extends Form<LDAPSource> {
|
||||
|
@ -60,7 +61,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="enabled">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.enabled || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.enabled, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Enabled`}
|
||||
</label>
|
||||
|
@ -68,7 +69,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="syncUsers">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.syncUsers || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.syncUsers, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Sync users`}
|
||||
</label>
|
||||
|
@ -76,7 +77,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="syncUsersPassword">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.syncUsersPassword || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.syncUsersPassword, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Sync users' passwords`}
|
||||
</label>
|
||||
|
@ -84,7 +85,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="syncGroups">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.syncGroups || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.syncGroups, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Sync groups`}
|
||||
</label>
|
||||
|
@ -103,7 +104,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="startTls">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.startTls || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.startTls, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Enable StartTLS`}
|
||||
</label>
|
||||
|
@ -140,7 +141,7 @@ export class LDAPSourceForm extends Form<LDAPSource> {
|
|||
name="propertyMappings">
|
||||
<select class="pf-c-form-control" multiple>
|
||||
${until(new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapList({
|
||||
ordering: "object_field"
|
||||
ordering: "managed,object_field"
|
||||
}).then(mappings => {
|
||||
return mappings.results.map(mapping => {
|
||||
let selected = false;
|
||||
|
|
|
@ -8,6 +8,7 @@ import "../../../elements/forms/FormGroup";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { until } from "lit-html/directives/until";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-source-oauth-form")
|
||||
export class OAuthSourceForm extends Form<OAuthSource> {
|
||||
|
@ -17,7 +18,7 @@ export class OAuthSourceForm extends Form<OAuthSource> {
|
|||
slug: value,
|
||||
}).then(source => {
|
||||
this.source = source;
|
||||
this.showUrlOptions = source.type?.urlsCustomizable || false;
|
||||
this.showUrlOptions = first(source.type?.urlsCustomizable, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -105,7 +106,7 @@ export class OAuthSourceForm extends Form<OAuthSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="enabled">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.enabled || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.enabled, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Enabled`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import "../../../elements/forms/FormGroup";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import { until } from "lit-html/directives/until";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-source-saml-form")
|
||||
export class SAMLSourceForm extends Form<SAMLSource> {
|
||||
|
@ -60,7 +61,7 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="enabled">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.enabled || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.enabled, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Enabled`}
|
||||
</label>
|
||||
|
@ -131,7 +132,7 @@ export class SAMLSourceForm extends Form<SAMLSource> {
|
|||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="allowIdpInitiated">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.source?.allowIdpInitiated || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.source?.allowIdpInitiated, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t` Allow IDP-initiated logins`}
|
||||
</label>
|
||||
|
|
|
@ -82,7 +82,7 @@ export class EmailStageForm extends Form<EmailStage> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="useTls">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.useTls || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.useTls, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Use TLS`}
|
||||
</label>
|
||||
|
@ -90,7 +90,7 @@ export class EmailStageForm extends Form<EmailStage> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="useSsl">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.useSsl || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.useSsl, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Use SSL`}
|
||||
</label>
|
||||
|
@ -127,7 +127,7 @@ export class EmailStageForm extends Form<EmailStage> {
|
|||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="useGlobalSettings">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.useGlobalSettings || true} @change=${(ev: Event) => {
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.useGlobalSettings, true)} @change=${(ev: Event) => {
|
||||
const target = ev.target as HTMLInputElement;
|
||||
this.showConnectionSettings = !target.checked;
|
||||
}}>
|
||||
|
|
|
@ -8,6 +8,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import { until } from "lit-html/directives/until";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-stage-identification-form")
|
||||
export class IdentificationStageForm extends Form<IdentificationStage> {
|
||||
|
@ -80,7 +81,7 @@ export class IdentificationStageForm extends Form<IdentificationStage> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="caseInsensitiveMatching">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.caseInsensitiveMatching || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.caseInsensitiveMatching, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Case insensitive matching`}
|
||||
</label>
|
||||
|
@ -89,7 +90,7 @@ export class IdentificationStageForm extends Form<IdentificationStage> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="showMatchedUser">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.showMatchedUser || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.showMatchedUser, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Show matched user`}
|
||||
</label>
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Form } from "../../../elements/forms/Form";
|
|||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import "../../../elements/forms/FormGroup";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-stage-invitation-form")
|
||||
export class InvitationStageForm extends Form<InvitationStage> {
|
||||
|
@ -58,7 +59,7 @@ export class InvitationStageForm extends Form<InvitationStage> {
|
|||
<div slot="body" class="pf-c-form">
|
||||
<ak-form-element-horizontal name="continueFlowWithoutInvitation">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.stage?.continueFlowWithoutInvitation || true}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.stage?.continueFlowWithoutInvitation, true)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Continue flow without invitation`}
|
||||
</label>
|
||||
|
|
|
@ -6,6 +6,7 @@ import { DEFAULT_CONFIG } from "../../../api/Config";
|
|||
import { Form } from "../../../elements/forms/Form";
|
||||
import { ifDefined } from "lit-html/directives/if-defined";
|
||||
import "../../../elements/forms/HorizontalFormElement";
|
||||
import { first } from "../../../utils";
|
||||
|
||||
@customElement("ak-prompt-form")
|
||||
export class PromptForm extends Form<Prompt> {
|
||||
|
@ -98,7 +99,7 @@ export class PromptForm extends Form<Prompt> {
|
|||
</ak-form-element-horizontal>
|
||||
<ak-form-element-horizontal name="required">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.prompt?.required || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.prompt?.required, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Required`}
|
||||
</label>
|
||||
|
|
|
@ -8,6 +8,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
|
|||
import "../../elements/forms/HorizontalFormElement";
|
||||
import "../../elements/CodeMirror";
|
||||
import YAML from "yaml";
|
||||
import { first } from "../../utils";
|
||||
|
||||
@customElement("ak-user-form")
|
||||
export class UserForm extends Form<User> {
|
||||
|
@ -61,7 +62,7 @@ export class UserForm extends Form<User> {
|
|||
<ak-form-element-horizontal
|
||||
name="isActive">
|
||||
<div class="pf-c-check">
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${this.user?.isActive || false}>
|
||||
<input type="checkbox" class="pf-c-check__input" ?checked=${first(this.user?.isActive, false)}>
|
||||
<label class="pf-c-check__label">
|
||||
${t`Is active`}
|
||||
</label>
|
||||
|
|
Reference in New Issue