SourceActionHandler.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2017, 2018
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../../lib/@waca/dashboard-common/dist/glass/controllers/BaseSlideoutActionHandler', '../nls/StringResources'], function (BaseSlideoutActionHandler, StringResources) {
  8. 'use strict';
  9. var ActionHandler = BaseSlideoutActionHandler.extend({
  10. getExtraCustomSpec: function getExtraCustomSpec(context) {
  11. var options = {
  12. id: 'dashboardPanel',
  13. reuseSlideout: true,
  14. width: '400px',
  15. position: 'left',
  16. resizable: {
  17. min: 300
  18. },
  19. pinning: {
  20. isPinned: true,
  21. 'float': false,
  22. display: false
  23. },
  24. content: {
  25. module: 'dashboard-analytics/dataSources/views/DataSourcePanel'
  26. },
  27. enableTabLooping: false
  28. };
  29. if (context && context.target && context.target.plugin) {
  30. var itemSpec = context.target.plugin.itemSpec;
  31. if (itemSpec && (itemSpec.title || itemSpec.label)) {
  32. options.label = itemSpec.title || itemSpec.label;
  33. }
  34. }
  35. return options;
  36. },
  37. onShowCallback: function onShowCallback(context, slideout) {
  38. ActionHandler.inherited('onShowCallback', this, arguments);
  39. if (slideout) {
  40. slideout.$el.addClass('datasetSlideout');
  41. }
  42. },
  43. getCoachMarkSpec: function getCoachMarkSpec(context) {
  44. var spec = context.target.coachMark;
  45. var boardView = context.glassContext.appController.getCurrentContentView();
  46. var isStory = boardView.getDashboardApi().getApplicationName() === 'story';
  47. spec.title = StringResources.get('addDataCoachMarkTitle');
  48. spec.contents = isStory ? StringResources.get('addDataStoryCoachMarkContents') : StringResources.get('addDataDashboardCoachMarkContents');
  49. return spec;
  50. }
  51. });
  52. return ActionHandler;
  53. });
  54. //# sourceMappingURL=SourceActionHandler.js.map