diff --git a/packages/rocketchat-livechat/client/lib/dateHandler.js b/packages/rocketchat-livechat/client/lib/dateHandler.js index d3263e424898..9e7a37b4b08e 100644 --- a/packages/rocketchat-livechat/client/lib/dateHandler.js +++ b/packages/rocketchat-livechat/client/lib/dateHandler.js @@ -1,4 +1,4 @@ -import { handleError } from 'meteor/rocketchat:lib'; +import { handleError } from 'meteor/rocketchat:utils'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/roomType.js b/packages/rocketchat-livechat/client/roomType.js index 013bff416eb2..3a96ff50cfc4 100644 --- a/packages/rocketchat-livechat/client/roomType.js +++ b/packages/rocketchat-livechat/client/roomType.js @@ -1,4 +1,4 @@ -import { RocketChat } from 'meteor/rocketchat:lib'; +import { roomTypes } from 'meteor/rocketchat:utils'; import LivechatRoomType from '../lib/LivechatRoomType'; -RocketChat.roomTypes.add(new LivechatRoomType()); +roomTypes.add(new LivechatRoomType()); diff --git a/packages/rocketchat-livechat/client/route.js b/packages/rocketchat-livechat/client/route.js index dc3431b20b78..6686da5278c6 100644 --- a/packages/rocketchat-livechat/client/route.js +++ b/packages/rocketchat-livechat/client/route.js @@ -1,5 +1,5 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; -import { AccountBox } from 'meteor/rocketchat:ui'; +import { AccountBox } from 'meteor/rocketchat:ui-utils'; const livechatManagerRoutes = FlowRouter.group({ prefix: '/livechat-manager', diff --git a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js index 355ee7a8e24c..2b840ce185fa 100644 --- a/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js +++ b/packages/rocketchat-livechat/client/startup/notifyUnreadRooms.js @@ -1,6 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { RocketChat } from 'meteor/rocketchat:lib'; +import { settings } from 'meteor/rocketchat:settings'; +import { getUserPreference } from 'meteor/rocketchat:utils'; +import { Subscriptions, Users } from 'meteor/rocketchat:models'; let audio = null; @@ -22,24 +24,24 @@ const play = (audio) => { Meteor.startup(function() { Tracker.autorun(function() { - if (!RocketChat.settings.get('Livechat_continuous_sound_notification_new_livechat_room')) { + if (!settings.get('Livechat_continuous_sound_notification_new_livechat_room')) { stop(audio); return; } - const subs = RocketChat.models.Subscriptions.find({ t: 'l', ls : { $exists: 0 }, open: true }).count(); + const subs = Subscriptions.find({ t: 'l', ls : { $exists: 0 }, open: true }).count(); if (subs === 0) { stop(audio); return; } - const user = RocketChat.models.Users.findOne(Meteor.userId(), { + const user = Users.findOne(Meteor.userId(), { fields: { 'settings.preferences.newRoomNotification': 1, }, }); - const newRoomNotification = RocketChat.getUserPreference(user, 'newRoomNotification'); + const newRoomNotification = getUserPreference(user, 'newRoomNotification'); [audio] = $(`#${ newRoomNotification }`); play(audio); diff --git a/packages/rocketchat-livechat/client/ui.js b/packages/rocketchat-livechat/client/ui.js index bff93a4e0177..2de5ebfe61d6 100644 --- a/packages/rocketchat-livechat/client/ui.js +++ b/packages/rocketchat-livechat/client/ui.js @@ -1,15 +1,16 @@ -import { RocketChat } from 'meteor/rocketchat:lib'; -import { AccountBox } from 'meteor/rocketchat:ui'; +import { settings } from 'meteor/rocketchat:settings'; +import { hasAllPermission } from 'meteor/rocketchat:authorization'; +import { AccountBox, TabBar, MessageTypes } from 'meteor/rocketchat:ui-utils'; AccountBox.addItem({ name: 'Livechat', icon: 'livechat', href: 'livechat-current-chats', sideNav: 'livechatFlex', - condition: () => RocketChat.settings.get('Livechat_enabled') && RocketChat.authz.hasAllPermission('view-livechat-manager'), + condition: () => settings.get('Livechat_enabled') && hasAllPermission('view-livechat-manager'), }); -RocketChat.TabBar.addButton({ +TabBar.addButton({ groups: ['live'], id: 'visitor-info', i18nTitle: 'Visitor_Info', @@ -18,7 +19,7 @@ RocketChat.TabBar.addButton({ order: 0, }); -RocketChat.TabBar.addButton({ +TabBar.addButton({ groups: ['live'], id: 'visitor-history', i18nTitle: 'Past_Chats', @@ -27,13 +28,13 @@ RocketChat.TabBar.addButton({ order: 11, }); -RocketChat.TabBar.addGroup('message-search', ['live']); -RocketChat.TabBar.addGroup('starred-messages', ['live']); -RocketChat.TabBar.addGroup('uploaded-files-list', ['live']); -RocketChat.TabBar.addGroup('push-notifications', ['live']); -RocketChat.TabBar.addGroup('video', ['live']); +TabBar.addGroup('message-search', ['live']); +TabBar.addGroup('starred-messages', ['live']); +TabBar.addGroup('uploaded-files-list', ['live']); +TabBar.addGroup('push-notifications', ['live']); +TabBar.addGroup('video', ['live']); -RocketChat.TabBar.addButton({ +TabBar.addButton({ groups: ['live'], id: 'external-search', i18nTitle: 'Knowledge_Base', @@ -42,7 +43,7 @@ RocketChat.TabBar.addButton({ order: 10, }); -RocketChat.MessageTypes.registerType({ +MessageTypes.registerType({ id: 'livechat-close', system: true, message: 'Conversation_closed', diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js index 20e035043f08..3bd14fc228cb 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalytics.js @@ -2,8 +2,8 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { Template } from 'meteor/templating'; -import { handleError } from 'meteor/rocketchat:lib'; -import { popover } from 'meteor/rocketchat:ui'; +import { handleError } from 'meteor/rocketchat:utils'; +import { popover } from 'meteor/rocketchat:ui-utils'; import moment from 'moment'; import { drawLineChart } from '../../../lib/chartHandler'; import { setDateRange, updateDateRange } from '../../../lib/dateHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js index d044ba627b26..c44cea51ff42 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsCustomDaterange.js @@ -1,6 +1,6 @@ import { Template } from 'meteor/templating'; -import { handleError } from 'meteor/rocketchat:lib'; -import { popover } from 'meteor/rocketchat:ui'; +import { handleError } from 'meteor/rocketchat:utils'; +import { popover } from 'meteor/rocketchat:ui-utils'; import moment from 'moment'; import { setDateRange } from '../../../lib/dateHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js index b1b9522a527e..a1b3da8335c3 100644 --- a/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js +++ b/packages/rocketchat-livechat/client/views/app/analytics/livechatAnalyticsDaterange.js @@ -1,5 +1,5 @@ import { Template } from 'meteor/templating'; -import { popover } from 'meteor/rocketchat:ui'; +import { popover } from 'meteor/rocketchat:ui-utils'; import moment from 'moment'; import { setDateRange } from '../../../lib/dateHandler'; diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js index 02f8bb49185f..af636db36e6f 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationFacebook.js @@ -1,9 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; -import { modal } from 'meteor/rocketchat:ui'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { modal } from 'meteor/rocketchat:ui-utils'; +import { t, handleError } from 'meteor/rocketchat:utils'; Template.livechatIntegrationFacebook.helpers({ pages() { diff --git a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js index 6ea1d11215d0..bc2d875243f4 100644 --- a/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js +++ b/packages/rocketchat-livechat/client/views/app/integrations/livechatIntegrationWebhook.js @@ -1,9 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; -import { modal } from 'meteor/rocketchat:ui'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { modal } from 'meteor/rocketchat:ui-utils'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { LivechatIntegration } from '../../../collections/LivechatIntegration'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index d7fab05cbca1..fea6c3f7abc7 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -4,8 +4,7 @@ import { Mongo } from 'meteor/mongo'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; import { Template } from 'meteor/templating'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { t, handleError } from 'meteor/rocketchat:utils'; import s from 'underscore.string'; import moment from 'moment'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js index 8babe75a5e56..7b1a21b80a1b 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCurrentChats.js @@ -4,8 +4,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; import { modal } from 'meteor/rocketchat:ui'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { AgentUsers } from '../../collections/AgentUsers'; import _ from 'underscore'; import moment from 'moment'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js index 3fa98254e364..0aea2995ee21 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFieldForm.js @@ -2,8 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { LivechatCustomField } from '../../collections/LivechatCustomField'; import toastr from 'toastr'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js index 24648b63d880..10c93f407887 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js +++ b/packages/rocketchat-livechat/client/views/app/livechatCustomFields.js @@ -1,9 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -import { modal } from 'meteor/rocketchat:ui'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { modal } from 'meteor/rocketchat:ui-utils'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { LivechatCustomField } from '../../collections/LivechatCustomField'; Template.livechatCustomFields.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js index 1ecfeddd6966..5000ca150ee9 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartmentForm.js @@ -2,8 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { AgentUsers } from '../../collections/AgentUsers'; import { LivechatDepartment } from '../../collections/LivechatDepartment'; import { LivechatDepartmentAgents } from '../../collections/LivechatDepartmentAgents'; diff --git a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js index c5a4c3ec883d..c163e237bd14 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatDepartments.js +++ b/packages/rocketchat-livechat/client/views/app/livechatDepartments.js @@ -1,9 +1,8 @@ import { Meteor } from 'meteor/meteor'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -import { modal } from 'meteor/rocketchat:ui'; -import { t } from 'meteor/rocketchat:utils'; -import { handleError } from 'meteor/rocketchat:lib'; +import { modal } from 'meteor/rocketchat:ui-utils'; +import { t, handleError } from 'meteor/rocketchat:utils'; import { LivechatDepartment } from '../../collections/LivechatDepartment'; Template.livechatDepartments.helpers({ diff --git a/packages/rocketchat-livechat/client/views/app/livechatInstallation.js b/packages/rocketchat-livechat/client/views/app/livechatInstallation.js index 9b731b038bb8..9ba6005c3124 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatInstallation.js +++ b/packages/rocketchat-livechat/client/views/app/livechatInstallation.js @@ -1,10 +1,10 @@ import { Template } from 'meteor/templating'; -import { RocketChat } from 'meteor/rocketchat:lib'; +import { settings } from 'meteor/rocketchat:settings'; import s from 'underscore.string'; Template.livechatInstallation.helpers({ script() { - const siteUrl = s.rtrim(RocketChat.settings.get('Site_Url'), '/'); + const siteUrl = s.rtrim(settings.get('Site_Url'), '/'); return `