VisSpecTask.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 VisSpecTask = BaseTask.extend({
  15. /**
  16. * Load the visSpec (or {}) and store in the visSpec member of the renderContext.
  17. * For Rave visualizations, this is the RAVE spec (or template prior to substituting data and overrides).
  18. * @param renderContext - information collected by a particular call to render or reRender (such as the view, control, data etc).
  19. * @returns a promise
  20. */
  21. process: function process(renderContext) {
  22. if (this._isStepComplete(renderContext, 'visSpec')) {
  23. return Promise.resolve(renderContext);
  24. }
  25. return this.getRenderState().getCurrentContextData('visView').whenVisSpecReady().then(function (visSpec) {
  26. this._completeStep(renderContext, 'visSpec', visSpec);
  27. return renderContext;
  28. }.bind(this)).catch(function (error) {
  29. this.showError('dwErrorRenderingVisualization');
  30. throw error;
  31. }.bind(this));
  32. }
  33. });
  34. return VisSpecTask;
  35. });
  36. //# sourceMappingURL=VisSpecTask.js.map