From 0a1a2a035eedaecadbf15e5b5ddb01aad39369e5 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 19 Apr 2021 18:25:16 +0200 Subject: [PATCH] web/admin: fix *Test Forms not having a default for codemirrors Signed-off-by: Jens Langhammer --- web/src/pages/policies/PolicyTestForm.ts | 3 ++- web/src/pages/property-mappings/PropertyMappingTestForm.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/pages/policies/PolicyTestForm.ts b/web/src/pages/policies/PolicyTestForm.ts index 5b67c397b..89366c8ea 100644 --- a/web/src/pages/policies/PolicyTestForm.ts +++ b/web/src/pages/policies/PolicyTestForm.ts @@ -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 { @@ -75,7 +76,7 @@ export class PolicyTestForm extends Form { - + >

${t`Set custom attributes using YAML or JSON.`}

diff --git a/web/src/pages/property-mappings/PropertyMappingTestForm.ts b/web/src/pages/property-mappings/PropertyMappingTestForm.ts index e770f8bdd..1a4fce60f 100644 --- a/web/src/pages/property-mappings/PropertyMappingTestForm.ts +++ b/web/src/pages/property-mappings/PropertyMappingTestForm.ts @@ -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 { @@ -64,7 +65,7 @@ export class PolicyTestForm extends Form { - + ${this.result ? this.renderResult(): html``}