[NEW] - Add setting to request a comment when closing Livechat room#13983
Merged
renatobecker-zz merged 5 commits intoRocketChat:developfrom Apr 3, 2019
Merged
[NEW] - Add setting to request a comment when closing Livechat room#13983renatobecker-zz merged 5 commits intoRocketChat:developfrom
renatobecker-zz merged 5 commits intoRocketChat:developfrom
Conversation
renatobecker-zz
suggested changes
Apr 3, 2019
| }); | ||
| } else { | ||
| const comment = TAPi18n.__('Chat_closed_by_agent'); | ||
| Meteor.call('livechat:closeRoom', this.rid, comment, function(error/* , result*/) { |
There was a problem hiding this comment.
This code is duplicated. Why not just creating a const (arrow function) and then pass the comment as a parameter?
| modal.showInputError(t('Please_add_a_comment_to_close_the_room')); | ||
| return false; | ||
| } | ||
| if (settings.get('Livechat_conversation_finished_message_enabled')) { |
There was a problem hiding this comment.
Please, add a const (arrow function) before this line, and then you can just do something like this:
const closeRoom = (comment) => ...here you can call Meteor.call('livechat:closeRoom' ....
if (!settings.get('Livechat_conversation_finished_message_enabled')) {
return closeRoom(...);
}
... here you can call de modal... closeRoom... and so on..
app/livechat/server/config.js
Outdated
| settings.add('Livechat_allow_switching_departments', true, { type: 'boolean', group: 'Livechat', public: true, i18nLabel: 'Allow_switching_departments' }); | ||
| settings.add('Livechat_show_agent_email', true, { type: 'boolean', group: 'Livechat', public: true, i18nLabel: 'Show_agent_email' }); | ||
|
|
||
| settings.add('Livechat_conversation_finished_message_enabled', true, { |
There was a problem hiding this comment.
Suggested change
| settings.add('Livechat_conversation_finished_message_enabled', true, { | |
| settings.add('Livechat_request_comment_when_closing_conversation', true, { |
request comment when ending live chat conversation
There was a problem hiding this comment.
@knrt10, once we change the name of the setting, you need to change it's translations string as well.
Contributor
Author
|
Updated |
renatobecker-zz
suggested changes
Apr 3, 2019
app/livechat/server/config.js
Outdated
| type: 'boolean', | ||
| group: 'Livechat', | ||
| public: true, | ||
| i18nLabel: 'Ask_for_conversation_finished_message', |
There was a problem hiding this comment.
You need to change the translation strings too.
renatobecker-zz
suggested changes
Apr 3, 2019
| "Are_you_sure": "Are you sure?", | ||
| "Are_you_sure_you_want_to_delete_your_account": "Are you sure you want to delete your account?", | ||
| "Are_you_sure_you_want_to_disable_Facebook_integration": "Are you sure you want to disable Facebook integration?", | ||
| "Livechat_request_comment_when_closing_conversation": "Livechat request comment when closing conversation", |
There was a problem hiding this comment.
- This translation is not in the right order;
- Remove
LivechatFrom both string;
| "Chatpal_Timeout_Size_Description": "The time between 2 index windows in ms (on bootstrapping)", | ||
| "Chatpal_Users": "Users", | ||
| "Chatpal_Welcome": "Enjoy your search!", | ||
| "Chat_closed_by_agent": "Chat closed by agent", |
There was a problem hiding this comment.
- This translation is not in the right order;
renatobecker-zz
approved these changes
Apr 3, 2019
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12428
cc @renatobecker would you please review and add livechat label to it.