NewStoryActionHandler.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /*
  4. * Licensed Materials - Property of IBM
  5. * IBM Cognos Products: Storytelling
  6. * (C) Copyright IBM Corp. 2018, 2020
  7. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['gemini/app/util/ErrorUtils'], function (ErrorUtils) {
  10. var ActionHandler = function () {
  11. function ActionHandler() {
  12. _classCallCheck(this, ActionHandler);
  13. }
  14. ActionHandler.prototype.onSelectItem = function onSelectItem(context) {
  15. var glassContext = context.glassContext;
  16. var instrumentationSvc = glassContext.getCoreSvc('.Instrumentation');
  17. if (instrumentationSvc.enabled) {
  18. instrumentationSvc.track({
  19. type: 'Created Object',
  20. objectType: 'Story',
  21. action: 'created',
  22. milestoneName: 'created_Story' //action_objectType
  23. });
  24. }
  25. glassContext.appController.openAppView('createStory');
  26. };
  27. /**
  28. * Determine whether to show the menu item
  29. */
  30. ActionHandler.prototype.isItemVisible = function isItemVisible(context) {
  31. return ErrorUtils.hasCapability(context.glassContext, 'canAuthorDashboard');
  32. };
  33. return ActionHandler;
  34. }();
  35. return ActionHandler;
  36. });
  37. //# sourceMappingURL=NewStoryActionHandler.js.map