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:
parent
ace777ebbe
commit
0a1a2a035e
|
@ -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>
|
||||
|
|
|
@ -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``}
|
||||
|
|
Reference in a new issue