@dhis2/analytics 23.13.6 → 23.13.9

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.13.9](https://github.com/dhis2/analytics/compare/v23.13.8...v23.13.9) (2022-08-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * prepare interpretation components for Cypress testing ([#1305](https://github.com/dhis2/analytics/issues/1305)) ([538c7bc](https://github.com/dhis2/analytics/commit/538c7bc686725122634f1b5152661d43cd54cf3b))
7
+
8
+ ## [23.13.8](https://github.com/dhis2/analytics/compare/v23.13.7...v23.13.8) (2022-08-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **translations:** sync translations from transifex (master) ([aef4238](https://github.com/dhis2/analytics/commit/aef4238813779447374e67354d716b51fb01102b))
14
+
15
+ ## [23.13.7](https://github.com/dhis2/analytics/compare/v23.13.6...v23.13.7) (2022-08-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * always display legend set name in legend key (DHIS2-75) ([#1306](https://github.com/dhis2/analytics/issues/1306)) ([57502ee](https://github.com/dhis2/analytics/commit/57502eebce5ccb52aca62c080708587c008da822))
21
+
1
22
  ## [23.13.6](https://github.com/dhis2/analytics/compare/v23.13.5...v23.13.6) (2022-08-12)
2
23
 
3
24
 
@@ -127,7 +127,8 @@ const InterpretationModal = _ref2 => {
127
127
  onClose: handleClose,
128
128
  className: (0, _classnames.default)(modalCSS.className, {
129
129
  hidden: shouldCssHideModal
130
- })
130
+ }),
131
+ dataTest: "interpretation-modal"
131
132
  }, /*#__PURE__*/_react.default.createElement("h1", {
132
133
  className: _style.default.dynamic([["3175860552", [_ui.colors.grey900, _ui.spacers.dp24, _ui.spacers.dp4, _ui.spacers.dp4]]]) + " " + "title"
133
134
  }, /*#__PURE__*/_react.default.createElement("span", {
@@ -56,7 +56,8 @@ const InterpretationForm = _ref => {
56
56
  const inputPlaceholder = _d2I18n.default.t('Write an interpretation');
57
57
 
58
58
  return /*#__PURE__*/_react.default.createElement(_index.MessageEditorContainer, {
59
- currentUser: currentUser
59
+ currentUser: currentUser,
60
+ dataTest: "interpretation-form"
60
61
  }, showRichTextEditor ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index.RichTextEditor, {
61
62
  disabled: saveMutationInProgress,
62
63
  inputPlaceholder: inputPlaceholder,
@@ -55,6 +55,7 @@ const InterpretationList = _ref => {
55
55
  return groupedInterpretations;
56
56
  }, {});
57
57
  return /*#__PURE__*/_react.default.createElement("ol", {
58
+ "data-test": "interpretations-list",
58
59
  className: _style.default.dynamic([["4058400613", [_ui.spacers.dp8, _ui.spacers.dp8, _ui.spacers.dp16, _ui.colors.grey800, _ui.spacers.dp12, _ui.spacers.dp12, _ui.spacers.dp32, _ui.spacers.dp4]]]) + " " + "interpretation-groups"
59
60
  }, Object.keys(interpretationsByDate).sort().reverse().map(date => /*#__PURE__*/_react.default.createElement("li", {
60
61
  key: date,
@@ -66,16 +66,19 @@ const Interpretation = _ref => {
66
66
  onClick: toggleLike,
67
67
  selected: isLikedByCurrentUser,
68
68
  count: interpretation.likes,
69
- disabled: toggleLikeInProgress
69
+ disabled: toggleLikeInProgress,
70
+ dataTest: "interpretation-like-unlike-button"
70
71
  }), /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
71
72
  tooltipContent: _d2I18n.default.t('Reply'),
72
73
  iconComponent: _ui.IconReply16,
73
74
  onClick: () => onReplyIconClick(interpretation.id),
74
- count: interpretation.comments.length
75
+ count: interpretation.comments.length,
76
+ dataTest: "interpretation-reply-button"
75
77
  }), interpretation.access.manage && /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
76
78
  iconComponent: _ui.IconShare16,
77
79
  tooltipContent: _d2I18n.default.t('Share'),
78
- onClick: () => setShowSharingDialog(true)
80
+ onClick: () => setShowSharingDialog(true),
81
+ dataTest: "interpretation-share-button"
79
82
  }), showSharingDialog && /*#__PURE__*/_react.default.createElement(_ui.SharingDialog, {
80
83
  open: true,
81
84
  type: 'interpretation',
@@ -84,7 +87,8 @@ const Interpretation = _ref => {
84
87
  }), interpretation.access.update && /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
85
88
  iconComponent: _ui.IconEdit16,
86
89
  tooltipContent: _d2I18n.default.t('Edit'),
87
- onClick: () => setIsUpdateMode(true)
90
+ onClick: () => setIsUpdateMode(true),
91
+ dataTest: "interpretation-edit-button"
88
92
  }), interpretation.access.delete && /*#__PURE__*/_react.default.createElement(_InterpretationDeleteButton.InterpretationDeleteButton, {
89
93
  id: interpretation.id,
90
94
  onComplete: onDeleted
@@ -47,7 +47,8 @@ const InterpretationDeleteButton = _ref2 => {
47
47
  tooltipContent: _d2I18n.default.t('Delete'),
48
48
  iconComponent: _ui.IconDelete16,
49
49
  onClick: remove,
50
- disabled: loading
50
+ disabled: loading,
51
+ dataTest: "interpretation-delete-button"
51
52
  });
52
53
  };
53
54
 
@@ -18,9 +18,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
18
  const MessageEditorContainer = _ref => {
19
19
  let {
20
20
  children,
21
- currentUser
21
+ currentUser,
22
+ dataTest
22
23
  } = _ref;
23
24
  return /*#__PURE__*/_react.default.createElement("div", {
25
+ "data-test": dataTest,
24
26
  className: _style.default.dynamic([["3807884305", [_ui.spacers.dp8, _ui.spacers.dp12]]]) + " " + "container"
25
27
  }, /*#__PURE__*/_react.default.createElement("div", {
26
28
  className: _style.default.dynamic([["3807884305", [_ui.spacers.dp8, _ui.spacers.dp12]]]) + " " + "avatar"
@@ -38,5 +40,6 @@ const MessageEditorContainer = _ref => {
38
40
  exports.MessageEditorContainer = MessageEditorContainer;
39
41
  MessageEditorContainer.propTypes = {
40
42
  currentUser: _propTypes.default.object.isRequired,
41
- children: _propTypes.default.node
43
+ children: _propTypes.default.node,
44
+ dataTest: _propTypes.default.string
42
45
  };
@@ -24,7 +24,8 @@ const MessageIconButton = _ref => {
24
24
  onClick,
25
25
  selected,
26
26
  count,
27
- iconComponent: Icon
27
+ iconComponent: Icon,
28
+ dataTest
28
29
  } = _ref;
29
30
  return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, {
30
31
  closeDelay: 200,
@@ -46,6 +47,7 @@ const MessageIconButton = _ref => {
46
47
  onClick();
47
48
  },
48
49
  disabled: disabled,
50
+ "data-test": dataTest,
49
51
  className: _style.default.dynamic([["3807261824", [_ui.spacers.dp4, _ui.colors.grey700, _ui.colors.teal600, _ui.colors.grey900, _ui.colors.teal800, _ui.colors.teal500, _ui.colors.teal700]]]) + " " + ((0, _classnames.default)('button', {
50
52
  selected
51
53
  }) || "")
@@ -61,6 +63,7 @@ MessageIconButton.propTypes = {
61
63
  iconComponent: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.func]).isRequired,
62
64
  tooltipContent: _propTypes.default.string.isRequired,
63
65
  count: _propTypes.default.number,
66
+ dataTest: _propTypes.default.string,
64
67
  disabled: _propTypes.default.bool,
65
68
  selected: _propTypes.default.bool,
66
69
  onClick: _propTypes.default.func
@@ -30,7 +30,7 @@ const LegendKey = _ref => {
30
30
  className: "jsx-".concat(_LegendKeyStyle.default.__hash) + " " + ((0, _classnames.default)('legendSet', {
31
31
  divider: index > 0
32
32
  }) || "")
33
- }, legendSets.length > 1 && /*#__PURE__*/_react.default.createElement("span", {
33
+ }, /*#__PURE__*/_react.default.createElement("span", {
34
34
  className: "jsx-".concat(_LegendKeyStyle.default.__hash) + " " + "legendSetName"
35
35
  }, legendSet.name), legendSet.legends.sort((a, b) => a.startValue - b.startValue).map(legend => /*#__PURE__*/_react.default.createElement("div", {
36
36
  key: legend.startValue,
@@ -105,7 +105,8 @@ const InterpretationModal = _ref2 => {
105
105
  onClose: handleClose,
106
106
  className: cx(modalCSS.className, {
107
107
  hidden: shouldCssHideModal
108
- })
108
+ }),
109
+ dataTest: "interpretation-modal"
109
110
  }, /*#__PURE__*/React.createElement("h1", {
110
111
  className: _JSXStyle.dynamic([["3175860552", [colors.grey900, spacers.dp24, spacers.dp4, spacers.dp4]]]) + " " + "title"
111
112
  }, /*#__PURE__*/React.createElement("span", {
@@ -35,7 +35,8 @@ export const InterpretationForm = _ref => {
35
35
  });
36
36
  const inputPlaceholder = i18n.t('Write an interpretation');
37
37
  return /*#__PURE__*/React.createElement(MessageEditorContainer, {
38
- currentUser: currentUser
38
+ currentUser: currentUser,
39
+ dataTest: "interpretation-form"
39
40
  }, showRichTextEditor ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(RichTextEditor, {
40
41
  disabled: saveMutationInProgress,
41
42
  inputPlaceholder: inputPlaceholder,
@@ -41,6 +41,7 @@ export const InterpretationList = _ref => {
41
41
  return groupedInterpretations;
42
42
  }, {});
43
43
  return /*#__PURE__*/React.createElement("ol", {
44
+ "data-test": "interpretations-list",
44
45
  className: _JSXStyle.dynamic([["4058400613", [spacers.dp8, spacers.dp8, spacers.dp16, colors.grey800, spacers.dp12, spacers.dp12, spacers.dp32, spacers.dp4]]]) + " " + "interpretation-groups"
45
46
  }, Object.keys(interpretationsByDate).sort().reverse().map(date => /*#__PURE__*/React.createElement("li", {
46
47
  key: date,
@@ -45,16 +45,19 @@ export const Interpretation = _ref => {
45
45
  onClick: toggleLike,
46
46
  selected: isLikedByCurrentUser,
47
47
  count: interpretation.likes,
48
- disabled: toggleLikeInProgress
48
+ disabled: toggleLikeInProgress,
49
+ dataTest: "interpretation-like-unlike-button"
49
50
  }), /*#__PURE__*/React.createElement(MessageIconButton, {
50
51
  tooltipContent: i18n.t('Reply'),
51
52
  iconComponent: IconReply16,
52
53
  onClick: () => onReplyIconClick(interpretation.id),
53
- count: interpretation.comments.length
54
+ count: interpretation.comments.length,
55
+ dataTest: "interpretation-reply-button"
54
56
  }), interpretation.access.manage && /*#__PURE__*/React.createElement(MessageIconButton, {
55
57
  iconComponent: IconShare16,
56
58
  tooltipContent: i18n.t('Share'),
57
- onClick: () => setShowSharingDialog(true)
59
+ onClick: () => setShowSharingDialog(true),
60
+ dataTest: "interpretation-share-button"
58
61
  }), showSharingDialog && /*#__PURE__*/React.createElement(SharingDialog, {
59
62
  open: true,
60
63
  type: 'interpretation',
@@ -63,7 +66,8 @@ export const Interpretation = _ref => {
63
66
  }), interpretation.access.update && /*#__PURE__*/React.createElement(MessageIconButton, {
64
67
  iconComponent: IconEdit16,
65
68
  tooltipContent: i18n.t('Edit'),
66
- onClick: () => setIsUpdateMode(true)
69
+ onClick: () => setIsUpdateMode(true),
70
+ dataTest: "interpretation-edit-button"
67
71
  }), interpretation.access.delete && /*#__PURE__*/React.createElement(InterpretationDeleteButton, {
68
72
  id: interpretation.id,
69
73
  onComplete: onDeleted
@@ -32,7 +32,8 @@ const InterpretationDeleteButton = _ref2 => {
32
32
  tooltipContent: i18n.t('Delete'),
33
33
  iconComponent: IconDelete16,
34
34
  onClick: remove,
35
- disabled: loading
35
+ disabled: loading,
36
+ dataTest: "interpretation-delete-button"
36
37
  });
37
38
  };
38
39
 
@@ -6,9 +6,11 @@ import React from 'react';
6
6
  const MessageEditorContainer = _ref => {
7
7
  let {
8
8
  children,
9
- currentUser
9
+ currentUser,
10
+ dataTest
10
11
  } = _ref;
11
12
  return /*#__PURE__*/React.createElement("div", {
13
+ "data-test": dataTest,
12
14
  className: _JSXStyle.dynamic([["3807884305", [spacers.dp8, spacers.dp12]]]) + " " + "container"
13
15
  }, /*#__PURE__*/React.createElement("div", {
14
16
  className: _JSXStyle.dynamic([["3807884305", [spacers.dp8, spacers.dp12]]]) + " " + "avatar"
@@ -25,6 +27,7 @@ const MessageEditorContainer = _ref => {
25
27
 
26
28
  MessageEditorContainer.propTypes = {
27
29
  currentUser: PropTypes.object.isRequired,
28
- children: PropTypes.node
30
+ children: PropTypes.node,
31
+ dataTest: PropTypes.string
29
32
  };
30
33
  export { MessageEditorContainer };
@@ -11,7 +11,8 @@ const MessageIconButton = _ref => {
11
11
  onClick,
12
12
  selected,
13
13
  count,
14
- iconComponent: Icon
14
+ iconComponent: Icon,
15
+ dataTest
15
16
  } = _ref;
16
17
  return /*#__PURE__*/React.createElement(Tooltip, {
17
18
  closeDelay: 200,
@@ -33,6 +34,7 @@ const MessageIconButton = _ref => {
33
34
  onClick();
34
35
  },
35
36
  disabled: disabled,
37
+ "data-test": dataTest,
36
38
  className: _JSXStyle.dynamic([["3807261824", [spacers.dp4, colors.grey700, colors.teal600, colors.grey900, colors.teal800, colors.teal500, colors.teal700]]]) + " " + (cx('button', {
37
39
  selected
38
40
  }) || "")
@@ -47,6 +49,7 @@ MessageIconButton.propTypes = {
47
49
  iconComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired,
48
50
  tooltipContent: PropTypes.string.isRequired,
49
51
  count: PropTypes.number,
52
+ dataTest: PropTypes.string,
50
53
  disabled: PropTypes.bool,
51
54
  selected: PropTypes.bool,
52
55
  onClick: PropTypes.func
@@ -17,7 +17,7 @@ const LegendKey = _ref => {
17
17
  className: "jsx-".concat(styles.__hash) + " " + (cx('legendSet', {
18
18
  divider: index > 0
19
19
  }) || "")
20
- }, legendSets.length > 1 && /*#__PURE__*/React.createElement("span", {
20
+ }, /*#__PURE__*/React.createElement("span", {
21
21
  className: "jsx-".concat(styles.__hash) + " " + "legendSetName"
22
22
  }, legendSet.name), legendSet.legends.sort((a, b) => a.startValue - b.startValue).map(legend => /*#__PURE__*/React.createElement("div", {
23
23
  key: legend.startValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "23.13.6",
3
+ "version": "23.13.9",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {