GuidedJourneyLayoutPropertiesProvider.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: BI Cloud (C) Copyright IBM Corp. 2019
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['underscore', 'gemini/lib/@waca/dashboard-common/dist/core/APIFactory', 'gemini/lib/@waca/dashboard-common/dist/api/PropertiesProviderAPI'], function (_, APIFactory, PropertiesProviderAPI) {
  9. var BLACKLISTED_PROPERTIES = ['fitPage'];
  10. var GuidedJourneyLayoutPropertiesProvider = function () {
  11. function GuidedJourneyLayoutPropertiesProvider(options) {
  12. _classCallCheck(this, GuidedJourneyLayoutPropertiesProvider);
  13. this.dashboardApi = options.dashboardAPI;
  14. this.content = options.content;
  15. this.stringResources = this.dashboardApi.getFeature('.StringResources');
  16. this._api = APIFactory.createAPI(this, [PropertiesProviderAPI]);
  17. // register self as a properties provider contributing storytelling GuidedJourneyLayoutPropertiesProvider properties
  18. this.content.getFeature('Properties').registerProvider(this.getAPI());
  19. }
  20. GuidedJourneyLayoutPropertiesProvider.prototype.getAPI = function getAPI() {
  21. return this._api;
  22. };
  23. GuidedJourneyLayoutPropertiesProvider.prototype.getPropertyLayoutList = function getPropertyLayoutList() {
  24. return [{
  25. id: 'canvas',
  26. type: 'Section',
  27. label: this.stringResources.get('sectionName_canvas'),
  28. position: 1
  29. }];
  30. };
  31. GuidedJourneyLayoutPropertiesProvider.prototype.getPropertyList = function getPropertyList() {
  32. return this._getBlackListedPropertiesList(BLACKLISTED_PROPERTIES);
  33. };
  34. GuidedJourneyLayoutPropertiesProvider.prototype._getBlackListedPropertiesList = function _getBlackListedPropertiesList(list) {
  35. return list.map(function (propertyName) {
  36. return {
  37. id: propertyName,
  38. getPropertyValue: function getPropertyValue() {},
  39. editor: {
  40. hidden: true
  41. }
  42. };
  43. });
  44. };
  45. return GuidedJourneyLayoutPropertiesProvider;
  46. }();
  47. return GuidedJourneyLayoutPropertiesProvider;
  48. });
  49. //# sourceMappingURL=GuidedJourneyLayoutPropertiesProvider.js.map