web/admin: fix *Test Forms not having a default for codemirrors

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-19 18:25:16 +02:00
parent ace777ebbe
commit 0a1a2a035e
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml";
@customElement("ak-policy-test-form")
export class PolicyTestForm extends Form<PolicyTest> {
@ -75,7 +76,7 @@ export class PolicyTestForm extends Form<PolicyTest> {
<ak-form-element-horizontal
label=${t`Context`}
name="context">
<ak-codemirror mode="yaml">
<ak-codemirror mode="yaml" value=${YAML.stringify({})}>>
</ak-codemirror>
<p class="pf-c-form__helper-text">${t`Set custom attributes using YAML or JSON.`}</p>
</ak-form-element-horizontal>

View File

@ -9,6 +9,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
import "../../elements/forms/HorizontalFormElement";
import "../../elements/CodeMirror";
import { PolicyTest } from "authentik-api/src";
import YAML from "yaml";
@customElement("ak-property-mapping-test-form")
export class PolicyTestForm extends Form<PolicyTest> {
@ -64,7 +65,7 @@ export class PolicyTestForm extends Form<PolicyTest> {
<ak-form-element-horizontal
label=${t`Context`}
name="context">
<ak-codemirror mode="yaml">
<ak-codemirror mode="yaml" value=${YAML.stringify({})}>
</ak-codemirror>
</ak-form-element-horizontal>
${this.result ? this.renderResult(): html``}