Skip to content
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

Merged
merged 5 commits into from
Apr 3, 2019

Conversation

knrt10
Copy link
Contributor

@knrt10 knrt10 commented Apr 2, 2019

Closes #12428

cc @renatobecker would you please review and add livechat label to it.

});
} else {
const comment = TAPi18n.__('Chat_closed_by_agent');
Meteor.call('livechat:closeRoom', this.rid, comment, function(error/* , result*/) {

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')) {

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..

@@ -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, {

Choose a reason for hiding this comment

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

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, let me update

@renatobecker-zz renatobecker-zz added this to the 1.0.0 milestone Apr 3, 2019
@knrt10
Copy link
Contributor Author

knrt10 commented Apr 3, 2019

Updated

type: 'boolean',
group: 'Livechat',
public: true,
i18nLabel: 'Ask_for_conversation_finished_message',

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",

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",

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;

@renatobecker-zz renatobecker-zz changed the title [IMPROVEMENT] - Deactivation of closing comment [NEW] - Add setting to request a comment when closing Livechat room Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Livechat] Improvement - Deactivation of closing comment
4 participants