@dhis2/analytics 21.2.5 → 22.0.0-alpha.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.
- package/build/cjs/components/FileMenu/FileMenu.js +6 -0
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +18 -4
- package/build/cjs/components/OpenFileDialog/FileList.js +5 -5
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +24 -20
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +17 -16
- package/build/cjs/index.js +16 -4
- package/build/cjs/locales/en/translations.json +3 -14
- package/build/cjs/modules/visTypes.js +14 -21
- package/build/es/components/FileMenu/FileMenu.js +6 -0
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +17 -4
- package/build/es/components/OpenFileDialog/FileList.js +5 -5
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +25 -22
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +18 -14
- package/build/es/index.js +1 -1
- package/build/es/locales/en/translations.json +3 -14
- package/build/es/modules/visTypes.js +10 -19
- package/package.json +1 -1
- package/CHANGELOG.md +0 -2922
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import i18n from '@dhis2/d2-i18n';
|
|
2
|
-
import {
|
|
2
|
+
import { SingleSelect, colors } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { getDisplayNameByVisType, visTypeIcons } from '../../modules/visTypes.js';
|
|
6
6
|
import { VisTypeIcon } from '../VisTypeIcon.js';
|
|
7
7
|
import { CustomSelectOption } from './CustomSelectOption.js';
|
|
8
|
-
export const VIS_TYPE_ALL = 'all';
|
|
9
|
-
export const VIS_TYPE_CHARTS = 'charts';
|
|
10
8
|
export const VisTypeFilter = ({
|
|
9
|
+
visTypes,
|
|
11
10
|
selected,
|
|
12
11
|
onChange
|
|
13
12
|
}) => /*#__PURE__*/React.createElement(SingleSelect, {
|
|
@@ -18,24 +17,29 @@ export const VisTypeFilter = ({
|
|
|
18
17
|
prefix: i18n.t('Type'),
|
|
19
18
|
dense: true,
|
|
20
19
|
maxHeight: "400px"
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
value: VIS_TYPE_CHARTS
|
|
27
|
-
}), /*#__PURE__*/React.createElement(Divider, null), Object.entries(visTypeDisplayNames).map(([type, label]) => /*#__PURE__*/React.createElement(CustomSelectOption, {
|
|
20
|
+
}, visTypes === null || visTypes === void 0 ? void 0 : visTypes.map(({
|
|
21
|
+
type,
|
|
22
|
+
disabled,
|
|
23
|
+
insertDivider
|
|
24
|
+
}) => /*#__PURE__*/React.createElement(CustomSelectOption, {
|
|
28
25
|
key: type,
|
|
29
|
-
|
|
26
|
+
disabled: disabled,
|
|
27
|
+
label: getDisplayNameByVisType(type),
|
|
28
|
+
insertDivider: insertDivider,
|
|
30
29
|
value: type,
|
|
31
|
-
icon: /*#__PURE__*/React.createElement(VisTypeIcon, {
|
|
30
|
+
icon: visTypeIcons[type] ? /*#__PURE__*/React.createElement(VisTypeIcon, {
|
|
32
31
|
type: type,
|
|
33
32
|
useSmall: true,
|
|
34
33
|
color: colors.grey600
|
|
35
|
-
})
|
|
34
|
+
}) : undefined
|
|
36
35
|
})));
|
|
37
36
|
VisTypeFilter.propTypes = {
|
|
38
37
|
selected: PropTypes.string,
|
|
38
|
+
visTypes: PropTypes.arrayOf(PropTypes.shape({
|
|
39
|
+
disabled: PropTypes.bool,
|
|
40
|
+
insertDivider: PropTypes.bool,
|
|
41
|
+
type: PropTypes.string
|
|
42
|
+
})),
|
|
39
43
|
onChange: PropTypes.func
|
|
40
44
|
};
|
|
41
45
|
export default VisTypeFilter;
|
package/build/es/index.js
CHANGED
|
@@ -68,7 +68,7 @@ export { itemIsValid } from './modules/layout/itemIsValid.js'; // Modules: visTy
|
|
|
68
68
|
|
|
69
69
|
export { getLayoutTypeByVisType } from './modules/visTypeToLayoutType.js'; // Modules: visTypes
|
|
70
70
|
|
|
71
|
-
export { VIS_TYPE_COLUMN, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR, VIS_TYPE_LINE, VIS_TYPE_AREA, VIS_TYPE_STACKED_AREA, VIS_TYPE_PIE, VIS_TYPE_RADAR, VIS_TYPE_GAUGE, VIS_TYPE_BUBBLE, VIS_TYPE_YEAR_OVER_YEAR_LINE, VIS_TYPE_YEAR_OVER_YEAR_COLUMN, VIS_TYPE_SINGLE_VALUE, VIS_TYPE_PIVOT_TABLE, VIS_TYPE_SCATTER,
|
|
71
|
+
export { VIS_TYPE_ALL, VIS_TYPE_CHARTS, VIS_TYPE_COLUMN, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR, VIS_TYPE_LINE, VIS_TYPE_AREA, VIS_TYPE_STACKED_AREA, VIS_TYPE_PIE, VIS_TYPE_RADAR, VIS_TYPE_GAUGE, VIS_TYPE_BUBBLE, VIS_TYPE_YEAR_OVER_YEAR_LINE, VIS_TYPE_YEAR_OVER_YEAR_COLUMN, VIS_TYPE_SINGLE_VALUE, VIS_TYPE_PIVOT_TABLE, VIS_TYPE_SCATTER, VIS_TYPE_LINE_LIST, visTypeDisplayNames, visTypeIcons, getDisplayNameByVisType, defaultVisType, isStacked, isMultiType, isYearOverYear, isDualAxisType, isSingleValue, isTwoCategoryChartType, isLegendSetType, isColumnBasedType, isVerticalType } from './modules/visTypes.js'; // Modules: layoutTypes
|
|
72
72
|
|
|
73
73
|
export { LAYOUT_TYPE_DEFAULT, LAYOUT_TYPE_PIE, LAYOUT_TYPE_SINGLE_VALUE, LAYOUT_TYPE_YEAR_OVER_YEAR, LAYOUT_TYPE_PIVOT_TABLE, LAYOUT_TYPE_SCATTER } from './modules/layoutTypes.js'; // Modules: layoutUiRules
|
|
74
74
|
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"Anyone": "Anyone",
|
|
82
82
|
"Only you": "Only you",
|
|
83
83
|
"Others": "Others",
|
|
84
|
+
"Not supported by this app yet": "Not supported by this app yet",
|
|
84
85
|
"Filter by name": "Filter by name",
|
|
85
86
|
"Created": "Created",
|
|
86
87
|
"Last updated": "Last updated",
|
|
87
88
|
"Type": "Type",
|
|
88
89
|
"Clear filters": "Clear filters",
|
|
89
90
|
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}",
|
|
90
|
-
"All charts": "All charts",
|
|
91
91
|
"Open": "Open",
|
|
92
92
|
"Couldn't load items": "Couldn't load items",
|
|
93
93
|
"There was a problem loading items. Try again or contact your system administrator.": "There was a problem loading items. Try again or contact your system administrator.",
|
|
@@ -309,19 +309,8 @@
|
|
|
309
309
|
"Year over year (column)": "Year over year (column)",
|
|
310
310
|
"Single value": "Single value",
|
|
311
311
|
"Scatter": "Scatter",
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"Compare parts of a whole against related elements vertically. Recommend data or org. unit as series.": "Compare parts of a whole against related elements vertically. Recommend data or org. unit as series.",
|
|
315
|
-
"Compare sizes of related elements horizontally. Recommend period as filter.": "Compare sizes of related elements horizontally. Recommend period as filter.",
|
|
316
|
-
"Compare parts of a whole against related elements horizontally. Recommend data or org. unit as series.": "Compare parts of a whole against related elements horizontally. Recommend data or org. unit as series.",
|
|
317
|
-
"Track or compare changes over time. Recommend period as category.": "Track or compare changes over time. Recommend period as category.",
|
|
318
|
-
"Track or compare parts of a whole over time. Recommend data as series and period as category.": "Track or compare parts of a whole over time. Recommend data as series and period as category.",
|
|
319
|
-
"Compare parts of a whole at a single point in time. Recommend period as filter.": "Compare parts of a whole at a single point in time. Recommend period as filter.",
|
|
320
|
-
"Compare several items against multiple variables.": "Compare several items against multiple variables.",
|
|
321
|
-
"Compare a percentage indicator against a 100% scale. Recommend period as filter.": "Compare a percentage indicator against a 100% scale. Recommend period as filter.",
|
|
322
|
-
"Compare changes over time between multiple time periods.": "Compare changes over time between multiple time periods.",
|
|
323
|
-
"Display a single value. Recommend relative period to show latest data.": "Display a single value. Recommend relative period to show latest data.",
|
|
324
|
-
"View the relationship between two data items at a place or time. Recommended for finding outliers.": "View the relationship between two data items at a place or time. Recommended for finding outliers.",
|
|
312
|
+
"Line list": "Line list",
|
|
313
|
+
"All charts": "All charts",
|
|
325
314
|
"{{seriesName}} (trend)": "{{seriesName}} (trend)",
|
|
326
315
|
"Trend": "Trend",
|
|
327
316
|
"No legend for this series": "No legend for this series",
|
|
@@ -16,6 +16,9 @@ export const VIS_TYPE_YEAR_OVER_YEAR_COLUMN = 'YEAR_OVER_YEAR_COLUMN';
|
|
|
16
16
|
export const VIS_TYPE_SINGLE_VALUE = 'SINGLE_VALUE';
|
|
17
17
|
export const VIS_TYPE_PIVOT_TABLE = 'PIVOT_TABLE';
|
|
18
18
|
export const VIS_TYPE_SCATTER = 'SCATTER';
|
|
19
|
+
export const VIS_TYPE_LINE_LIST = 'LINE_LIST';
|
|
20
|
+
export const VIS_TYPE_ALL = 'ALL';
|
|
21
|
+
export const VIS_TYPE_CHARTS = 'CHARTS';
|
|
19
22
|
export const visTypeDisplayNames = {
|
|
20
23
|
[VIS_TYPE_PIVOT_TABLE]: i18n.t('Pivot table'),
|
|
21
24
|
[VIS_TYPE_COLUMN]: i18n.t('Column'),
|
|
@@ -31,24 +34,10 @@ export const visTypeDisplayNames = {
|
|
|
31
34
|
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: i18n.t('Year over year (line)'),
|
|
32
35
|
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: i18n.t('Year over year (column)'),
|
|
33
36
|
[VIS_TYPE_SINGLE_VALUE]: i18n.t('Single value'),
|
|
34
|
-
[VIS_TYPE_SCATTER]: i18n.t('Scatter')
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[
|
|
38
|
-
[VIS_TYPE_COLUMN]: i18n.t('Compare sizes of related elements vertically. Recommend period as filter.'),
|
|
39
|
-
[VIS_TYPE_STACKED_COLUMN]: i18n.t('Compare parts of a whole against related elements vertically. Recommend data or org. unit as series.'),
|
|
40
|
-
[VIS_TYPE_BAR]: i18n.t('Compare sizes of related elements horizontally. Recommend period as filter.'),
|
|
41
|
-
[VIS_TYPE_STACKED_BAR]: i18n.t('Compare parts of a whole against related elements horizontally. Recommend data or org. unit as series.'),
|
|
42
|
-
[VIS_TYPE_LINE]: i18n.t('Track or compare changes over time. Recommend period as category.'),
|
|
43
|
-
[VIS_TYPE_AREA]: i18n.t('Track or compare changes over time. Recommend period as category.'),
|
|
44
|
-
[VIS_TYPE_STACKED_AREA]: i18n.t('Track or compare parts of a whole over time. Recommend data as series and period as category.'),
|
|
45
|
-
[VIS_TYPE_PIE]: i18n.t('Compare parts of a whole at a single point in time. Recommend period as filter.'),
|
|
46
|
-
[VIS_TYPE_RADAR]: i18n.t('Compare several items against multiple variables.'),
|
|
47
|
-
[VIS_TYPE_GAUGE]: i18n.t('Compare a percentage indicator against a 100% scale. Recommend period as filter.'),
|
|
48
|
-
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: i18n.t('Compare changes over time between multiple time periods.'),
|
|
49
|
-
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: i18n.t('Compare changes over time between multiple time periods.'),
|
|
50
|
-
[VIS_TYPE_SINGLE_VALUE]: i18n.t('Display a single value. Recommend relative period to show latest data.'),
|
|
51
|
-
[VIS_TYPE_SCATTER]: i18n.t('View the relationship between two data items at a place or time. Recommended for finding outliers.')
|
|
37
|
+
[VIS_TYPE_SCATTER]: i18n.t('Scatter'),
|
|
38
|
+
[VIS_TYPE_LINE_LIST]: i18n.t('Line list'),
|
|
39
|
+
[VIS_TYPE_ALL]: i18n.t('All types'),
|
|
40
|
+
[VIS_TYPE_CHARTS]: i18n.t('All charts')
|
|
52
41
|
};
|
|
53
42
|
export const visTypeIcons = {
|
|
54
43
|
[VIS_TYPE_PIVOT_TABLE]: IconTable24,
|
|
@@ -65,7 +54,9 @@ export const visTypeIcons = {
|
|
|
65
54
|
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: IconVisualizationLineMulti24,
|
|
66
55
|
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: IconVisualizationColumnMulti24,
|
|
67
56
|
[VIS_TYPE_SINGLE_VALUE]: IconVisualizationSingleValue24,
|
|
68
|
-
[VIS_TYPE_SCATTER]: IconVisualizationScatter24
|
|
57
|
+
[VIS_TYPE_SCATTER]: IconVisualizationScatter24,
|
|
58
|
+
[VIS_TYPE_LINE_LIST]: IconTable24 // TODO different icon @joe
|
|
59
|
+
|
|
69
60
|
};
|
|
70
61
|
export const getDisplayNameByVisType = visType => {
|
|
71
62
|
const displayName = visTypeDisplayNames[visType];
|