ModellingSettingsViewBridge.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Licensed Materials - Property of IBM
  3. * IBM Cognos Products: Modeling UI (C) Copyright IBM Corp. 2019
  4. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. */
  6. define([
  7. 'bi/glass/app/ContentView'
  8. ], function (ContentView) {
  9. var ModellingSettingsViewBridge = ContentView.extend({
  10. init(options) {
  11. ContentView.inherited('init', this, [options]);
  12. // assign options to props because react-like
  13. this.props = options;
  14. // this.initialize(this.props, options.glassContext);
  15. },
  16. // hook for subclasses
  17. initialize() {},
  18. /**
  19. * Glass will call this method to get the asset type that is used to match share action handler.
  20. * In <i>perspectives/common/ca-modeller.json</i>, the types of share feature should contain this type.
  21. */
  22. getType() {
  23. return 'module';
  24. },
  25. render() {
  26. return new Promise((resolve, reject) => {
  27. require(['ca-modeller/modellingSettings'], (modellingSettingsModule) => {
  28. if (!this._unmounted) {
  29. this._unmount = modellingSettingsModule.default(this.props.glassContext, { el: this.el });
  30. resolve();
  31. }
  32. });
  33. });
  34. },
  35. onClose() {
  36. if (this._unmount && this.el) {
  37. this._unmount();
  38. } else {
  39. this._unmounted = true;
  40. }
  41. }
  42. });
  43. return ModellingSettingsViewBridge;
  44. });