A platform for community discussion. Free, open, simple.
FEATURE: Menu toggle for different reply modes
Joffrey JAFFEUX992382940299
diff --git a/app/assets/javascripts/discourse/components/composer-action-title.js.es6 b/app/assets/javascripts/discourse/components/composer-action-title.js.es6new file mode 100644index 00000000000..bc6e0e95bfe--- /dev/null+++ b/app/assets/javascripts/discourse/components/composer-action-title.js.es6@@ -0,0 +1,63 @@+import { default as computed } from 'ember-addons/ember-computed-decorators';+import { PRIVATE_MESSAGE, CREATE_TOPIC, REPLY, EDIT } from "discourse/models/composer";+import { iconHTML } from 'discourse-common/lib/icon-library';++export default Ember.Component.extend({+ classNames: ["composer-action-title"],+ options: Ember.computed.alias("model.replyOptions"),+ action: Ember.computed.alias("model.action"),+ isEditing: Ember.computed.equal("action", EDIT),++ @computed("options", "action")+ actionTitle(opts, action) {+ switch (action) {+ case PRIVATE_MESSAGE:+ return I18n.t("topic.private_message");+ case CREATE_TOPIC:+ return I18n.t("topic.create_long");+ case REPLY:+ if (opts.userAvatar && opts.userLink) {+ return this._formatReplyToUserPost(opts.userAvatar, opts.userLink);+ } else if (opts.topicLink) {+ return this._formatReplyToTopic(opts.topicLink);+ }+ case EDIT:+ if (opts.userAvatar && opts.userLink && opts.topicLink) {+ return this._formatEditUserPost(+ opts.userAvatar,+ opts.userLink,+ opts.topicLink,+ opts.originalUser+ );+ }+ };+ },++ _formatEditUserPost(userAvatar, userLink, topicLink, originalUser) {+ let editTitle = `+ <a class="topic-link" href="${topicLink.href}">${topicLink.anchor}</a>+ ${userAvatar}+ <span class="username">${userLink.anchor}</span>+ ${iconHTML("mail-forward", { class: "reply-to-glyph" })}+ `;++ if (originalUser) {+ editTitle += `+ ${originalUser.avatar}+ <span class="original-username">${originalUser.username}</span>+ `;+ }++ return editTitle.htmlSafe();+ },++ _formatReplyToTopic(link) {+ return `<a class="topic-link" href="${link.href}">${link.anchor}</a>`.htmlSafe();+ },++ _formatReplyToUserPost(avatar, link) {+ const htmlLink = `<a class="user-link" href="${link.href}">${link.anchor}</a>`;+ return `${avatar}${htmlLink}`.htmlSafe();+ },++});diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6index 41ec3ba3221..3b9815b9d8a 100644--- a/app/assets/javascripts/discourse/models/composer.js.es6+++ b/app/assets/javascripts/discourse/models/composer.js.es6@@ -1,4 +1,3 @@-import { iconHTML } from 'discourse-common/lib/icon-library';import RestModel from 'discourse/models/rest';import Topic from 'discourse/models/topic';import { throwAjaxError } from 'discourse/lib/ajax-error';@@ -6,45 +5,45 @@ import Quote from 'discourse/lib/quote';import Draft from 'discourse/models/draft';import computed from 'ember-addons/ember-computed-decorators';import { escapeExpression, tinyAvatar } from 'discourse/lib/utilities';-import { emojiUnescape } from 'discourse/lib/text';++// The actions the composer can take+export const+ CREATE_TOPIC = 'createTopic',+ PRIVATE_MESSAGE = 'privateMessage',+ NEW_PRIVATE_MESSAGE_KEY = 'new_private_message',+ REPLY = 'reply',+ EDIT = 'edit',+ REPLY_AS_NEW_TOPIC_KEY = "reply_as_new_topic",+ REPLY_AS_NEW_PRIVATE_MESSAGE_KEY = "reply_as_new_private_message";const CLOSED = 'closed',- SAVING = 'saving',- OPEN = 'open',- DRAFT = 'draft',-- // The actions the composer can take- CREATE_TOPIC = 'createTopic',- PRIVATE_MESSAGE = 'privateMessage',- NEW_PRIVATE_MESSAGE_KEY = 'new_private_message',- REPLY = 'reply',- EDIT = 'edit',- REPLY_AS_NEW_TOPIC_KEY = "reply_as_new_topic",- REPLY_AS_NEW_PRIVATE_MESSAGE_KEY = "reply_as_new_private_message",-- // When creating, these fields are moved into the post model from the composer model- _create_serializer = {- raw: 'reply',- title: 'title',- unlist_topic: 'unlistTopic',- category: 'categoryId',- topic_id: 'topic.id',- is_warning: 'isWarning',- whisper: 'whisper',- archetype: 'archetypeId',- target_usernames: 'targetUsernames',- typing_duration_msecs: 'typingTime',- composer_open_duration_msecs: 'composerTime',- tags: 'tags',- featured_link: 'featuredLink'- },-- _edit_topic_serializer = {- title: 'topic.title',- categoryId: 'topic.category.id',- tags: 'topic.tags',- featuredLink: 'topic.featured_link'- };+ SAVING = 'saving',+ OPEN = 'open',+ DRAFT = 'draft',++ // When creating, these fields are moved into the post model from the composer model+ _create_serializer = {+ raw: 'reply',+ title: 'title',+ unlist_topic: 'unlistTopic',+ category: 'categoryId',+ topic_id: 'topic.id',+ is_warning: 'isWarning',+ whisper: 'whisper',+ archetype: 'archetypeId',+ target_usernames: 'targetUsernames',+ typing_duration_msecs: 'typingTime',+ composer_open_duration_msecs: 'composerTime',+ tags: 'tags',+ featured_link: 'featuredLink'+ },++ _edit_topic_serializer = {+ title: 'topic.title',+ categoryId: 'topic.category.id',+ tags: 'topic.tags',+ featuredLink: 'topic.featured_link'+ };const _saveLabels = {};_saveLabels[EDIT] = 'composer.save_edit';@@ -167,52 +166,55 @@ const Composer = RestModel.extend({return this.get('canEditTopicFeaturedLink') ? 'composer.title_or_link_placeholder' : 'composer.title_placeholder';},- // Determine the appropriate title for this action- actionTitle: function() {- const topic = this.get('topic');+ @computed("action", "post", "topic", "topic.title")+ replyOptions(action, post, topic, topicTitle) {+ let options = {+ userLink: null,+ topicLink: null,+ postLink: null,+ userAvatar: null,+ originalUser: null+ };- let postLink, topicLink, usernameLink;if (topic) {- const postNumber = this.get('post.post_number');- postLink = "<a href='" + (topic.get('url')) + "/" + postNumber + "'>" +- I18n.t("post.post_number", { number: postNumber }) + "</a>";-- let title = topic.get('fancy_title') || escapeExpression(topic.get('title'));-- topicLink = "<a href='" + (topic.get('url')) + "'> " + title + "</a>";- usernameLink = "<a href='" + (topic.get('url')) + "/" + postNumber + "'>" + this.get('post.username') + "</a>";+ options.topicLink = {+ href: topic.get("url"),+ anchor: topic.get("fancy_title") || escapeExpression(topicTitle)+ };}- let postDescription;- const post = this.get('post');-if (post) {- postDescription = I18n.t('post.' + this.get('action'), {- link: postLink,- replyAvatar: tinyAvatar(post.get('avatar_template')),- username: this.get('post.username'),- usernameLink- });+ options.label = I18n.t(`post.${action}`);+ options.userAvatar = tinyAvatar(post.get("avatar_template"));if (!this.site.mobileView) {- const replyUsername = post.get('reply_to_user.username');- const replyAvatarTemplate = post.get('reply_to_user.avatar_template');- if (replyUsername && replyAvatarTemplate && this.get('action') === EDIT) {- postDescription += ` ${iconHTML('mail-forward', { class: 'reply-to-glyph' })} ` + tinyAvatar(replyAvatarTemplate) + " " + replyUsername;+ const originalUserName = post.get('reply_to_user.username');+ const originalUserAvatar = post.get('reply_to_user.avatar_template');+ if (originalUserName && originalUserAvatar && action === EDIT) {+ options.originalUser = {+ username: originalUserName,+ avatar: tinyAvatar(originalUserAvatar)+ };}}}- switch (this.get('action')) {- case PRIVATE_MESSAGE: return I18n.t('topic.private_message');- case CREATE_TOPIC: return I18n.t('topic.create_long');- case REPLY:- case EDIT:- if (postDescription) return postDescription;- if (topic) return emojiUnescape(I18n.t('post.reply_topic', { link: topicLink }));+ if (topic && post) {+ const postNumber = post.get("post_number");++ options.postLink = {+ href: `${topic.get("url")}/${postNumber}`,+ anchor: I18n.t("post.post_number", { number: postNumber })+ };++ options.userLink = {+ href: `${topic.get("url")}/${postNumber}`,+ anchor: post.get("username")+ };}- }.property('action', 'post', 'topic', 'topic.title'),+ return options;+ },// whether to disable the post buttoncantSubmitPost: function() {diff --git a/app/assets/javascripts/discourse/templates/components/composer-action-title.hbs b/app/assets/javascripts/discourse/templates/components/composer-action-title.hbsnew file mode 100644index 00000000000..fcb2bacfa05--- /dev/null+++ b/app/assets/javascripts/discourse/templates/components/composer-action-title.hbs@@ -0,0 +1,12 @@+{{#if isEditing}}+ {{d-icon "pencil"}}+{{else}}+ {{composer-actions+ composerModel=model+ options=model.replyOptions+ whispering=model.whisper+ canWhisper=canWhisper+ action=model.action}}+{{/if}}++{{actionTitle}}diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbsindex ed0b8c40285..beb60b375aa 100644--- a/app/assets/javascripts/discourse/templates/composer.hbs+++ b/app/assets/javascripts/discourse/templates/composer.hbs@@ -16,7 +16,7 @@{{plugin-outlet name="composer-open" args=(hash model=model)}}<div class='reply-to'><div class="reply-details">- {{{model.actionTitle}}}+ {{composer-action-title model=model canWhisper=canWhisper}}{{#unless site.mobileView}}{{#if whisperOrUnlistTopicText}}diff --git a/app/assets/javascripts/select-kit/components/composer-actions.js.es6 b/app/assets/javascripts/select-kit/components/composer-actions.js.es6new file mode 100644index 00000000000..d8b3a2be475--- /dev/null+++ b/app/assets/javascripts/select-kit/components/composer-actions.js.es6@@ -0,0 +1,132 @@+import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";+import { default as computed } from "ember-addons/ember-computed-decorators";+import { default as Composer, REPLY, EDIT } from "discourse/models/composer";++export default DropdownSelectBoxComponent.extend({+ composerController: Ember.inject.controller("composer"),+ pluginApiIdentifiers: ["composer-actions"],+ classNames: "composer-actions",+ fullWidthOnMobile: true,+ collectionHeight: "auto",+ autofilterable: false,+ filterable: false,+ allowInitialValueMutation: false,+ allowAutoSelectFirst: false,+ showFullTitle: false,++ computeHeaderContent() {+ let content = this.baseHeaderComputedContent();++ switch (this.get("action")) {+ case REPLY:+ content.icon = "mail-forward";+ break;+ case EDIT:+ content.icon = "pencil";+ break;+ };++ return content;+ },++ @computed("options", "canWhisper", "whispering", "composerModel.post.username")+ content(options, canWhisper, whispering, postUsername) {+ let items = [+ {+ name: I18n.t("composer.composer_actions.reply_as_new_topic.label"),+ description: I18n.t("composer.composer_actions.reply_as_new_topic.desc"),+ icon: "plus",+ id: "reply_as_new_topic"+ }+ ];++ if (postUsername && postUsername !== this.currentUser.get("username")) {+ items.push({+ name: I18n.t("composer.composer_actions.reply_as_private_message.label"),+ description: I18n.t("composer.composer_actions.reply_as_private_message.desc"),+ icon: "envelope",+ id: "reply_as_private_message"+ });+ }++ if (Ember.get(options, "postLink")) {+ items.push({+ name: I18n.t("composer.composer_actions.reply_to_topic.label"),+ description: I18n.t("composer.composer_actions.reply_to_topic.desc"),+ icon: "mail-forward",+ id: "reply_to_topic"+ });+ }++ if (canWhisper) {+ if (whispering) {+ items.push({+ name: I18n.t("composer.composer_actions.reply_as_not_whisper.label"),+ description: I18n.t("composer.composer_actions.reply_as_not_whisper.desc"),+ icon: "eye",+ id: "reply_as_not_whisper"+ });+ } else {+ items.push({+ name: I18n.t("composer.composer_actions.reply_as_whisper.label"),+ description: I18n.t("composer.composer_actions.reply_as_whisper.desc"),+ icon: "eye-slash",+ id: "reply_as_whisper"+ });+ }+ }++ return items;+ },++ _replyFromExisting(options) {+ const topicTitle = this.get("composerModel.topic.title");+ let url = this.get("composerModel.post.url") || this.get("composerModel.topic.url");++ this.get("composerController").open(options).then(() => {+ url = `${location.protocol}//${location.host}${url}`;+ const link = `[${Handlebars.escapeExpression(topicTitle)}](${url})`;+ this.get("composerController").get("model").prependText(`${I18n.t("post.continue_discussion", { postLink: link })}`, {new_line: true});+ });+ },++ actions: {+ onSelect(value) {+ switch(value) {+ case "reply_as_whisper":+ this.set("composerModel.whisper", true);+ this.get("composerController").save();+ break;++ case "reply_as_not_whisper":+ this.set("composerModel.whisper", false);+ this.get("composerController").save();+ break;++ case "reply_to_topic":+ this.set("composerModel.post", null);+ this.get("composerController").save();+ break;++ case "reply_as_new_topic":+ const replyAsNewTopicOpts = {+ action: Composer.CREATE_TOPIC,+ draftKey: Composer.REPLY_AS_NEW_TOPIC_KEY,+ categoryId: this.get("composerModel.topic.category.id")+ };+ this._replyFromExisting(replyAsNewTopicOpts);+ break;++ case "reply_as_private_message":+ const replyAsPrivateMsgOpts = {+ action: Composer.PRIVATE_MESSAGE,+ archetypeId: "private_message",+ draftKey: Composer.REPLY_AS_NEW_PRIVATE_MESSAGE_KEY,+ usernames: this.get("composerModel.post.username")+ };+ this._replyFromExisting(replyAsPrivateMsgOpts);+ break;+ }+ }+ }+});diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scssindex bd343963b35..5160d934ddb 100644--- a/app/assets/stylesheets/common/base/compose.scss+++ b/app/assets/stylesheets/common/base/compose.scss@@ -11,7 +11,7 @@max-width: 1475px;width: 100%;&.hide-preview {- max-width:740px;+ max-width:740px;}@media screen and (max-width: 1200px) {min-width: 0;@@ -29,7 +29,7 @@.saving-text,.draft-text {display: none;- padding-left: 10px;+ padding-left: 10px;.spinner {margin-left: 5px;border-color: $secondary;@@ -96,11 +96,25 @@color: $primary-high;}.reply-details {- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;max-width: calc(100% - 100px);}+ .composer-action-title {+ display: inline-flex;+ align-items: center;+ justify-content: space-between;++ .topic-link, .user-link, .username {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ max-width: calc(100%-125px);+ margin-right: 5px;+ }++ .d-icon {+ margin-right: 5px;+ }+ }.composer-controls {margin-left: auto;margin-right: -5px;@@ -378,4 +392,4 @@ div.ac-wrap {.md-table {overflow-y: auto;-}\ No newline at end of file+}diff --git a/app/assets/stylesheets/common/select-kit/composer-actions.scss b/app/assets/stylesheets/common/select-kit/composer-actions.scssnew file mode 100644index 00000000000..a2dace01076--- /dev/null+++ b/app/assets/stylesheets/common/select-kit/composer-actions.scss@@ -0,0 +1,22 @@+.select-kit {+ &.dropdown-select-box {+ &.composer-actions {+ margin: 0;+ .select-kit-header {+ background: none;+ outline: none;+ padding: 0;++ .d-icon {+ border: 1px solid $primary-low;+ padding: 5px;+ margin: 0;++ &:hover {+ background: $primary-low;+ }+ }+ }+ }+ }+}diff --git a/config/locales/client.ar.yml b/config/locales/client.ar.ymlindex dfe5b65c70d..fcbc996ac85 100644--- a/config/locales/client.ar.yml+++ b/config/locales/client.ar.yml@@ -1855,8 +1855,6 @@ ar:many: لقد حدّدت <b>{{count}}</b> منشور.other: لقد حدّدت <b>{{count}}</b> منشور.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "اقتبس"edit_reason: "السبب:"post_number: "المنشور {{number}}"diff --git a/config/locales/client.ca.yml b/config/locales/client.ca.ymlindex bd1bb04b051..7abb2bad4da 100644--- a/config/locales/client.ca.yml+++ b/config/locales/client.ca.yml@@ -1505,8 +1505,6 @@ ca:one: Has seleccionat <b>1</b> publicacióother: Has seleccionat <b>{{count}}</b> publicacions.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Cita"edit_reason: "Motiu:"post_number: "publicació {{number}}"diff --git a/config/locales/client.cs.yml b/config/locales/client.cs.ymlindex b4aff067586..1ccb8cd93ce 100644--- a/config/locales/client.cs.yml+++ b/config/locales/client.cs.yml@@ -1542,8 +1542,6 @@ cs:few: Máte označeny <b>{{count}}</b> příspěvky.other: Máte označeno <b>{{count}}</b> příspěvků.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Cituj"edit_reason: "Důvod: "post_number: "příspěvek č. {{number}}"diff --git a/config/locales/client.da.yml b/config/locales/client.da.ymlindex a48aaee063b..b652bd9ad8f 100644--- a/config/locales/client.da.yml+++ b/config/locales/client.da.yml@@ -1540,8 +1540,6 @@ da:one: Du har valgt <b>1</b> indlæg.other: Du har valgt <b>{{count}}</b> indlæg.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citér"edit_reason: "Reason: "post_number: "indlæg {{number}}"diff --git a/config/locales/client.de.yml b/config/locales/client.de.ymlindex 16fc0a2d619..c1fde58866d 100644--- a/config/locales/client.de.yml+++ b/config/locales/client.de.yml@@ -1695,8 +1695,6 @@ de:one: Du hast <b>1</b> Beitrag ausgewählt.other: Du hast <b>{{count}}</b> Beiträge ausgewählt.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Zitat"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "Grund: "diff --git a/config/locales/client.el.yml b/config/locales/client.el.ymlindex 51d9a38c548..5dee9bb3a9c 100644--- a/config/locales/client.el.yml+++ b/config/locales/client.el.yml@@ -1654,8 +1654,6 @@ el:one: Έχεις επιλέξει <b>1</b> ανάρτηση.other: Έχεις επιλέξει <b>{{count}}</b> αναρτήσεις.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Παράθεση"edit_reason: "Αιτία:"post_number: "ανάρτηση {{number}}"diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 2cfdb0e1d14..2a0127f39d7 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -1291,6 +1291,23 @@ en:admin_options_title: "Optional staff settings for this topic"+ composer_actions:+ reply_as_new_topic:+ label: Reply as linked topic+ desc: Create a new topic+ reply_as_private_message:+ label: New message+ desc: Create a private message+ reply_to_topic:+ label: Reply to topic+ desc: Reply to the original post without replying to a specific post+ reply_as_whisper:+ label: Reply as whipser+ desc: This message will only be visible by staff members+ reply_as_not_whisper:+ label: Reply as not whisher+ desc: This message will be visible by anyone+notifications:tooltip:regular:@@ -1882,8 +1899,6 @@ en:other: "You have selected <b>{{count}}</b> posts."post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Quote"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "Reason: "diff --git a/config/locales/client.es.yml b/config/locales/client.es.ymlindex 7d90c9c29da..5c3311303bb 100644--- a/config/locales/client.es.yml+++ b/config/locales/client.es.yml@@ -1702,8 +1702,6 @@ es:one: Has seleccionado <b>1</b> post.other: Has seleccionado <b>{{count}}</b> posts.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citar"edit: "<i class='fa fa-pencil'></i>{{link}} {{replyAvatar}} {{username}} "edit_reason: "Motivo:"diff --git a/config/locales/client.et.yml b/config/locales/client.et.ymlindex b5af3416329..081d116139b 100644--- a/config/locales/client.et.yml+++ b/config/locales/client.et.yml@@ -1599,8 +1599,6 @@ et:one: Oled valinud <b>1</b> postituse.other: Oled valinud <b>{{count}}</b> postitust.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Tsitaat"edit_reason: "Põhjus:"post_number: "postitus {{number}}"diff --git a/config/locales/client.fa_IR.yml b/config/locales/client.fa_IR.ymlindex 7324b3d6e5e..6af668a8b9d 100644--- a/config/locales/client.fa_IR.yml+++ b/config/locales/client.fa_IR.yml@@ -1512,8 +1512,6 @@ fa_IR:description:other: شما <b>{{count}}</b> نوشته انتخاب کرده ایدpost:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "نقلقول"edit_reason: "دلیل:"post_number: "نوشته {{number}}"diff --git a/config/locales/client.fi.yml b/config/locales/client.fi.ymlindex 80ff33b64e6..e900163c6dc 100644--- a/config/locales/client.fi.yml+++ b/config/locales/client.fi.yml@@ -1699,8 +1699,6 @@ fi:one: Olet valinnut <b>yhden</b> viestin.other: Olet valinnut <b>{{count}}</b> viestiä.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Lainaa"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "Syy:"diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.ymlindex fb23784f140..3ca5f14f9c0 100644--- a/config/locales/client.fr.yml+++ b/config/locales/client.fr.yml@@ -1695,8 +1695,6 @@ fr:one: vous avez sélectionné <b>1</b> message.other: Vous avez sélectionné <b>{{count}}</b> messages.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citer"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "Raison :"diff --git a/config/locales/client.gl.yml b/config/locales/client.gl.ymlindex b982402abaa..a70d651147b 100644--- a/config/locales/client.gl.yml+++ b/config/locales/client.gl.yml@@ -1188,8 +1188,6 @@ gl:one: Seleccionaches <b>unha</b> publicación.other: Seleccionaches <b>{{count}}</b> publicacións.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"edit_reason: "Razón:"post_number: "publicación {{number}}"last_edited_on: "última edición da publicación"diff --git a/config/locales/client.he.yml b/config/locales/client.he.ymlindex 3e7e7ddf0c7..c3a9655f087 100644--- a/config/locales/client.he.yml+++ b/config/locales/client.he.yml@@ -1561,8 +1561,6 @@ he:one: בחרתם פוסט אחד.other: בחרתם <b>{{count}}</b> פוסטים.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "ציטוט"edit_reason: "סיבה: "post_number: "פוסט {{number}}"diff --git a/config/locales/client.it.yml b/config/locales/client.it.ymlindex a6466033990..d42929dd86d 100644--- a/config/locales/client.it.yml+++ b/config/locales/client.it.yml@@ -1691,8 +1691,6 @@ it:one: Hai selezionato <b>1</b> messaggio.other: Hai selezionato <b>{{count}}</b> messaggi.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Cita"edit_reason: "Motivo:"post_number: "messaggio {{number}}"diff --git a/config/locales/client.ja.yml b/config/locales/client.ja.ymlindex 2db0766819e..f39726ff713 100644--- a/config/locales/client.ja.yml+++ b/config/locales/client.ja.yml@@ -1567,8 +1567,6 @@ ja:description:other: <b>{{count}}</b>個の投稿を選択中。post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "引用"edit_reason: "理由: "post_number: "投稿{{number}}"diff --git a/config/locales/client.ko.yml b/config/locales/client.ko.ymlindex 4a726211067..90581f22b43 100644--- a/config/locales/client.ko.yml+++ b/config/locales/client.ko.yml@@ -1578,8 +1578,6 @@ ko:description:other: <b>{{count}}</b>개의 개시글을 선택하셨어요.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "인용하기"edit_reason: "Reason: "post_number: "{{number}}번째 글"diff --git a/config/locales/client.lv.yml b/config/locales/client.lv.ymlindex ed00ec83da5..df3d7e95919 100644--- a/config/locales/client.lv.yml+++ b/config/locales/client.lv.yml@@ -1623,8 +1623,6 @@ lv:one: Jūs esat izvēlējies <b>1</b> ierakstu.other: Jūs esat izvēlējies <b>{{count}}</b> ierakstus.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citāts"edit_reason: "Iemesls:"post_number: "ieraksts {{number}}"diff --git a/config/locales/client.nb_NO.yml b/config/locales/client.nb_NO.ymlindex 6c5b33a3f24..57258dd4199 100644--- a/config/locales/client.nb_NO.yml+++ b/config/locales/client.nb_NO.yml@@ -1702,8 +1702,6 @@ nb_NO:one: Du har valgt <b>1</b> innlegg.other: Du har valgt <b>{{count}}</b> innlegg.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Sitat"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "Begrunnelse:"diff --git a/config/locales/client.nl.yml b/config/locales/client.nl.ymlindex c50421b1a15..05d96910efd 100644--- a/config/locales/client.nl.yml+++ b/config/locales/client.nl.yml@@ -1623,8 +1623,6 @@ nl:one: U hebt <b>1</b> bericht geselecteerd.other: U hebt <b>{{count}}</b> berichten geselecteerd.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citeren"edit_reason: "Reden: "post_number: "bericht {{number}}"diff --git a/config/locales/client.pl_PL.yml b/config/locales/client.pl_PL.ymlindex 44980ea0d07..373ccc956c8 100644--- a/config/locales/client.pl_PL.yml+++ b/config/locales/client.pl_PL.yml@@ -1784,8 +1784,6 @@ pl_PL:many: Wybrano <b>{{count}}</b> wpisów.other: Wybrano <b>{{count}}</b> wpisów.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Cytuj"edit_reason: "Powód"post_number: "wpis {{number}}"diff --git a/config/locales/client.pt.yml b/config/locales/client.pt.ymlindex fd667b5ac22..641d809ba4a 100644--- a/config/locales/client.pt.yml+++ b/config/locales/client.pt.yml@@ -1514,8 +1514,6 @@ pt:one: Selecionou <b>1</b> publicação.other: Selecionou <b>{{count}}</b> publicações.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citar"edit_reason: "Motivo:"post_number: "publicação {{number}}"diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.ymlindex f94403a25e3..95838a2e05b 100644--- a/config/locales/client.pt_BR.yml+++ b/config/locales/client.pt_BR.yml@@ -1581,8 +1581,6 @@ pt_BR:one: <b>1</b> resposta selecionada.other: <b>{{count}}</b> respostas selecionadas.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citação"edit_reason: "Motivo:"post_number: "resposta {{number}}"diff --git a/config/locales/client.ro.yml b/config/locales/client.ro.ymlindex 11a6e9f587b..795e66f6503 100644--- a/config/locales/client.ro.yml+++ b/config/locales/client.ro.yml@@ -1487,8 +1487,6 @@ ro:few: Ai selectat <b>{{count}}</b> mesaje.other: Ai selectat <b>{{count}}</b> de mesaje.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citează"edit_reason: "Motivul edit[rii: "post_number: "postarea {{number}}"diff --git a/config/locales/client.ru.yml b/config/locales/client.ru.ymlindex f0421e01e98..211f98c3bb8 100644--- a/config/locales/client.ru.yml+++ b/config/locales/client.ru.yml@@ -1687,8 +1687,6 @@ ru:many: Вы выбрали <b>{{count}}</b> сообщений.other: Вы выбрали <b>{{count}}</b> сообщений.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Цитата"edit_reason: "Причина:"post_number: "сообщение {{number}}"diff --git a/config/locales/client.sk.yml b/config/locales/client.sk.ymlindex 928dea873a5..873a2d0353f 100644--- a/config/locales/client.sk.yml+++ b/config/locales/client.sk.yml@@ -1428,8 +1428,6 @@ sk:few: Označili ste <b>{{count}}</b> príspevkyother: Označili ste <b>{{count}}</b> príspevkovpost:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citácia"edit_reason: "Dôvod:"post_number: "príspevok {{number}}"diff --git a/config/locales/client.sq.yml b/config/locales/client.sq.ymlindex 665b5e622b8..ceca48bba6b 100644--- a/config/locales/client.sq.yml+++ b/config/locales/client.sq.yml@@ -1391,8 +1391,6 @@ sq:one: Keni përzgjedhur <b>1</b> postim.other: Keni përzgjedhur <b>{{count}}</b> postime.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"edit_reason: "Arsyeja:"post_number: "postimi {{number}}"last_edited_on: "redaktimi i fundit u krye më"diff --git a/config/locales/client.sv.yml b/config/locales/client.sv.ymlindex f2bcf7ae5e0..bbb3959bf5c 100644--- a/config/locales/client.sv.yml+++ b/config/locales/client.sv.yml@@ -1485,8 +1485,6 @@ sv:one: Du har markerat <b>1</b> inlägg.other: Du har markerat <b>{{count}}</b> inlägg.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Citat"edit_reason: "Anledning:"post_number: "inlägg {{number}}"diff --git a/config/locales/client.th.yml b/config/locales/client.th.ymlindex 4b4130e1ae2..d78a454e767 100644--- a/config/locales/client.th.yml+++ b/config/locales/client.th.yml@@ -1129,8 +1129,6 @@ th:description:other: คุณได้เลือก <b>{{count}}</b> โพสต์.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"edit_reason: "เหตุผล:"post_number: "โพสต์ {{number}}"last_edited_on: "โพสแก้ไขล่าสุดเมื่อ"diff --git a/config/locales/client.tr_TR.yml b/config/locales/client.tr_TR.ymlindex 0b5a6255f29..c5a7a4275c3 100644--- a/config/locales/client.tr_TR.yml+++ b/config/locales/client.tr_TR.yml@@ -1501,8 +1501,6 @@ tr_TR:description:other: <b>{{count}}</b> gönderi seçtiniz.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Alıntı"edit_reason: "Neden: "post_number: "gönderi {{number}}"diff --git a/config/locales/client.ur.yml b/config/locales/client.ur.ymlindex 21604d91b50..0e7c1899e3e 100644--- a/config/locales/client.ur.yml+++ b/config/locales/client.ur.yml@@ -1443,8 +1443,6 @@ ur:one: آپ نے <b>1</b> پوسٹ منتخب کی ہے۔other: آپ نے <b>{{count}}</b> پوسٹس منتخب کی ہیں۔post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "اقتباس کریں"edit_reason: "وجہ:"post_number: "پوسٹ {{number}}"diff --git a/config/locales/client.vi.yml b/config/locales/client.vi.ymlindex 143b0a6fad4..30a91db4cd2 100644--- a/config/locales/client.vi.yml+++ b/config/locales/client.vi.yml@@ -1414,8 +1414,6 @@ vi:description:other: Bạn đã chọn <b>{{count}}</b> bài viết.post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "Trích dẫn"edit_reason: "Lý do: "post_number: "bài viết {{number}}"diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.ymlindex 35835966f2e..e2e11312579 100644--- a/config/locales/client.zh_CN.yml+++ b/config/locales/client.zh_CN.yml@@ -1623,8 +1623,6 @@ zh_CN:description:other: 已选择 <b>{{count}}</b> 个帖子。post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "引用"edit: "<i class='fa fa-pencil'></i> {{link}} {{replyAvatar}} {{username}}"edit_reason: "理由:"diff --git a/config/locales/client.zh_TW.yml b/config/locales/client.zh_TW.ymlindex 6fd464b20e9..0a26c393e2a 100644--- a/config/locales/client.zh_TW.yml+++ b/config/locales/client.zh_TW.yml@@ -1404,8 +1404,6 @@ zh_TW:description:other: 你已選擇了 <b>{{count}}</b> 篇文章。post:- reply: "<i class='fa fa-mail-forward'></i> {{replyAvatar}} {{usernameLink}}"- reply_topic: "<i class='fa fa-mail-forward'></i> {{link}}"quote_reply: "引用"edit_reason: "原因: "post_number: "文章 {{number}}"diff --git a/test/javascripts/acceptance/composer-actions-test.js.es6 b/test/javascripts/acceptance/composer-actions-test.js.es6new file mode 100644index 00000000000..f8b848389ae--- /dev/null+++ b/test/javascripts/acceptance/composer-actions-test.js.es6@@ -0,0 +1,101 @@+import { acceptance } from 'helpers/qunit-helpers';++acceptance('Composer Actions', {+ loggedIn: true,+ settings: {+ enable_whispers: true+ }+});++QUnit.test('replying to post', assert => {+ const composerActions = selectKit('.composer-actions');++ visit('/t/internationalization-localization/280');+ click('article#post_3 button.reply');++ composerActions.expand();++ andThen(() => {+ assert.equal(composerActions.rowByIndex(0).value(), 'reply_as_new_topic');+ assert.equal(composerActions.rowByIndex(1).value(), 'reply_as_private_message');+ assert.equal(composerActions.rowByIndex(2).value(), 'reply_to_topic');+ assert.equal(composerActions.rowByIndex(3).value(), 'reply_as_whisper');+ });+});++QUnit.test('replying to post - reply_as_private_message', assert => {+ const composerActions = selectKit('.composer-actions');++ visit('/t/internationalization-localization/280');+ click('article#post_3 button.reply');++ composerActions.expand().selectRowByValue('reply_as_private_message');++ andThen(() => {+ assert.equal(find('.users-input .item:eq(0)').text(), 'codinghorror');+ assert.ok(find('.d-editor-input').val().indexOf('Continuing the discussion') >= 0);+ });+});++QUnit.test('replying to post - reply_to_topic', assert => {+ const composerActions = selectKit('.composer-actions');++ visit('/t/internationalization-localization/280');+ click('article#post_3 button.reply');+ fillIn('.d-editor-input', 'test replying to topic when intially replied to post');+ composerActions.expand().selectRowByValue('reply_to_topic');++ andThen(() => {+ assert.equal(find('.topic-post:last .cooked p').html().trim(), 'test replying to topic when intially replied to post');+ assert.notOk(exists(find('.topic-post:last .reply-to-tab')));+ });+});++QUnit.test('replying to post - reply_as_whisper', assert => {+ const composerActions = selectKit('.composer-actions');++ visit('/t/internationalization-localization/280');+ click('article#post_3 button.reply');+ fillIn('.d-editor-input', 'test replying as whisper to topic when intially not a whisper');+ composerActions.expand().selectRowByValue('reply_as_whisper');++ andThen(() => {+ assert.ok(exists(find('.topic-post:last .post-info.whisper')));+ assert.equal(find('.topic-post:last .cooked p').html().trim(), 'test replying as whisper to topic when intially not a whisper');+ });+});++QUnit.test('replying to post - reply_as_not_whisper', assert => {+ const composerActions = selectKit('.composer-actions');++ visit('/t/internationalization-localization/280');+ click('article#post_3 button.reply');+ fillIn('.d-editor-input', 'test replying as not a whisper to topic when intially a whisper');+ selectKit('.toolbar-popup-menu-options').expand().selectRowByValue('toggleWhisper');+ composerActions.expand().selectRowByValue('reply_as_not_whisper');++ andThen(() => {+ assert.notOk(exists(find('.topic-post:last .post-info.whisper')));+ assert.equal(find('.topic-post:last .cooked p').html().trim(), 'test replying as not a whisper to topic when intially a whisper');+ });+});++QUnit.test('replying to post - reply_as_new_topic', assert => {+ const composerActions = selectKit('.composer-actions');+ const categoryChooser = selectKit('.title-wrapper .category-chooser');+ const categoryChooserReplyArea = selectKit('.reply-area .category-chooser');++ visit('/t/internationalization-localization/280');++ click('#topic-title .d-icon-pencil');+ categoryChooser.expand().selectRowByValue(4);+ click('#topic-title .submit-edit');++ click('article#post_3 button.reply');+ composerActions.expand().selectRowByValue('reply_as_new_topic');++ andThen(() => {+ assert.equal(categoryChooserReplyArea.header().name(), 'faq');+ assert.ok(find('.d-editor-input').val().indexOf('Continuing the discussion') >= 0);+ });+});