UX: Fix label in search when tagging is disabled (#14503)

This commit is contained in:
Penar Musaraj 2021-10-04 17:04:34 -04:00 committed by GitHub
parent a9d20610d4
commit 23df78acb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -32,14 +32,6 @@ export const SEARCH_TYPE_DEFAULT = "topics_posts";
export const SEARCH_TYPE_CATS_TAGS = "categories_tags";
export const SEARCH_TYPE_USERS = "users";
const SearchTypes = [
{ name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
{
name: I18n.t("search.type.categories_and_tags"),
id: SEARCH_TYPE_CATS_TAGS,
},
{ name: I18n.t("search.type.users"), id: SEARCH_TYPE_USERS },
];
const PAGE_LIMIT = 10;
export default Controller.extend({
@ -66,11 +58,21 @@ export default Controller.extend({
invalidSearch: false,
page: 1,
resultCount: null,
searchTypes: SearchTypes,
searchTypes: null,
init() {
this._super(...arguments);
this.set("searchTypes", [
{ name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
{
name: this.siteSettings.tagging_enabled
? I18n.t("search.type.categories_and_tags")
: I18n.t("search.type.categories"),
id: SEARCH_TYPE_CATS_TAGS,
},
{ name: I18n.t("search.type.users"), id: SEARCH_TYPE_USERS },
]);
this.selected = [];
},

View File

@ -2365,6 +2365,7 @@ en:
type:
default: "Topics/posts"
users: "Users"
categories: "Categories"
categories_and_tags: "Categories/tags"
context: