Skip to content

Commit

Permalink
UX: change composer button text to 'whisper' when whispering
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Nov 10, 2017
1 parent 73aa7ed commit 6cd6952
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/assets/javascripts/discourse/models/composer.js.es6
Expand Up @@ -46,6 +46,12 @@ const CLOSED = 'closed',
featuredLink: 'topic.featured_link'
};

const _saveLabels = {};
_saveLabels[EDIT] = 'composer.save_edit';
_saveLabels[REPLY] = 'composer.reply';
_saveLabels[CREATE_TOPIC] = 'composer.create_topic';
_saveLabels[PRIVATE_MESSAGE] = 'composer.create_pm';

const Composer = RestModel.extend({
_categoryId: null,
unlistTopic: false,
Expand Down Expand Up @@ -250,14 +256,9 @@ const Composer = RestModel.extend({
}
},

@computed('action')
saveLabel(action) {
switch (action) {
case EDIT: return 'composer.save_edit';
case REPLY: return 'composer.reply';
case CREATE_TOPIC: return 'composer.create_topic';
case PRIVATE_MESSAGE: return 'composer.create_pm';
}
@computed('action', 'whisper')
saveLabel(action, whisper) {
return whisper ? 'composer.create_whisper' : _saveLabels[action];
},

hasMetaData: function() {
Expand Down
1 change: 1 addition & 0 deletions config/locales/client.en.yml
Expand Up @@ -1218,6 +1218,7 @@ en:
cancel: "Cancel"
create_topic: "Create Topic"
create_pm: "Message"
create_whisper: "Whisper"
title: "Or press Ctrl+Enter"

users_placeholder: "Add a user"
Expand Down

2 comments on commit 6cd6952

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/help-us-test-the-composer/72745/96

@eviltrout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.