@sis-cc/dotstatsuite-components 16.0.0 → 16.1.1

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.
@@ -154,14 +154,14 @@ var dataTransformer = exports.dataTransformer = function dataTransformer(dataNew
154
154
  var dimAnnotations = (0, _sdmxData.getRelationnalAnnotations)(R.propOr([], 'annotations')(observation))(annotations);
155
155
  var isTime = (0, _dotstatsuiteSdmxjs.isTimePeriodDimension)(observation);
156
156
  var values = getValuesEnhanced(locale, annotations, isTime, id)(R.propOr([], 'values', observation));
157
- var _idHidden = _hiddenIds[id] && R.isEmpty(R.difference(_hiddenIds[id], R.pluck('id')(values)));
157
+ var _idHidden = _hiddenIds[id] && R.isEmpty(R.pluck('id')(values), R.difference(_hiddenIds[id]));
158
158
  var isHidden = _idHidden || R.has(id, hiddenIds) || (0, _sdmxData.getIsHidden)(dimAnnotations);
159
159
  return {
160
160
  observation: R.append((0, _extends3.default)({}, observation, {
161
161
  display: !isHidden,
162
162
  __index: obsIndex,
163
163
  name: (0, _dotstatsuiteSdmxjs.getRefinedName)(observation),
164
- values: _idHidden ? [] : values,
164
+ values: values,
165
165
  role: isTime ? TIME_PERIOD_ID : R.head(R.propOr([], 'roles', observation))
166
166
  }))(acc.observation),
167
167
  dimensionsLayout: (0, _sdmxData.setAnnotationsLayout)(id, acc.dimensionsLayout)(dimAnnotations)
@@ -5,5 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  var SDMX_3_0_JSON_DATA_FORMAT = exports.SDMX_3_0_JSON_DATA_FORMAT = 'application/vnd.sdmx.data+json;version=2.0';
7
7
  var SDMX_3_0_CSV_DATA_FORMAT = exports.SDMX_3_0_CSV_DATA_FORMAT = 'application/vnd.sdmx.data+csv;version=2.0';
8
+ var EMPTY_ATTACHMENT_LEVEL_CHAR = exports.EMPTY_ATTACHMENT_LEVEL_CHAR = '~';
8
9
  var REPORTING_YEAR_START_DAY = exports.REPORTING_YEAR_START_DAY = 'REPORTING_YEAR_START_DAY';
9
10
  var REPYEARSTART = exports.REPYEARSTART = 'REPYEARSTART';
@@ -15,6 +15,8 @@ var R = _interopRequireWildcard(_ramda);
15
15
 
16
16
  var _dotstatsuiteSdmxjs = require('@sis-cc/dotstatsuite-sdmxjs');
17
17
 
18
+ var _constants = require('./constants');
19
+
18
20
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -56,8 +58,8 @@ var parseMetadataSeries = exports.parseMetadataSeries = function parseMetadataSe
56
58
  var metaIndexes = R.take(metaAttrLength, indexes);
57
59
 
58
60
  var evolvedKey = R.pipe(R.split(':'), R.addIndex(R.map)(function (vInd, dInd) {
59
- if (R.isEmpty(vInd)) {
60
- return vInd;
61
+ if (R.isEmpty(vInd) || R.equals(_constants.EMPTY_ATTACHMENT_LEVEL_CHAR, vInd)) {
62
+ return '';
61
63
  }
62
64
  var dim = R.nth(dInd, dimensions);
63
65
  var val = R.nth(Number(vInd), dim.values || []);
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": "16.0.0",
4
+ "version": "16.1.1",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -153,7 +153,7 @@ export const dataTransformer = (dataNew, options = {}) => {
153
153
  const dimAnnotations = getRelationnalAnnotations(R.propOr([], 'annotations')(observation))(annotations)
154
154
  const isTime = isTimePeriodDimension(observation);
155
155
  const values = getValuesEnhanced(locale, annotations, isTime, id)(R.propOr([], 'values', observation));
156
- const _idHidden = _hiddenIds[id] && R.isEmpty(R.difference(_hiddenIds[id], R.pluck('id')(values)))
156
+ const _idHidden = _hiddenIds[id] && R.isEmpty(R.pluck('id')(values), R.difference(_hiddenIds[id]))
157
157
  const isHidden = _idHidden || R.has(id, hiddenIds) || getIsHidden(dimAnnotations);
158
158
  return ({
159
159
  observation: R.append({
@@ -161,7 +161,7 @@ export const dataTransformer = (dataNew, options = {}) => {
161
161
  display: !isHidden,
162
162
  __index: obsIndex,
163
163
  name: getRefinedName(observation),
164
- values: _idHidden ? [] : values,
164
+ values: values,
165
165
  role: isTime ? TIME_PERIOD_ID : R.head(R.propOr([], 'roles', observation)),
166
166
  })(acc.observation),
167
167
  dimensionsLayout: setAnnotationsLayout(id, acc.dimensionsLayout)(dimAnnotations),
@@ -1,4 +1,5 @@
1
1
  export const SDMX_3_0_JSON_DATA_FORMAT = 'application/vnd.sdmx.data+json;version=2.0';
2
2
  export const SDMX_3_0_CSV_DATA_FORMAT = 'application/vnd.sdmx.data+csv;version=2.0';
3
+ export const EMPTY_ATTACHMENT_LEVEL_CHAR = '~';
3
4
  export const REPORTING_YEAR_START_DAY = 'REPORTING_YEAR_START_DAY';
4
5
  export const REPYEARSTART = 'REPYEARSTART';
@@ -1,5 +1,6 @@
1
1
  import * as R from 'ramda';
2
2
  import { getRefinedName } from '@sis-cc/dotstatsuite-sdmxjs';
3
+ import { EMPTY_ATTACHMENT_LEVEL_CHAR } from './constants';
3
4
 
4
5
  const dimensionValueDisplay = (display) => data => {
5
6
  if (display === 'code') {
@@ -37,8 +38,8 @@ export const parseMetadataSeries = (metadataJson, options) => {
37
38
  const evolvedKey = R.pipe(
38
39
  R.split(':'),
39
40
  R.addIndex(R.map)((vInd, dInd) => {
40
- if (R.isEmpty(vInd)) {
41
- return vInd;
41
+ if (R.isEmpty(vInd) || R.equals(EMPTY_ATTACHMENT_LEVEL_CHAR, vInd)) {
42
+ return '';
42
43
  }
43
44
  const dim = R.nth(dInd, dimensions);
44
45
  const val = R.nth(Number(vInd), dim.values || []);
@@ -20,8 +20,8 @@
20
20
  1
21
21
  ],
22
22
  "dimensionGroupAttributes": {
23
- "0:::": [null,null,null,0,0],
24
- "0::0:": [0,0,0]
23
+ "0:~:~:~": [null,null,null,0,0],
24
+ "0:~:0:~": [0,0,0]
25
25
  }
26
26
  }],
27
27
  "structures": [{
@@ -81,7 +81,7 @@ describe('parseMetadataSeries test', () => {
81
81
  data: {
82
82
  dataSets: [{
83
83
  dimensionGroupAttributes: {
84
- '::': [0, 0, null, 0, 0, 0, 0]
84
+ '~:~:~': [0, 0, null, 0, 0, 0, 0]
85
85
  }
86
86
  }],
87
87
  structures: [{