1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: admin
- * Copyright IBM Corp. 2017, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/common/slideout/BasePane', 'bi/admin/nls/StringResource', 'bi/admin/multitenancy/services/TenantsCustomizationService', 'bi/commons/ui/dialogs/ConfirmationDialog', 'react', 'react-dom', 'ba-react-admin/ba-react-admin.min', 'jquery'], function (BasePane, StringResource, TenantsCustomizationService, ConfirmationDialog, React, ReactDOM, AdminReact, $) {
- var TenantsListPane = BasePane.extend({
- init: function init(options) {
- TenantsListPane.inherited('init', this, arguments);
- $.extend(this, options);
- this.title = StringResource.get('multitenancy');
- this.tenantsController = new TenantsCustomizationService({
- glassContext: this.glassContext
- });
- },
- renderBody: function renderBody($body) {
- $body.append("<div style='height: 100%'><div class='tenantListPaneRoot'></div></div>");
- var tenantListView = React.createElement(AdminReact.TenantListView, {
- tenantController: this.tenantsController,
- glassContext: this.glassContext,
- StringResource: StringResource,
- parent: this
- });
- ReactDOM.render(tenantListView, this.$el.find('.tenantListPaneRoot')[0]);
- return Promise.resolve(this);
- },
- confirm: function confirm(confirmTitle, confirmMessage, confirmFunction) {
- var oDialog = new ConfirmationDialog('tenantConfirmation', confirmTitle, confirmMessage);
- oDialog.setDialogOptions({
- 'width': '500px'
- });
- oDialog.confirm(confirmFunction);
- oDialog.renderContent($('<div>'));
- },
- openSlideout: function openSlideout(tenant) {
- this.glassContext.appController.showSlideOut({
- parent: this.slideout,
- content: {
- module: 'bi/admin/multitenancy/slideout/TenantsDetailPane',
- id: 'TenantsDetailPane',
- tenant: tenant
- }
- });
- },
- reOpenSlideout: function reOpenSlideout() {
- this.glassContext.appController.showSlideOut({
- parent: this.slideout.parent,
- overlay: true,
- width: '400px',
- label: this.title,
- content: {
- module: 'bi/admin/multitenancy/slideout/TenantsListPane',
- id: 'TenantsListPane',
- title: this.title,
- showGobackButton: true
- }
- });
- }
- });
- return TenantsListPane;
- });
|