@dhis2/analytics 21.0.10 → 21.0.11

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [21.0.11](https://github.com/dhis2/analytics/compare/v21.0.10...v21.0.11) (2021-12-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * support legendset in dimension create ([#1107](https://github.com/dhis2/analytics/issues/1107)) ([4b4dbe7](https://github.com/dhis2/analytics/commit/4b4dbe74c0012419f12c6b2f9c297e1a3e256c05))
7
+
1
8
  ## [21.0.10](https://github.com/dhis2/analytics/compare/v21.0.9...v21.0.10) (2021-12-09)
2
9
 
3
10
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DIMENSION_PROPS = exports.DIMENSION_PROP_FILTER = exports.DIMENSION_PROP_ITEMS = exports.DIMENSION_PROP_ID = exports.DIMENSION = void 0;
6
+ exports.DIMENSION_PROPS = exports.DIMENSION_PROP_LEGEND_SET = exports.DIMENSION_PROP_FILTER = exports.DIMENSION_PROP_ITEMS = exports.DIMENSION_PROP_ID = exports.DIMENSION = void 0;
7
7
 
8
8
  var _isObject = _interopRequireDefault(require("lodash/isObject"));
9
9
 
@@ -38,5 +38,12 @@ const DIMENSION_PROP_FILTER = {
38
38
  isValid: prop => (0, _isString.default)(prop)
39
39
  };
40
40
  exports.DIMENSION_PROP_FILTER = DIMENSION_PROP_FILTER;
41
- const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER];
41
+ const DIMENSION_PROP_LEGEND_SET = {
42
+ name: 'legendSet',
43
+ defaultValue: [],
44
+ required: false,
45
+ isValid: prop => (0, _isString.default)(prop)
46
+ };
47
+ exports.DIMENSION_PROP_LEGEND_SET = DIMENSION_PROP_LEGEND_SET;
48
+ const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET];
42
49
  exports.DIMENSION_PROPS = DIMENSION_PROPS;
@@ -17,6 +17,9 @@ const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
17
17
  }),
18
18
  ...(args.filter && {
19
19
  [_dimension.DIMENSION_PROP_FILTER.name]: args.filter
20
+ }),
21
+ ...(args.legendSet && {
22
+ [_dimension.DIMENSION_PROP_LEGEND_SET.name]: args.legendSet
20
23
  })
21
24
  };
22
25
  return dimension;
@@ -23,4 +23,10 @@ export const DIMENSION_PROP_FILTER = {
23
23
  required: false,
24
24
  isValid: prop => isString(prop)
25
25
  };
26
- export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER];
26
+ export const DIMENSION_PROP_LEGEND_SET = {
27
+ name: 'legendSet',
28
+ defaultValue: [],
29
+ required: false,
30
+ isValid: prop => isString(prop)
31
+ };
32
+ export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET];
@@ -1,4 +1,4 @@
1
- import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER } from './dimension.js';
1
+ import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET } from './dimension.js';
2
2
  export const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
3
3
  const dimension = {
4
4
  [DIMENSION_PROP_ID.name]: dimensionId,
@@ -9,6 +9,9 @@ export const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
9
9
  }),
10
10
  ...(args.filter && {
11
11
  [DIMENSION_PROP_FILTER.name]: args.filter
12
+ }),
13
+ ...(args.legendSet && {
14
+ [DIMENSION_PROP_LEGEND_SET.name]: args.legendSet
12
15
  })
13
16
  };
14
17
  return dimension;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "21.0.10",
3
+ "version": "21.0.11",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {