OpenTemplateActionHandler.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. /*
  6. *+------------------------------------------------------------------------+
  7. *| Licensed Materials - Property of IBM
  8. *| IBM Cognos Products: dashboard-core
  9. *| (C) Copyright IBM Corp. 2019, 2020
  10. *|
  11. *| US Government Users Restricted Rights - Use, duplication or disclosure
  12. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  13. *+------------------------------------------------------------------------+
  14. */
  15. define(['./OpenActionHandler'], function (BaseClass) {
  16. var ActionHandler = function (_BaseClass) {
  17. _inherits(ActionHandler, _BaseClass);
  18. function ActionHandler() {
  19. _classCallCheck(this, ActionHandler);
  20. return _possibleConstructorReturn(this, _BaseClass.apply(this, arguments));
  21. }
  22. ActionHandler.prototype.canExecute = function canExecute(options) {
  23. var isDashboardTemplatesEnabled = !options.glassContext.getCoreSvc('.FeatureChecker').checkValue('dashboard', 'dashboardTemplates', 'disabled');
  24. return isDashboardTemplatesEnabled && _BaseClass.prototype.canExecute.call(this, options);
  25. };
  26. ActionHandler.prototype._getTargetPerspective = function _getTargetPerspective() {
  27. return Promise.resolve('dashboardTemplate');
  28. };
  29. ActionHandler.prototype._hasValidTags = function _hasValidTags(item) {
  30. var tags = item.tags || [];
  31. return tags.indexOf('dashboard_template') !== -1;
  32. };
  33. return ActionHandler;
  34. }(BaseClass);
  35. return ActionHandler;
  36. });
  37. //# sourceMappingURL=OpenTemplateActionHandler.js.map