Skip to content

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

FIX: Keep tags when switching to shared draft

Robin Warda83424568336
diff --git a/app/assets/javascripts/select-kit/components/composer-actions.js.es6 b/app/assets/javascripts/select-kit/components/composer-actions.js.es6
index 0ab04b0ad17..be9902dc4ab 100644
--- a/app/assets/javascripts/select-kit/components/composer-actions.js.es6
+++ b/app/assets/javascripts/select-kit/components/composer-actions.js.es6
@@ -276,6 +276,7 @@ export default DropdownSelectBoxComponent.extend({
options.action = action;
options.categoryId = this.get("composerModel.categoryId");
options.topicTitle = this.get("composerModel.title");
+ options.tags = this.get("composerModel.tags");
options.skipDraftCheck = true;
this._openComposer(options);
},
diff --git a/test/javascripts/acceptance/composer-actions-test.js.es6 b/test/javascripts/acceptance/composer-actions-test.js.es6
index acf39c55ff3..9ee3868bbcf 100644
--- a/test/javascripts/acceptance/composer-actions-test.js.es6
+++ b/test/javascripts/acceptance/composer-actions-test.js.es6
@@ -7,6 +7,9 @@ acceptance("Composer Actions", {
settings: {
enable_whispers: true
},
+ site: {
+ can_tag_topics: true
+ },
beforeEach() {
_clearSnapshots();
}
@@ -131,16 +134,21 @@ QUnit.test("shared draft", async assert => {
toggleCheckDraftPopup(true);
const composerActions = selectKit(".composer-actions");
+ const tags = selectKit(".mini-tag-chooser");
await visit("/");
await click("#create-topic");
await fillIn("#reply-title", "This is the new text for the title");
await fillIn(".d-editor-input", "This is the new text for the post");
+ await tags.expand();
+ await tags.selectRowByValue("monkey");
await composerActions.expand();
await composerActions.selectRowByValue("shared_draft");
+ assert.equal(tags.header().value(), "monkey", "tags are not reset");
+
assert.equal(
find("#reply-control .btn-primary.create .d-button-label").text(),
I18n.t("composer.create_shared_draft")