ModuleUtils.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. /*
  3. * +------------------------------------------------------------------------+
  4. * | Licensed Materials - Property of IBM
  5. * | IBM Cognos Products: Dashboard
  6. * | (C) Copyright IBM Corp. 2017
  7. * |
  8. * | US Government Users Restricted Rights - Use, duplication or disclosure
  9. * | restricted by GSA ADP Schedule Contract with IBM Corp.
  10. * +------------------------------------------------------------------------+
  11. */
  12. define(['underscore'], function (_) {
  13. 'use strict';
  14. /**
  15. *@constructor
  16. */
  17. var ModuleUtils = {
  18. SHAPING: {
  19. DATAITEM_CHANGED: 0
  20. }
  21. };
  22. ModuleUtils.updateDataItemId = function (dataItemId, querySubjectId) {
  23. var id = dataItemId;
  24. var idParts = id.split('.');
  25. return id.replace(idParts[0], querySubjectId);
  26. };
  27. ModuleUtils.getColumnPropertyValue = function (metaDataColumn, propertyName) {
  28. var property;
  29. if (metaDataColumn.moserObject.getProperty) {
  30. property = _.find(metaDataColumn.moserObject.getProperty(), function (prop) {
  31. return prop.getName() === propertyName;
  32. });
  33. }
  34. return property ? property.getValue() : null;
  35. };
  36. return ModuleUtils;
  37. });
  38. //# sourceMappingURL=ModuleUtils.js.map