From 47835ade9a3dcebb14bdd744e92d93b9c9199b90 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 19 Feb 2021 13:46:02 +0100 Subject: [PATCH] UX: implements a new tags-intersection-chooser (#12139) --- .../discourse/app/components/tag-heading.js | 4 -- .../app/templates/components/bread-crumbs.hbs | 22 +++++++--- .../app/templates/components/tag-heading.hbs | 11 ----- .../discourse/app/templates/tags/show.hbs | 9 ---- .../components/tags-intersection-chooser.js | 43 +++++++++++++++++++ .../stylesheets/common/base/tagging.scss | 20 +++------ 6 files changed, 66 insertions(+), 43 deletions(-) delete mode 100644 app/assets/javascripts/discourse/app/components/tag-heading.js delete mode 100644 app/assets/javascripts/discourse/app/templates/components/tag-heading.hbs create mode 100644 app/assets/javascripts/select-kit/addon/components/tags-intersection-chooser.js diff --git a/app/assets/javascripts/discourse/app/components/tag-heading.js b/app/assets/javascripts/discourse/app/components/tag-heading.js deleted file mode 100644 index 0e6d50b17d4..00000000000 --- a/app/assets/javascripts/discourse/app/components/tag-heading.js +++ /dev/null @@ -1,4 +0,0 @@ -import Component from "@ember/component"; -export default Component.extend({ - tagName: "", -}); diff --git a/app/assets/javascripts/discourse/app/templates/components/bread-crumbs.hbs b/app/assets/javascripts/discourse/app/templates/components/bread-crumbs.hbs index 7647cc6ca7f..8236b9448a7 100644 --- a/app/assets/javascripts/discourse/app/templates/components/bread-crumbs.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/bread-crumbs.hbs @@ -15,12 +15,24 @@ {{/each}} {{#if siteSettings.tagging_enabled}} - {{#unless additionalTags}} - {{!-- the tag filter doesn't work with tag intersections, so hide it --}} - {{#if siteSettings.show_filter_by_tag}} - {{tag-drop currentCategory=category noSubcategories=noSubcategories tagId=tag.id}} + {{#if siteSettings.show_filter_by_tag}} + {{#if additionalTags}} + {{tags-intersection-chooser + currentCategory=category + mainTag=tag.id + additionalTags=additionalTags + options=(hash + categoryId=category.id + ) + }} + {{else}} + {{tag-drop + currentCategory=category + noSubcategories=noSubcategories + tagId=tag.id + }} {{/if}} - {{/unless}} + {{/if}} {{/if}} {{plugin-outlet name="bread-crumbs-right" connectorTagName="li" tagName=""}} diff --git a/app/assets/javascripts/discourse/app/templates/components/tag-heading.hbs b/app/assets/javascripts/discourse/app/templates/components/tag-heading.hbs deleted file mode 100644 index ec791283cc4..00000000000 --- a/app/assets/javascripts/discourse/app/templates/components/tag-heading.hbs +++ /dev/null @@ -1,11 +0,0 @@ -

- {{#link-to "tags"}} - {{i18n "tagging.tags"}} - {{/link-to}} - {{d-icon "angle-right"}} - {{discourse-tag-bound tagRecord=tag style="simple"}} - {{#each additionalTags as |tag|}} - & - {{discourse-tag tag style="simple"}} - {{/each}} -

\ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/templates/tags/show.hbs b/app/assets/javascripts/discourse/app/templates/tags/show.hbs index dbb03bbb563..d8f2fc07427 100644 --- a/app/assets/javascripts/discourse/app/templates/tags/show.hbs +++ b/app/assets/javascripts/discourse/app/templates/tags/show.hbs @@ -7,15 +7,6 @@