UX: replace "all subcategories" with "remove filter", reorder tag dropdown (#27473)

This commit is contained in:
Kris 2024-06-13 17:10:25 -04:00 committed by GitHub
parent c2417ffc47
commit e92323c81e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 13 deletions

View File

@ -53,13 +53,13 @@ module("Integration | Component | select-kit/tag-drop", function (hooks) {
assert.strictEqual(
content[0].name,
I18n.t("tagging.selector_no_tags"),
"it has the translated label for no-tags"
I18n.t("tagging.selector_remove_filter"),
"it has the correct label for removing the tag filter"
);
assert.strictEqual(
content[1].name,
I18n.t("tagging.selector_remove_filter"),
"it has the correct label for removing the tag filter"
I18n.t("tagging.selector_no_tags"),
"it has the translated label for no-tags"
);
await this.subject.fillInFilter("dav");

View File

@ -159,7 +159,7 @@ export default ComboBoxComponent.extend({
}
if (this.selectKit.options.subCategory) {
return I18n.t("categories.all_subcategories", {
return I18n.t("categories.remove_filter", {
categoryName: this.parentCategoryName,
});
}

View File

@ -96,13 +96,6 @@ export default ComboBoxComponent.extend(TagsMixin, {
shortcuts: computed("tagId", function () {
const shortcuts = [];
if (this.tagId !== NONE_TAG) {
shortcuts.push({
id: NO_TAG_ID,
name: I18n.t("tagging.selector_no_tags"),
});
}
if (this.tagId) {
shortcuts.push({
id: ALL_TAGS_ID,
@ -110,6 +103,13 @@ export default ComboBoxComponent.extend(TagsMixin, {
});
}
if (this.tagId !== NONE_TAG) {
shortcuts.push({
id: NO_TAG_ID,
name: I18n.t("tagging.selector_no_tags"),
});
}
// If there is a single shortcut, we can have a single "remove filter"
// option
if (shortcuts.length === 1 && shortcuts[0].id === ALL_TAGS_ID) {

View File

@ -1076,7 +1076,6 @@ en:
categories:
categories_label: "categories"
subcategories_label: "subcategories"
all_subcategories: "all subcategories"
no_subcategories: "no subcategories"
remove_filter: "remove filter"
plus_more_count: