@sis-cc/dotstatsuite-components 13.0.2 → 13.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,8 +123,6 @@ var enhanceObservations = exports.enhanceObservations = function enhanceObservat
123
123
  }, attributes);
124
124
  var _obsAttributes = R.pipe(R.indexBy(R.prop('id')), R.props(options.attributesIds || []))(_attributes);
125
125
 
126
- var seriesDimensions = R.filter(R.pipe(R.propOr([], 'values'), R.length, R.lt(1)), dimensions);
127
-
128
126
  return R.mapObjIndexed(function (observation) {
129
127
  var attrValuesIndexes = observation.attrValuesIndexes,
130
128
  dimValuesIndexes = observation.dimValuesIndexes;
@@ -148,7 +146,7 @@ var enhanceObservations = exports.enhanceObservations = function enhanceObservat
148
146
  attributes: obsAttributes,
149
147
  formattedValue: (0, _formatValue.formatValue)(observation, formatAttributesIndexes, attributes),
150
148
  orderedDimIndexes: getOrderedDimensionsIndexes(dimensions, dimValuesIndexes),
151
- units: getObservationUnits(observation, seriesDimensions, _attributes, options),
149
+ units: getObservationUnits(observation, dimensions, _attributes, options),
152
150
  indexedDimValIds: indexedDimValIds
153
151
  });
154
152
  }, observations);
@@ -116,7 +116,7 @@ var prepareData = exports.prepareData = function prepareData(sdmxJson, customAtt
116
116
  var attributes = _ref.attributes,
117
117
  dimensions = _ref.dimensions;
118
118
  return R.merge(attributes.series || {}, dimensions.series || {});
119
- }, R.values, R.pluck('id'))(unitsArtefacts);
119
+ }, R.keys)(unitsArtefacts);
120
120
  var options = {
121
121
  attachmentSeriesIndexes: attachmentSeriesIndexes,
122
122
  customAttributes: customAttributes,
@@ -156,7 +156,9 @@ var prepareData = exports.prepareData = function prepareData(sdmxJson, customAtt
156
156
  return !R.includes(id, customAttributes.flags || []) && !R.includes(id, customAttributes.notes || []);
157
157
  }))(headerAttributesIds);
158
158
 
159
- var dataflowAdvancedAttributes = (0, _getAdvancedAttributes.getDataflowAdvancedAttributes)(headerAttributes, oneValueDimensions, headerAdvancedAttrIds, R.length(dimensions));
159
+ var dataflowAdvancedAttributes = (0, _getAdvancedAttributes.getDataflowAdvancedAttributes)(headerAttributes,
160
+ //oneValueDimensions,
161
+ R.pick(R.keys(parsedDimensionsIds.oneValue), dimensionsIndexedByIds), headerAdvancedAttrIds, R.length(dimensions));
160
162
 
161
163
  var observationsAdvancedAttributesIds = R.filter(function (id) {
162
164
  return !R.includes(id, customAttributes.flags || []) && !R.includes(id, customAttributes.notes || []);
@@ -51,7 +51,7 @@ var getDataflowAdvancedAttributes = exports.getDataflowAdvancedAttributes = func
51
51
  var vId = R.path(['values', 0, 'id'], dim);
52
52
  coordinates = (0, _extends4.default)({}, coordinates, (0, _defineProperty3.default)({}, dId, vId));
53
53
  key = R.set(R.lensIndex(dIndex), 0)(key);
54
- }, attrDimensions);
54
+ }, R.reject(R.isNil, attrDimensions));
55
55
  }
56
56
 
57
57
  key = R.join(':', key);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "13.0.2",
4
+ "version": "13.0.3",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -121,8 +121,6 @@ export const enhanceObservations = (dimensions = [], observations = {}, attribut
121
121
  R.props(options.attributesIds || [])
122
122
  )(_attributes);
123
123
 
124
- const seriesDimensions = R.filter(R.pipe(R.propOr([], 'values'), R.length, R.lt(1)), dimensions);
125
-
126
124
  return R.mapObjIndexed(
127
125
  (observation) => {
128
126
  const { attrValuesIndexes, dimValuesIndexes } = observation;
@@ -154,7 +152,7 @@ export const enhanceObservations = (dimensions = [], observations = {}, attribut
154
152
  attributes: obsAttributes,
155
153
  formattedValue: formatValue(observation, formatAttributesIndexes, attributes),
156
154
  orderedDimIndexes: getOrderedDimensionsIndexes(dimensions, dimValuesIndexes),
157
- units: getObservationUnits(observation, seriesDimensions, _attributes, options),
155
+ units: getObservationUnits(observation, dimensions, _attributes, options),
158
156
  indexedDimValIds,
159
157
  });
160
158
  },
@@ -81,8 +81,7 @@ export const prepareData = (sdmxJson, customAttributes, unitsProps={}) => {
81
81
  const observationsAttributesIds = R.propOr([], 'observations', attributesIdsIndexedByTargets);
82
82
  const obsUnitsIds = R.pipe(
83
83
  ({ attributes, dimensions }) => R.merge(attributes.series || {}, dimensions.series || {}),
84
- R.values,
85
- R.pluck('id')
84
+ R.keys
86
85
  )(unitsArtefacts);
87
86
  const options = {
88
87
  attachmentSeriesIndexes,
@@ -156,7 +155,8 @@ export const prepareData = (sdmxJson, customAttributes, unitsProps={}) => {
156
155
 
157
156
  const dataflowAdvancedAttributes = getDataflowAdvancedAttributes(
158
157
  headerAttributes,
159
- oneValueDimensions,
158
+ //oneValueDimensions,
159
+ R.pick(R.keys(parsedDimensionsIds.oneValue), dimensionsIndexedByIds),
160
160
  headerAdvancedAttrIds,
161
161
  R.length(dimensions)
162
162
  );
@@ -26,7 +26,7 @@ export const getDataflowAdvancedAttributes = (attributes, dimensions, advancedAt
26
26
  coordinates = { ...coordinates, [dId]: vId };
27
27
  key = R.set(R.lensIndex(dIndex), 0)(key);
28
28
  },
29
- attrDimensions
29
+ R.reject(R.isNil, attrDimensions)
30
30
  );
31
31
  }
32
32
 
@@ -33,7 +33,7 @@ describe('table preparators performance tests', () => {
33
33
  OBS_STATUS: { id: 'OBS_STATUS', values: { A: 'A' } },
34
34
  UNIT_MULT: { id: 'UNIT_MULT', values: { '0': '0' } }
35
35
  },
36
- unitsIds: ['UNIT_MEASURE', 'UNIT_MULT', 'BASE_PER']
36
+ unitsIds: ['UNIT_MULT', 'BASE_PER']
37
37
  };
38
38
  expect(
39
39
  enhanceObservations(multiHierRowsDim, multiHierRowsObs, multiHierRowsAttr, options)