SystemPane.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: admin
  5. * Copyright IBM Corp. 2018
  6. * US Government Users Restricted Rights -
  7. * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['bi/admin/common/slideout/BasePane', 'bi/admin/nls/StringResource', 'react-dom', 'react', 'ba-react-admin/ba-react-admin.min'], function (BasePane, StringResource, ReactDOM, React, AdminReact) {
  10. 'use strict'; //NOSONAR: meant to be strict
  11. var SystemPane = BasePane.extend({
  12. init: function init(options) {
  13. SystemPane.inherited('init', this, arguments);
  14. $.extend(this, options);
  15. },
  16. renderBody: function renderBody($body) {
  17. ReactDOM.unmountComponentAtNode(this.$el.find('.bi-admin-pane-body')[0]);
  18. return this.glassContext.getCoreSvc('.UserProfile').isSysAdmin().then(function (isSysAdmin) {
  19. var isNotSysAdmin = isSysAdmin === false;
  20. this.reactBulkImportPane = React.createElement(AdminReact.ConfigurationView, {
  21. 'StringResource': StringResource,
  22. 'glassContext': this.glassContext,
  23. 'isNotSysAdmin': isNotSysAdmin
  24. });
  25. ReactDOM.render(this.reactBulkImportPane, this.$el.find('.bi-admin-pane-body')[0]);
  26. }.bind(this));
  27. },
  28. remove: function remove() {
  29. SystemPane.inherited('remove', this, arguments);
  30. ReactDOM.unmountComponentAtNode(this.$el.find('.bi-admin-pane-body')[0]);
  31. this.reactBulkImportPane = null;
  32. }
  33. });
  34. return SystemPane;
  35. });