web/admin: fix default for codemirror

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-17 19:37:13 +02:00
parent 78dd7b0341
commit 240136154b
4 changed files with 5 additions and 4 deletions

View File

@ -72,7 +72,7 @@ export class UserForm extends Form<User> {
<ak-form-element-horizontal
label=${t`Attributes`}
name="attributes">
<ak-codemirror mode="yaml" value="${YAML.stringify(this.user?.attributes)}">
<ak-codemirror mode="yaml" value="${YAML.stringify(first(this.user?.attributes, {}))}">
</ak-codemirror>
<p class="pf-c-form__helper-text">${t`Set custom attributes using YAML or JSON.`}</p>
</ak-form-element-horizontal>