@sis-cc/dotstatsuite-components 15.0.11 → 15.0.12

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.
@@ -27,7 +27,7 @@ var getHeaderUnits = exports.getHeaderUnits = function getHeaderUnits(_ref) {
27
27
  var artefacts = R.converge(R.merge, [R.pathOr({}, ['dimensions', 'header']), R.pathOr({}, ['attributes', 'header'])])(unitsArtefacts);
28
28
 
29
29
  return R.pipe(R.props(unitsDefinitionCodes), R.reduce(function (acc, entry) {
30
- if (R.isNil(entry) || R.includes(R.path(['values', 0, 'id'], entry), rejectedValueIds)) {
30
+ if (R.isNil(entry) || !R.propOr(true, 'display', entry) || !R.pathOr(true, ['values', 0, 'display'], entry) || R.includes(R.path(['values', 0, 'id'], entry), rejectedValueIds)) {
31
31
  return acc;
32
32
  }
33
33
  return R.append((0, _extends3.default)({}, R.pick(['id', 'name'], entry), { value: R.path(['values', 0], entry) }), acc);
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": "15.0.11",
4
+ "version": "15.0.12",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -17,7 +17,8 @@ export const getHeaderUnits = ({
17
17
  R.props(unitsDefinitionCodes),
18
18
  R.reduce(
19
19
  (acc, entry) => {
20
- if (R.isNil(entry) || R.includes(R.path(['values', 0, 'id'], entry), rejectedValueIds)) {
20
+ if (R.isNil(entry) || !(R.propOr(true, 'display', entry)) || !(R.pathOr(true, ['values', 0, 'display'], entry))
21
+ || R.includes(R.path(['values', 0, 'id'], entry), rejectedValueIds)) {
21
22
  return acc;
22
23
  }
23
24
  return R.append(
@@ -31,4 +31,21 @@ describe('getHeaderUnits tests', () => {
31
31
  { id: 'A2', value: { id: 'V1' } }
32
32
  ]);
33
33
  });
34
+ it('no display', () => {
35
+ expect(getHeaderUnits({
36
+ unitsArtefacts: {
37
+ attributes: { header: {
38
+ A1: { id: 'A1', values: [{ id: 'V1' }] },
39
+ A2: { id: 'A2', display: false, values: [{ id: 'V1' }] },
40
+ A3: { id: 'A3', values: [{ id: 'RA' }] },
41
+ } },
42
+ dimensions: { header: {
43
+ D1: { id: 'D1', values: [{ id: 'V1', display: false }] },
44
+ D2: { id: 'D2', values: [{ id: 'RD' }] }
45
+ } }
46
+ },
47
+ rejectedValues: ['RA', 'RD'],
48
+ unitsDefinitionCodes: ['D1', 'C8', 'A2']
49
+ })).to.deep.equal([]);
50
+ })
34
51
  });
@@ -73,7 +73,7 @@ describe('hierarchiseDimensionWithNativeHierarchy tests', () => {
73
73
  { id: 'A', parent: undefined, parents: [], __indexPosition: 20 },
74
74
  { id: 'EA', parent: undefined, parents: [], __indexPosition: 30 },
75
75
  { id: 'GER', parent: 'EA', parents: ['EA'], __indexPosition: 100 },
76
- { id: '', parent: '', parents: [''], __indexPosition: 101 }
76
+ { id: '', parent: undefined, parents: [], __indexPosition: 101 }
77
77
  ]
78
78
  };
79
79