DashboardInternalProperties.js 2.1 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. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['../../../lib/@waca/dashboard-common/dist/core/APIFactory', '../../../lib/@waca/dashboard-common/dist/api/PropertiesProviderAPI'], function (APIFactory, PropertiesProviderAPI) {
  9. var DashboardInternalProperties = function () {
  10. function DashboardInternalProperties(_ref) {
  11. var features = _ref.features,
  12. options = _ref.options;
  13. _classCallCheck(this, DashboardInternalProperties);
  14. this._api = APIFactory.createAPI(this, [PropertiesProviderAPI]);
  15. this._templateCollection = options.templateCollection || [];
  16. features['Properties'].registerProvider(this.getAPI());
  17. }
  18. DashboardInternalProperties.prototype.getAPI = function getAPI() {
  19. return this._api;
  20. };
  21. DashboardInternalProperties.prototype.getPropertyLayoutList = function getPropertyLayoutList() {
  22. return [];
  23. };
  24. DashboardInternalProperties.prototype.getPropertyList = function getPropertyList() {
  25. var _this = this;
  26. return [{
  27. id: 'excludedTemplates',
  28. getPropertyValue: function getPropertyValue() {
  29. return _this._getExcludedTemplatesFromCollections();
  30. },
  31. setPropertyValue: function setPropertyValue() {
  32. throw new Error('not supported');
  33. }
  34. }];
  35. };
  36. DashboardInternalProperties.prototype._getExcludedTemplatesFromCollections = function _getExcludedTemplatesFromCollections() {
  37. var excludedTemplates = [];
  38. this._templateCollection.find(function (template) {
  39. if (template.dataId === 'tab' && Array.isArray(template.excludedTemplates)) {
  40. excludedTemplates = excludedTemplates.concat(template.excludedTemplates);
  41. }
  42. });
  43. return excludedTemplates;
  44. };
  45. return DashboardInternalProperties;
  46. }();
  47. return DashboardInternalProperties;
  48. });
  49. //# sourceMappingURL=DashboardInternalProperties.js.map