123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- "use strict";
- define(['underscore', 'bi/glass/app/ContentView', 'bi/admin/nls/StringResource', 'react-dom', 'react', 'ba-react-admin/ba-react-admin.min', 'collaboration/messaging/connectors/slack/SlackClient'], function (_, ContentView, StringResource, ReactDOM, React, AdminReact, SlackClient) {
- 'use strict';
- var CollaborationDetailsPane = ContentView.extend({
-
- init: function init(options) {
- CollaborationDetailsPane.inherited('init', this, arguments);
- _.extend(this, options);
- this.$el.addClass("collaboration-details-view");
- },
-
- render: function render() {
-
- this.reactViewProps.SlackClient = SlackClient;
- this.reactViewProps.parent = this;
- this.reactViewProps.openAddMembersSlideout = this.openAddMembersSlideout.bind(this);
- this.reactViewProps.closeAddMembersSlideout = this.closeAddMembersSlideout.bind(this);
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- var reactElement = React.createElement(AdminReact.CollaborationDetailsView, this.reactViewProps);
- this.reactView = ReactDOM.render(reactElement, this.$el[0]);
- },
-
- canHide: function canHide(options) {
- return !this.reactView || this.reactView.canHide(options);
- },
- openAddMembersSlideout: function openAddMembersSlideout(options) {
- if (!this.slideout.child) {
- this.glassContext.appController.showSlideOut({
- 'parent': this.slideout,
- 'width': '450',
-
- onHide: options.onHideAddMembers,
- 'content': {
- 'module': 'bi/admin/account/slideout/SecurityObjectSelectorPane',
- 'parentView': this,
- 'title': StringResource.get('selectAccountGroupOrRole'),
- 'allowedSelectionTypes': ['group', 'role', 'account'],
- 'multiSelectCallback': options.multiSelectCallback
- }
- });
- }
- },
- closeAddMembersSlideout: function closeAddMembersSlideout(options) {
- if (this.slideout.child) {
- this.slideout.child.hide();
- }
- },
- remove: function remove() {
- if (this.$el) {
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- }
- return CollaborationDetailsPane.inherited('remove', this, arguments);
- }
- });
- return CollaborationDetailsPane;
- });
|