@dhis2/analytics 23.10.4 → 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 +21 -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/components/LegendKey/styles/LegendKey.style.js +2 -2
- package/build/cjs/index.js +22 -0
- package/build/cjs/locales/en/translations.json +32 -1
- package/build/cjs/locales/ro/translations.json +6 -6
- package/build/cjs/modules/legends.js +6 -2
- 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/components/LegendKey/styles/LegendKey.style.js +2 -2
- package/build/es/index.js +3 -1
- package/build/es/locales/en/translations.json +32 -1
- package/build/es/locales/ro/translations.json +6 -6
- package/build/es/modules/legends.js +6 -2
- package/package.json +3 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useModalContentWidth = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _utils = require("../../../modules/utils.js");
|
|
11
|
+
|
|
12
|
+
const MODAL_SIDE_PADDING = 2 * 24;
|
|
13
|
+
const MODAL_SIDE_MARGINS = 2 * 128;
|
|
14
|
+
|
|
15
|
+
const computeModalContentWidth = windowWidth => {
|
|
16
|
+
return windowWidth - MODAL_SIDE_MARGINS - MODAL_SIDE_PADDING;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const useModalContentWidth = () => {
|
|
20
|
+
const [windowWidth, setWindowWidth] = (0, _react.useState)(window.innerWidth);
|
|
21
|
+
const debouncedWindowWidth = (0, _utils.useDebounce)(windowWidth, 150);
|
|
22
|
+
const [modalContentWidth, setModalContentWidth] = (0, _react.useState)(computeModalContentWidth(windowWidth));
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
const onResize = () => {
|
|
25
|
+
setWindowWidth(window.innerWidth);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
window.addEventListener('resize', onResize);
|
|
29
|
+
return () => {
|
|
30
|
+
window.removeEventListener('resize', onResize);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
(0, _react.useEffect)(() => {
|
|
34
|
+
setModalContentWidth(computeModalContentWidth(debouncedWindowWidth));
|
|
35
|
+
}, [debouncedWindowWidth]);
|
|
36
|
+
return modalContentWidth;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.useModalContentWidth = useModalContentWidth;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationForm = void 0;
|
|
7
|
+
|
|
8
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
9
|
+
|
|
10
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _index = require("../common/index.js");
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
const InterpretationForm = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
type,
|
|
29
|
+
id,
|
|
30
|
+
currentUser,
|
|
31
|
+
disabled,
|
|
32
|
+
onSave
|
|
33
|
+
} = _ref;
|
|
34
|
+
const [showRichTextEditor, setShowRichTextEditor] = (0, _react.useState)(false);
|
|
35
|
+
const [interpretationText, setInterpretationText] = (0, _react.useState)('');
|
|
36
|
+
const saveMutationRef = (0, _react.useRef)({
|
|
37
|
+
resource: "interpretations/".concat(type, "/").concat(id),
|
|
38
|
+
type: 'create',
|
|
39
|
+
data: _ref2 => {
|
|
40
|
+
let {
|
|
41
|
+
interpretationText
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return interpretationText;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const [save, {
|
|
47
|
+
loading: saveMutationInProgress
|
|
48
|
+
}] = (0, _appRuntime.useDataMutation)(saveMutationRef.current, {
|
|
49
|
+
onComplete: () => {
|
|
50
|
+
setShowRichTextEditor(false);
|
|
51
|
+
setInterpretationText('');
|
|
52
|
+
onSave();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const inputPlaceholder = _d2I18n.default.t('Write an interpretation');
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_index.MessageEditorContainer, {
|
|
59
|
+
currentUser: currentUser
|
|
60
|
+
}, showRichTextEditor ? /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_index.RichTextEditor, {
|
|
61
|
+
disabled: saveMutationInProgress,
|
|
62
|
+
inputPlaceholder: inputPlaceholder,
|
|
63
|
+
onChange: setInterpretationText,
|
|
64
|
+
value: interpretationText
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement(_index.MessageButtonStrip, null, /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
66
|
+
primary: true,
|
|
67
|
+
small: true,
|
|
68
|
+
disabled: saveMutationInProgress,
|
|
69
|
+
onClick: () => save({
|
|
70
|
+
interpretationText
|
|
71
|
+
})
|
|
72
|
+
}, _d2I18n.default.t('Post interpretation')), /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
73
|
+
secondary: true,
|
|
74
|
+
small: true,
|
|
75
|
+
disabled: saveMutationInProgress,
|
|
76
|
+
onClick: () => {
|
|
77
|
+
setInterpretationText('');
|
|
78
|
+
setShowRichTextEditor(false);
|
|
79
|
+
}
|
|
80
|
+
}, _d2I18n.default.t('Cancel')))) : /*#__PURE__*/_react.default.createElement(_ui.Input, {
|
|
81
|
+
onFocus: () => setShowRichTextEditor(true),
|
|
82
|
+
placeholder: inputPlaceholder,
|
|
83
|
+
disabled: disabled
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
exports.InterpretationForm = InterpretationForm;
|
|
88
|
+
InterpretationForm.propTypes = {
|
|
89
|
+
currentUser: _propTypes.default.object,
|
|
90
|
+
disabled: _propTypes.default.bool,
|
|
91
|
+
id: _propTypes.default.string,
|
|
92
|
+
type: _propTypes.default.string,
|
|
93
|
+
onSave: _propTypes.default.func
|
|
94
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationList = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _index = require("../common/index.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const sortByCreatedDateDesc = (a, b) => {
|
|
23
|
+
const dateA = a.created;
|
|
24
|
+
const dateB = b.created;
|
|
25
|
+
|
|
26
|
+
if (dateA < dateB) {
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (dateA > dateB) {
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return 0;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const InterpretationList = _ref => {
|
|
38
|
+
let {
|
|
39
|
+
currentUser,
|
|
40
|
+
interpretations,
|
|
41
|
+
onInterpretationClick,
|
|
42
|
+
onReplyIconClick,
|
|
43
|
+
refresh,
|
|
44
|
+
disabled
|
|
45
|
+
} = _ref;
|
|
46
|
+
const interpretationsByDate = interpretations.reduce((groupedInterpretations, interpretation) => {
|
|
47
|
+
const date = interpretation.created.split('T')[0];
|
|
48
|
+
|
|
49
|
+
if (date in groupedInterpretations) {
|
|
50
|
+
groupedInterpretations[date].push(interpretation);
|
|
51
|
+
} else {
|
|
52
|
+
groupedInterpretations[date] = [interpretation];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return groupedInterpretations;
|
|
56
|
+
}, {});
|
|
57
|
+
return /*#__PURE__*/_react.default.createElement("ol", {
|
|
58
|
+
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
|
+
}, Object.keys(interpretationsByDate).sort().reverse().map(date => /*#__PURE__*/_react.default.createElement("li", {
|
|
60
|
+
key: date,
|
|
61
|
+
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]]])
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
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]]]) + " " + "date-section"
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.IconCalendar24, {
|
|
65
|
+
color: _ui.colors.grey600
|
|
66
|
+
}), /*#__PURE__*/_react.default.createElement("time", {
|
|
67
|
+
dateTime: date,
|
|
68
|
+
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]]]) + " " + "date-header"
|
|
69
|
+
}, (0, _moment.default)(date).format('ll'))), /*#__PURE__*/_react.default.createElement("ol", {
|
|
70
|
+
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-list"
|
|
71
|
+
}, interpretationsByDate[date].sort(sortByCreatedDateDesc).map(interpretation => /*#__PURE__*/_react.default.createElement(_index.Interpretation, {
|
|
72
|
+
key: interpretation.id,
|
|
73
|
+
interpretation: interpretation,
|
|
74
|
+
currentUser: currentUser,
|
|
75
|
+
onClick: onInterpretationClick,
|
|
76
|
+
onReplyIconClick: onReplyIconClick,
|
|
77
|
+
onDeleted: refresh,
|
|
78
|
+
onUpdated: refresh,
|
|
79
|
+
disabled: disabled
|
|
80
|
+
}))))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
81
|
+
id: "4058400613",
|
|
82
|
+
dynamic: [_ui.spacers.dp8, _ui.spacers.dp8, _ui.spacers.dp16, _ui.colors.grey800, _ui.spacers.dp12, _ui.spacers.dp12, _ui.spacers.dp32, _ui.spacers.dp4]
|
|
83
|
+
}, [".date-section.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(_ui.spacers.dp8, ";-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:").concat(_ui.spacers.dp8, ";}"), ".date-header.__jsx-style-dynamic-selector{font-size:14px;font-weight:500;line-height:".concat(_ui.spacers.dp16, ";color:").concat(_ui.colors.grey800, ";}"), ".interpretation-groups.__jsx-style-dynamic-selector{margin:0;padding:0;padding-top:".concat(_ui.spacers.dp12, ";list-style:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:").concat(_ui.spacers.dp12, ";}"), ".interpretation-list.__jsx-style-dynamic-selector{margin:0;padding-left:".concat(_ui.spacers.dp32, ";list-style:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:").concat(_ui.spacers.dp4, ";}")]));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.InterpretationList = InterpretationList;
|
|
87
|
+
InterpretationList.propTypes = {
|
|
88
|
+
currentUser: _propTypes.default.object.isRequired,
|
|
89
|
+
interpretations: _propTypes.default.array.isRequired,
|
|
90
|
+
refresh: _propTypes.default.func.isRequired,
|
|
91
|
+
onInterpretationClick: _propTypes.default.func.isRequired,
|
|
92
|
+
onReplyIconClick: _propTypes.default.func.isRequired,
|
|
93
|
+
disabled: _propTypes.default.bool
|
|
94
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationsUnit = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
11
|
+
|
|
12
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
13
|
+
|
|
14
|
+
var _ui = require("@dhis2/ui");
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _InterpretationForm = require("./InterpretationForm.js");
|
|
23
|
+
|
|
24
|
+
var _InterpretationList = require("./InterpretationList.js");
|
|
25
|
+
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
const interpretationsQuery = {
|
|
33
|
+
interpretations: {
|
|
34
|
+
resource: 'interpretations',
|
|
35
|
+
params: _ref => {
|
|
36
|
+
let {
|
|
37
|
+
type,
|
|
38
|
+
id
|
|
39
|
+
} = _ref;
|
|
40
|
+
return {
|
|
41
|
+
fields: ['access', 'id', 'user[displayName]', 'created', 'text', 'comments[id]', 'likes', 'likedBy[id]'],
|
|
42
|
+
filter: "".concat(type, ".id:eq:").concat(id)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const InterpretationsUnit = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
48
|
+
let {
|
|
49
|
+
currentUser,
|
|
50
|
+
type,
|
|
51
|
+
id,
|
|
52
|
+
onInterpretationClick,
|
|
53
|
+
onReplyIconClick,
|
|
54
|
+
disabled
|
|
55
|
+
} = _ref2;
|
|
56
|
+
const [isExpanded, setIsExpanded] = (0, _react.useState)(true);
|
|
57
|
+
const {
|
|
58
|
+
data,
|
|
59
|
+
loading,
|
|
60
|
+
fetching,
|
|
61
|
+
refetch
|
|
62
|
+
} = (0, _appRuntime.useDataQuery)(interpretationsQuery, {
|
|
63
|
+
lazy: true
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const onCompleteAction = () => {
|
|
67
|
+
refetch({
|
|
68
|
+
type,
|
|
69
|
+
id
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
74
|
+
refresh: onCompleteAction
|
|
75
|
+
}), []);
|
|
76
|
+
(0, _react.useEffect)(() => {
|
|
77
|
+
if (id) {
|
|
78
|
+
refetch({
|
|
79
|
+
type,
|
|
80
|
+
id
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, [type, id]);
|
|
84
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
85
|
+
className: _style.default.dynamic([["4120713286", [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]]]) + " " + ((0, _classnames.default)('container', {
|
|
86
|
+
expanded: isExpanded
|
|
87
|
+
}) || "")
|
|
88
|
+
}, fetching && !loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
89
|
+
className: _style.default.dynamic([["4120713286", [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]]]) + " " + "fetching-loader"
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.CircularLoader, {
|
|
91
|
+
small: true
|
|
92
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
94
|
+
className: _style.default.dynamic([["4120713286", [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]]]) + " " + "header"
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
96
|
+
className: _style.default.dynamic([["4120713286", [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]]]) + " " + "title"
|
|
97
|
+
}, _d2I18n.default.t('Interpretations')), isExpanded ? /*#__PURE__*/_react.default.createElement(_ui.IconChevronUp24, {
|
|
98
|
+
color: _ui.colors.grey700
|
|
99
|
+
}) : /*#__PURE__*/_react.default.createElement(_ui.IconChevronDown24, {
|
|
100
|
+
color: _ui.colors.grey700
|
|
101
|
+
})), isExpanded && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, loading && /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: _style.default.dynamic([["4120713286", [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]]]) + " " + "loader"
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.CircularLoader, {
|
|
104
|
+
small: true
|
|
105
|
+
})), data && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_InterpretationForm.InterpretationForm, {
|
|
106
|
+
currentUser: currentUser,
|
|
107
|
+
type: type,
|
|
108
|
+
id: id,
|
|
109
|
+
onSave: onCompleteAction,
|
|
110
|
+
disabled: disabled
|
|
111
|
+
}), /*#__PURE__*/_react.default.createElement(_InterpretationList.InterpretationList, {
|
|
112
|
+
currentUser: currentUser,
|
|
113
|
+
interpretations: data.interpretations.interpretations,
|
|
114
|
+
onInterpretationClick: onInterpretationClick,
|
|
115
|
+
onReplyIconClick: onReplyIconClick,
|
|
116
|
+
refresh: onCompleteAction,
|
|
117
|
+
disabled: disabled
|
|
118
|
+
}))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
119
|
+
id: "4120713286",
|
|
120
|
+
dynamic: [_ui.spacers.dp16, _ui.colors.grey400, _ui.colors.white, _ui.spacers.dp32, _ui.colors.grey900]
|
|
121
|
+
}, [".container.__jsx-style-dynamic-selector{position:relative;padding:".concat(_ui.spacers.dp16, ";border-bottom:1px solid ").concat(_ui.colors.grey400, ";background-color:").concat(_ui.colors.white, ";}"), ".fetching-loader.__jsx-style-dynamic-selector{position:absolute;inset:0px;background-color:rgba(255,255,255,0.8);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;z-index:1;}", ".expanded.__jsx-style-dynamic-selector{padding-bottom:".concat(_ui.spacers.dp32, ";}"), ".loader.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;cursor:pointer;}", ".title.__jsx-style-dynamic-selector{font-size:16px;font-weight:500;line-height:21px;color:".concat(_ui.colors.grey900, ";}")]));
|
|
122
|
+
});
|
|
123
|
+
exports.InterpretationsUnit = InterpretationsUnit;
|
|
124
|
+
InterpretationsUnit.displayName = 'InterpretationsUnit';
|
|
125
|
+
InterpretationsUnit.defaultProps = {
|
|
126
|
+
onInterpretationClick: Function.prototype
|
|
127
|
+
};
|
|
128
|
+
InterpretationsUnit.propTypes = {
|
|
129
|
+
currentUser: _propTypes.default.object.isRequired,
|
|
130
|
+
id: _propTypes.default.string.isRequired,
|
|
131
|
+
type: _propTypes.default.string.isRequired,
|
|
132
|
+
disabled: _propTypes.default.bool,
|
|
133
|
+
onInterpretationClick: _propTypes.default.func,
|
|
134
|
+
onReplyIconClick: _propTypes.default.func
|
|
135
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "InterpretationsUnit", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _InterpretationsUnit.InterpretationsUnit;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _InterpretationsUnit = require("./InterpretationsUnit.js");
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Interpretation = void 0;
|
|
7
|
+
|
|
8
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
9
|
+
|
|
10
|
+
var _ui = require("@dhis2/ui");
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _index = require("../index.js");
|
|
17
|
+
|
|
18
|
+
var _InterpretationDeleteButton = require("./InterpretationDeleteButton.js");
|
|
19
|
+
|
|
20
|
+
var _InterpretationUpdateForm = require("./InterpretationUpdateForm.js");
|
|
21
|
+
|
|
22
|
+
var _useLike = require("./useLike.js");
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
const Interpretation = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
interpretation,
|
|
33
|
+
currentUser,
|
|
34
|
+
onClick,
|
|
35
|
+
onUpdated,
|
|
36
|
+
onDeleted,
|
|
37
|
+
disabled,
|
|
38
|
+
onReplyIconClick
|
|
39
|
+
} = _ref;
|
|
40
|
+
const [isUpdateMode, setIsUpdateMode] = (0, _react.useState)(false);
|
|
41
|
+
const [showSharingDialog, setShowSharingDialog] = (0, _react.useState)(false);
|
|
42
|
+
const {
|
|
43
|
+
toggleLike,
|
|
44
|
+
isLikedByCurrentUser,
|
|
45
|
+
toggleLikeInProgress
|
|
46
|
+
} = (0, _useLike.useLike)({
|
|
47
|
+
interpretation,
|
|
48
|
+
currentUser,
|
|
49
|
+
onComplete: onUpdated
|
|
50
|
+
});
|
|
51
|
+
const shouldShowButton = !!onClick && !disabled;
|
|
52
|
+
return isUpdateMode ? /*#__PURE__*/_react.default.createElement(_InterpretationUpdateForm.InterpretationUpdateForm, {
|
|
53
|
+
close: () => setIsUpdateMode(false),
|
|
54
|
+
id: interpretation.id,
|
|
55
|
+
showSharingLink: interpretation.access.manage,
|
|
56
|
+
onComplete: onUpdated,
|
|
57
|
+
text: interpretation.text,
|
|
58
|
+
currentUser: currentUser
|
|
59
|
+
}) : /*#__PURE__*/_react.default.createElement(_index.Message, {
|
|
60
|
+
text: interpretation.text,
|
|
61
|
+
created: interpretation.created,
|
|
62
|
+
username: interpretation.user.displayName
|
|
63
|
+
}, !disabled && /*#__PURE__*/_react.default.createElement(_index.MessageStatsBar, null, /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
|
|
64
|
+
tooltipContent: isLikedByCurrentUser ? _d2I18n.default.t('Unlike') : _d2I18n.default.t('Like'),
|
|
65
|
+
iconComponent: _ui.IconThumbUp16,
|
|
66
|
+
onClick: toggleLike,
|
|
67
|
+
selected: isLikedByCurrentUser,
|
|
68
|
+
count: interpretation.likes,
|
|
69
|
+
disabled: toggleLikeInProgress
|
|
70
|
+
}), /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
|
|
71
|
+
tooltipContent: _d2I18n.default.t('Reply'),
|
|
72
|
+
iconComponent: _ui.IconReply16,
|
|
73
|
+
onClick: () => onReplyIconClick(interpretation.id),
|
|
74
|
+
count: interpretation.comments.length
|
|
75
|
+
}), interpretation.access.manage && /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
|
|
76
|
+
iconComponent: _ui.IconShare16,
|
|
77
|
+
tooltipContent: _d2I18n.default.t('Share'),
|
|
78
|
+
onClick: () => setShowSharingDialog(true)
|
|
79
|
+
}), showSharingDialog && /*#__PURE__*/_react.default.createElement(_ui.SharingDialog, {
|
|
80
|
+
open: true,
|
|
81
|
+
type: 'interpretation',
|
|
82
|
+
id: interpretation.id,
|
|
83
|
+
onClose: () => setShowSharingDialog(false)
|
|
84
|
+
}), interpretation.access.update && /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
|
|
85
|
+
iconComponent: _ui.IconEdit16,
|
|
86
|
+
tooltipContent: _d2I18n.default.t('Edit'),
|
|
87
|
+
onClick: () => setIsUpdateMode(true)
|
|
88
|
+
}), interpretation.access.delete && /*#__PURE__*/_react.default.createElement(_InterpretationDeleteButton.InterpretationDeleteButton, {
|
|
89
|
+
id: interpretation.id,
|
|
90
|
+
onComplete: onDeleted
|
|
91
|
+
})), shouldShowButton && /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
92
|
+
secondary: true,
|
|
93
|
+
small: true,
|
|
94
|
+
onClick: (_, event) => {
|
|
95
|
+
event.stopPropagation();
|
|
96
|
+
onClick(interpretation.id);
|
|
97
|
+
}
|
|
98
|
+
}, _d2I18n.default.t('See interpretation')));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports.Interpretation = Interpretation;
|
|
102
|
+
Interpretation.propTypes = {
|
|
103
|
+
currentUser: _propTypes.default.object.isRequired,
|
|
104
|
+
interpretation: _propTypes.default.object.isRequired,
|
|
105
|
+
onDeleted: _propTypes.default.func.isRequired,
|
|
106
|
+
onReplyIconClick: _propTypes.default.func.isRequired,
|
|
107
|
+
onUpdated: _propTypes.default.func.isRequired,
|
|
108
|
+
disabled: _propTypes.default.bool,
|
|
109
|
+
onClick: _propTypes.default.func
|
|
110
|
+
};
|
package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationDeleteButton = void 0;
|
|
7
|
+
|
|
8
|
+
var _appRuntime = require("@dhis2/app-runtime");
|
|
9
|
+
|
|
10
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _index = require("../index.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const mutation = {
|
|
23
|
+
resource: 'interpretations',
|
|
24
|
+
id: _ref => {
|
|
25
|
+
let {
|
|
26
|
+
id
|
|
27
|
+
} = _ref;
|
|
28
|
+
return id;
|
|
29
|
+
},
|
|
30
|
+
type: 'delete'
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const InterpretationDeleteButton = _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
id,
|
|
36
|
+
onComplete
|
|
37
|
+
} = _ref2;
|
|
38
|
+
const [remove, {
|
|
39
|
+
loading
|
|
40
|
+
}] = (0, _appRuntime.useDataMutation)(mutation, {
|
|
41
|
+
onComplete,
|
|
42
|
+
variables: {
|
|
43
|
+
id
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_index.MessageIconButton, {
|
|
47
|
+
tooltipContent: _d2I18n.default.t('Delete'),
|
|
48
|
+
iconComponent: _ui.IconDelete16,
|
|
49
|
+
onClick: remove,
|
|
50
|
+
disabled: loading
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.InterpretationDeleteButton = InterpretationDeleteButton;
|
|
55
|
+
InterpretationDeleteButton.propTypes = {
|
|
56
|
+
id: _propTypes.default.string.isRequired,
|
|
57
|
+
onComplete: _propTypes.default.func.isRequired
|
|
58
|
+
};
|
package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InterpretationSharingLink = void 0;
|
|
7
|
+
|
|
8
|
+
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
9
|
+
|
|
10
|
+
var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
|
|
11
|
+
|
|
12
|
+
var _ui = require("@dhis2/ui");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
const InterpretationSharingLink = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
type,
|
|
27
|
+
id
|
|
28
|
+
} = _ref;
|
|
29
|
+
const [showSharingDialog, setShowSharingDialog] = (0, _react.useState)(false);
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: _style.default.dynamic([["3990725326", [_ui.spacers.dp4, _ui.spacers.dp8, _ui.colors.grey800]]]) + " " + "container"
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
33
|
+
onClick: () => setShowSharingDialog(true),
|
|
34
|
+
className: _style.default.dynamic([["3990725326", [_ui.spacers.dp4, _ui.spacers.dp8, _ui.colors.grey800]]]) + " " + "link"
|
|
35
|
+
}, _d2I18n.default.t('Manage sharing'))), showSharingDialog && /*#__PURE__*/_react.default.createElement(_ui.SharingDialog, {
|
|
36
|
+
open: true,
|
|
37
|
+
type: type,
|
|
38
|
+
id: id,
|
|
39
|
+
onClose: () => setShowSharingDialog(false)
|
|
40
|
+
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
41
|
+
id: "3990725326",
|
|
42
|
+
dynamic: [_ui.spacers.dp4, _ui.spacers.dp8, _ui.colors.grey800]
|
|
43
|
+
}, [".container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;gap:".concat(_ui.spacers.dp4, ";margin-top:").concat(_ui.spacers.dp8, ";font-size:13px;color:").concat(_ui.colors.grey800, ";cursor:pointer;}"), ".link.__jsx-style-dynamic-selector{-webkit-text-decoration:underline;text-decoration:underline;}"]));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.InterpretationSharingLink = InterpretationSharingLink;
|
|
47
|
+
InterpretationSharingLink.propTypes = {
|
|
48
|
+
id: _propTypes.default.string,
|
|
49
|
+
type: _propTypes.default.string
|
|
50
|
+
};
|