A platform for community discussion. Free, open, simple.
FIX: simplifies and corrects new collection header tag/drop behaviour
Joffrey JAFFEUXee8cda691dec
diff --git a/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs b/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbsindex ce6613330e1..e46d6c32e15 100644--- a/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs+++ b/app/assets/javascripts/discourse/templates/components/bread-crumbs.hbs@@ -7,7 +7,7 @@category=secondCategoryparentCategory=firstCategorycategories=childCategories- subCategory="true"+ subCategory=truenoSubcategories=noSubcategories}}{{/if}}diff --git a/app/assets/javascripts/select-kit/components/category-drop.js.es6 b/app/assets/javascripts/select-kit/components/category-drop.js.es6index f9c1f9a6f83..d88fa7ff588 100644--- a/app/assets/javascripts/select-kit/components/category-drop.js.es6+++ b/app/assets/javascripts/select-kit/components/category-drop.js.es6@@ -20,6 +20,7 @@ export default ComboBoxComponent.extend({fullWidthOnMobile: true,caretDownIcon: "caret-right",caretUpIcon: "caret-down",+ subCategory: false,init() {this._super();@@ -50,11 +51,7 @@ export default ComboBoxComponent.extend({collectionHeader(allCategoriesUrl, allCategoriesLabel, noCategoriesUrl, noCategoriesLabel) {let shortcuts = "";- const currentRoute = Ember.getOwner(this)- .lookup("controller:application")- .get("currentRouteName");-- if (currentRoute !== "discovery.parentCategory") {+ if (this.get("hasSelection") || (this.get("noSubcategories") && this.get("subCategory"))) {shortcuts += `<a href="${allCategoriesUrl}" class="category-filter">${allCategoriesLabel}@@ -62,7 +59,7 @@ export default ComboBoxComponent.extend({`;}- if (this.get("subCategory") && currentRoute !== "discovery.categoryNone") {+ if (this.get("subCategory") && (this.get("hasSelection") || !this.get("noSubcategories"))) {shortcuts += `<a href="${noCategoriesUrl}" class="category-filter">${noCategoriesLabel}diff --git a/app/assets/javascripts/select-kit/components/tag-drop.js.es6 b/app/assets/javascripts/select-kit/components/tag-drop.js.es6index ba23945bcc7..e5082277474 100644--- a/app/assets/javascripts/select-kit/components/tag-drop.js.es6+++ b/app/assets/javascripts/select-kit/components/tag-drop.js.es6@@ -79,10 +79,6 @@ export default ComboBoxComponent.extend({collectionHeader(allTagsUrl, allTagsLabel, noTagsUrl, noTagsLabel) {let content = "";- const currentRoute = Ember.getOwner(this)- .lookup("controller:application")- .get("currentRouteName");-if (this.get("tagId") !== "none") {content += `<a href="${noTagsUrl}" class="tag-filter">@@ -91,7 +87,7 @@ export default ComboBoxComponent.extend({`;}- if (currentRoute === "tags.showCategory") {+ if (this.get("hasSelection") || this.get("tagId") === "none") {content += `<a href="${allTagsUrl}" class="tag-filter">${allTagsLabel}