Skip to content

[NEW] - Add setting to request a comment when closing Livechat room#13983

Merged
renatobecker-zz merged 5 commits intoRocketChat:developfrom
knrt10:issue12428
Apr 3, 2019
Merged

[NEW] - Add setting to request a comment when closing Livechat room#13983
renatobecker-zz merged 5 commits intoRocketChat:developfrom
knrt10:issue12428

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

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.

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

"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

Comments