mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 13:44:30 +08:00
FIX: do no reset tags selection on category selection (#6369)
We will instead implement a server side solution to this in the future.
This commit is contained in:
parent
56b6a4779d
commit
6c1e70d554
app/assets/javascripts/discourse
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");
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user