HighlighterTask.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 HighlighterTask = BaseTask.extend({
  15. /**
  16. * Load the selection highlighter (or {{}) and store in the highligher 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, 'highlighter')) {
  22. return Promise.resolve(renderContext);
  23. }
  24. return this.getRenderState().getCurrentContextData('visView').whenHighlighterReady().then(function (highlighter) {
  25. this._completeStep(renderContext, 'highlighter', highlighter);
  26. return renderContext;
  27. }.bind(this)).catch(function (error) {
  28. this.showError('dwErrorRenderingVisualization');
  29. throw error;
  30. }.bind(this));
  31. }
  32. });
  33. return HighlighterTask;
  34. });
  35. //# sourceMappingURL=HighlighterTask.js.map