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( assert.strictEqual(
content[0].name, content[0].name,
I18n.t("tagging.selector_no_tags"), I18n.t("tagging.selector_remove_filter"),
"it has the translated label for no-tags" "it has the correct label for removing the tag filter"
); );
assert.strictEqual( assert.strictEqual(
content[1].name, content[1].name,
I18n.t("tagging.selector_remove_filter"), I18n.t("tagging.selector_no_tags"),
"it has the correct label for removing the tag filter" "it has the translated label for no-tags"
); );
await this.subject.fillInFilter("dav"); await this.subject.fillInFilter("dav");

View File

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

View File

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

View File

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