The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/ee/app/engagement-dashboard/client/routes.js

33 lines
1.2 KiB

import { hasAllPermission } from '../../../../app/authorization';
import { registerAdminRoute, registerAdminSidebarItem } from '../../../../client/views/admin';
import { hasLicense } from '../../license/client';
import { createTemplateForComponent } from '../../../../client/lib/portals/createTemplateForComponent';
import { appLayout } from '../../../../client/lib/appLayout';
registerAdminRoute('/engagement-dashboard/:tab?', {
name: 'engagement-dashboard',
action: async () => {
const licensed = await hasLicense('engagement-dashboard');
if (!licensed) {
return;
}
const EngagementDashboardRoute = createTemplateForComponent('EngagementDashboardRoute', () => import('./components/EngagementDashboardRoute'), { attachment: 'at-parent' });
appLayout.render('main', { center: EngagementDashboardRoute });
},
});
hasLicense('engagement-dashboard').then((enabled) => {
if (!enabled) {
return;
}
registerAdminSidebarItem({
href: 'engagement-dashboard',
i18nLabel: 'Engagement Dashboard',
icon: 'file-keynote',
permissionGranted: () => hasAllPermission('view-statistics'),
});
}).catch((error) => {
console.error('Error checking license.', error);
});