${ backupCodes }
`;
- swal({
+ modal.open({
title: t('Backup_codes'),
text: `${ t('Make_sure_you_have_a_copy_of_your_codes', { codes }) }`,
html: true
diff --git a/packages/rocketchat-authorization/client/views/permissionsRole.js b/packages/rocketchat-authorization/client/views/permissionsRole.js
index be70ede7d007..542461439333 100644
--- a/packages/rocketchat-authorization/client/views/permissionsRole.js
+++ b/packages/rocketchat-authorization/client/views/permissionsRole.js
@@ -105,7 +105,7 @@ Template.permissionsRole.helpers({
Template.permissionsRole.events({
'click .remove-user'(e, instance) {
e.preventDefault();
- swal({
+ modal.open({
title: t('Are_you_sure'),
type: 'warning',
showCancelButton: true,
@@ -120,7 +120,7 @@ Template.permissionsRole.events({
return handleError(error);
}
- swal({
+ modal.open({
title: t('Removed'),
text: t('User_removed'),
type: 'success',
diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js
index a5fe524a756b..3370645d43f2 100644
--- a/packages/rocketchat-channel-settings/client/views/channelSettings.js
+++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js
@@ -83,7 +83,7 @@ Template.channelSettings.helpers({
Template.channelSettings.events({
'click .delete'() {
- return swal({
+ modal.open({
title: t('Are_you_sure'),
text: t('Delete_Room_Warning'),
type: 'warning',
@@ -94,13 +94,11 @@ Template.channelSettings.events({
closeOnConfirm: false,
html: false
}, () => {
- swal.disableButtons();
Meteor.call('eraseRoom', this.rid, function(error) {
if (error) {
- handleError(error);
- return swal.enableButtons();
+ return handleError(error);
}
- swal({
+ modal.open({
title: t('Deleted'),
text: t('Room_has_been_deleted'),
type: 'success',
@@ -309,7 +307,7 @@ Template.channelSettings.onCreated(function() {
};
if (room['default']) {
if (RocketChat.authz.hasRole(Meteor.userId(), 'admin')) {
- swal({
+ modal.open({
title: t('Room_default_change_to_private_will_be_default_no_more'),
type: 'warning',
showCancelButton: true,
@@ -388,7 +386,7 @@ Template.channelSettings.onCreated(function() {
return RocketChat.authz.hasAtLeastOnePermission(['archive-room', 'unarchive-room'], room._id);
},
save(value, room) {
- return swal({
+ modal.open({
title: t('Are_you_sure'),
type: 'warning',
showCancelButton: true,
@@ -398,16 +396,14 @@ Template.channelSettings.onCreated(function() {
closeOnConfirm: false,
html: false
}, function(confirmed) {
- swal.disableButtons();
if (confirmed) {
const action = value ? 'archiveRoom' : 'unarchiveRoom';
- return Meteor.call(action, room._id, function(err) {
+ Meteor.call(action, room._id, function(err) {
if (err) {
- swal.enableButtons();
handleError(err);
}
- swal({
+ modal.open({
title: value ? t('Room_archived') : t('Room_has_been_archived'),
text: value ? t('Room_has_been_archived') : t('Room_has_been_unarchived'),
type: 'success',
@@ -415,7 +411,7 @@ Template.channelSettings.onCreated(function() {
showConfirmButton: false
});
- return RocketChat.callbacks.run(action, room);
+ RocketChat.callbacks.run(action, room);
});
} else {
return $('.channel-settings form [name=\'archived\']').prop('checked', !!room.archived);
diff --git a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js
index 1a40506fed3c..81fe003aba48 100644
--- a/packages/rocketchat-custom-sounds/client/admin/soundInfo.js
+++ b/packages/rocketchat-custom-sounds/client/admin/soundInfo.js
@@ -39,7 +39,7 @@ Template.soundInfo.events({
const sound = instance.sound.get();
if (sound != null) {
const _id = sound._id;
- swal({
+ modal.open({
title: t('Are_you_sure'),
text: t('Custom_Sound_Delete_Warning'),
type: 'warning',
@@ -50,14 +50,11 @@ Template.soundInfo.events({
closeOnConfirm: false,
html: false
}, function() {
- swal.disableButtons();
-
Meteor.call('deleteCustomSound', _id, (error/*, result*/) => {
if (error) {
handleError(error);
- swal.enableButtons();
} else {
- swal({
+ modal.open({
title: t('Deleted'),
text: t('Custom_Sound_Has_Been_Deleted'),
type: 'success',
diff --git a/packages/rocketchat-emoji-custom/admin/emojiInfo.js b/packages/rocketchat-emoji-custom/admin/emojiInfo.js
index f839c38312dd..5758043bb5e7 100644
--- a/packages/rocketchat-emoji-custom/admin/emojiInfo.js
+++ b/packages/rocketchat-emoji-custom/admin/emojiInfo.js
@@ -47,7 +47,7 @@ Template.emojiInfo.events({
const emoji = instance.emoji.get();
if (emoji != null) {
const _id = emoji._id;
- swal({
+ modal.open({
title: t('Are_you_sure'),
text: t('Custom_Emoji_Delete_Warning'),
type: 'warning',
@@ -58,14 +58,11 @@ Template.emojiInfo.events({
closeOnConfirm: false,
html: false
}, function() {
- swal.disableButtons();
-
Meteor.call('deleteEmojiCustom', _id, (error/*, result*/) => {
if (error) {
- handleError(error);
- swal.enableButtons();
+ return handleError(error);
} else {
- swal({
+ modal.open({
title: t('Deleted'),
text: t('Custom_Emoji_Has_Been_Deleted'),
type: 'success',
diff --git a/packages/rocketchat-integrations/client/views/integrationsIncoming.js b/packages/rocketchat-integrations/client/views/integrationsIncoming.js
index 38e4ebfcc7a3..e872eaba9c09 100644
--- a/packages/rocketchat-integrations/client/views/integrationsIncoming.js
+++ b/packages/rocketchat-integrations/client/views/integrationsIncoming.js
@@ -159,7 +159,7 @@ Template.integrationsIncoming.events({
'click .submit > .delete': () => {
const params = Template.instance().data.params();
- swal({
+ modal.open({
title: t('Are_you_sure'),
text: t('You_will_not_be_able_to_recover'),
type: 'warning',
@@ -172,9 +172,9 @@ Template.integrationsIncoming.events({
}, () => {
Meteor.call('deleteIncomingIntegration', params.id, (err) => {
if (err) {
- handleError(err);
+ return handleError(err);
} else {
- swal({
+ modal.open({
title: t('Deleted'),
text: t('Your_entry_has_been_deleted'),
type: 'success',
diff --git a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js
index 77f4ddf0748e..415650371fd1 100644
--- a/packages/rocketchat-integrations/client/views/integrationsOutgoing.js
+++ b/packages/rocketchat-integrations/client/views/integrationsOutgoing.js
@@ -224,7 +224,7 @@ Template.integrationsOutgoing.events({
'click .submit > .delete': () => {
const params = Template.instance().data.params();
- swal({
+ modal.open({
title: t('Are_you_sure'),
text: t('You_will_not_be_able_to_recover'),
type: 'warning',
@@ -239,7 +239,7 @@ Template.integrationsOutgoing.events({
if (err) {
handleError(err);
} else {
- swal({
+ modal.open({
title: t('Deleted'),
text: t('Your_entry_has_been_deleted'),
type: 'success',
diff --git a/packages/rocketchat-lib/client/lib/settings.js b/packages/rocketchat-lib/client/lib/settings.js
index 03896cd11514..5614cf2b7c1e 100644
--- a/packages/rocketchat-lib/client/lib/settings.js
+++ b/packages/rocketchat-lib/client/lib/settings.js
@@ -61,7 +61,7 @@ Meteor.startup(function() {
Meteor.setTimeout(function() {
const currentUrl = location.origin + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
if (__meteor_runtime_config__.ROOT_URL.replace(/\/$/, '') !== currentUrl) {
- swal({
+ modal.open({
type: 'warning',
title: t('Warning'),
text: `${ t('The_setting_s_is_configured_to_s_and_you_are_accessing_from_s', t('Site_Url'), siteUrl, currentUrl) }