@dhis2/analytics 23.7.2 → 23.7.5
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 +21 -0
- package/build/cjs/api/analytics/AnalyticsRequest.js +14 -2
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +9 -9
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +2 -2
- package/build/es/api/analytics/AnalyticsRequest.js +14 -2
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +10 -10
- package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +2 -2
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [23.7.5](https://github.com/dhis2/analytics/compare/v23.7.4...v23.7.5) (2022-04-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* filter on displayName to get objects in current language DHIS2-13015 ([#1199](https://github.com/dhis2/analytics/issues/1199)) ([00c9d77](https://github.com/dhis2/analytics/commit/00c9d77793e6c92b84c0859873b599153b2a17cc))
|
|
7
|
+
|
|
8
|
+
## [23.7.4](https://github.com/dhis2/analytics/compare/v23.7.3...v23.7.4) (2022-04-06)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* avoid dialog jumping when searching/paging TECH-1064 ([#1193](https://github.com/dhis2/analytics/issues/1193)) ([f06faa0](https://github.com/dhis2/analytics/commit/f06faa0d1fd8a7284d2a70cc6e17801ca303f300))
|
|
14
|
+
|
|
15
|
+
## [23.7.3](https://github.com/dhis2/analytics/compare/v23.7.2...v23.7.3) (2022-03-31)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* get stage id and filter string for filters just like for columns and rows([#1191](https://github.com/dhis2/analytics/issues/1191)) ([4550517](https://github.com/dhis2/analytics/commit/45505179f9c1bf359d900d05d22f267c356d72cf))
|
|
21
|
+
|
|
1
22
|
## [23.7.2](https://github.com/dhis2/analytics/compare/v23.7.1...v23.7.2) (2022-03-26)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -87,9 +87,21 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
87
87
|
|
|
88
88
|
const fixedIds = Object.keys((0, _predefinedDimensions.getFixedDimensions)());
|
|
89
89
|
filters.forEach(f => {
|
|
90
|
-
|
|
90
|
+
if (passFilterAsDimension && fixedIds.includes(f.dimension)) {
|
|
91
|
+
var _f$items;
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
request = request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id));
|
|
94
|
+
} else {
|
|
95
|
+
var _f$programStage, _f$items2;
|
|
96
|
+
|
|
97
|
+
let filterString = (_f$programStage = f.programStage) !== null && _f$programStage !== void 0 && _f$programStage.id ? "".concat(f.programStage.id, ".").concat(f.dimension) : f.dimension;
|
|
98
|
+
|
|
99
|
+
if (f.filter) {
|
|
100
|
+
filterString += ":".concat(f.filter);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
request = request.addFilter(filterString, (_f$items2 = f.items) === null || _f$items2 === void 0 ? void 0 : _f$items2.map(item => item.id));
|
|
104
|
+
}
|
|
93
105
|
});
|
|
94
106
|
return request;
|
|
95
107
|
}
|
|
@@ -128,7 +128,7 @@ const OpenFileDialog = ({
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
if (filters.searchTerm) {
|
|
131
|
-
queryFilters.push("
|
|
131
|
+
queryFilters.push("displayName:ilike:".concat(filters.searchTerm));
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
return queryFilters;
|
|
@@ -198,7 +198,7 @@ const OpenFileDialog = ({
|
|
|
198
198
|
const cypressSelector = 'open-file-dialog-modal';
|
|
199
199
|
return /*#__PURE__*/_react.default.createElement(_ui.Modal, {
|
|
200
200
|
large: true,
|
|
201
|
-
position: "
|
|
201
|
+
position: "top",
|
|
202
202
|
hide: !open,
|
|
203
203
|
onClose: onClose,
|
|
204
204
|
dataTest: cypressSelector
|
|
@@ -240,7 +240,9 @@ const OpenFileDialog = ({
|
|
|
240
240
|
}, _d2I18n.default.t('Clear filters'))), error ? /*#__PURE__*/_react.default.createElement(_ui.NoticeBox, {
|
|
241
241
|
title: (0, _utils.getTranslatedString)(type, 'errorTitle'),
|
|
242
242
|
warning: true
|
|
243
|
-
}, (0, _utils.getTranslatedString)(type, 'errorText')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
243
|
+
}, (0, _utils.getTranslatedString)(type, 'errorText')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
244
|
+
className: "jsx-".concat(_OpenFileDialogStyles.styles.__hash) + " " + "data-table-wrapper"
|
|
245
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.DataTable, {
|
|
244
246
|
layout: "fixed"
|
|
245
247
|
}, /*#__PURE__*/_react.default.createElement(_ui.DataTableHead, null, /*#__PURE__*/_react.default.createElement(_ui.DataTableRow, null, data !== null && data !== void 0 && data.files[_utils.AOTypeMap[type].apiEndpoint].length ? headers.map(({
|
|
246
248
|
field,
|
|
@@ -263,7 +265,7 @@ const OpenFileDialog = ({
|
|
|
263
265
|
}, loading && /*#__PURE__*/_react.default.createElement(_ui.DataTableRow, null, /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, {
|
|
264
266
|
large: true
|
|
265
267
|
}, /*#__PURE__*/_react.default.createElement(_ui.Box, {
|
|
266
|
-
height: "
|
|
268
|
+
height: "342px"
|
|
267
269
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
268
270
|
className: "jsx-".concat(_OpenFileDialogStyles.styles.__hash) + " " + "info-cell"
|
|
269
271
|
}, /*#__PURE__*/_react.default.createElement(_ui.CircularLoader, {
|
|
@@ -273,7 +275,7 @@ const OpenFileDialog = ({
|
|
|
273
275
|
}, (0, _utils.getTranslatedString)(type, 'loadingText')))))), !loading && !(data !== null && data !== void 0 && data.files[_utils.AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/_react.default.createElement(_ui.DataTableRow, null, /*#__PURE__*/_react.default.createElement(_ui.DataTableCell, {
|
|
274
276
|
large: true
|
|
275
277
|
}, /*#__PURE__*/_react.default.createElement(_ui.Box, {
|
|
276
|
-
minHeight: "
|
|
278
|
+
minHeight: "342px"
|
|
277
279
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
278
280
|
className: "jsx-".concat(_OpenFileDialogStyles.styles.__hash) + " " + "info-cell"
|
|
279
281
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -293,15 +295,13 @@ const OpenFileDialog = ({
|
|
|
293
295
|
data: data.files[_utils.AOTypeMap[type].apiEndpoint],
|
|
294
296
|
onSelect: onFileSelect,
|
|
295
297
|
showVisTypeColumn: Boolean(filterVisTypes === null || filterVisTypes === void 0 ? void 0 : filterVisTypes.length)
|
|
296
|
-
}))), (data === null || data === void 0 ? void 0 : data.files[_utils.AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/_react.default.createElement(
|
|
297
|
-
position: "bottom"
|
|
298
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
298
|
+
})))), (data === null || data === void 0 ? void 0 : data.files[_utils.AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
299
299
|
className: "jsx-".concat(_OpenFileDialogStyles.styles.__hash) + " " + "pagination-controls"
|
|
300
300
|
}, /*#__PURE__*/_react.default.createElement(_PaginationControls.PaginationControls, {
|
|
301
301
|
page: page,
|
|
302
302
|
pager: data.files.pager,
|
|
303
303
|
onPageChange: setPage
|
|
304
|
-
})))
|
|
304
|
+
}))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
305
305
|
id: _OpenFileDialogStyles.styles.__hash
|
|
306
306
|
}, _OpenFileDialogStyles.styles))));
|
|
307
307
|
};
|
|
@@ -7,6 +7,6 @@ exports.styles = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _ui = require("@dhis2/ui");
|
|
9
9
|
|
|
10
|
-
const styles = [".data-table-body.jsx-
|
|
10
|
+
const styles = [".data-table-wrapper.jsx-3416632651{min-height:405px;}", ".data-table-body.jsx-3416632651{min-height:465px;}", ".pagination-controls.jsx-3416632651{width:100%;margin-top:".concat(_ui.spacers.dp12, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;}"), ".search-and-filter-bar.jsx-3416632651{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(_ui.spacers.dp4, ";-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:").concat(_ui.spacers.dp8, ";}"), ".search-field-container.jsx-3416632651{min-width:220px;}", ".type-field-container.jsx-3416632651,.created-by-field-container.jsx-3416632651{min-width:180px;}", ".info-cell.jsx-3416632651{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;gap:".concat(_ui.spacers.dp8, ";margin:").concat(_ui.spacers.dp32, " 0;}"), ".info-container.jsx-3416632651{max-width:400px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".info-text.jsx-3416632651{text-align:center;font-size:14px;line-height:19px;color:".concat(_ui.colors.grey700, ";}"), ".info-button.jsx-3416632651{margin-top:".concat(_ui.spacers.dp12, ";}")];
|
|
11
11
|
exports.styles = styles;
|
|
12
|
-
styles.__hash = "
|
|
12
|
+
styles.__hash = "3416632651";
|
|
@@ -74,9 +74,21 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
74
74
|
|
|
75
75
|
const fixedIds = Object.keys(getFixedDimensions());
|
|
76
76
|
filters.forEach(f => {
|
|
77
|
-
|
|
77
|
+
if (passFilterAsDimension && fixedIds.includes(f.dimension)) {
|
|
78
|
+
var _f$items;
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
request = request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id));
|
|
81
|
+
} else {
|
|
82
|
+
var _f$programStage, _f$items2;
|
|
83
|
+
|
|
84
|
+
let filterString = (_f$programStage = f.programStage) !== null && _f$programStage !== void 0 && _f$programStage.id ? "".concat(f.programStage.id, ".").concat(f.dimension) : f.dimension;
|
|
85
|
+
|
|
86
|
+
if (f.filter) {
|
|
87
|
+
filterString += ":".concat(f.filter);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
request = request.addFilter(filterString, (_f$items2 = f.items) === null || _f$items2 === void 0 ? void 0 : _f$items2.map(item => item.id));
|
|
91
|
+
}
|
|
80
92
|
});
|
|
81
93
|
return request;
|
|
82
94
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import { useDataQuery } from '@dhis2/app-runtime';
|
|
3
3
|
import i18n from '@dhis2/d2-i18n';
|
|
4
|
-
import { Box, Modal, ModalTitle, ModalContent, DataTable, DataTableHead, DataTableBody, DataTableRow, DataTableCell, DataTableColumnHeader,
|
|
4
|
+
import { Box, Modal, ModalTitle, ModalContent, DataTable, DataTableHead, DataTableBody, DataTableRow, DataTableCell, DataTableColumnHeader, NoticeBox, CircularLoader, Button } from '@dhis2/ui';
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -101,7 +101,7 @@ export const OpenFileDialog = ({
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
if (filters.searchTerm) {
|
|
104
|
-
queryFilters.push("
|
|
104
|
+
queryFilters.push("displayName:ilike:".concat(filters.searchTerm));
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
return queryFilters;
|
|
@@ -171,7 +171,7 @@ export const OpenFileDialog = ({
|
|
|
171
171
|
const cypressSelector = 'open-file-dialog-modal';
|
|
172
172
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
173
173
|
large: true,
|
|
174
|
-
position: "
|
|
174
|
+
position: "top",
|
|
175
175
|
hide: !open,
|
|
176
176
|
onClose: onClose,
|
|
177
177
|
dataTest: cypressSelector
|
|
@@ -213,7 +213,9 @@ export const OpenFileDialog = ({
|
|
|
213
213
|
}, i18n.t('Clear filters'))), error ? /*#__PURE__*/React.createElement(NoticeBox, {
|
|
214
214
|
title: getTranslatedString(type, 'errorTitle'),
|
|
215
215
|
warning: true
|
|
216
|
-
}, getTranslatedString(type, 'errorText')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
216
|
+
}, getTranslatedString(type, 'errorText')) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
className: "jsx-".concat(styles.__hash) + " " + "data-table-wrapper"
|
|
218
|
+
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
217
219
|
layout: "fixed"
|
|
218
220
|
}, /*#__PURE__*/React.createElement(DataTableHead, null, /*#__PURE__*/React.createElement(DataTableRow, null, data !== null && data !== void 0 && data.files[AOTypeMap[type].apiEndpoint].length ? headers.map(({
|
|
219
221
|
field,
|
|
@@ -236,7 +238,7 @@ export const OpenFileDialog = ({
|
|
|
236
238
|
}, loading && /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, {
|
|
237
239
|
large: true
|
|
238
240
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
239
|
-
height: "
|
|
241
|
+
height: "342px"
|
|
240
242
|
}, /*#__PURE__*/React.createElement("div", {
|
|
241
243
|
className: "jsx-".concat(styles.__hash) + " " + "info-cell"
|
|
242
244
|
}, /*#__PURE__*/React.createElement(CircularLoader, {
|
|
@@ -246,7 +248,7 @@ export const OpenFileDialog = ({
|
|
|
246
248
|
}, getTranslatedString(type, 'loadingText')))))), !loading && !(data !== null && data !== void 0 && data.files[AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/React.createElement(DataTableRow, null, /*#__PURE__*/React.createElement(DataTableCell, {
|
|
247
249
|
large: true
|
|
248
250
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
249
|
-
minHeight: "
|
|
251
|
+
minHeight: "342px"
|
|
250
252
|
}, /*#__PURE__*/React.createElement("div", {
|
|
251
253
|
className: "jsx-".concat(styles.__hash) + " " + "info-cell"
|
|
252
254
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -266,15 +268,13 @@ export const OpenFileDialog = ({
|
|
|
266
268
|
data: data.files[AOTypeMap[type].apiEndpoint],
|
|
267
269
|
onSelect: onFileSelect,
|
|
268
270
|
showVisTypeColumn: Boolean(filterVisTypes === null || filterVisTypes === void 0 ? void 0 : filterVisTypes.length)
|
|
269
|
-
}))), (data === null || data === void 0 ? void 0 : data.files[AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/React.createElement(
|
|
270
|
-
position: "bottom"
|
|
271
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
271
|
+
})))), (data === null || data === void 0 ? void 0 : data.files[AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
272
272
|
className: "jsx-".concat(styles.__hash) + " " + "pagination-controls"
|
|
273
273
|
}, /*#__PURE__*/React.createElement(PaginationControls, {
|
|
274
274
|
page: page,
|
|
275
275
|
pager: data.files.pager,
|
|
276
276
|
onPageChange: setPage
|
|
277
|
-
})))
|
|
277
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
278
278
|
id: styles.__hash
|
|
279
279
|
}, styles))));
|
|
280
280
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { colors, spacers } from '@dhis2/ui';
|
|
2
|
-
export const styles = [".data-table-body.jsx-
|
|
3
|
-
styles.__hash = "
|
|
2
|
+
export const styles = [".data-table-wrapper.jsx-3416632651{min-height:405px;}", ".data-table-body.jsx-3416632651{min-height:465px;}", ".pagination-controls.jsx-3416632651{width:100%;margin-top:".concat(spacers.dp12, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;}"), ".search-and-filter-bar.jsx-3416632651{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(spacers.dp4, ";-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:").concat(spacers.dp8, ";}"), ".search-field-container.jsx-3416632651{min-width:220px;}", ".type-field-container.jsx-3416632651,.created-by-field-container.jsx-3416632651{min-width:180px;}", ".info-cell.jsx-3416632651{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;gap:".concat(spacers.dp8, ";margin:").concat(spacers.dp32, " 0;}"), ".info-container.jsx-3416632651{max-width:400px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".info-text.jsx-3416632651{text-align:center;font-size:14px;line-height:19px;color:".concat(colors.grey700, ";}"), ".info-button.jsx-3416632651{margin-top:".concat(spacers.dp12, ";}")];
|
|
3
|
+
styles.__hash = "3416632651";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/analytics",
|
|
3
|
-
"version": "23.7.
|
|
3
|
+
"version": "23.7.5",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"styled-jsx": "^3.3.2"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@dhis2/d2-ui-translation-dialog": "^7.3.1",
|
|
62
61
|
"classnames": "^2.3.1",
|
|
63
62
|
"d2-utilizr": "^0.2.16",
|
|
64
63
|
"d3-color": "^1.2.3",
|