@dhis2/analytics 25.1.22 → 25.2.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/__demo__/FileMenu.stories.js +8 -6
- package/build/cjs/__demo__/Toolbar.stories.js +77 -0
- package/build/cjs/components/FileMenu/FileMenu.js +21 -59
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +318 -194
- package/build/cjs/components/Options/VisualizationOptions.js +3 -1
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +107 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +66 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +94 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +99 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.styles.js +13 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +219 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +23 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +56 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +50 -0
- package/build/cjs/components/Toolbar/HoverMenuBar/index.js +37 -0
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +50 -0
- package/build/cjs/components/Toolbar/MenuButton.styles.js +13 -0
- package/build/cjs/components/Toolbar/Toolbar.js +39 -0
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +45 -0
- package/build/cjs/components/Toolbar/UpdateButton.js +57 -0
- package/build/cjs/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +50 -0
- package/build/cjs/components/Toolbar/__tests__/Toolbar.spec.js +24 -0
- package/build/cjs/components/Toolbar/__tests__/ToolbarSidebar.spec.js +30 -0
- package/build/cjs/components/Toolbar/__tests__/UpdateButton.spec.js +44 -0
- package/build/cjs/components/Toolbar/index.js +57 -0
- package/build/cjs/index.js +304 -46
- package/build/cjs/locales/en/translations.json +1 -0
- package/build/cjs/locales/nl/translations.json +5 -4
- package/build/es/__demo__/FileMenu.stories.js +7 -6
- package/build/es/__demo__/Toolbar.stories.js +69 -0
- package/build/es/components/FileMenu/FileMenu.js +20 -57
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +293 -189
- package/build/es/components/Options/VisualizationOptions.js +3 -1
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +90 -0
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +44 -0
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +75 -0
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +78 -0
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.styles.js +4 -0
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +168 -0
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +16 -0
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +49 -0
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +41 -0
- package/build/es/components/Toolbar/HoverMenuBar/index.js +4 -0
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +33 -0
- package/build/es/components/Toolbar/MenuButton.styles.js +4 -0
- package/build/es/components/Toolbar/Toolbar.js +24 -0
- package/build/es/components/Toolbar/ToolbarSidebar.js +29 -0
- package/build/es/components/Toolbar/UpdateButton.js +38 -0
- package/build/es/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +43 -0
- package/build/es/components/Toolbar/__tests__/Toolbar.spec.js +17 -0
- package/build/es/components/Toolbar/__tests__/ToolbarSidebar.spec.js +23 -0
- package/build/es/components/Toolbar/__tests__/UpdateButton.spec.js +37 -0
- package/build/es/components/Toolbar/index.js +5 -0
- package/build/es/index.js +1 -0
- package/build/es/locales/en/translations.json +1 -0
- package/build/es/locales/nl/translations.json +5 -4
- package/package.json +3 -1
- package/CHANGELOG.md +0 -4044
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ToolbarSidebar } from '../index.js';
|
|
4
|
+
describe('<ToolbarSidebar/>', () => {
|
|
5
|
+
it('renders children', () => {
|
|
6
|
+
const childNode = 'text node';
|
|
7
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(ToolbarSidebar, null, childNode));
|
|
8
|
+
expect(wrapper.containsMatchingElement(childNode)).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it('accepts a `dataTest` prop', () => {
|
|
11
|
+
const dataTest = 'test';
|
|
12
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(ToolbarSidebar, {
|
|
13
|
+
dataTest: dataTest
|
|
14
|
+
}));
|
|
15
|
+
expect(wrapper.prop('data-test')).toBe(dataTest);
|
|
16
|
+
});
|
|
17
|
+
it('accepts a `isHidden` prop', () => {
|
|
18
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(ToolbarSidebar, {
|
|
19
|
+
isHidden: true
|
|
20
|
+
}));
|
|
21
|
+
expect(wrapper.find('div').hasClass('isHidden')).toEqual(true);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { UpdateButton } from '../index.js';
|
|
4
|
+
describe('<UpdateButton/>', () => {
|
|
5
|
+
const noop = () => {};
|
|
6
|
+
|
|
7
|
+
it('accepts an `onClick` prop', () => {
|
|
8
|
+
const onClick = jest.fn();
|
|
9
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(UpdateButton, {
|
|
10
|
+
onClick: onClick
|
|
11
|
+
}));
|
|
12
|
+
wrapper.simulate('click');
|
|
13
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
14
|
+
});
|
|
15
|
+
it('accepts a `dataTest` prop', () => {
|
|
16
|
+
const dataTest = 'test';
|
|
17
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(UpdateButton, {
|
|
18
|
+
onClick: noop,
|
|
19
|
+
dataTest: dataTest
|
|
20
|
+
}));
|
|
21
|
+
expect(wrapper.prop('data-test')).toBe(dataTest);
|
|
22
|
+
});
|
|
23
|
+
it('accepts a `disabled` prop', () => {
|
|
24
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(UpdateButton, {
|
|
25
|
+
disabled: true,
|
|
26
|
+
onClick: noop
|
|
27
|
+
}));
|
|
28
|
+
expect(wrapper.find('button').prop('disabled')).toEqual(true);
|
|
29
|
+
});
|
|
30
|
+
it('accepts an `loading` prop', () => {
|
|
31
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(UpdateButton, {
|
|
32
|
+
onClick: noop,
|
|
33
|
+
loading: true
|
|
34
|
+
}));
|
|
35
|
+
expect(wrapper.find('CircularLoader')).toHaveLength(1);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InterpretationsAndDetailsToggler } from './InterpretationsAndDetailsToggler.js';
|
|
2
|
+
export { Toolbar } from './Toolbar.js';
|
|
3
|
+
export { ToolbarSidebar } from './ToolbarSidebar.js';
|
|
4
|
+
export { UpdateButton } from './UpdateButton.js';
|
|
5
|
+
export * from './HoverMenuBar/index.js';
|
package/build/es/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { default as LegendKey } from './components/LegendKey/LegendKey.js';
|
|
|
16
16
|
export { default as AboutAOUnit } from './components/AboutAOUnit/AboutAOUnit.js';
|
|
17
17
|
export { InterpretationsUnit } from './components/Interpretations/InterpretationsUnit/InterpretationsUnit.js';
|
|
18
18
|
export { InterpretationModal } from './components/Interpretations/InterpretationModal/InterpretationModal.js';
|
|
19
|
+
export * from './components/Toolbar/index.js';
|
|
19
20
|
export { TranslationDialog } from './components/TranslationDialog/index.js';
|
|
20
21
|
export { OfflineTooltip } from './components/OfflineTooltip.js';
|
|
21
22
|
export { CachedDataQueryProvider, useCachedDataQuery } from './components/CachedDataQueryProvider.js'; // Api
|
|
@@ -267,6 +267,7 @@
|
|
|
267
267
|
"Six-months": "Six-months",
|
|
268
268
|
"Financial Years": "Financial Years",
|
|
269
269
|
"Years": "Years",
|
|
270
|
+
"Interpretations and details": "Interpretations and details",
|
|
270
271
|
"Translating to": "Translating to",
|
|
271
272
|
"Choose a locale": "Choose a locale",
|
|
272
273
|
"Base locale reference": "Base locale reference",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"Drag items here, or double click in the list, to start building a calculation formula": "",
|
|
45
45
|
"Math operators": "",
|
|
46
46
|
"Data Type": "",
|
|
47
|
-
"All types": "",
|
|
47
|
+
"All types": "Alle typen",
|
|
48
48
|
"Disaggregation": "",
|
|
49
49
|
"No data": "Geen gegevens",
|
|
50
50
|
"Search by data item name": "",
|
|
51
|
-
"No items selected": "",
|
|
51
|
+
"No items selected": "Geen items geselecteerd",
|
|
52
52
|
"Selected Items": "",
|
|
53
53
|
"No indicators found": "",
|
|
54
54
|
"No data sets found": "",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"No data sets found for \"{{- searchTerm}}\"": "",
|
|
59
59
|
"No event data items found for \"{{- searchTerm}}\"": "",
|
|
60
60
|
"No program indicators found for \"{{- searchTerm}}\"": "",
|
|
61
|
-
"Nothing found for \"{{- searchTerm}}\"": "",
|
|
61
|
+
"Nothing found for \"{{- searchTerm}}\"": "Niets gevonden voor \"{{- zoekTerm}}\"",
|
|
62
62
|
"Calculation": "",
|
|
63
63
|
"Metric type": "",
|
|
64
64
|
"All metrics": "",
|
|
65
|
-
"Move to {{axisName}}": "",
|
|
65
|
+
"Move to {{axisName}}": "Ga naar {{axisNaam}}",
|
|
66
66
|
"Add to {{axisName}}": "Voeg toe aan {{axisName}}",
|
|
67
67
|
"Not available for {{visualizationType}}": "",
|
|
68
68
|
"Remove Assigned Categories": "",
|
|
@@ -267,6 +267,7 @@
|
|
|
267
267
|
"Six-months": "",
|
|
268
268
|
"Financial Years": "",
|
|
269
269
|
"Years": "Jaren",
|
|
270
|
+
"Interpretations and details": "",
|
|
270
271
|
"Translating to": "",
|
|
271
272
|
"Choose a locale": "",
|
|
272
273
|
"Base locale reference": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/analytics",
|
|
3
|
-
"version": "25.1
|
|
3
|
+
"version": "25.2.1",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"@storybook/addons": "^6.5.9",
|
|
41
41
|
"@storybook/preset-create-react-app": "^3.1.7",
|
|
42
42
|
"@storybook/react": "^6.1.14",
|
|
43
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
44
|
+
"@testing-library/react": "^12.1.5",
|
|
43
45
|
"enzyme": "^3.9.0",
|
|
44
46
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
45
47
|
"fs-extra": "^10.1.0",
|