web/admin: fix hideManaged toggle for propertymapping list

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-31 16:35:20 +02:00
parent d248b30eb3
commit c92a2ecbf5
2 changed files with 3 additions and 2 deletions

View file

@ -93,7 +93,7 @@ class Prompt(SerializerModel):
if self.type == FieldTypes.HIDDEN: if self.type == FieldTypes.HIDDEN:
field_class = HiddenField field_class = HiddenField
kwargs["required"] = False kwargs["required"] = False
kwargs["initial"] = self.placeholder kwargs["default"] = self.placeholder
if self.type == FieldTypes.CHECKBOX: if self.type == FieldTypes.CHECKBOX:
field_class = BooleanField field_class = BooleanField
kwargs["required"] = False kwargs["required"] = False

View file

@ -43,7 +43,7 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
page: page, page: page,
pageSize: PAGE_SIZE, pageSize: PAGE_SIZE,
search: this.search || "", search: this.search || "",
managedIsnull: this.hideManaged.toString(), managedIsnull: this.hideManaged ? "true" : undefined,
}); });
} }
@ -126,6 +126,7 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
<div class="pf-c-check"> <div class="pf-c-check">
<input class="pf-c-check__input" type="checkbox" id="hide-managed" name="hide-managed" ?checked=${this.hideManaged} @change=${() => { <input class="pf-c-check__input" type="checkbox" id="hide-managed" name="hide-managed" ?checked=${this.hideManaged} @change=${() => {
this.hideManaged = !this.hideManaged; this.hideManaged = !this.hideManaged;
this.page = 1;
this.fetch(); this.fetch();
}} /> }} />
<label class="pf-c-check__label" for="hide-managed">${gettext("Hide managed mappings")}</label> <label class="pf-c-check__label" for="hide-managed">${gettext("Hide managed mappings")}</label>