@dhis2/analytics 23.6.1 → 23.6.4

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,24 @@
1
+ ## [23.6.4](https://github.com/dhis2/analytics/compare/v23.6.3...v23.6.4) (2022-03-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **TranslationDialog:** remove warnings ([#1174](https://github.com/dhis2/analytics/issues/1174)) ([c7e778d](https://github.com/dhis2/analytics/commit/c7e778da4b9aa6f950b874bd6f61a4018a5c8f3f))
7
+
8
+ ## [23.6.3](https://github.com/dhis2/analytics/compare/v23.6.2...v23.6.3) (2022-03-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * rename event visualization to line list ([#1176](https://github.com/dhis2/analytics/issues/1176)) ([057bdd0](https://github.com/dhis2/analytics/commit/057bdd0a27923de54e2a7294bef60f3613cdef50))
14
+
15
+ ## [23.6.2](https://github.com/dhis2/analytics/compare/v23.6.1...v23.6.2) (2022-03-06)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **translations:** sync translations from transifex (master) ([2bb2866](https://github.com/dhis2/analytics/commit/2bb2866b1c1a9a59a415f083319e35cbcc1b29ac))
21
+
1
22
  ## [23.6.1](https://github.com/dhis2/analytics/compare/v23.6.0...v23.6.1) (2022-03-05)
2
23
 
3
24
 
@@ -57,13 +57,13 @@ const texts = {
57
57
  newButtonLabel: _d2I18n.default.t('New map')
58
58
  },
59
59
  [AO_TYPE_EVENT_VISUALIZATION]: {
60
- modalTitle: _d2I18n.default.t('Open an event visualization'),
61
- loadingText: _d2I18n.default.t('Loading event visualizations'),
62
- errorTitle: _d2I18n.default.t("Couldn't load event visualizations"),
63
- errorText: _d2I18n.default.t('There was a problem loading event visualizations. Try again or contact your system administrator.'),
64
- noDataText: _d2I18n.default.t('No event visualizations found. Click New event visualization to get started.'),
65
- noFilteredDataText: _d2I18n.default.t("No event visualizations found. Try adjusting your search or filter options to find what you're looking for."),
66
- newButtonLabel: _d2I18n.default.t('New event visualization')
60
+ modalTitle: _d2I18n.default.t('Open a line list'),
61
+ loadingText: _d2I18n.default.t('Loading line lists'),
62
+ errorTitle: _d2I18n.default.t("Couldn't load line lists"),
63
+ errorText: _d2I18n.default.t('There was a problem loading line lists. Try again or contact your system administrator.'),
64
+ noDataText: _d2I18n.default.t('No line lists found. Click New line list to get started.'),
65
+ noFilteredDataText: _d2I18n.default.t("No line lists found. Try adjusting your search or filter options to find what you're looking for."),
66
+ newButtonLabel: _d2I18n.default.t('New line list')
67
67
  }
68
68
  };
69
69
 
@@ -37,7 +37,7 @@ const LocalesSelect = ({
37
37
  selected
38
38
  }) => onChange(selected),
39
39
  loading: fetching,
40
- selected: data ? selected : undefined,
40
+ selected: data && selected ? selected : '',
41
41
  dense: true
42
42
  }, data && data.locales // XXX remove duplicates ?! fr_SN - French (Senegal)
43
43
  .reduce((locales, {
@@ -27,6 +27,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
27
27
 
28
28
  const SESSION_STORAGE_TRANSLATION_LOCALE_KEY = 'translation-dialog-selected-locale';
29
29
 
30
+ const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
31
+
30
32
  const TranslationForm = ({
31
33
  fieldsToTranslate,
32
34
  objectToTranslate,
@@ -44,8 +46,6 @@ const TranslationForm = ({
44
46
  critical: true
45
47
  });
46
48
 
47
- const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
48
-
49
49
  const getTranslationIndexForField = field => newTranslations.findIndex(element => element.locale === translationLocale && element.property.toLowerCase() === camelCaseToUnderscores(field));
50
50
 
51
51
  const getTranslationForField = field => {
@@ -65,11 +65,12 @@ const TranslationForm = ({
65
65
  setNewTranslations(translationIndex === -1 ? [...newTranslations, newTranslation] : newTranslations.map((translation, index) => index === translationIndex ? newTranslation : translation));
66
66
  };
67
67
 
68
- const [fetchFieldsTranslations] = (0, _appRuntime.useDataMutation)({
68
+ const i18nMutationRef = (0, _react.useRef)({
69
69
  resource: 'i18n',
70
70
  type: 'create',
71
71
  data: fieldsToTranslate.map(camelCaseToUnderscores)
72
- }, {
72
+ });
73
+ const [fetchFieldsTranslations] = (0, _appRuntime.useDataMutation)(i18nMutationRef.current, {
73
74
  onComplete: res => setFieldsTranslations(res),
74
75
  onError: error => showError(error)
75
76
  });
@@ -110,13 +110,13 @@
110
110
  "No maps found. Click New map to get started.": "No maps found. Click New map to get started.",
111
111
  "No maps found. Try adjusting your search or filter options to find what you're looking for.": "No maps found. Try adjusting your search or filter options to find what you're looking for.",
112
112
  "New map": "New map",
113
- "Open an event visualization": "Open an event visualization",
114
- "Loading event visualizations": "Loading event visualizations",
115
- "Couldn't load event visualizations": "Couldn't load event visualizations",
116
- "There was a problem loading event visualizations. Try again or contact your system administrator.": "There was a problem loading event visualizations. Try again or contact your system administrator.",
117
- "No event visualizations found. Click New event visualization to get started.": "No event visualizations found. Click New event visualization to get started.",
118
- "No event visualizations found. Try adjusting your search or filter options to find what you're looking for.": "No event visualizations found. Try adjusting your search or filter options to find what you're looking for.",
119
- "New event visualization": "New event visualization",
113
+ "Open a line list": "Open a line list",
114
+ "Loading line lists": "Loading line lists",
115
+ "Couldn't load line lists": "Couldn't load line lists",
116
+ "There was a problem loading line lists. Try again or contact your system administrator.": "There was a problem loading line lists. Try again or contact your system administrator.",
117
+ "No line lists found. Click New line list to get started.": "No line lists found. Click New line list to get started.",
118
+ "No line lists found. Try adjusting your search or filter options to find what you're looking for.": "No line lists found. Try adjusting your search or filter options to find what you're looking for.",
119
+ "New line list": "New line list",
120
120
  "Options": "Options",
121
121
  "Hide": "Hide",
122
122
  "Update": "Update",
@@ -43,13 +43,13 @@ const texts = {
43
43
  newButtonLabel: i18n.t('New map')
44
44
  },
45
45
  [AO_TYPE_EVENT_VISUALIZATION]: {
46
- modalTitle: i18n.t('Open an event visualization'),
47
- loadingText: i18n.t('Loading event visualizations'),
48
- errorTitle: i18n.t("Couldn't load event visualizations"),
49
- errorText: i18n.t('There was a problem loading event visualizations. Try again or contact your system administrator.'),
50
- noDataText: i18n.t('No event visualizations found. Click New event visualization to get started.'),
51
- noFilteredDataText: i18n.t("No event visualizations found. Try adjusting your search or filter options to find what you're looking for."),
52
- newButtonLabel: i18n.t('New event visualization')
46
+ modalTitle: i18n.t('Open a line list'),
47
+ loadingText: i18n.t('Loading line lists'),
48
+ errorTitle: i18n.t("Couldn't load line lists"),
49
+ errorText: i18n.t('There was a problem loading line lists. Try again or contact your system administrator.'),
50
+ noDataText: i18n.t('No line lists found. Click New line list to get started.'),
51
+ noFilteredDataText: i18n.t("No line lists found. Try adjusting your search or filter options to find what you're looking for."),
52
+ newButtonLabel: i18n.t('New line list')
53
53
  }
54
54
  };
55
55
  export const getTranslatedString = (type, key) => (texts[type] || texts[NO_TYPE])[key];
@@ -22,7 +22,7 @@ export const LocalesSelect = ({
22
22
  selected
23
23
  }) => onChange(selected),
24
24
  loading: fetching,
25
- selected: data ? selected : undefined,
25
+ selected: data && selected ? selected : '',
26
26
  dense: true
27
27
  }, data && data.locales // XXX remove duplicates ?! fr_SN - French (Senegal)
28
28
  .reduce((locales, {
@@ -6,6 +6,9 @@ import React, { useEffect, useRef, useState } from 'react';
6
6
  import { LocalesSelect } from './LocalesSelect.js';
7
7
  import { TranslationModalActions } from './TranslationModalActions.js';
8
8
  const SESSION_STORAGE_TRANSLATION_LOCALE_KEY = 'translation-dialog-selected-locale';
9
+
10
+ const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
11
+
9
12
  export const TranslationForm = ({
10
13
  fieldsToTranslate,
11
14
  objectToTranslate,
@@ -23,8 +26,6 @@ export const TranslationForm = ({
23
26
  critical: true
24
27
  });
25
28
 
26
- const camelCaseToUnderscores = field => field.replace(/[a-z][A-Z]/g, match => [match.charAt(0), match.charAt(1)].join('_')).toLowerCase();
27
-
28
29
  const getTranslationIndexForField = field => newTranslations.findIndex(element => element.locale === translationLocale && element.property.toLowerCase() === camelCaseToUnderscores(field));
29
30
 
30
31
  const getTranslationForField = field => {
@@ -44,11 +45,12 @@ export const TranslationForm = ({
44
45
  setNewTranslations(translationIndex === -1 ? [...newTranslations, newTranslation] : newTranslations.map((translation, index) => index === translationIndex ? newTranslation : translation));
45
46
  };
46
47
 
47
- const [fetchFieldsTranslations] = useDataMutation({
48
+ const i18nMutationRef = useRef({
48
49
  resource: 'i18n',
49
50
  type: 'create',
50
51
  data: fieldsToTranslate.map(camelCaseToUnderscores)
51
- }, {
52
+ });
53
+ const [fetchFieldsTranslations] = useDataMutation(i18nMutationRef.current, {
52
54
  onComplete: res => setFieldsTranslations(res),
53
55
  onError: error => showError(error)
54
56
  });
@@ -110,13 +110,13 @@
110
110
  "No maps found. Click New map to get started.": "No maps found. Click New map to get started.",
111
111
  "No maps found. Try adjusting your search or filter options to find what you're looking for.": "No maps found. Try adjusting your search or filter options to find what you're looking for.",
112
112
  "New map": "New map",
113
- "Open an event visualization": "Open an event visualization",
114
- "Loading event visualizations": "Loading event visualizations",
115
- "Couldn't load event visualizations": "Couldn't load event visualizations",
116
- "There was a problem loading event visualizations. Try again or contact your system administrator.": "There was a problem loading event visualizations. Try again or contact your system administrator.",
117
- "No event visualizations found. Click New event visualization to get started.": "No event visualizations found. Click New event visualization to get started.",
118
- "No event visualizations found. Try adjusting your search or filter options to find what you're looking for.": "No event visualizations found. Try adjusting your search or filter options to find what you're looking for.",
119
- "New event visualization": "New event visualization",
113
+ "Open a line list": "Open a line list",
114
+ "Loading line lists": "Loading line lists",
115
+ "Couldn't load line lists": "Couldn't load line lists",
116
+ "There was a problem loading line lists. Try again or contact your system administrator.": "There was a problem loading line lists. Try again or contact your system administrator.",
117
+ "No line lists found. Click New line list to get started.": "No line lists found. Click New line list to get started.",
118
+ "No line lists found. Try adjusting your search or filter options to find what you're looking for.": "No line lists found. Try adjusting your search or filter options to find what you're looking for.",
119
+ "New line list": "New line list",
120
120
  "Options": "Options",
121
121
  "Hide": "Hide",
122
122
  "Update": "Update",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "23.6.1",
3
+ "version": "23.6.4",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {