FIX: ensures edit-category-setting is correctly casting boolean (#9999)
This commit is contained in:
parent
472862e87d
commit
cb13152a43
|
@ -108,11 +108,18 @@ export default buildCategoryPanel("settings", {
|
||||||
.sort((a, b) => a.name.localeCompare(b.name));
|
.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("category.sort_ascending")
|
||||||
|
sortAscendingOption(sortAscending) {
|
||||||
|
if (sortAscending === "false") return false;
|
||||||
|
if (sortAscending === "true") return true;
|
||||||
|
return sortAscending;
|
||||||
|
},
|
||||||
|
|
||||||
@discourseComputed
|
@discourseComputed
|
||||||
sortAscendingOptions() {
|
sortAscendingOptions() {
|
||||||
return [
|
return [
|
||||||
{ name: I18n.t("category.sort_ascending"), value: "true" },
|
{ name: I18n.t("category.sort_ascending"), value: true },
|
||||||
{ name: I18n.t("category.sort_descending"), value: "false" }
|
{ name: I18n.t("category.sort_descending"), value: false }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -181,17 +181,25 @@
|
||||||
{{i18n "category.sort_order"}}
|
{{i18n "category.sort_order"}}
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
{{combo-box valueProperty="value" content=availableSorts value=category.sort_order none="category.sort_options.default"}}
|
{{combo-box
|
||||||
|
valueProperty="value"
|
||||||
|
content=availableSorts
|
||||||
|
value=category.sort_order
|
||||||
|
options=(hash
|
||||||
|
none="category.sort_options.default"
|
||||||
|
)
|
||||||
|
onChange=(action (mut category.sort_order))
|
||||||
|
}}
|
||||||
{{#unless isDefaultSortOrder}}
|
{{#unless isDefaultSortOrder}}
|
||||||
{{combo-box
|
{{combo-box
|
||||||
castBoolean=true
|
|
||||||
valueProperty="value"
|
valueProperty="value"
|
||||||
content=sortAscendingOptions
|
content=sortAscendingOptions
|
||||||
value=category.sort_ascending
|
value=sortAscendingOption
|
||||||
none="category.sort_options.default"
|
|
||||||
options=(hash
|
options=(hash
|
||||||
|
none="category.sort_options.default"
|
||||||
placementStrategy="absolute"
|
placementStrategy="absolute"
|
||||||
)
|
)
|
||||||
|
onChange=(action (mut category.sort_ascending))
|
||||||
}}
|
}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue