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/app/integrations/client/views/integrations.js

36 lines
987 B

import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/rocketchat:tap-i18n';
import { Tracker } from 'meteor/tracker';
import moment from 'moment';
import { hasAtLeastOnePermission } from '../../../authorization';
import { integrations } from '../../lib/rocketchat';
import { ChatIntegrations } from '../collections';
import { SideNav } from '../../../ui-utils/client';
Template.integrations.helpers({
hasPermission() {
return hasAtLeastOnePermission([
'manage-outgoing-integrations',
'manage-own-outgoing-integrations',
'manage-incoming-integrations',
'manage-own-incoming-integrations',
]);
},
integrations() {
return ChatIntegrations.find();
},
dateFormated(date) {
return moment(date).format('L LT');
},
eventTypeI18n(event) {
return TAPi18n.__(integrations.outgoingEvents[event].label);
},
});
Template.integrations.onRendered(() => {
Tracker.afterFlush(() => {
SideNav.setFlex('adminFlex');
SideNav.openFlex();
});
});