TenantsListPane.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: admin
  5. * Copyright IBM Corp. 2017, 2019
  6. * US Government Users Restricted Rights - Use, duplication or disclosure
  7. * restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. 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, $) {
  10. var TenantsListPane = BasePane.extend({
  11. init: function init(options) {
  12. TenantsListPane.inherited('init', this, arguments);
  13. $.extend(this, options);
  14. this.title = StringResource.get('multitenancy');
  15. this.tenantsController = new TenantsCustomizationService({
  16. glassContext: this.glassContext
  17. });
  18. },
  19. renderBody: function renderBody($body) {
  20. $body.append("<div style='height: 100%'><div class='tenantListPaneRoot'></div></div>");
  21. var tenantListView = React.createElement(AdminReact.TenantListView, {
  22. tenantController: this.tenantsController,
  23. glassContext: this.glassContext,
  24. StringResource: StringResource,
  25. parent: this
  26. });
  27. ReactDOM.render(tenantListView, this.$el.find('.tenantListPaneRoot')[0]);
  28. return Promise.resolve(this);
  29. },
  30. confirm: function confirm(confirmTitle, confirmMessage, confirmFunction) {
  31. var oDialog = new ConfirmationDialog('tenantConfirmation', confirmTitle, confirmMessage);
  32. oDialog.setDialogOptions({
  33. 'width': '500px'
  34. });
  35. oDialog.confirm(confirmFunction);
  36. oDialog.renderContent($('<div>'));
  37. },
  38. openSlideout: function openSlideout(tenant) {
  39. this.glassContext.appController.showSlideOut({
  40. parent: this.slideout,
  41. content: {
  42. module: 'bi/admin/multitenancy/slideout/TenantsDetailPane',
  43. id: 'TenantsDetailPane',
  44. tenant: tenant
  45. }
  46. });
  47. },
  48. reOpenSlideout: function reOpenSlideout() {
  49. this.glassContext.appController.showSlideOut({
  50. parent: this.slideout.parent,
  51. overlay: true,
  52. width: '400px',
  53. label: this.title,
  54. content: {
  55. module: 'bi/admin/multitenancy/slideout/TenantsListPane',
  56. id: 'TenantsListPane',
  57. title: this.title,
  58. showGobackButton: true
  59. }
  60. });
  61. }
  62. });
  63. return TenantsListPane;
  64. });