VisControlTask.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: Dashboard
  6. *| (C) Copyright IBM Corp. 2018
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. define(['./BaseTask'], function (BaseTask) {
  13. 'use strict';
  14. var VisControlTask = BaseTask.extend({
  15. /**
  16. * Load the visControl (if any) and store in the visControl member of the renderContext.
  17. * @param renderContext - information collected by a particular call to render or reRender (such as the view, control, data etc).
  18. * @returns a promise
  19. */
  20. process: function process(renderContext) {
  21. if (this._isStepComplete(renderContext, 'visControl')) {
  22. return Promise.resolve(renderContext);
  23. }
  24. return this.getRenderState().getCurrentContextData('visView').whenVisControlReady().then(function (visControl) {
  25. this._completeStep(renderContext, 'visControl', visControl);
  26. return renderContext;
  27. }.bind(this)).catch(function (error) {
  28. this.showError('dwErrorRenderingVisualization');
  29. throw error;
  30. }.bind(this));
  31. }
  32. });
  33. return VisControlTask;
  34. });
  35. //# sourceMappingURL=VisControlTask.js.map