@dhis2/analytics 21.0.5 → 21.0.9

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,31 @@
1
+ ## [21.0.9](https://github.com/dhis2/analytics/compare/v21.0.8...v21.0.9) (2021-12-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * include legendset in the analytics request ([#1102](https://github.com/dhis2/analytics/issues/1102)) ([14d5261](https://github.com/dhis2/analytics/commit/14d52618c714cca1a2d7b3441a7aba5ea209efc2))
7
+
8
+ ## [21.0.8](https://github.com/dhis2/analytics/compare/v21.0.7...v21.0.8) (2021-12-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * disable org unit filters and groups when user org units are used ([#1100](https://github.com/dhis2/analytics/issues/1100)) ([ce63e14](https://github.com/dhis2/analytics/commit/ce63e14517abfe5f7edc6f42b46c6e1dc07a3555))
14
+
15
+ ## [21.0.7](https://github.com/dhis2/analytics/compare/v21.0.6...v21.0.7) (2021-12-01)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * dimension without items + filter (TECH-788) ([#1097](https://github.com/dhis2/analytics/issues/1097)) ([37369ce](https://github.com/dhis2/analytics/commit/37369ce74eb189724d0943d35492d377f0ff44f8))
21
+
22
+ ## [21.0.6](https://github.com/dhis2/analytics/compare/v21.0.5...v21.0.6) (2021-11-28)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **translations:** sync translations from transifex (master) ([8c10c19](https://github.com/dhis2/analytics/commit/8c10c1909a77e4ae9c729e99bc41bc84b9a51860))
28
+
1
29
  ## [21.0.5](https://github.com/dhis2/analytics/compare/v21.0.4...v21.0.5) (2021-11-26)
2
30
 
3
31
 
@@ -56,20 +56,28 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
56
56
  const columns = visualization.columns || [];
57
57
  const rows = visualization.rows || [];
58
58
  columns.concat(rows).forEach(d => {
59
+ var _d$legendSet, _d$items;
60
+
59
61
  let dimension = d.dimension;
60
62
 
63
+ if ((_d$legendSet = d.legendSet) !== null && _d$legendSet !== void 0 && _d$legendSet.id) {
64
+ dimension += "-".concat(d.legendSet.id);
65
+ }
66
+
61
67
  if (d.filter) {
62
68
  dimension += ":".concat(d.filter);
63
69
  }
64
70
 
65
- request = request.addDimension(dimension, d.items.map(item => item.id));
71
+ request = request.addDimension(dimension, (_d$items = d.items) === null || _d$items === void 0 ? void 0 : _d$items.map(item => item.id));
66
72
  }); // extract filters from visualization
67
73
 
68
74
  const filters = visualization.filters || []; // only pass dx/pe/ou as dimension
69
75
 
70
76
  const fixedIds = Object.keys((0, _predefinedDimensions.getFixedDimensions)());
71
77
  filters.forEach(f => {
72
- request = passFilterAsDimension && fixedIds.includes(f.dimension) ? request.addDimension(f.dimension, f.items.map(item => item.id)) : request.addFilter(f.dimension, f.items.map(item => item.id));
78
+ var _f$items, _f$items2;
79
+
80
+ request = passFilterAsDimension && fixedIds.includes(f.dimension) ? request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id)) : request.addFilter(f.dimension, (_f$items2 = f.items) === null || _f$items2 === void 0 ? void 0 : _f$items2.map(item => item.id));
73
81
  });
74
82
  return request;
75
83
  }
@@ -125,12 +125,16 @@ class extends base {
125
125
  if (existingDimension) {
126
126
  this.dimensions.splice(dimensionIndex, 1, {
127
127
  dimension,
128
- items: updatedItems
128
+ ...(items && {
129
+ items: updatedItems
130
+ })
129
131
  });
130
132
  } else {
131
133
  this.dimensions.push({
132
134
  dimension,
133
- items: updatedItems
135
+ ...(items && {
136
+ items: updatedItems
137
+ })
134
138
  });
135
139
  }
136
140
 
@@ -122,8 +122,7 @@ describe('AnalyticsRequest', () => {
122
122
  it('should add the given dimension without any associated value', () => {
123
123
  request.addDimension('Jtf34kNZhzP');
124
124
  expect(request.dimensions).toEqual([{
125
- dimension: 'Jtf34kNZhzP',
126
- items: []
125
+ dimension: 'Jtf34kNZhzP'
127
126
  }]);
128
127
  });
129
128
  it('should add the given dimension with the associated value (passed as string)', () => {
@@ -56,7 +56,7 @@ const OrgUnitDimension = ({
56
56
  let result = [...selected];
57
57
 
58
58
  if (checked && DYNAMIC_ORG_UNITS.includes(id)) {
59
- result = [...result.filter(item => DYNAMIC_ORG_UNITS.includes(item.id) || _ouIdHelper.ouIdHelper.hasLevelPrefix(item.id) || _ouIdHelper.ouIdHelper.hasGroupPrefix(item.id)), {
59
+ result = [...result.filter(item => DYNAMIC_ORG_UNITS.includes(item.id)), {
60
60
  id,
61
61
  displayName
62
62
  }];
@@ -216,7 +216,9 @@ const OrgUnitDimension = ({
216
216
  onChange: onSelectItems,
217
217
  dataTest: 'org-unit-tree'
218
218
  })), /*#__PURE__*/_react.default.createElement("div", {
219
- className: "jsx-".concat(_OrgUnitDimension.default.__hash) + " " + "selectsWrapper"
219
+ className: "jsx-".concat(_OrgUnitDimension.default.__hash) + " " + ((0, _classnames.default)('selectsWrapper', {
220
+ disabled: selected.some(item => DYNAMIC_ORG_UNITS.includes(item.id))
221
+ }) || "")
220
222
  }, /*#__PURE__*/_react.default.createElement(_ui.MultiSelect, {
221
223
  selected: ouLevels.length ? selected.filter(item => _ouIdHelper.ouIdHelper.hasLevelPrefix(item.id)).map(item => _ouIdHelper.ouIdHelper.removePrefix(item.id)) : [],
222
224
  onChange: ({
@@ -1,23 +1,23 @@
1
1
  {
2
- "view only": "",
3
- "view and edit": "",
4
- "all users ({{accessLevel}})": "",
5
- "{{userOrGroup}} ({{accessLevel}})": "",
6
- "Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
7
- "Not shared with any users or groups": "",
8
- "About this visualization": "",
2
+ "view only": "pouze zobrazit",
3
+ "view and edit": "zobrazit a upravit",
4
+ "all users ({{accessLevel}})": "všichni uživatelé ({{accessLevel}})",
5
+ "{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
6
+ "Shared with {{commaSeparatedListOfUsersAndGroups}}": "Sdíleno s {{commaSeparatedListOfUsersAndGroups}}",
7
+ "Not shared with any users or groups": "Nesdíleno s žádnými uživateli ani skupinami",
8
+ "About this visualization": "O této vizualizaci",
9
9
  "No description": "Bez popisu",
10
- "Last updated {{time}}": "",
11
- "Created {{time}} by {{author}}": "",
12
- "Viewed {{count}} times_0": "",
13
- "Viewed {{count}} times_1": "",
14
- "Viewed {{count}} times_2": "",
15
- "Viewed {{count}} times_3": "",
10
+ "Last updated {{time}}": "Poslední aktualizace {{time}}",
11
+ "Created {{time}} by {{author}}": "Vytvořeno {{time}} uživatelem {{author}}",
12
+ "Viewed {{count}} times_0": "Zobrazeno 1 krát",
13
+ "Viewed {{count}} times_1": "Zobrazeno {{count}}krát",
14
+ "Viewed {{count}} times_2": "Zobrazeno {{count}}krát",
15
+ "Viewed {{count}} times_3": "Zobrazeno {{count}}krát",
16
16
  "Notifications": "Oznámení",
17
- "You're subscribed and getting updates about new interpretations.": "",
18
- "Unsubscribe": "",
19
- "Subscribe to get updates about new interpretations.": "",
20
- "Subscribe": "",
17
+ "You're subscribed and getting updates about new interpretations.": "Jste přihlášeni k odběru a dostáváte aktualizace o nových interpretacích.",
18
+ "Unsubscribe": "Odhlásit odběr",
19
+ "Subscribe to get updates about new interpretations.": "Přihlaste se k odběru novinek o nových interpretacích.",
20
+ "Subscribe": "Odebírat",
21
21
  "Data Type": "Typ dat",
22
22
  "All types": "Všechny typy",
23
23
  "Totals only": "Pouze součty",
@@ -120,20 +120,20 @@
120
120
  "Options": "Možnosti",
121
121
  "Hide": "Skrýt",
122
122
  "Update": "Aktualizovat",
123
- "{{count}} org units_0": "",
124
- "{{count}} org units_1": "",
125
- "{{count}} org units_2": "",
126
- "{{count}} org units_3": "",
127
- "{{count}} levels_0": "",
128
- "{{count}} levels_1": "",
129
- "{{count}} levels_2": "",
130
- "{{count}} levels_3": "",
131
- "{{count}} groups_0": "",
132
- "{{count}} groups_1": "",
133
- "{{count}} groups_2": "",
134
- "{{count}} groups_3": "",
135
- "Selected: {{commaSeparatedListOfOrganisationUnits}}": "",
136
- "Nothing selected": "",
123
+ "{{count}} org units_0": "{{count}} organizační jednotka",
124
+ "{{count}} org units_1": "{{count}} organizační jednotky",
125
+ "{{count}} org units_2": "{{count}} organizačních jednotek",
126
+ "{{count}} org units_3": "{{count}} organizačních jednotek",
127
+ "{{count}} levels_0": "{{count}} úroveň",
128
+ "{{count}} levels_1": "{{count}} úrovně",
129
+ "{{count}} levels_2": "{{count}} úrovní",
130
+ "{{count}} levels_3": "{{count}} úrovní",
131
+ "{{count}} groups_0": "{{count}} skupina",
132
+ "{{count}} groups_1": "{{count}} skupiny",
133
+ "{{count}} groups_2": "{{count}} skupin",
134
+ "{{count}} groups_3": "{{count}} skupin",
135
+ "Selected: {{commaSeparatedListOfOrganisationUnits}}": "Vybráno: {{commaSeparatedListOfOfOrganisationUnits}}",
136
+ "Nothing selected": "Není vybráno nic",
137
137
  "User organisation unit": "Organizační jednotka uživatele",
138
138
  "User sub-units": "Podjednotky uživatele",
139
139
  "User sub-x2-units": "Jednotky 2. řádu uživatele",
@@ -1,20 +1,20 @@
1
1
  {
2
- "view only": "",
3
- "view and edit": "",
4
- "all users ({{accessLevel}})": "",
5
- "{{userOrGroup}} ({{accessLevel}})": "",
6
- "Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
7
- "Not shared with any users or groups": "",
8
- "About this visualization": "",
2
+ "view only": "只读",
3
+ "view and edit": "查看和编辑",
4
+ "all users ({{accessLevel}})": "所有用户 ({{accessLevel}})",
5
+ "{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
6
+ "Shared with {{commaSeparatedListOfUsersAndGroups}}": "与 {{commaSeparatedListOfUsersAndGroups}} 共享",
7
+ "Not shared with any users or groups": "不与任何用户或组共享",
8
+ "About this visualization": "关于此可视化",
9
9
  "No description": "无描述",
10
- "Last updated {{time}}": "",
11
- "Created {{time}} by {{author}}": "",
12
- "Viewed {{count}} times": "",
10
+ "Last updated {{time}}": "最后更新 {{time}}",
11
+ "Created {{time}} by {{author}}": "由 {{author}} 在 {{time}} 创建",
12
+ "Viewed {{count}} times": "查看了 {{count}} 次",
13
13
  "Notifications": "通知",
14
- "You're subscribed and getting updates about new interpretations.": "",
15
- "Unsubscribe": "",
16
- "Subscribe to get updates about new interpretations.": "",
17
- "Subscribe": "",
14
+ "You're subscribed and getting updates about new interpretations.": "您已订阅并获取有关新解释的更新。",
15
+ "Unsubscribe": "退订",
16
+ "Subscribe to get updates about new interpretations.": "订阅以获取有关新解释的更新。",
17
+ "Subscribe": "订阅",
18
18
  "Data Type": "数据类型",
19
19
  "All types": "所有类型",
20
20
  "Totals only": "总计",
@@ -117,11 +117,11 @@
117
117
  "Options": "选项",
118
118
  "Hide": "隐藏",
119
119
  "Update": "更新",
120
- "{{count}} org units": "",
121
- "{{count}} levels": "",
122
- "{{count}} groups": "",
123
- "Selected: {{commaSeparatedListOfOrganisationUnits}}": "",
124
- "Nothing selected": "",
120
+ "{{count}} org units": "{{count}} 个组织单位",
121
+ "{{count}} levels": "{{count}} 级",
122
+ "{{count}} groups": "{{count}} 组",
123
+ "Selected: {{commaSeparatedListOfOrganisationUnits}}": "已选择:{{commaSeparatedListOfOrganisationUnits}}",
124
+ "Nothing selected": "未选择任何内容",
125
125
  "User organisation unit": "用户所在机构",
126
126
  "User sub-units": "我的下属机构",
127
127
  "User sub-x2-units": "该用户2级下属机构",
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DIMENSION_PROPS = exports.DIMENSION_PROP_ITEMS = exports.DIMENSION_PROP_ID = exports.DIMENSION = void 0;
6
+ exports.DIMENSION_PROPS = 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
 
@@ -31,5 +31,12 @@ const DIMENSION_PROP_ITEMS = {
31
31
  isValid: prop => Array.isArray(prop)
32
32
  };
33
33
  exports.DIMENSION_PROP_ITEMS = DIMENSION_PROP_ITEMS;
34
- const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS];
34
+ const DIMENSION_PROP_FILTER = {
35
+ name: 'filter',
36
+ defaultValue: [],
37
+ required: false,
38
+ isValid: prop => (0, _isString.default)(prop)
39
+ };
40
+ exports.DIMENSION_PROP_FILTER = DIMENSION_PROP_FILTER;
41
+ const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER];
35
42
  exports.DIMENSION_PROPS = DIMENSION_PROPS;
@@ -7,11 +7,19 @@ exports.dimensionCreate = void 0;
7
7
 
8
8
  var _dimension = require("./dimension");
9
9
 
10
- const dimensionCreate = (dimensionId, itemIds = []) => ({
11
- [_dimension.DIMENSION_PROP_ID.name]: dimensionId,
12
- [_dimension.DIMENSION_PROP_ITEMS.name]: itemIds.map(id => ({
13
- id
14
- }))
15
- });
10
+ const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
11
+ const dimension = {
12
+ [_dimension.DIMENSION_PROP_ID.name]: dimensionId,
13
+ ...(itemIds.length && {
14
+ [_dimension.DIMENSION_PROP_ITEMS.name]: itemIds.map(id => ({
15
+ id
16
+ }))
17
+ }),
18
+ ...(args.filter && {
19
+ [_dimension.DIMENSION_PROP_FILTER.name]: args.filter
20
+ })
21
+ };
22
+ return dimension;
23
+ };
16
24
 
17
25
  exports.dimensionCreate = dimensionCreate;
@@ -43,20 +43,28 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
43
43
  const columns = visualization.columns || [];
44
44
  const rows = visualization.rows || [];
45
45
  columns.concat(rows).forEach(d => {
46
+ var _d$legendSet, _d$items;
47
+
46
48
  let dimension = d.dimension;
47
49
 
50
+ if ((_d$legendSet = d.legendSet) !== null && _d$legendSet !== void 0 && _d$legendSet.id) {
51
+ dimension += "-".concat(d.legendSet.id);
52
+ }
53
+
48
54
  if (d.filter) {
49
55
  dimension += ":".concat(d.filter);
50
56
  }
51
57
 
52
- request = request.addDimension(dimension, d.items.map(item => item.id));
58
+ request = request.addDimension(dimension, (_d$items = d.items) === null || _d$items === void 0 ? void 0 : _d$items.map(item => item.id));
53
59
  }); // extract filters from visualization
54
60
 
55
61
  const filters = visualization.filters || []; // only pass dx/pe/ou as dimension
56
62
 
57
63
  const fixedIds = Object.keys(getFixedDimensions());
58
64
  filters.forEach(f => {
59
- request = passFilterAsDimension && fixedIds.includes(f.dimension) ? request.addDimension(f.dimension, f.items.map(item => item.id)) : request.addFilter(f.dimension, f.items.map(item => item.id));
65
+ var _f$items, _f$items2;
66
+
67
+ request = passFilterAsDimension && fixedIds.includes(f.dimension) ? request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id)) : request.addFilter(f.dimension, (_f$items2 = f.items) === null || _f$items2 === void 0 ? void 0 : _f$items2.map(item => item.id));
60
68
  });
61
69
  return request;
62
70
  }
@@ -116,12 +116,16 @@ class extends base {
116
116
  if (existingDimension) {
117
117
  this.dimensions.splice(dimensionIndex, 1, {
118
118
  dimension,
119
- items: updatedItems
119
+ ...(items && {
120
+ items: updatedItems
121
+ })
120
122
  });
121
123
  } else {
122
124
  this.dimensions.push({
123
125
  dimension,
124
- items: updatedItems
126
+ ...(items && {
127
+ items: updatedItems
128
+ })
125
129
  });
126
130
  }
127
131
 
@@ -115,8 +115,7 @@ describe('AnalyticsRequest', () => {
115
115
  it('should add the given dimension without any associated value', () => {
116
116
  request.addDimension('Jtf34kNZhzP');
117
117
  expect(request.dimensions).toEqual([{
118
- dimension: 'Jtf34kNZhzP',
119
- items: []
118
+ dimension: 'Jtf34kNZhzP'
120
119
  }]);
121
120
  });
122
121
  it('should add the given dimension with the associated value (passed as string)', () => {
@@ -31,7 +31,7 @@ const OrgUnitDimension = ({
31
31
  let result = [...selected];
32
32
 
33
33
  if (checked && DYNAMIC_ORG_UNITS.includes(id)) {
34
- result = [...result.filter(item => DYNAMIC_ORG_UNITS.includes(item.id) || ouIdHelper.hasLevelPrefix(item.id) || ouIdHelper.hasGroupPrefix(item.id)), {
34
+ result = [...result.filter(item => DYNAMIC_ORG_UNITS.includes(item.id)), {
35
35
  id,
36
36
  displayName
37
37
  }];
@@ -191,7 +191,9 @@ const OrgUnitDimension = ({
191
191
  onChange: onSelectItems,
192
192
  dataTest: 'org-unit-tree'
193
193
  })), /*#__PURE__*/React.createElement("div", {
194
- className: "jsx-".concat(styles.__hash) + " " + "selectsWrapper"
194
+ className: "jsx-".concat(styles.__hash) + " " + (cx('selectsWrapper', {
195
+ disabled: selected.some(item => DYNAMIC_ORG_UNITS.includes(item.id))
196
+ }) || "")
195
197
  }, /*#__PURE__*/React.createElement(MultiSelect, {
196
198
  selected: ouLevels.length ? selected.filter(item => ouIdHelper.hasLevelPrefix(item.id)).map(item => ouIdHelper.removePrefix(item.id)) : [],
197
199
  onChange: ({
@@ -1,23 +1,23 @@
1
1
  {
2
- "view only": "",
3
- "view and edit": "",
4
- "all users ({{accessLevel}})": "",
5
- "{{userOrGroup}} ({{accessLevel}})": "",
6
- "Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
7
- "Not shared with any users or groups": "",
8
- "About this visualization": "",
2
+ "view only": "pouze zobrazit",
3
+ "view and edit": "zobrazit a upravit",
4
+ "all users ({{accessLevel}})": "všichni uživatelé ({{accessLevel}})",
5
+ "{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
6
+ "Shared with {{commaSeparatedListOfUsersAndGroups}}": "Sdíleno s {{commaSeparatedListOfUsersAndGroups}}",
7
+ "Not shared with any users or groups": "Nesdíleno s žádnými uživateli ani skupinami",
8
+ "About this visualization": "O této vizualizaci",
9
9
  "No description": "Bez popisu",
10
- "Last updated {{time}}": "",
11
- "Created {{time}} by {{author}}": "",
12
- "Viewed {{count}} times_0": "",
13
- "Viewed {{count}} times_1": "",
14
- "Viewed {{count}} times_2": "",
15
- "Viewed {{count}} times_3": "",
10
+ "Last updated {{time}}": "Poslední aktualizace {{time}}",
11
+ "Created {{time}} by {{author}}": "Vytvořeno {{time}} uživatelem {{author}}",
12
+ "Viewed {{count}} times_0": "Zobrazeno 1 krát",
13
+ "Viewed {{count}} times_1": "Zobrazeno {{count}}krát",
14
+ "Viewed {{count}} times_2": "Zobrazeno {{count}}krát",
15
+ "Viewed {{count}} times_3": "Zobrazeno {{count}}krát",
16
16
  "Notifications": "Oznámení",
17
- "You're subscribed and getting updates about new interpretations.": "",
18
- "Unsubscribe": "",
19
- "Subscribe to get updates about new interpretations.": "",
20
- "Subscribe": "",
17
+ "You're subscribed and getting updates about new interpretations.": "Jste přihlášeni k odběru a dostáváte aktualizace o nových interpretacích.",
18
+ "Unsubscribe": "Odhlásit odběr",
19
+ "Subscribe to get updates about new interpretations.": "Přihlaste se k odběru novinek o nových interpretacích.",
20
+ "Subscribe": "Odebírat",
21
21
  "Data Type": "Typ dat",
22
22
  "All types": "Všechny typy",
23
23
  "Totals only": "Pouze součty",
@@ -120,20 +120,20 @@
120
120
  "Options": "Možnosti",
121
121
  "Hide": "Skrýt",
122
122
  "Update": "Aktualizovat",
123
- "{{count}} org units_0": "",
124
- "{{count}} org units_1": "",
125
- "{{count}} org units_2": "",
126
- "{{count}} org units_3": "",
127
- "{{count}} levels_0": "",
128
- "{{count}} levels_1": "",
129
- "{{count}} levels_2": "",
130
- "{{count}} levels_3": "",
131
- "{{count}} groups_0": "",
132
- "{{count}} groups_1": "",
133
- "{{count}} groups_2": "",
134
- "{{count}} groups_3": "",
135
- "Selected: {{commaSeparatedListOfOrganisationUnits}}": "",
136
- "Nothing selected": "",
123
+ "{{count}} org units_0": "{{count}} organizační jednotka",
124
+ "{{count}} org units_1": "{{count}} organizační jednotky",
125
+ "{{count}} org units_2": "{{count}} organizačních jednotek",
126
+ "{{count}} org units_3": "{{count}} organizačních jednotek",
127
+ "{{count}} levels_0": "{{count}} úroveň",
128
+ "{{count}} levels_1": "{{count}} úrovně",
129
+ "{{count}} levels_2": "{{count}} úrovní",
130
+ "{{count}} levels_3": "{{count}} úrovní",
131
+ "{{count}} groups_0": "{{count}} skupina",
132
+ "{{count}} groups_1": "{{count}} skupiny",
133
+ "{{count}} groups_2": "{{count}} skupin",
134
+ "{{count}} groups_3": "{{count}} skupin",
135
+ "Selected: {{commaSeparatedListOfOrganisationUnits}}": "Vybráno: {{commaSeparatedListOfOfOrganisationUnits}}",
136
+ "Nothing selected": "Není vybráno nic",
137
137
  "User organisation unit": "Organizační jednotka uživatele",
138
138
  "User sub-units": "Podjednotky uživatele",
139
139
  "User sub-x2-units": "Jednotky 2. řádu uživatele",
@@ -1,20 +1,20 @@
1
1
  {
2
- "view only": "",
3
- "view and edit": "",
4
- "all users ({{accessLevel}})": "",
5
- "{{userOrGroup}} ({{accessLevel}})": "",
6
- "Shared with {{commaSeparatedListOfUsersAndGroups}}": "",
7
- "Not shared with any users or groups": "",
8
- "About this visualization": "",
2
+ "view only": "只读",
3
+ "view and edit": "查看和编辑",
4
+ "all users ({{accessLevel}})": "所有用户 ({{accessLevel}})",
5
+ "{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
6
+ "Shared with {{commaSeparatedListOfUsersAndGroups}}": "与 {{commaSeparatedListOfUsersAndGroups}} 共享",
7
+ "Not shared with any users or groups": "不与任何用户或组共享",
8
+ "About this visualization": "关于此可视化",
9
9
  "No description": "无描述",
10
- "Last updated {{time}}": "",
11
- "Created {{time}} by {{author}}": "",
12
- "Viewed {{count}} times": "",
10
+ "Last updated {{time}}": "最后更新 {{time}}",
11
+ "Created {{time}} by {{author}}": "由 {{author}} 在 {{time}} 创建",
12
+ "Viewed {{count}} times": "查看了 {{count}} 次",
13
13
  "Notifications": "通知",
14
- "You're subscribed and getting updates about new interpretations.": "",
15
- "Unsubscribe": "",
16
- "Subscribe to get updates about new interpretations.": "",
17
- "Subscribe": "",
14
+ "You're subscribed and getting updates about new interpretations.": "您已订阅并获取有关新解释的更新。",
15
+ "Unsubscribe": "退订",
16
+ "Subscribe to get updates about new interpretations.": "订阅以获取有关新解释的更新。",
17
+ "Subscribe": "订阅",
18
18
  "Data Type": "数据类型",
19
19
  "All types": "所有类型",
20
20
  "Totals only": "总计",
@@ -117,11 +117,11 @@
117
117
  "Options": "选项",
118
118
  "Hide": "隐藏",
119
119
  "Update": "更新",
120
- "{{count}} org units": "",
121
- "{{count}} levels": "",
122
- "{{count}} groups": "",
123
- "Selected: {{commaSeparatedListOfOrganisationUnits}}": "",
124
- "Nothing selected": "",
120
+ "{{count}} org units": "{{count}} 个组织单位",
121
+ "{{count}} levels": "{{count}} 级",
122
+ "{{count}} groups": "{{count}} 组",
123
+ "Selected: {{commaSeparatedListOfOrganisationUnits}}": "已选择:{{commaSeparatedListOfOrganisationUnits}}",
124
+ "Nothing selected": "未选择任何内容",
125
125
  "User organisation unit": "用户所在机构",
126
126
  "User sub-units": "我的下属机构",
127
127
  "User sub-x2-units": "该用户2级下属机构",
@@ -17,4 +17,10 @@ export const DIMENSION_PROP_ITEMS = {
17
17
  required: false,
18
18
  isValid: prop => Array.isArray(prop)
19
19
  };
20
- export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS];
20
+ export const DIMENSION_PROP_FILTER = {
21
+ name: 'filter',
22
+ defaultValue: [],
23
+ required: false,
24
+ isValid: prop => isString(prop)
25
+ };
26
+ export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER];
@@ -1,7 +1,15 @@
1
- import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS } from './dimension';
2
- export const dimensionCreate = (dimensionId, itemIds = []) => ({
3
- [DIMENSION_PROP_ID.name]: dimensionId,
4
- [DIMENSION_PROP_ITEMS.name]: itemIds.map(id => ({
5
- id
6
- }))
7
- });
1
+ import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER } from './dimension';
2
+ export const dimensionCreate = (dimensionId, itemIds = [], args = {}) => {
3
+ const dimension = {
4
+ [DIMENSION_PROP_ID.name]: dimensionId,
5
+ ...(itemIds.length && {
6
+ [DIMENSION_PROP_ITEMS.name]: itemIds.map(id => ({
7
+ id
8
+ }))
9
+ }),
10
+ ...(args.filter && {
11
+ [DIMENSION_PROP_FILTER.name]: args.filter
12
+ })
13
+ };
14
+ return dimension;
15
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "21.0.5",
3
+ "version": "21.0.9",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {