Skip to content

Commit

Permalink
Improve code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Mar 20, 2020
1 parent a1de24b commit 5ca73cb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
14 changes: 11 additions & 3 deletions ee/app/livechat-enterprise/client/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { hasLicense } from '../../license/client';
import './views/livechatMonitors';
import './views/livechatUnits';
import './views/livechatUnitForm';
import './views/livechatSideNavItems';
import './route';
import './views/livechatTags';
import './views/livechatTagForm';
import './route';
import './views/app/registerCustomTemplates.js';

hasLicense('livechat-enterprise').then((enabled) => {
if (!enabled) {
return;
}

require('./views/app/registerCustomTemplates');
require('./views/livechatSideNavItems');
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { addCustomFormTemplate } from '../../../../../../app/livechat/client/vie
import './customTemplates/livechatDepartmentCustomFieldsForm';
import './customTemplates/livechatAgentEditCustomFieldsForm';
import './customTemplates/livechatAgentInfoCustomFieldsForm';
import { hasLicense } from '../../../../license/client';

hasLicense('livechat-enterprise').then((enabled) => {
if (enabled) {
addCustomFormTemplate('livechatDepartmentForm', 'livechatDepartmentCustomFieldsForm');
addCustomFormTemplate('livechatAgentEditForm', 'livechatAgentEditCustomFieldsForm');
addCustomFormTemplate('livechatAgentInfoForm', 'livechatAgentInfoCustomFieldsForm');
}
});
addCustomFormTemplate('livechatDepartmentForm', 'livechatDepartmentCustomFieldsForm');
addCustomFormTemplate('livechatAgentEditForm', 'livechatAgentEditCustomFieldsForm');
addCustomFormTemplate('livechatAgentInfoForm', 'livechatAgentInfoCustomFieldsForm');
11 changes: 3 additions & 8 deletions ee/app/livechat-enterprise/client/views/livechatSideNavItems.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { addSidebarItem } from '../../../../../app/livechat/client/views/sideNav/livechatSideNavItems';
import { hasLicense } from '../../../license/client';

hasLicense('livechat-enterprise').then((enabled) => {
if (enabled) {
addSidebarItem('Monitors', 'livechat-monitors', 'manage-livechat-monitors');
addSidebarItem('Units', 'livechat-units', 'manage-livechat-units');
addSidebarItem('Tags', 'livechat-tags', 'manage-livechat-tags');
}
});
addSidebarItem('Monitors', 'livechat-monitors', 'manage-livechat-monitors');
addSidebarItem('Units', 'livechat-units', 'manage-livechat-units');
addSidebarItem('Tags', 'livechat-tags', 'manage-livechat-tags');
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { callbacks } from '../../../../../app/callbacks';
import LivechatRooms from '../../../../../app/models/server/models/LivechatRooms';
import { LivechatDepartment } from '../../../../../app/models/server/models/LivechatDepartment';
import LivechatDepartment from '../../../../../app/models/server/models/LivechatDepartment';

callbacks.add('livechat.newRoom', (room) => {
if (!room.departmentId) {
Expand Down
1 change: 1 addition & 0 deletions ee/app/livechat-enterprise/server/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const createPermissions = () => {
'manage-livechat-agents',
];


permissions.map((p) => Permissions.addRole(p, livechatMonitorRole));

Permissions.createOrUpdate('manage-livechat-units', [adminRole, livechatManagerRole]);
Expand Down

0 comments on commit 5ca73cb

Please sign in to comment.