-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] - Add setting to request a comment when closing Livechat room #13983
Conversation
}); | ||
} 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -80,6 +80,13 @@ Meteor.startup(function() { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knrt10, once we change the name of the setting, you need to change it's translations string as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let me update
Updated |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to change the translation strings too.
@@ -360,6 +360,7 @@ | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This translation is not in the right order;
- Remove
Livechat
From both string;
@@ -567,6 +568,7 @@ | |||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This translation is not in the right order;
Closes #12428
cc @renatobecker would you please review and add livechat label to it.