@dhis2/analytics 21.2.2 → 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/components/TranslationDialog/TranslationModal/TranslationForm.js +20 -17
- package/build/cjs/index.js +16 -4
- package/build/cjs/locales/ar/translations.json +1 -0
- package/build/cjs/locales/ar_EG/translations.json +1 -0
- package/build/cjs/locales/ar_IQ/translations.json +1 -0
- package/build/cjs/locales/ckb/translations.json +1 -0
- package/build/cjs/locales/cs/translations.json +1 -0
- package/build/cjs/locales/da/translations.json +1 -0
- package/build/cjs/locales/en/translations.json +3 -14
- package/build/cjs/locales/es/translations.json +1 -0
- package/build/cjs/locales/fr/translations.json +1 -0
- package/build/cjs/locales/id/translations.json +1 -0
- package/build/cjs/locales/km/translations.json +1 -0
- package/build/cjs/locales/lo/translations.json +1 -0
- package/build/cjs/locales/my/translations.json +1 -0
- package/build/cjs/locales/nb/translations.json +54 -53
- package/build/cjs/locales/nl/translations.json +1 -0
- package/build/cjs/locales/prs/translations.json +1 -0
- package/build/cjs/locales/ps/translations.json +1 -0
- package/build/cjs/locales/pt/translations.json +1 -0
- package/build/cjs/locales/pt_BR/translations.json +1 -0
- package/build/cjs/locales/ru/translations.json +1 -0
- package/build/cjs/locales/sv/translations.json +1 -0
- package/build/cjs/locales/tet/translations.json +1 -0
- package/build/cjs/locales/tg/translations.json +1 -0
- package/build/cjs/locales/uk/translations.json +1 -0
- package/build/cjs/locales/ur/translations.json +1 -0
- package/build/cjs/locales/uz/translations.json +1 -0
- package/build/cjs/locales/uz_Latn/translations.json +1 -0
- package/build/cjs/locales/vi/translations.json +1 -0
- package/build/cjs/locales/zh/translations.json +1 -0
- package/build/cjs/locales/zh_CN/translations.json +1 -0
- 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/components/TranslationDialog/TranslationModal/TranslationForm.js +20 -17
- package/build/es/index.js +1 -1
- package/build/es/locales/ar/translations.json +1 -0
- package/build/es/locales/ar_EG/translations.json +1 -0
- package/build/es/locales/ar_IQ/translations.json +1 -0
- package/build/es/locales/ckb/translations.json +1 -0
- package/build/es/locales/cs/translations.json +1 -0
- package/build/es/locales/da/translations.json +1 -0
- package/build/es/locales/en/translations.json +3 -14
- package/build/es/locales/es/translations.json +1 -0
- package/build/es/locales/fr/translations.json +1 -0
- package/build/es/locales/id/translations.json +1 -0
- package/build/es/locales/km/translations.json +1 -0
- package/build/es/locales/lo/translations.json +1 -0
- package/build/es/locales/my/translations.json +1 -0
- package/build/es/locales/nb/translations.json +54 -53
- package/build/es/locales/nl/translations.json +1 -0
- package/build/es/locales/prs/translations.json +1 -0
- package/build/es/locales/ps/translations.json +1 -0
- package/build/es/locales/pt/translations.json +1 -0
- package/build/es/locales/pt_BR/translations.json +1 -0
- package/build/es/locales/ru/translations.json +1 -0
- package/build/es/locales/sv/translations.json +1 -0
- package/build/es/locales/tet/translations.json +1 -0
- package/build/es/locales/tg/translations.json +1 -0
- package/build/es/locales/uk/translations.json +1 -0
- package/build/es/locales/ur/translations.json +1 -0
- package/build/es/locales/uz/translations.json +1 -0
- package/build/es/locales/uz_Latn/translations.json +1 -0
- package/build/es/locales/vi/translations.json +1 -0
- package/build/es/locales/zh/translations.json +1 -0
- package/build/es/locales/zh_CN/translations.json +1 -0
- package/build/es/modules/visTypes.js +10 -19
- package/package.json +1 -1
- package/CHANGELOG.md +0 -2901
|
@@ -1,43 +1,43 @@
|
|
|
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": "kun visning",
|
|
3
|
+
"view and edit": "vis og endre",
|
|
4
|
+
"all users ({{accessLevel}})": "alle brukere ({{accessLevel}})",
|
|
5
|
+
"{{userOrGroup}} ({{accessLevel}})": "{{userOrGroup}} ({{accessLevel}})",
|
|
6
|
+
"Shared with {{commaSeparatedListOfUsersAndGroups}}": "Delt med {{commaSeparatedListOfUsersAndGroups}}",
|
|
7
|
+
"Not shared with any users or groups": "Ikke delt med noen brukere eller grupper",
|
|
8
|
+
"About this visualization": "Om denne visualiseringen",
|
|
9
9
|
"No description": "Ingen beskrivelse",
|
|
10
|
-
"Last updated {{time}}": "",
|
|
11
|
-
"Created {{time}} by {{author}}": "",
|
|
12
|
-
"Viewed {{count}} times": "",
|
|
13
|
-
"Viewed {{count}} times_plural": "",
|
|
10
|
+
"Last updated {{time}}": "Sist oppdatert {{time}}",
|
|
11
|
+
"Created {{time}} by {{author}}": "Opprettet {{time}} av {{author}}",
|
|
12
|
+
"Viewed {{count}} times": "Vist 1 gang",
|
|
13
|
+
"Viewed {{count}} times_plural": "Vist {{count}} ganger",
|
|
14
14
|
"Notifications": "Varsler",
|
|
15
|
-
"You're subscribed and getting updates about new interpretations.": "",
|
|
16
|
-
"Unsubscribe": "",
|
|
17
|
-
"Subscribe to get updates about new interpretations.": "",
|
|
18
|
-
"Subscribe": "",
|
|
15
|
+
"You're subscribed and getting updates about new interpretations.": "Du abonnerer og får oppdateringer om nye tolkninger.",
|
|
16
|
+
"Unsubscribe": "Avslutt abonnementet",
|
|
17
|
+
"Subscribe to get updates about new interpretations.": "Abonner for å få oppdateringer om nye tolkninger.",
|
|
18
|
+
"Subscribe": "Abonner",
|
|
19
19
|
"Data Type": "Datatype",
|
|
20
20
|
"All types": "Alle typer",
|
|
21
|
-
"Totals only": "",
|
|
22
|
-
"Details only": "",
|
|
21
|
+
"Totals only": "Kun totaler",
|
|
22
|
+
"Details only": "Kun detaljer",
|
|
23
23
|
"Disaggregation": "Disaggregering",
|
|
24
24
|
"No data": "Ingen data",
|
|
25
25
|
"Loading": "Laster",
|
|
26
|
-
"Search by data item name": "",
|
|
26
|
+
"Search by data item name": "Søk etter datapunktnavn",
|
|
27
27
|
"No items selected": "Ingen elementer er valgt",
|
|
28
28
|
"Selected Items": "Valgte elementer",
|
|
29
|
-
"No indicators found": "",
|
|
30
|
-
"No data elements found": "",
|
|
31
|
-
"No data sets found": "",
|
|
32
|
-
"No event data items found": "",
|
|
33
|
-
"No program indicators found": "",
|
|
34
|
-
"No indicators found for \"{{- searchTerm}}\"": "",
|
|
35
|
-
"No data elements found for \"{{- searchTerm}}\"": "",
|
|
36
|
-
"No data sets found for \"{{- searchTerm}}\"": "",
|
|
37
|
-
"No event data items found for \"{{- searchTerm}}\"": "",
|
|
38
|
-
"No program indicators found for \"{{- searchTerm}}\"": "",
|
|
39
|
-
"Nothing found for \"{{- searchTerm}}\"": "",
|
|
40
|
-
"Metric type": "",
|
|
29
|
+
"No indicators found": "Ingen indikatorer funnet",
|
|
30
|
+
"No data elements found": "Ingen dataelementer funnet",
|
|
31
|
+
"No data sets found": "Ingen datasett funnet",
|
|
32
|
+
"No event data items found": "Ingen hendelsesdataelementer funnet",
|
|
33
|
+
"No program indicators found": "Ingen programindikatorer funnet",
|
|
34
|
+
"No indicators found for \"{{- searchTerm}}\"": "Ingen indikatorer funnet for \"{{- searchTerm}}\"",
|
|
35
|
+
"No data elements found for \"{{- searchTerm}}\"": "Ingen dataelementer funnet for \"{{- searchTerm}}\"",
|
|
36
|
+
"No data sets found for \"{{- searchTerm}}\"": "Ingen datasett funnet for \"{{- searchTerm}}\"",
|
|
37
|
+
"No event data items found for \"{{- searchTerm}}\"": "Ingen hendelsesdataelementer funnet for \"{{- searchTerm}}\"",
|
|
38
|
+
"No program indicators found for \"{{- searchTerm}}\"": "Ingen programindikatorer funnet for \"{{- searchTerm}}\"",
|
|
39
|
+
"Nothing found for \"{{- searchTerm}}\"": "Ingenting funnet for \"{{- searchTerm}}\"",
|
|
40
|
+
"Metric type": "Metrisk type",
|
|
41
41
|
"All metrics": "Alle beregninger",
|
|
42
42
|
"Move to {{axisName}}": "Flytt til {{axisName}}",
|
|
43
43
|
"Add to {{axisName}}": "Legg til {{axisName}}",
|
|
@@ -49,49 +49,49 @@
|
|
|
49
49
|
"Main dimensions": "Hoveddimensjoner",
|
|
50
50
|
"Your dimensions": "Dine dimensjoner",
|
|
51
51
|
"Dimension recommended with selected data": "Dimensjon anbefalt med valgte data",
|
|
52
|
-
"All items": "",
|
|
53
|
-
"Automatically include all items": "",
|
|
54
|
-
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "",
|
|
55
|
-
"Manually select items...": "",
|
|
56
|
-
"Nothing found in {{- dimensionTitle}}": "",
|
|
52
|
+
"All items": "Alle elementer",
|
|
53
|
+
"Automatically include all items": "Inkluder automatisk alle elementer",
|
|
54
|
+
"Select all {{- dimensionTitle}} items. With this option, new items added in the future will be automatically included.": "Velg alle {{- dimensionTitle}} elementer. Med dette alternativet vil nye elementer som legges til i fremtiden automatisk inkluderes.",
|
|
55
|
+
"Manually select items...": "Velg elementer manuelt...",
|
|
56
|
+
"Nothing found in {{- dimensionTitle}}": "Ingenting funnet i {{- dimensionTitle}}",
|
|
57
57
|
"Search": "Søk",
|
|
58
|
-
"Nothing found for {{searchTerm}}": "",
|
|
59
|
-
"Delete {{fileType}}": "",
|
|
60
|
-
"This {{fileType}} and related interpretations will be deleted. Continue?": "",
|
|
58
|
+
"Nothing found for {{searchTerm}}": "Ingenting funnet for {{searchTerm}}",
|
|
59
|
+
"Delete {{fileType}}": "Slett {{fileType}}",
|
|
60
|
+
"This {{fileType}} and related interpretations will be deleted. Continue?": "Denne {{fileType}} og relaterte tolkninger vil bli slettet. Fortsette?",
|
|
61
61
|
"Cancel": "Avbryt",
|
|
62
62
|
"Delete": "Slett",
|
|
63
63
|
"File": "Fil",
|
|
64
64
|
"New": "Ny",
|
|
65
|
-
"Open…": "",
|
|
65
|
+
"Open…": "Åpne...",
|
|
66
66
|
"Save": "Lagre",
|
|
67
|
-
"Save…": "",
|
|
68
|
-
"Save as…": "",
|
|
69
|
-
"Rename…": "",
|
|
70
|
-
"Translate…": "",
|
|
71
|
-
"Share…": "",
|
|
72
|
-
"Get link…": "",
|
|
67
|
+
"Save…": "Lagre...",
|
|
68
|
+
"Save as…": "Lagre som...",
|
|
69
|
+
"Rename…": "Gi nytt navn...",
|
|
70
|
+
"Translate…": "Oversette...",
|
|
71
|
+
"Share…": "Dele...",
|
|
72
|
+
"Get link…": "Få lenke…",
|
|
73
73
|
"Open in this app": "Åpne i denne appen",
|
|
74
74
|
"Close": "Lukk",
|
|
75
|
-
"Rename {{fileType}}": "",
|
|
75
|
+
"Rename {{fileType}}": "Gi nytt navn til {{fileType}}",
|
|
76
76
|
"Name": "Navn",
|
|
77
77
|
"Description": "Beskrivelse",
|
|
78
78
|
"Rename": "Gi nytt navn",
|
|
79
|
-
"Save {{fileType}} as": "",
|
|
79
|
+
"Save {{fileType}} as": "Lagre {{fileType}} som",
|
|
80
80
|
"Created by": "Opprettet av",
|
|
81
81
|
"Anyone": "Hvem som helst",
|
|
82
|
-
"Only you": "",
|
|
82
|
+
"Only you": "Bare deg",
|
|
83
83
|
"Others": "Andre",
|
|
84
84
|
"Filter by name": "Filtrer etter navn",
|
|
85
85
|
"Created": "Opprettet",
|
|
86
86
|
"Last updated": "Sist oppdatert",
|
|
87
87
|
"Type": "Type",
|
|
88
88
|
"Clear filters": "Tøm filtre",
|
|
89
|
-
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "",
|
|
90
|
-
"All charts": "",
|
|
89
|
+
"{{firstItemIndex}}-{{lastItemIndex}} of {{totalNumberOfItems}}": "{{firstItemIndex}}-{{lastItemIndex}} av {{totalNumberOfItems}}",
|
|
90
|
+
"All charts": "Alle diagrammer",
|
|
91
91
|
"Open": "Åpne",
|
|
92
|
-
"Couldn't load items": "",
|
|
93
|
-
"There was a problem loading items. Try again or contact your system administrator.": "",
|
|
94
|
-
"No items found. Create a new to get started.": "",
|
|
92
|
+
"Couldn't load items": "Kunne ikke laste inn elementer",
|
|
93
|
+
"There was a problem loading items. Try again or contact your system administrator.": "Det oppsto et problem med å laste elementer. Prøv igjen eller kontakt systemadministratoren.",
|
|
94
|
+
"No items found. Create a new to get started.": "Ingen elementer funnet. Opprett en ny for å komme i gang.",
|
|
95
95
|
"No items found. Try adjusting your search or filter options to find what you're looking for.": "",
|
|
96
96
|
"Create new": "Opprett ny",
|
|
97
97
|
"Open a visualization": "",
|
|
@@ -228,6 +228,7 @@
|
|
|
228
228
|
"Choose a locale to translate from the menu above": "",
|
|
229
229
|
"Translate: {{objectName}}": "",
|
|
230
230
|
"Save translations": "",
|
|
231
|
+
"Could not load translations": "",
|
|
231
232
|
"Retry": "",
|
|
232
233
|
"Series": "Serie",
|
|
233
234
|
"Category": "Kategori",
|
|
@@ -224,6 +224,7 @@
|
|
|
224
224
|
"Choose a locale to translate from the menu above": "从上面的菜单中选择要翻译的语言环境",
|
|
225
225
|
"Translate: {{objectName}}": "翻译:{{objectName}}",
|
|
226
226
|
"Save translations": "保存翻译",
|
|
227
|
+
"Could not load translations": "",
|
|
227
228
|
"Retry": "重试",
|
|
228
229
|
"Series": "系列",
|
|
229
230
|
"Category": "分类",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isColumnBasedType = exports.isLegendSetType = exports.isVerticalType = exports.isTwoCategoryChartType = exports.isSingleValue = exports.isMultiType = exports.isDualAxisType = exports.isYearOverYear = exports.isStacked = exports.defaultVisType = exports.getDisplayNameByVisType = exports.visTypeIcons = exports.
|
|
6
|
+
exports.isColumnBasedType = exports.isLegendSetType = exports.isVerticalType = exports.isTwoCategoryChartType = exports.isSingleValue = exports.isMultiType = exports.isDualAxisType = exports.isYearOverYear = exports.isStacked = exports.defaultVisType = exports.getDisplayNameByVisType = exports.visTypeIcons = exports.visTypeDisplayNames = exports.VIS_TYPE_CHARTS = exports.VIS_TYPE_ALL = exports.VIS_TYPE_LINE_LIST = exports.VIS_TYPE_SCATTER = exports.VIS_TYPE_PIVOT_TABLE = exports.VIS_TYPE_SINGLE_VALUE = exports.VIS_TYPE_YEAR_OVER_YEAR_COLUMN = exports.VIS_TYPE_YEAR_OVER_YEAR_LINE = exports.VIS_TYPE_BUBBLE = exports.VIS_TYPE_GAUGE = exports.VIS_TYPE_RADAR = exports.VIS_TYPE_PIE = exports.VIS_TYPE_STACKED_AREA = exports.VIS_TYPE_AREA = exports.VIS_TYPE_LINE = exports.VIS_TYPE_STACKED_BAR = exports.VIS_TYPE_BAR = exports.VIS_TYPE_STACKED_COLUMN = exports.VIS_TYPE_COLUMN = void 0;
|
|
7
7
|
|
|
8
8
|
var _ui = require("@dhis2/ui");
|
|
9
9
|
|
|
@@ -43,6 +43,12 @@ const VIS_TYPE_PIVOT_TABLE = 'PIVOT_TABLE';
|
|
|
43
43
|
exports.VIS_TYPE_PIVOT_TABLE = VIS_TYPE_PIVOT_TABLE;
|
|
44
44
|
const VIS_TYPE_SCATTER = 'SCATTER';
|
|
45
45
|
exports.VIS_TYPE_SCATTER = VIS_TYPE_SCATTER;
|
|
46
|
+
const VIS_TYPE_LINE_LIST = 'LINE_LIST';
|
|
47
|
+
exports.VIS_TYPE_LINE_LIST = VIS_TYPE_LINE_LIST;
|
|
48
|
+
const VIS_TYPE_ALL = 'ALL';
|
|
49
|
+
exports.VIS_TYPE_ALL = VIS_TYPE_ALL;
|
|
50
|
+
const VIS_TYPE_CHARTS = 'CHARTS';
|
|
51
|
+
exports.VIS_TYPE_CHARTS = VIS_TYPE_CHARTS;
|
|
46
52
|
const visTypeDisplayNames = {
|
|
47
53
|
[VIS_TYPE_PIVOT_TABLE]: _index.default.t('Pivot table'),
|
|
48
54
|
[VIS_TYPE_COLUMN]: _index.default.t('Column'),
|
|
@@ -58,27 +64,12 @@ const visTypeDisplayNames = {
|
|
|
58
64
|
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: _index.default.t('Year over year (line)'),
|
|
59
65
|
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: _index.default.t('Year over year (column)'),
|
|
60
66
|
[VIS_TYPE_SINGLE_VALUE]: _index.default.t('Single value'),
|
|
61
|
-
[VIS_TYPE_SCATTER]: _index.default.t('Scatter')
|
|
67
|
+
[VIS_TYPE_SCATTER]: _index.default.t('Scatter'),
|
|
68
|
+
[VIS_TYPE_LINE_LIST]: _index.default.t('Line list'),
|
|
69
|
+
[VIS_TYPE_ALL]: _index.default.t('All types'),
|
|
70
|
+
[VIS_TYPE_CHARTS]: _index.default.t('All charts')
|
|
62
71
|
};
|
|
63
72
|
exports.visTypeDisplayNames = visTypeDisplayNames;
|
|
64
|
-
const visTypeDescriptions = {
|
|
65
|
-
[VIS_TYPE_PIVOT_TABLE]: _index.default.t('View data and indicators in a manipulatable table.'),
|
|
66
|
-
[VIS_TYPE_COLUMN]: _index.default.t('Compare sizes of related elements vertically. Recommend period as filter.'),
|
|
67
|
-
[VIS_TYPE_STACKED_COLUMN]: _index.default.t('Compare parts of a whole against related elements vertically. Recommend data or org. unit as series.'),
|
|
68
|
-
[VIS_TYPE_BAR]: _index.default.t('Compare sizes of related elements horizontally. Recommend period as filter.'),
|
|
69
|
-
[VIS_TYPE_STACKED_BAR]: _index.default.t('Compare parts of a whole against related elements horizontally. Recommend data or org. unit as series.'),
|
|
70
|
-
[VIS_TYPE_LINE]: _index.default.t('Track or compare changes over time. Recommend period as category.'),
|
|
71
|
-
[VIS_TYPE_AREA]: _index.default.t('Track or compare changes over time. Recommend period as category.'),
|
|
72
|
-
[VIS_TYPE_STACKED_AREA]: _index.default.t('Track or compare parts of a whole over time. Recommend data as series and period as category.'),
|
|
73
|
-
[VIS_TYPE_PIE]: _index.default.t('Compare parts of a whole at a single point in time. Recommend period as filter.'),
|
|
74
|
-
[VIS_TYPE_RADAR]: _index.default.t('Compare several items against multiple variables.'),
|
|
75
|
-
[VIS_TYPE_GAUGE]: _index.default.t('Compare a percentage indicator against a 100% scale. Recommend period as filter.'),
|
|
76
|
-
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: _index.default.t('Compare changes over time between multiple time periods.'),
|
|
77
|
-
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: _index.default.t('Compare changes over time between multiple time periods.'),
|
|
78
|
-
[VIS_TYPE_SINGLE_VALUE]: _index.default.t('Display a single value. Recommend relative period to show latest data.'),
|
|
79
|
-
[VIS_TYPE_SCATTER]: _index.default.t('View the relationship between two data items at a place or time. Recommended for finding outliers.')
|
|
80
|
-
};
|
|
81
|
-
exports.visTypeDescriptions = visTypeDescriptions;
|
|
82
73
|
const visTypeIcons = {
|
|
83
74
|
[VIS_TYPE_PIVOT_TABLE]: _ui.IconTable24,
|
|
84
75
|
[VIS_TYPE_BAR]: _ui.IconVisualizationBar24,
|
|
@@ -94,7 +85,9 @@ const visTypeIcons = {
|
|
|
94
85
|
[VIS_TYPE_YEAR_OVER_YEAR_LINE]: _ui.IconVisualizationLineMulti24,
|
|
95
86
|
[VIS_TYPE_YEAR_OVER_YEAR_COLUMN]: _ui.IconVisualizationColumnMulti24,
|
|
96
87
|
[VIS_TYPE_SINGLE_VALUE]: _ui.IconVisualizationSingleValue24,
|
|
97
|
-
[VIS_TYPE_SCATTER]: _ui.IconVisualizationScatter24
|
|
88
|
+
[VIS_TYPE_SCATTER]: _ui.IconVisualizationScatter24,
|
|
89
|
+
[VIS_TYPE_LINE_LIST]: _ui.IconTable24 // TODO different icon @joe
|
|
90
|
+
|
|
98
91
|
};
|
|
99
92
|
exports.visTypeIcons = visTypeIcons;
|
|
100
93
|
|
|
@@ -14,8 +14,10 @@ import { supportedFileTypes } from './utils.js';
|
|
|
14
14
|
export const FileMenu = ({
|
|
15
15
|
d2,
|
|
16
16
|
// to be removed as soon as TranslateDialog and FavoritesDialog are rewritten
|
|
17
|
+
defaultFilterVisType,
|
|
17
18
|
fileType,
|
|
18
19
|
fileObject,
|
|
20
|
+
filterVisTypes,
|
|
19
21
|
onNew,
|
|
20
22
|
onOpen,
|
|
21
23
|
onSave,
|
|
@@ -130,6 +132,8 @@ export const FileMenu = ({
|
|
|
130
132
|
}, i18n.t('File'))), /*#__PURE__*/React.createElement(OpenFileDialog, {
|
|
131
133
|
open: currentDialog === 'open',
|
|
132
134
|
type: fileType,
|
|
135
|
+
filterVisTypes: filterVisTypes,
|
|
136
|
+
defaultFilterVisType: defaultFilterVisType,
|
|
133
137
|
onClose: onDialogClose,
|
|
134
138
|
onFileSelect: id => {
|
|
135
139
|
onOpen(id);
|
|
@@ -238,8 +242,10 @@ FileMenu.defaultProps = {
|
|
|
238
242
|
};
|
|
239
243
|
FileMenu.propTypes = {
|
|
240
244
|
d2: PropTypes.object,
|
|
245
|
+
defaultFilterVisType: PropTypes.string,
|
|
241
246
|
fileObject: PropTypes.object,
|
|
242
247
|
fileType: PropTypes.oneOf(supportedFileTypes),
|
|
248
|
+
filterVisTypes: PropTypes.array,
|
|
243
249
|
onDelete: PropTypes.func,
|
|
244
250
|
onError: PropTypes.func,
|
|
245
251
|
onNew: PropTypes.func,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import { MenuDivider, Tooltip } from '@dhis2/ui';
|
|
2
4
|
import cx from 'classnames';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import React from 'react';
|
|
5
7
|
import styles from './styles/CustomSelectOption.style.js';
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
const CustomSelectOptionItem = ({
|
|
7
10
|
value,
|
|
8
11
|
label,
|
|
9
12
|
icon,
|
|
13
|
+
insertDivider,
|
|
10
14
|
onClick,
|
|
11
15
|
active,
|
|
12
16
|
disabled
|
|
13
|
-
}) => /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
14
18
|
onClick: e => onClick({}, e),
|
|
15
19
|
"data-value": value,
|
|
16
20
|
"data-label": label,
|
|
@@ -19,10 +23,18 @@ export const CustomSelectOption = ({
|
|
|
19
23
|
disabled
|
|
20
24
|
}) || "")
|
|
21
25
|
}, icon, /*#__PURE__*/React.createElement("span", {
|
|
22
|
-
className: "jsx-".concat(styles.__hash) + " " +
|
|
26
|
+
className: "jsx-".concat(styles.__hash) + " " + (cx({
|
|
27
|
+
label: icon
|
|
28
|
+
}) || "")
|
|
23
29
|
}, label), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
24
30
|
id: styles.__hash
|
|
25
|
-
}, styles))
|
|
31
|
+
}, styles)), insertDivider ? /*#__PURE__*/React.createElement(MenuDivider, {
|
|
32
|
+
dense: true
|
|
33
|
+
}) : null);
|
|
34
|
+
|
|
35
|
+
export const CustomSelectOption = props => props.disabled ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
36
|
+
content: i18n.t('Not supported by this app yet')
|
|
37
|
+
}, /*#__PURE__*/React.createElement(CustomSelectOptionItem, props)) : /*#__PURE__*/React.createElement(CustomSelectOptionItem, props);
|
|
26
38
|
CustomSelectOption.propTypes = {
|
|
27
39
|
icon: PropTypes.element.isRequired,
|
|
28
40
|
label: PropTypes.string.isRequired,
|
|
@@ -31,4 +43,5 @@ CustomSelectOption.propTypes = {
|
|
|
31
43
|
disabled: PropTypes.bool,
|
|
32
44
|
onClick: PropTypes.func
|
|
33
45
|
};
|
|
46
|
+
CustomSelectOptionItem.propTypes = CustomSelectOption.propTypes;
|
|
34
47
|
export default CustomSelectOption;
|
|
@@ -4,14 +4,14 @@ import React from 'react';
|
|
|
4
4
|
import { VisTypeIcon } from '../VisTypeIcon.js';
|
|
5
5
|
import { DateField } from './DateField.js';
|
|
6
6
|
export const FileList = ({
|
|
7
|
-
type,
|
|
8
7
|
data,
|
|
9
|
-
onSelect
|
|
8
|
+
onSelect,
|
|
9
|
+
showVisTypeColumn
|
|
10
10
|
}) => /*#__PURE__*/React.createElement(React.Fragment, null, data.map(visualization => /*#__PURE__*/React.createElement(DataTableRow, {
|
|
11
11
|
key: visualization.id
|
|
12
12
|
}, /*#__PURE__*/React.createElement(DataTableCell, {
|
|
13
13
|
onClick: () => onSelect(visualization.id)
|
|
14
|
-
}, visualization.displayName),
|
|
14
|
+
}, visualization.displayName), showVisTypeColumn && /*#__PURE__*/React.createElement(DataTableCell, {
|
|
15
15
|
align: "center"
|
|
16
16
|
}, /*#__PURE__*/React.createElement(VisTypeIcon, {
|
|
17
17
|
type: visualization.type,
|
|
@@ -30,7 +30,7 @@ FileList.propTypes = {
|
|
|
30
30
|
lastUpdated: PropTypes.string.isRequired,
|
|
31
31
|
type: PropTypes.string
|
|
32
32
|
})).isRequired,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
onSelect: PropTypes.func.isRequired,
|
|
34
|
+
showVisTypeColumn: PropTypes.bool
|
|
35
35
|
};
|
|
36
36
|
export default FileList;
|
|
@@ -5,13 +5,14 @@ import { Box, Modal, ModalTitle, ModalContent, DataTable, DataTableHead, DataTab
|
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import { VIS_TYPE_ALL, VIS_TYPE_CHARTS } from '../../modules/visTypes.js';
|
|
8
9
|
import { CreatedByFilter, CREATED_BY_ALL, CREATED_BY_ALL_BUT_CURRENT_USER, CREATED_BY_CURRENT_USER } from './CreatedByFilter.js';
|
|
9
10
|
import { FileList } from './FileList.js';
|
|
10
11
|
import { NameFilter } from './NameFilter.js';
|
|
11
12
|
import { styles } from './OpenFileDialog.styles.js';
|
|
12
13
|
import { PaginationControls } from './PaginationControls.js';
|
|
13
|
-
import { getTranslatedString,
|
|
14
|
-
import { VisTypeFilter
|
|
14
|
+
import { getTranslatedString, AOTypeMap } from './utils.js';
|
|
15
|
+
import { VisTypeFilter } from './VisTypeFilter.js';
|
|
15
16
|
|
|
16
17
|
const getQuery = type => ({
|
|
17
18
|
files: {
|
|
@@ -42,6 +43,8 @@ const getQuery = type => ({
|
|
|
42
43
|
export const OpenFileDialog = ({
|
|
43
44
|
type,
|
|
44
45
|
open,
|
|
46
|
+
filterVisTypes,
|
|
47
|
+
defaultFilterVisType,
|
|
45
48
|
onClose,
|
|
46
49
|
onFileSelect,
|
|
47
50
|
onNew,
|
|
@@ -51,7 +54,7 @@ export const OpenFileDialog = ({
|
|
|
51
54
|
const defaultFilters = {
|
|
52
55
|
searchTerm: '',
|
|
53
56
|
createdBy: CREATED_BY_ALL,
|
|
54
|
-
visType:
|
|
57
|
+
visType: defaultFilterVisType
|
|
55
58
|
};
|
|
56
59
|
const [{
|
|
57
60
|
sortField,
|
|
@@ -82,26 +85,23 @@ export const OpenFileDialog = ({
|
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
if (filters.visType) {
|
|
89
|
+
switch (filters.visType) {
|
|
90
|
+
case VIS_TYPE_ALL:
|
|
91
|
+
break;
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
case VIS_TYPE_CHARTS:
|
|
94
|
+
queryFilters.push('type:!eq:PIVOT_TABLE');
|
|
95
|
+
break;
|
|
92
96
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
default:
|
|
98
|
+
queryFilters.push("type:eq:".concat(filters.visType));
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
if (filters.searchTerm) {
|
|
99
104
|
queryFilters.push("name:ilike:".concat(filters.searchTerm));
|
|
100
|
-
} // for ER 2.38 only show line list ER types
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (type === AO_TYPE_EVENT_REPORT) {
|
|
104
|
-
queryFilters.push('dataType:eq:EVENTS');
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
return queryFilters;
|
|
@@ -154,7 +154,7 @@ export const OpenFileDialog = ({
|
|
|
154
154
|
width: '110px'
|
|
155
155
|
}];
|
|
156
156
|
|
|
157
|
-
if (
|
|
157
|
+
if (filterVisTypes !== null && filterVisTypes !== void 0 && filterVisTypes.length) {
|
|
158
158
|
headers.splice(1, 0, {
|
|
159
159
|
field: 'type',
|
|
160
160
|
label: i18n.t('Type'),
|
|
@@ -187,9 +187,10 @@ export const OpenFileDialog = ({
|
|
|
187
187
|
searchTerm: value
|
|
188
188
|
}), 200));
|
|
189
189
|
}
|
|
190
|
-
})),
|
|
190
|
+
})), (filterVisTypes === null || filterVisTypes === void 0 ? void 0 : filterVisTypes.length) && /*#__PURE__*/React.createElement("div", {
|
|
191
191
|
className: "jsx-".concat(styles.__hash) + " " + "type-field-container"
|
|
192
192
|
}, /*#__PURE__*/React.createElement(VisTypeFilter, {
|
|
193
|
+
visTypes: filterVisTypes,
|
|
193
194
|
selected: filters.visType,
|
|
194
195
|
onChange: value => setFilters({ ...filters,
|
|
195
196
|
visType: value
|
|
@@ -258,9 +259,9 @@ export const OpenFileDialog = ({
|
|
|
258
259
|
onClose();
|
|
259
260
|
}
|
|
260
261
|
}, getTranslatedString(type, 'newButtonLabel'))))))))), (data === null || data === void 0 ? void 0 : data.files[AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/React.createElement(FileList, {
|
|
261
|
-
type: type,
|
|
262
262
|
data: data.files[AOTypeMap[type].apiEndpoint],
|
|
263
|
-
onSelect: onFileSelect
|
|
263
|
+
onSelect: onFileSelect,
|
|
264
|
+
showVisTypeColumn: Boolean(filterVisTypes === null || filterVisTypes === void 0 ? void 0 : filterVisTypes.length)
|
|
264
265
|
}))), (data === null || data === void 0 ? void 0 : data.files[AOTypeMap[type].apiEndpoint].length) > 0 && /*#__PURE__*/React.createElement(DataTableToolbar, {
|
|
265
266
|
position: "bottom"
|
|
266
267
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -279,6 +280,8 @@ OpenFileDialog.propTypes = {
|
|
|
279
280
|
type: PropTypes.oneOf(Object.keys(AOTypeMap)).isRequired,
|
|
280
281
|
onClose: PropTypes.func.isRequired,
|
|
281
282
|
onFileSelect: PropTypes.func.isRequired,
|
|
282
|
-
onNew: PropTypes.func.isRequired
|
|
283
|
+
onNew: PropTypes.func.isRequired,
|
|
284
|
+
defaultFilterVisType: PropTypes.string,
|
|
285
|
+
filterVisTypes: PropTypes.array
|
|
283
286
|
};
|
|
284
287
|
export default OpenFileDialog;
|