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

We will instead implement a server side solution to this in the future.
This commit is contained in:
Joffrey JAFFEUX 2018-09-06 10:35:07 +02:00 committed by GitHub
parent 56b6a4779d
commit 6c1e70d554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 47 deletions
app/assets/javascripts/discourse
controllers
templates
test/javascripts/acceptance

@ -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);
},

@ -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>

@ -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");
});