@dhis2/analytics 23.11.1 → 23.12.0
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 +7 -0
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +64 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +93 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +62 -0
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +95 -0
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +187 -0
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +100 -0
- package/build/cjs/components/Interpretations/InterpretationModal/index.js +13 -0
- package/build/cjs/components/Interpretations/InterpretationModal/useModalContentWidth.js +39 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +94 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +94 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +135 -0
- package/build/cjs/components/Interpretations/InterpretationsUnit/index.js +13 -0
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +110 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +58 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +50 -0
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +108 -0
- package/build/cjs/components/Interpretations/common/Interpretation/index.js +21 -0
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +53 -0
- package/build/cjs/components/Interpretations/common/Message/Message.js +55 -0
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +33 -0
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +42 -0
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +67 -0
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +31 -0
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +33 -0
- package/build/cjs/components/Interpretations/common/Message/index.js +53 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/RichTextEditor.js +262 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/index.js +13 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/markdownHandler.js +148 -0
- package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +21 -0
- package/build/cjs/components/Interpretations/common/UserMention/UserList.js +48 -0
- package/build/cjs/components/Interpretations/common/UserMention/UserMentionWrapper.js +226 -0
- package/build/cjs/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +30 -0
- package/build/cjs/components/Interpretations/common/UserMention/useUserSearchResults.js +78 -0
- package/build/cjs/components/Interpretations/common/index.js +44 -0
- package/build/cjs/index.js +16 -0
- package/build/cjs/locales/en/translations.json +32 -1
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +45 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +70 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +47 -0
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +73 -0
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +165 -0
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +79 -0
- package/build/es/components/Interpretations/InterpretationModal/index.js +1 -0
- package/build/es/components/Interpretations/InterpretationModal/useModalContentWidth.js +28 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +71 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +78 -0
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +112 -0
- package/build/es/components/Interpretations/InterpretationsUnit/index.js +1 -0
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +87 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +43 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +33 -0
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +85 -0
- package/build/es/components/Interpretations/common/Interpretation/index.js +2 -0
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +45 -0
- package/build/es/components/Interpretations/common/Message/Message.js +41 -0
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +21 -0
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +30 -0
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +54 -0
- package/build/es/components/Interpretations/common/Message/MessageInput.js +16 -0
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +21 -0
- package/build/es/components/Interpretations/common/Message/index.js +6 -0
- package/build/es/components/Interpretations/common/RichTextEditor/RichTextEditor.js +240 -0
- package/build/es/components/Interpretations/common/RichTextEditor/index.js +1 -0
- package/build/es/components/Interpretations/common/RichTextEditor/markdownHandler.js +128 -0
- package/build/es/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +9 -0
- package/build/es/components/Interpretations/common/UserMention/UserList.js +33 -0
- package/build/es/components/Interpretations/common/UserMention/UserMentionWrapper.js +202 -0
- package/build/es/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js +17 -0
- package/build/es/components/Interpretations/common/UserMention/useUserSearchResults.js +63 -0
- package/build/es/components/Interpretations/common/index.js +3 -0
- package/build/es/index.js +2 -0
- package/build/es/locales/en/translations.json +32 -1
- package/package.json +2 -1
package/build/es/components/Interpretations/common/UserMention/styles/UserMentionWrapper.style.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { colors, spacers } from '@dhis2/ui';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Note that the clone and clone > pre styles have been chosen
|
|
7
|
+
* to emulate the styles of the textarea. If we decide to make
|
|
8
|
+
* changes there, they should be refelcted here too.
|
|
9
|
+
*/
|
|
10
|
+
export const userMentionWrapperClasses = [".wrapper.jsx-1289989717{position:relative;}", ".clone.jsx-1289989717{position:absolute;visibility:hidden;inset:0;box-sizing:border-box;padding:".concat(spacers.dp8, " ").concat(spacers.dp12, ";border:1px solid ").concat(colors.grey500, ";font-size:14px;line-height:").concat(spacers.dp16, ";z-index:1;pointer-events:none;}"), ".clone.jsx-1289989717>pre.jsx-1289989717{display:inline;word-wrap:break-word;overflow-wrap:break-word;font:inherit;margin:0;}", ".container.jsx-1289989717{background-color:".concat(colors.white, ";max-height:180px;overflow:auto;}")];
|
|
11
|
+
userMentionWrapperClasses.__hash = "1289989717";
|
|
12
|
+
export const resolvedHeaderStyle = {
|
|
13
|
+
styles: /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
14
|
+
id: "4275958396"
|
|
15
|
+
}, [".jsx-4275958396{position:-webkit-sticky;position:sticky;top:0;}"]),
|
|
16
|
+
className: "jsx-4275958396"
|
|
17
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useDataQuery } from '@dhis2/app-runtime';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
const usersQuery = {
|
|
5
|
+
users: {
|
|
6
|
+
resource: 'users/gist',
|
|
7
|
+
params: _ref => {
|
|
8
|
+
let {
|
|
9
|
+
searchText
|
|
10
|
+
} = _ref;
|
|
11
|
+
return {
|
|
12
|
+
fields: 'id,displayName,username',
|
|
13
|
+
order: 'firstName,surname',
|
|
14
|
+
total: true,
|
|
15
|
+
filter: "username:ilike:".concat(searchText, ",firstName:ilike:").concat(searchText, ",surname:ilike:").concat(searchText, ",email:ilike:").concat(searchText),
|
|
16
|
+
rootJunction: 'OR'
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const useUserSearchResults = _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
searchText
|
|
24
|
+
} = _ref2;
|
|
25
|
+
const [{
|
|
26
|
+
users,
|
|
27
|
+
pager
|
|
28
|
+
}, setData] = useState({
|
|
29
|
+
users: [],
|
|
30
|
+
pager: {}
|
|
31
|
+
});
|
|
32
|
+
const {
|
|
33
|
+
data,
|
|
34
|
+
fetching,
|
|
35
|
+
refetch
|
|
36
|
+
} = useDataQuery(usersQuery, {
|
|
37
|
+
lazy: true
|
|
38
|
+
});
|
|
39
|
+
const debouncedRefetch = useCallback(debounce(refetch, 250), [refetch]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (searchText.length) {
|
|
42
|
+
debouncedRefetch({
|
|
43
|
+
searchText
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return () => debouncedRefetch.cancel();
|
|
48
|
+
}, [searchText]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (data) {
|
|
51
|
+
setData(data.users);
|
|
52
|
+
}
|
|
53
|
+
}, [data]);
|
|
54
|
+
return {
|
|
55
|
+
users,
|
|
56
|
+
pager,
|
|
57
|
+
fetching,
|
|
58
|
+
clear: () => setData({
|
|
59
|
+
users: [],
|
|
60
|
+
pager: {}
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
};
|
package/build/es/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { default as FileMenu } from './components/FileMenu/FileMenu.js';
|
|
|
14
14
|
export { default as VisTypeIcon } from './components/VisTypeIcon.js';
|
|
15
15
|
export { default as LegendKey } from './components/LegendKey/LegendKey.js';
|
|
16
16
|
export { default as AboutAOUnit } from './components/AboutAOUnit/AboutAOUnit.js';
|
|
17
|
+
export { InterpretationsUnit } from './components/Interpretations/InterpretationsUnit/InterpretationsUnit.js';
|
|
18
|
+
export { InterpretationModal } from './components/Interpretations/InterpretationModal/InterpretationModal.js';
|
|
17
19
|
export { CachedDataQueryProvider, useCachedDataQuery } from './components/CachedDataQueryProvider.js'; // Api
|
|
18
20
|
|
|
19
21
|
export { default as Analytics } from './api/analytics/Analytics.js';
|
|
@@ -83,6 +83,38 @@
|
|
|
83
83
|
"line list": "line list",
|
|
84
84
|
"map": "map",
|
|
85
85
|
"visualization": "visualization",
|
|
86
|
+
"Edit": "Edit",
|
|
87
|
+
"Write a reply": "Write a reply",
|
|
88
|
+
"Post reply": "Post reply",
|
|
89
|
+
"Could not update comment": "Could not update comment",
|
|
90
|
+
"Enter comment text": "Enter comment text",
|
|
91
|
+
"Update": "Update",
|
|
92
|
+
"Viewing interpretation: {{visualisationName}}": "Viewing interpretation: {{visualisationName}}",
|
|
93
|
+
"Could not load interpretation": "Could not load interpretation",
|
|
94
|
+
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "The interpretation couldn’t be displayed. Try again or contact your system administrator.",
|
|
95
|
+
"Hide interpretation": "Hide interpretation",
|
|
96
|
+
"Write an interpretation": "Write an interpretation",
|
|
97
|
+
"Post interpretation": "Post interpretation",
|
|
98
|
+
"Interpretations": "Interpretations",
|
|
99
|
+
"Unlike": "Unlike",
|
|
100
|
+
"Like": "Like",
|
|
101
|
+
"Reply": "Reply",
|
|
102
|
+
"Share": "Share",
|
|
103
|
+
"See interpretation": "See interpretation",
|
|
104
|
+
"Manage sharing": "Manage sharing",
|
|
105
|
+
"Could not update interpretation": "Could not update interpretation",
|
|
106
|
+
"Enter interpretation text": "Enter interpretation text",
|
|
107
|
+
"Bold text": "Bold text",
|
|
108
|
+
"Italic text": "Italic text",
|
|
109
|
+
"Link to a URL": "Link to a URL",
|
|
110
|
+
"Mention a user": "Mention a user",
|
|
111
|
+
"Add emoji": "Add emoji",
|
|
112
|
+
"Preview": "Preview",
|
|
113
|
+
"Back to write mode": "Back to write mode",
|
|
114
|
+
"Too many results. Try refining the search.": "Too many results. Try refining the search.",
|
|
115
|
+
"Search for a user": "Search for a user",
|
|
116
|
+
"Searching for \"{{searchText}}\"": "Searching for \"{{searchText}}\"",
|
|
117
|
+
"No results found": "No results found",
|
|
86
118
|
"Created by": "Created by",
|
|
87
119
|
"Anyone": "Anyone",
|
|
88
120
|
"Only you": "Only you",
|
|
@@ -123,7 +155,6 @@
|
|
|
123
155
|
"New line list": "New line list",
|
|
124
156
|
"Options": "Options",
|
|
125
157
|
"Hide": "Hide",
|
|
126
|
-
"Update": "Update",
|
|
127
158
|
"{{count}} org units": "{{count}} org unit",
|
|
128
159
|
"{{count}} org units_plural": "{{count}} org units",
|
|
129
160
|
"{{count}} levels": "{{count}} level",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/analytics",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.12.0",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"styled-jsx": "^4.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
+
"@dhis2/d2-ui-rich-text": "^7.4.0",
|
|
61
62
|
"classnames": "^2.3.1",
|
|
62
63
|
"d2-utilizr": "^0.2.16",
|
|
63
64
|
"d3-color": "^1.2.3",
|