diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index f4eb54e336fa..86af90653453 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1109,8 +1109,8 @@ "Livechat_Dashboard": "Livechat Dashboard", "Livechat_enabled": "Livechat enabled", "Livechat_Facebook_Enabled": "Facebook integration enabled", - "Livechat_Facebook_API_Key": "Facebook API Key", - "Livechat_Facebook_API_Secret": "Facebook API Secret", + "Livechat_Facebook_API_Key": "OmniChannel API Key", + "Livechat_Facebook_API_Secret": "OmniChannel API Secret", "Livechat_forward_open_chats": "Forward open chats", "Livechat_forward_open_chats_timeout": "Timeout (in seconds) to forward chats", "Livechat_guest_count": "Guest Counter", diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js index 75bbdce564b3..1fa2bd58e3ca 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js @@ -1,5 +1,3 @@ -/* globals swal */ - Template.livechatIntegrationFacebook.helpers({ pages() { return Template.instance().pages.get(); @@ -35,7 +33,7 @@ Template.livechatIntegrationFacebook.onCreated(function() { this.result = (successFn, errorFn = () => {}) => { return (error, result) => { - if (result.success === false && (result.type === 'OAuthException' || typeof result.url !== 'undefined')) { + if (result && result.success === false && (result.type === 'OAuthException' || typeof result.url !== 'undefined')) { const oauthWindow = window.open(result.url, 'facebook-integration-oauth', 'width=600,height=400'); const checkInterval = setInterval(() => { @@ -48,7 +46,7 @@ Template.livechatIntegrationFacebook.onCreated(function() { } if (error) { errorFn(error); - return swal({ + return modal.open({ title: t('Error_loading_pages'), text: error.reason, type: 'error' @@ -93,7 +91,7 @@ Template.livechatIntegrationFacebook.events({ 'click .disable'(event, instance) { event.preventDefault(); - swal({ + modal.open({ title: t('Disable_Facebook_integration'), text: t('Are_you_sure_you_want_to_disable_Facebook_integration'), type: 'warning', @@ -111,7 +109,7 @@ Template.livechatIntegrationFacebook.events({ instance.enabled.set(false); instance.pages.set([]); - swal({ + modal.open({ title: t('Disabled'), text: t('Integration_disabled'), type: 'success', diff --git a/packages/rocketchat-ui/client/views/app/modal.js b/packages/rocketchat-ui/client/views/app/modal.js index 1d2c05478f64..4458b07030cf 100644 --- a/packages/rocketchat-ui/client/views/app/modal.js +++ b/packages/rocketchat-ui/client/views/app/modal.js @@ -3,7 +3,7 @@ this.modal = { renderedModal: null, open(config = {}, fn) { - config.confirmButtonText = config.confirmButtonText || t('Send'); + config.confirmButtonText = config.confirmButtonText || (config.type === 'error' ? t('Ok') : t('Send')); config.cancelButtonText = config.cancelButtonText || t('Cancel'); config.closeOnConfirm = config.closeOnConfirm == null ? true : config.closeOnConfirm; config.showConfirmButton = config.showConfirmButton == null ? true : config.showConfirmButton;