Skip to content

A platform for community discussion. Free, open, simple.

FIX: do no reset tags selection on category selection (#6369)

Joffrey JAFFEUX6c1e70d5545d
diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6
index 009fd35a8dd..1a6bf47dd0f 100644
--- a/app/assets/javascripts/discourse/controllers/composer.js.es6
+++ b/app/assets/javascripts/discourse/controllers/composer.js.es6
@@ -297,12 +297,6 @@ export default Ember.Controller.extend({
uploadIcon: () => uploadIcon(),
actions: {
- resetTagsSelection() {
- if (this.get("model.tags")) {
- this.set("model.tags", []);
- }
- },
-
cancelUpload() {
this.set("model.uploadCancelled", true);
},
diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs
index 7c75f0ba03a..dc71db36f76 100644
--- a/app/assets/javascripts/discourse/templates/composer.hbs
+++ b/app/assets/javascripts/discourse/templates/composer.hbs
@@ -64,8 +64,6 @@
fullWidthOnMobile=true
value=model.categoryId
scopedCategoryId=scopedCategoryId
- onSelect=(action "resetTagsSelection")
- onSelectNone=(action "resetTagsSelection")
tabindex="3"}}
{{popup-input-tip validation=categoryValidation}}
</div>
diff --git a/test/javascripts/acceptance/category-chooser-with-tags-test.js.es6 b/test/javascripts/acceptance/category-chooser-with-tags-test.js.es6
deleted file mode 100644
index 234eb2d8565..00000000000
--- a/test/javascripts/acceptance/category-chooser-with-tags-test.js.es6
+++ /dev/null
@@ -1,39 +0,0 @@
-import { acceptance } from "helpers/qunit-helpers";
-
-acceptance("CategoryChooser - with tags", {
- loggedIn: true,
- site: { can_tag_topics: true },
- settings: {
- tagging_enabled: true,
- allow_uncategorized_topics: false
- }
-});
-
-QUnit.test("resets tags when changing category", async assert => {
- const categoryChooser = selectKit(".category-chooser");
- const miniTagChooser = selectKit(".mini-tag-chooser");
- const findSelected = () =>
- find(".mini-tag-chooser .mini-tag-chooser-header .selected-name").text();
-
- await visit("/");
- await click("#create-topic");
- await miniTagChooser.expand();
- await miniTagChooser.selectRowByValue("monkey");
-
- assert.equal(findSelected(), "monkey");
-
- await categoryChooser.expand();
- await categoryChooser.selectRowByValue(6);
-
- assert.equal(findSelected(), "optional tags");
-
- await miniTagChooser.expand();
- await miniTagChooser.selectRowByValue("monkey");
-
- assert.equal(findSelected(), "monkey");
-
- await categoryChooser.expand();
- await categoryChooser.selectNoneRow();
-
- assert.equal(findSelected(), "optional tags");
-});