@selfcommunity/react-ui 0.5.5-alpha.1 → 0.5.5-alpha.11
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/lib/cjs/components/BroadcastMessages/Message.d.ts.map +1 -1
- package/lib/cjs/components/BroadcastMessages/Message.js +1 -1
- package/lib/cjs/components/BroadcastMessages/Message.js.map +1 -1
- package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.d.ts +2 -20
- package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.d.ts.map +1 -1
- package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +62 -34
- package/lib/cjs/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js.map +1 -1
- package/lib/cjs/components/Header/Header.js +3 -2
- package/lib/cjs/components/Header/Header.js.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageEditor.d.ts.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageEditor.js +34 -32
- package/lib/cjs/components/MessageEditor/MessageEditor.js.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageMediaUploader/index.d.ts.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageMediaUploader/index.js +29 -25
- package/lib/cjs/components/MessageEditor/MessageMediaUploader/index.js.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +5 -5
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/cjs/components/Snippets/Snippets.d.ts +9 -0
- package/lib/cjs/components/Snippets/Snippets.d.ts.map +1 -1
- package/lib/cjs/components/Snippets/Snippets.js +16 -3
- package/lib/cjs/components/Snippets/Snippets.js.map +1 -1
- package/lib/cjs/components/Thread/Thread.d.ts +8 -2
- package/lib/cjs/components/Thread/Thread.d.ts.map +1 -1
- package/lib/cjs/components/Thread/Thread.js +49 -40
- package/lib/cjs/components/Thread/Thread.js.map +1 -1
- package/lib/cjs/components/ToastNotifications/ToastNotifications.d.ts.map +1 -1
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +0 -1
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js.map +1 -1
- package/lib/cjs/components/UserProfileHeader/UserProfileHeader.d.ts.map +1 -1
- package/lib/cjs/components/UserProfileHeader/UserProfileHeader.js +6 -1
- package/lib/cjs/components/UserProfileHeader/UserProfileHeader.js.map +1 -1
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts +3 -3
- package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/esm/components/BroadcastMessages/Message.d.ts.map +1 -1
- package/lib/esm/components/BroadcastMessages/Message.js +1 -1
- package/lib/esm/components/BroadcastMessages/Message.js.map +1 -1
- package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.d.ts +2 -20
- package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.d.ts.map +1 -1
- package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js +64 -36
- package/lib/esm/components/ChangePicture/ChangePictureDialog/ChangePictureDialog.js.map +1 -1
- package/lib/esm/components/Header/Header.js +3 -2
- package/lib/esm/components/Header/Header.js.map +1 -1
- package/lib/esm/components/MessageEditor/MessageEditor.d.ts.map +1 -1
- package/lib/esm/components/MessageEditor/MessageEditor.js +35 -33
- package/lib/esm/components/MessageEditor/MessageEditor.js.map +1 -1
- package/lib/esm/components/MessageEditor/MessageMediaUploader/index.d.ts.map +1 -1
- package/lib/esm/components/MessageEditor/MessageMediaUploader/index.js +29 -25
- package/lib/esm/components/MessageEditor/MessageMediaUploader/index.js.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +5 -5
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/esm/components/Snippets/Snippets.d.ts +9 -0
- package/lib/esm/components/Snippets/Snippets.d.ts.map +1 -1
- package/lib/esm/components/Snippets/Snippets.js +17 -4
- package/lib/esm/components/Snippets/Snippets.js.map +1 -1
- package/lib/esm/components/Thread/Thread.d.ts +8 -2
- package/lib/esm/components/Thread/Thread.d.ts.map +1 -1
- package/lib/esm/components/Thread/Thread.js +49 -40
- package/lib/esm/components/Thread/Thread.js.map +1 -1
- package/lib/esm/components/ToastNotifications/ToastNotifications.d.ts.map +1 -1
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +0 -1
- package/lib/esm/components/ToastNotifications/ToastNotifications.js.map +1 -1
- package/lib/esm/components/UserProfileHeader/UserProfileHeader.d.ts.map +1 -1
- package/lib/esm/components/UserProfileHeader/UserProfileHeader.js +7 -2
- package/lib/esm/components/UserProfileHeader/UserProfileHeader.js.map +1 -1
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts +3 -3
- package/lib/esm/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
- package/lib/umd/react-ui.js +7 -7
- package/lib/umd/react-ui.js.LICENSE.txt +1 -1
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +7 -7
|
@@ -15,18 +15,22 @@ const UploadButton = asUploadButton(forwardRef((props, ref) => (React.createElem
|
|
|
15
15
|
const PREFIX = 'SCMessageMediaUploader';
|
|
16
16
|
const classes = {
|
|
17
17
|
previewContainer: `${PREFIX}-preview-container`,
|
|
18
|
-
mediaUploadSection: `${PREFIX}-media-upload-section`,
|
|
19
18
|
uploadButton: `${PREFIX}-upload-button`,
|
|
20
19
|
docPreview: `${PREFIX}-doc-preview`,
|
|
21
20
|
docLoadingPreview: `${PREFIX}-doc-loading-preview`,
|
|
22
21
|
progress: `${PREFIX}-progress`,
|
|
23
22
|
clearMedia: `${PREFIX}-clear-media`
|
|
24
23
|
};
|
|
25
|
-
const Root = styled(
|
|
24
|
+
const Root = styled(Widget, {
|
|
26
25
|
name: PREFIX,
|
|
27
26
|
slot: 'Root',
|
|
28
27
|
overridesResolver: (props, styles) => styles.root
|
|
29
28
|
})(({ theme }) => ({
|
|
29
|
+
'& .MuiCardHeader-root': {
|
|
30
|
+
paddingRight: theme.spacing(2),
|
|
31
|
+
paddingTop: theme.spacing(1)
|
|
32
|
+
},
|
|
33
|
+
backgroundColor: theme.palette.grey['A200'],
|
|
30
34
|
[`& .${classes.previewContainer}`]: {
|
|
31
35
|
display: 'flex',
|
|
32
36
|
justifyContent: 'center',
|
|
@@ -37,13 +41,14 @@ const Root = styled(Box, {
|
|
|
37
41
|
maxWidth: '40%'
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
|
-
[`& .${classes.mediaUploadSection}`]: {
|
|
41
|
-
backgroundColor: theme.palette.grey['A200']
|
|
42
|
-
},
|
|
43
44
|
[`& .${classes.uploadButton}`]: {
|
|
44
45
|
backgroundColor: theme.palette.common.white
|
|
45
46
|
},
|
|
46
47
|
[`& .${classes.docPreview}`]: {
|
|
48
|
+
[theme.breakpoints.down('md')]: {
|
|
49
|
+
height: 100,
|
|
50
|
+
width: 200
|
|
51
|
+
},
|
|
47
52
|
height: 200,
|
|
48
53
|
width: 400,
|
|
49
54
|
position: 'relative'
|
|
@@ -97,6 +102,7 @@ export default function MessageMediaUploader(props) {
|
|
|
97
102
|
}
|
|
98
103
|
setPreviews([]);
|
|
99
104
|
setFile(null);
|
|
105
|
+
setLoading(false);
|
|
100
106
|
setFileType(null);
|
|
101
107
|
forwardMessageFile(null);
|
|
102
108
|
setLoaded(false);
|
|
@@ -132,25 +138,23 @@ export default function MessageMediaUploader(props) {
|
|
|
132
138
|
* Renders root object
|
|
133
139
|
*/
|
|
134
140
|
return (React.createElement(Root, null,
|
|
135
|
-
React.createElement(
|
|
136
|
-
|
|
137
|
-
React.createElement(
|
|
138
|
-
React.createElement(
|
|
139
|
-
React.createElement(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
React.createElement(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
React.createElement(Icon, null, "close"))) : null)),
|
|
154
|
-
React.createElement(Box, { className: classes.previewContainer }, fileType && fileType.startsWith(SCMessageFileType.DOCUMENT) ? (React.createElement(Box, { className: loaded ? classes.docPreview : classes.docLoadingPreview }, file && loaded ? (React.createElement("iframe", { src: file.file_url, title: "file", width: "100%", height: "100%", style: { resize: 'both' }, loading: "lazy" })) : (React.createElement(CircularProgress, { size: 30 })))) : (React.createElement(UploadPreview, { rememberPreviousBatches: true, previewMethodsRef: previewMethodsRef, onPreviewsChanged: onPreviewsChanged }))))))));
|
|
141
|
+
React.createElement(CardHeader, { action: React.createElement(Icon, { onClick: onClose }, "close") }),
|
|
142
|
+
React.createElement(CardContent, null,
|
|
143
|
+
Object.keys(errors).map((id) => (React.createElement(Fade, { in: true, key: id },
|
|
144
|
+
React.createElement(Alert, { severity: "error", onClose: handleRemoveErrors(id) },
|
|
145
|
+
React.createElement(AlertTitle, null, errors[id].name),
|
|
146
|
+
errors[id].error)))),
|
|
147
|
+
React.createElement(ChunkedUploady, { destination: {
|
|
148
|
+
url: `${scContext.settings.portal}${Endpoints.PrivateMessageUploadMediaInChunks.url()}`,
|
|
149
|
+
headers: { Authorization: `Bearer ${scContext.settings.session.authToken.accessToken}` },
|
|
150
|
+
method: Endpoints.PrivateMessageUploadMediaInChunks.method
|
|
151
|
+
}, chunkSize: 2142880, chunked: true },
|
|
152
|
+
React.createElement(MessageChunkUploader, { onStart: handleStart, onSuccess: handleSuccess, onProgress: handleProgress, onError: handleError }),
|
|
153
|
+
React.createElement(Box, { className: classes.progress }, Object.values(uploading).map((chunk, index) => (React.createElement("div", { key: index },
|
|
154
|
+
React.createElement(Typography, { align: "center" }, `${Math.round(chunk.completed)}%`))))),
|
|
155
|
+
React.createElement(Box, { sx: { display: 'flex', justifyContent: 'center' } }, !file && !loading && React.createElement(UploadButton, { className: classes.uploadButton, inputFieldName: "qqfile" })),
|
|
156
|
+
React.createElement(Box, { className: classes.clearMedia }, previews.length && loaded ? (React.createElement(IconButton, { onClick: onClear },
|
|
157
|
+
React.createElement(Icon, null, "close"))) : null),
|
|
158
|
+
React.createElement(Box, { className: classes.previewContainer }, fileType && fileType.startsWith(SCMessageFileType.DOCUMENT) ? (React.createElement(Box, { className: loaded ? classes.docPreview : classes.docLoadingPreview }, file && loaded ? (React.createElement("iframe", { src: file.file_url, title: "file", width: "100%", height: "100%", style: { resize: 'both' }, loading: "lazy" })) : (React.createElement(CircularProgress, { size: 30 })))) : (React.createElement(UploadPreview, { rememberPreviousBatches: true, previewMethodsRef: previewMethodsRef, onPreviewsChanged: onPreviewsChanged })))))));
|
|
155
159
|
}
|
|
156
160
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/MessageEditor/MessageMediaUploader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnF,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAE9H,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAgB,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM,YAAY,GAAG,cAAc,CACjC,UAAU,CAAC,CAAC,KAAkB,EAAE,GAAQ,EAAE,EAAE,CAAC,CAC3C,oBAAC,UAAU,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG;IAC7B,oBAAC,IAAI,iBAAc,CACR,CACd,CAAC,CACH,CAAC;AAEF,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,MAAM,OAAO,GAAG;IACd,gBAAgB,EAAE,GAAG,MAAM,oBAAoB;IAC/C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/MessageEditor/MessageMediaUploader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnF,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAE9H,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,cAAc,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAA2B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAgB,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAE5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,oBAAoB,MAAM,sCAAsC,CAAC;AACxE,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,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CAAC,CAAC,CAC3B,oBAAC,UAAU,IAAC,OAAO,EAAE,OAAO;oBAC1B,oBAAC,IAAI,gBAAa,CACP,CACd,CAAC,CAAC,CAAC,IAAI,CACJ;gBACN,oBAAC,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,IACrC,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC7D,oBAAC,GAAG,IAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,IACpE,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAChB,gCAAQ,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,MAAM,EAAC,EAAE,OAAO,EAAC,MAAM,GAAG,CAC/G,CAAC,CAAC,CAAC,CACF,oBAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,GAAI,CAC/B,CACG,CACP,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IAAC,uBAAuB,QAAC,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,GAAI,CACtH,CACG,CACS,CACL,CACT,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/PrivateMessage/PrivateMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,gCAAgC,EAAC,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAoFhE,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,kBAAkB,EAAE,gCAAgC,CAAC;IAErD;;;OAGG;IACH,QAAQ,CAAC,EAAE,gCAAgC,CAAC;IAE5C;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,OAAO,EAAE,+BAA+B,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"PrivateMessage.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/PrivateMessage/PrivateMessage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,gCAAgC,EAAC,MAAM,sBAAsB,CAAC;AAItE,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAoFhE,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,kBAAkB,EAAE,gCAAgC,CAAC;IAErD;;;OAGG;IACH,QAAQ,CAAC,EAAE,gCAAgC,CAAC;IAE5C;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,OAAO,EAAE,+BAA+B,GAAG,GAAG,CAAC,OAAO,CA2IxG"}
|
|
@@ -127,27 +127,27 @@ export default function PrivateMessageNotification(inProps) {
|
|
|
127
127
|
React.createElement(FormattedMessage, { id: 'ui.userToastNotifications.privateMessage.sentMessage', defaultMessage: 'ui.userToastNotifications.privateMessage.sentMessage' }),
|
|
128
128
|
":",
|
|
129
129
|
React.createElement(Box, { className: classes.messageWrap },
|
|
130
|
-
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message), className: classes.message },
|
|
130
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender), className: classes.message },
|
|
131
131
|
React.createElement(Typography, { variant: "body2", dangerouslySetInnerHTML: { __html: notificationObject.message.message } }))))),
|
|
132
132
|
isSnippetTemplate && (React.createElement(Box, null,
|
|
133
133
|
React.createElement(Typography, { component: "div", color: "inherit" },
|
|
134
134
|
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.message.sender), className: classes.username }, notificationObject.message.sender.username),
|
|
135
135
|
' ',
|
|
136
|
-
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message), className: classes.messageLabel }, intl.formatMessage(messages.receivePrivateMessage, {
|
|
136
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender), className: classes.messageLabel }, intl.formatMessage(messages.receivePrivateMessage, {
|
|
137
137
|
total: 1,
|
|
138
138
|
b: (...chunks) => React.createElement("strong", null, chunks)
|
|
139
139
|
})))))), footer: React.createElement(React.Fragment, null, isToastTemplate && (React.createElement(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 },
|
|
140
140
|
React.createElement(DateTimeAgo, { date: notificationObject.active_at }),
|
|
141
141
|
React.createElement(Typography, { color: "primary" },
|
|
142
|
-
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message) },
|
|
142
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender) },
|
|
143
143
|
React.createElement(FormattedMessage, { id: "ui.userToastNotifications.replyMessage", defaultMessage: 'ui.userToastNotifications.replyMessage' })))))) }));
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
146
|
content = (React.createElement(NotificationItem, { template: template, isNew: notificationObject.is_new, disableTypography: true, actions: React.createElement(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 },
|
|
147
147
|
React.createElement(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }),
|
|
148
|
-
React.createElement(Button, { color: 'primary', variant: "outlined", size: "small", classes: { root: classes.replyButton }, component: Link, to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message) },
|
|
148
|
+
React.createElement(Button, { color: 'primary', variant: "outlined", size: "small", classes: { root: classes.replyButton }, component: Link, to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender) },
|
|
149
149
|
React.createElement(FormattedMessage, { id: "ui.notification.privateMessage.btnReplyLabel", defaultMessage: "ui.notification.privateMessage.btnReplyLabel" }))), primary: React.createElement(Box, { className: classes.messageWrap },
|
|
150
|
-
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message), className: classes.message },
|
|
150
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, notificationObject.message.sender), className: classes.message },
|
|
151
151
|
React.createElement(Typography, { variant: "body2", dangerouslySetInnerHTML: { __html: notificationObject.message.message } }))) }));
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateMessage.js","sourceRoot":"","sources":["../../../../../src/components/Notification/PrivateMessage/PrivateMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAC,IAAI,EAAE,Q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;gBACG,eAAe,IAAI,CAClB,oBAAC,GAAG;oBACF,oBAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,IAChG,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CACtC;oBAAC,GAAG;oBACX,oBAAC,gBAAgB,IACf,EAAE,EAAE,sDAAsD,EAC1D,cAAc,EAAE,sDAAsD,GACtE;;oBAEF,oBAAC,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,WAAW;wBACjC,oBAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"PrivateMessage.js","sourceRoot":"","sources":["../../../../../src/components/Notification/PrivateMessage/PrivateMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAwB,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACrE,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAEhE,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,qBAAqB,EAAE;QACrB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,uCAAuC;KACxD;CACF,CAAC,CAAC;AAEH,MAAM,MAAM,GAA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AM,EAAE,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAC,GAAI,CAChG,CACH,GAER,CACH,CAAC;KACH;IAED;;OAEG;IACH,OAAO,CACL,oBAAC,IAAI,kBAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,IAAM,IAAI,GAC5F,OAAO,CACH,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -33,6 +33,14 @@ export interface SnippetsProps {
|
|
|
33
33
|
* @default false
|
|
34
34
|
*/
|
|
35
35
|
shouldUpdate?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Props spread to delete icon
|
|
38
|
+
*/
|
|
39
|
+
deleteIconProps?: {
|
|
40
|
+
show: boolean;
|
|
41
|
+
action?: () => void;
|
|
42
|
+
name?: string;
|
|
43
|
+
};
|
|
36
44
|
}
|
|
37
45
|
/**
|
|
38
46
|
*
|
|
@@ -55,6 +63,7 @@ export interface SnippetsProps {
|
|
|
55
63
|
|---|---|---|
|
|
56
64
|
|root|.SCSnippets-root|Styles applied to the root element.|
|
|
57
65
|
|selected|.SCSnippets-selected|Styles applied to the selected element.|
|
|
66
|
+
|deleteSection|.SCSnippets-delete-section|Styles applied to delete thread section.|
|
|
58
67
|
|
|
59
68
|
* @param inProps
|
|
60
69
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snippets.d.ts","sourceRoot":"","sources":["../../../../src/components/Snippets/Snippets.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Snippets.d.ts","sourceRoot":"","sources":["../../../../src/components/Snippets/Snippets.tsx"],"names":[],"mappings":"AAgDA,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,QAAQ,KAAA,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,OAAO,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAoJpE"}
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React, { useEffect, useRef, useState } from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
|
-
import { Divider, List } from '@mui/material';
|
|
14
|
+
import { Box, Divider, List } from '@mui/material';
|
|
15
15
|
import Widget from '../Widget';
|
|
16
16
|
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
17
17
|
import { SCNotificationTopicType, SCNotificationTypologyType } from '@selfcommunity/types';
|
|
@@ -20,10 +20,12 @@ import Message from '../Message';
|
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import { useThemeProps } from '@mui/system';
|
|
22
22
|
import PubSub from 'pubsub-js';
|
|
23
|
+
import Icon from '@mui/material/Icon';
|
|
23
24
|
const PREFIX = 'SCSnippets';
|
|
24
25
|
const classes = {
|
|
25
26
|
root: `${PREFIX}-root`,
|
|
26
|
-
selected: `${PREFIX}-selected
|
|
27
|
+
selected: `${PREFIX}-selected`,
|
|
28
|
+
deleteSection: `${PREFIX}-delete-section`
|
|
27
29
|
};
|
|
28
30
|
const Root = styled(Widget, {
|
|
29
31
|
name: PREFIX,
|
|
@@ -41,6 +43,14 @@ const Root = styled(Widget, {
|
|
|
41
43
|
},
|
|
42
44
|
[`& .${classes.selected}`]: {
|
|
43
45
|
background: theme.palette.primary.main
|
|
46
|
+
},
|
|
47
|
+
[`& .${classes.deleteSection}`]: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
width: '100%',
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
bottom: '0px',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
backgroundColor: '#fff'
|
|
44
54
|
}
|
|
45
55
|
}));
|
|
46
56
|
/**
|
|
@@ -64,6 +74,7 @@ const Root = styled(Widget, {
|
|
|
64
74
|
|---|---|---|
|
|
65
75
|
|root|.SCSnippets-root|Styles applied to the root element.|
|
|
66
76
|
|selected|.SCSnippets-selected|Styles applied to the selected element.|
|
|
77
|
+
|deleteSection|.SCSnippets-delete-section|Styles applied to delete thread section.|
|
|
67
78
|
|
|
68
79
|
* @param inProps
|
|
69
80
|
*/
|
|
@@ -73,7 +84,7 @@ export default function Snippets(inProps) {
|
|
|
73
84
|
props: inProps,
|
|
74
85
|
name: PREFIX
|
|
75
86
|
});
|
|
76
|
-
const { autoHide = false, className = null, onSnippetClick, threadId, getSnippetHeadline, shouldUpdate } = props, rest = __rest(props, ["autoHide", "className", "onSnippetClick", "threadId", "getSnippetHeadline", "shouldUpdate"]);
|
|
87
|
+
const { autoHide = false, className = null, onSnippetClick, threadId, getSnippetHeadline, shouldUpdate, deleteIconProps } = props, rest = __rest(props, ["autoHide", "className", "onSnippetClick", "threadId", "getSnippetHeadline", "shouldUpdate", "deleteIconProps"]);
|
|
77
88
|
// STATE
|
|
78
89
|
const [snippets, setSnippets] = useState([]);
|
|
79
90
|
const [loading, setLoading] = useState(true);
|
|
@@ -177,7 +188,9 @@ export default function Snippets(inProps) {
|
|
|
177
188
|
return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }),
|
|
178
189
|
React.createElement(List, null, snippets.map((message, index) => (React.createElement("div", { key: index },
|
|
179
190
|
React.createElement(Message, { elevation: 0, message: message, key: message.id, onClick: () => handleOpenThread(message), className: message.id === threadId ? classes.selected : '' }),
|
|
180
|
-
index < total - 1 ? React.createElement(Divider, null) : null))))
|
|
191
|
+
index < total - 1 ? React.createElement(Divider, null) : null)))),
|
|
192
|
+
total && deleteIconProps.show && (React.createElement(Box, { className: classes.deleteSection },
|
|
193
|
+
React.createElement(Icon, { onClick: deleteIconProps.action }, deleteIconProps.name)))));
|
|
181
194
|
}
|
|
182
195
|
return null;
|
|
183
196
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snippets.js","sourceRoot":"","sources":["../../../../src/components/Snippets/Snippets.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Snippets.js","sourceRoot":"","sources":["../../../../src/components/Snippets/Snippets.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAE,SAAS,EAAe,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAuB,uBAAuB,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AA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AAO,EAAE,OAAO,EAChB,GAAG,EAAE,OAAO,CAAC,EAAE,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EACxC,SAAS,EAAE,OAAO,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAC1D;gBACD,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,IAAI,CACnC,CACP,CAAC,CACG;YACN,KAAK,IAAI,eAAe,CAAC,IAAI,IAAI,CAChC,oBAAC,GAAG,IAAC,SAAS,EAAE,OAAO,CAAC,aAAa;gBACnC,oBAAC,IAAI,IAAC,OAAO,EAAE,eAAe,CAAC,MAAM,IAAG,eAAe,CAAC,IAAI,CAAQ,CAChE,CACP,CACI,CACR,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SCPrivateMessageType } from '@selfcommunity/types';
|
|
2
2
|
export interface ThreadProps {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* User object (thread receiver)
|
|
5
|
+
* default null
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
userObj?: SCPrivateMessageType;
|
|
7
8
|
/**
|
|
8
9
|
* Message receiver id
|
|
9
10
|
* @default null
|
|
@@ -48,6 +49,11 @@ export interface ThreadProps {
|
|
|
48
49
|
* @default null
|
|
49
50
|
*/
|
|
50
51
|
onMessageBack?: (dispatch: any) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Callback fired when deleting a thread.
|
|
54
|
+
* @default null
|
|
55
|
+
*/
|
|
56
|
+
onMessageDelete?: (dispatch: any) => void;
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
53
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/components/Thread/Thread.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsD,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/components/Thread/Thread.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsD,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAmI/G,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3C;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6ZhE"}
|
|
@@ -63,7 +63,7 @@ const Root = styled(Widget, {
|
|
|
63
63
|
minHeight: '500px'
|
|
64
64
|
},
|
|
65
65
|
[`& .${classes.threadBox}`]: {
|
|
66
|
-
maxHeight: '
|
|
66
|
+
maxHeight: '540px',
|
|
67
67
|
[theme.breakpoints.down('md')]: {
|
|
68
68
|
maxHeight: '400px'
|
|
69
69
|
},
|
|
@@ -79,6 +79,7 @@ const Root = styled(Widget, {
|
|
|
79
79
|
'& .MuiTypography-root': {
|
|
80
80
|
fontSize: '1.5rem'
|
|
81
81
|
},
|
|
82
|
+
minHeight: '550px',
|
|
82
83
|
[theme.breakpoints.down('md')]: {
|
|
83
84
|
maxHeight: '450px'
|
|
84
85
|
}
|
|
@@ -97,6 +98,7 @@ const Root = styled(Widget, {
|
|
|
97
98
|
flexGrow: 1,
|
|
98
99
|
flexShrink: 1,
|
|
99
100
|
flexBasis: 'auto',
|
|
101
|
+
minHeight: '550px',
|
|
100
102
|
[theme.breakpoints.down('md')]: {
|
|
101
103
|
height: '450px'
|
|
102
104
|
}
|
|
@@ -178,7 +180,7 @@ export default function Thread(inProps) {
|
|
|
178
180
|
props: inProps,
|
|
179
181
|
name: PREFIX
|
|
180
182
|
});
|
|
181
|
-
const {
|
|
183
|
+
const { userObj, autoHide, className, openNewMessage, onNewMessageSent, onMessageSent, shouldUpdate, onMessageBack, onMessageDelete } = props, rest = __rest(props, ["userObj", "autoHide", "className", "openNewMessage", "onNewMessageSent", "onMessageSent", "shouldUpdate", "onMessageBack", "onMessageDelete"]);
|
|
182
184
|
// CONTEXT
|
|
183
185
|
const scUserContext = useContext(SCUserContext);
|
|
184
186
|
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
|
@@ -190,14 +192,14 @@ export default function Thread(inProps) {
|
|
|
190
192
|
const loggedUser = scUserContext.user && scUserContext.user.id;
|
|
191
193
|
const [isHovered, setIsHovered] = useState({});
|
|
192
194
|
const [openDeleteMessageDialog, setOpenDeleteMessageDialog] = useState(false);
|
|
193
|
-
const [openDeleteThreadDialog, setOpenDeleteThreadDialog] = useState(false);
|
|
194
195
|
const [deletingMsg, setDeletingMsg] = useState(null);
|
|
195
196
|
const [message, setMessage] = useState('');
|
|
196
197
|
const [messageFile, setMessageFile] = useState(null);
|
|
197
198
|
const [sending, setSending] = useState(false);
|
|
198
199
|
const [followers, setFollowers] = useState([]);
|
|
199
200
|
const [recipients, setRecipients] = useState([]);
|
|
200
|
-
const
|
|
201
|
+
const [isFollowed, setIsFollowed] = useState(false);
|
|
202
|
+
const [receiver, setReceiver] = useState(null);
|
|
201
203
|
// REFS
|
|
202
204
|
const refreshSubscription = useRef(null);
|
|
203
205
|
// INTL
|
|
@@ -260,30 +262,10 @@ export default function Thread(inProps) {
|
|
|
260
262
|
.then(() => {
|
|
261
263
|
const result = messageObjs.filter((m) => m.id !== deletingMsg.id);
|
|
262
264
|
setMessageObjs(result);
|
|
263
|
-
handleClose();
|
|
264
|
-
})
|
|
265
|
-
.catch((error) => {
|
|
266
|
-
console.log(error);
|
|
267
|
-
let _snackBar = enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.common.error", defaultMessage: "ui.common.error" }), {
|
|
268
|
-
variant: 'error',
|
|
269
|
-
onClick: () => {
|
|
270
|
-
closeSnackbar(_snackBar);
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Handles deletion of a thread
|
|
277
|
-
*/
|
|
278
|
-
function handleDeleteThread() {
|
|
279
|
-
PrivateMessageService.deleteAThread(threadId)
|
|
280
|
-
.then(() => {
|
|
281
|
-
onMessageBack('default');
|
|
282
265
|
shouldUpdate(true);
|
|
283
|
-
|
|
266
|
+
handleClose();
|
|
284
267
|
})
|
|
285
268
|
.catch((error) => {
|
|
286
|
-
setOpenDeleteThreadDialog(false);
|
|
287
269
|
console.log(error);
|
|
288
270
|
let _snackBar = enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.common.error", defaultMessage: "ui.common.error" }), {
|
|
289
271
|
variant: 'error',
|
|
@@ -306,7 +288,7 @@ export default function Thread(inProps) {
|
|
|
306
288
|
url: Endpoints.SendMessage.url(),
|
|
307
289
|
method: Endpoints.SendMessage.method,
|
|
308
290
|
data: {
|
|
309
|
-
recipients: openNewMessage ? ids : [
|
|
291
|
+
recipients: openNewMessage ? ids : [typeof userObj === 'number' ? userObj : userObj.receiver.id],
|
|
310
292
|
message: message,
|
|
311
293
|
file_uuid: messageFile !== null && messageFile !== void 0 ? messageFile : null
|
|
312
294
|
}
|
|
@@ -316,7 +298,6 @@ export default function Thread(inProps) {
|
|
|
316
298
|
setMessageObjs((prev) => [...prev, res.data]);
|
|
317
299
|
setSending(false);
|
|
318
300
|
onMessageSent(res.data);
|
|
319
|
-
shouldUpdate(false);
|
|
320
301
|
if (openNewMessage) {
|
|
321
302
|
onNewMessageSent(res.data);
|
|
322
303
|
shouldUpdate(true);
|
|
@@ -346,6 +327,19 @@ export default function Thread(inProps) {
|
|
|
346
327
|
.then((res) => {
|
|
347
328
|
const data = res.data;
|
|
348
329
|
setFollowers(data);
|
|
330
|
+
if (data.length && userObj) {
|
|
331
|
+
let u;
|
|
332
|
+
if (typeof userObj === 'number') {
|
|
333
|
+
u = userObj;
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
u = userObj.receiver.id;
|
|
337
|
+
}
|
|
338
|
+
setIsFollowed(data.some((f) => f.id === u));
|
|
339
|
+
}
|
|
340
|
+
if (openNewMessage) {
|
|
341
|
+
setIsFollowed(true);
|
|
342
|
+
}
|
|
349
343
|
})
|
|
350
344
|
.catch((error) => {
|
|
351
345
|
console.log(error);
|
|
@@ -355,17 +349,30 @@ export default function Thread(inProps) {
|
|
|
355
349
|
* Fetches thread
|
|
356
350
|
*/
|
|
357
351
|
function fetchThread() {
|
|
352
|
+
let u;
|
|
353
|
+
if (typeof userObj === 'number') {
|
|
354
|
+
u = userObj;
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
u = userObj.receiver.id;
|
|
358
|
+
}
|
|
358
359
|
http
|
|
359
360
|
.request({
|
|
360
361
|
url: Endpoints.GetAThread.url(),
|
|
361
362
|
method: Endpoints.GetAThread.method,
|
|
362
363
|
params: {
|
|
363
|
-
|
|
364
|
+
user: u
|
|
364
365
|
}
|
|
365
366
|
})
|
|
366
367
|
.then((res) => {
|
|
367
368
|
const data = res.data;
|
|
368
369
|
setMessageObjs(data.results);
|
|
370
|
+
if (data.results[0].receiver.id !== loggedUser) {
|
|
371
|
+
setReceiver(data.results[0].receiver);
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
setReceiver(data.results[0].sender);
|
|
375
|
+
}
|
|
369
376
|
setLoading(false);
|
|
370
377
|
})
|
|
371
378
|
.catch((error) => {
|
|
@@ -377,11 +384,14 @@ export default function Thread(inProps) {
|
|
|
377
384
|
* if openNewMessage is true, fetches user followers too.
|
|
378
385
|
*/
|
|
379
386
|
useEffect(() => {
|
|
387
|
+
if (userObj) {
|
|
388
|
+
fetchThread();
|
|
389
|
+
fetchFollowers();
|
|
390
|
+
}
|
|
380
391
|
if (openNewMessage) {
|
|
381
392
|
fetchFollowers();
|
|
382
393
|
}
|
|
383
|
-
|
|
384
|
-
}, [threadId, openNewMessage]);
|
|
394
|
+
}, [userObj, openNewMessage]);
|
|
385
395
|
/**
|
|
386
396
|
* When a ws notification arrives, update data
|
|
387
397
|
*/
|
|
@@ -408,22 +418,21 @@ export default function Thread(inProps) {
|
|
|
408
418
|
*/
|
|
409
419
|
function renderThread() {
|
|
410
420
|
return (React.createElement(React.Fragment, null,
|
|
411
|
-
isMobile &&
|
|
421
|
+
isMobile && receiver && (React.createElement(AppBar, { position: "static" },
|
|
412
422
|
React.createElement(Toolbar, { className: classes.toolBar },
|
|
413
423
|
React.createElement(Box, { sx: { display: 'flex', justifyContent: 'flex-start', alignItems: 'center' } },
|
|
414
|
-
React.createElement(Icon, { onClick:
|
|
415
|
-
React.createElement(Avatar, { alt: "Remy Sharp", src:
|
|
416
|
-
React.createElement(Typography, { variant: "h6", color: "inherit", component: "div" },
|
|
424
|
+
React.createElement(Icon, { onClick: onMessageBack }, "chevron_left"),
|
|
425
|
+
React.createElement(Avatar, { alt: "Remy Sharp", src: receiver.avatar, sx: { marginRight: '8px' } }),
|
|
426
|
+
React.createElement(Typography, { variant: "h6", color: "inherit", component: "div" }, receiver.username)),
|
|
417
427
|
React.createElement(Box, { sx: { display: 'flex', justifyContent: 'flex-end', alignItems: 'center' } },
|
|
418
|
-
React.createElement(Icon, { onClick:
|
|
428
|
+
React.createElement(Icon, { onClick: onMessageDelete }, "delete"))))),
|
|
419
429
|
React.createElement(Box, { className: classes.threadBox },
|
|
420
|
-
openDeleteThreadDialog && (React.createElement(ConfirmDialog, { open: openDeleteThreadDialog, title: React.createElement(FormattedMessage, { id: "ui.delete.thread.message.dialog.msg", defaultMessage: "ui.delete.thread.message.dialog.msg" }), btnConfirm: React.createElement(FormattedMessage, { id: "ui.thread.message.dialog.confirm", defaultMessage: "ui.thread.message.dialog.confirm" }), onConfirm: () => handleDeleteThread(), onClose: () => setOpenDeleteThreadDialog(false) })),
|
|
421
430
|
openDeleteMessageDialog && (React.createElement(ConfirmDialog, { open: openDeleteMessageDialog, title: React.createElement(FormattedMessage, { id: "ui.thread.message.dialog.msg", defaultMessage: "ui.thread.message.dialog.msg" }), btnConfirm: React.createElement(FormattedMessage, { id: "ui.thread.message.dialog.confirm", defaultMessage: "ui.thread.message.dialog.confirm" }), onConfirm: () => handleDelete(), onClose: handleClose })),
|
|
422
431
|
Object.keys(formattedMessages).map((key, index) => (React.createElement("div", { key: index },
|
|
423
432
|
React.createElement(ListSubheader, { className: classes.center }, key),
|
|
424
433
|
formattedMessages[key].map((msg, index) => (React.createElement("div", { key: index, className: loggedUser === msg.sender.id ? classes.sender : classes.receiver },
|
|
425
434
|
React.createElement(Message, { elevation: 0, message: msg, key: msg.id, snippetType: false, loggedUser: loggedUser, onMouseEnter: () => handleMouseEnter(msg.id), onMouseLeave: () => handleMouseLeave(msg.id), isHovering: isHovered[msg.id], onDeleteIconClick: () => handleDeleteDialog(msg) }))))))),
|
|
426
|
-
React.createElement(MessageEditor, { send: () => sendMessage(), isSending: sending, getMessage: handleMessage, getMessageFile: handleMessageFile }))));
|
|
435
|
+
React.createElement(MessageEditor, { send: () => sendMessage(), isSending: sending, getMessage: handleMessage, getMessageFile: handleMessageFile, autoHide: !isFollowed }))));
|
|
427
436
|
}
|
|
428
437
|
/**
|
|
429
438
|
* Renders empty box (when there is no thread open) or new message box
|
|
@@ -442,7 +451,7 @@ export default function Thread(inProps) {
|
|
|
442
451
|
React.createElement(Autocomplete, { className: classes.autocomplete, multiple: true, freeSolo: true, options: followers, getOptionLabel: (option) => option.username, renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder)}`, variant: "standard", InputProps: Object.assign(Object.assign({}, params.InputProps), { disableUnderline: true }) }))), onChange: selectRecipients })))),
|
|
443
452
|
React.createElement(Box, { className: classes.newMessageEmptyBox }),
|
|
444
453
|
React.createElement(Box, { className: classes.newMessageEditor },
|
|
445
|
-
React.createElement(MessageEditor, { send: () => sendMessage(), isSending: sending, getMessage: handleMessage, getMessageFile: handleMessageFile })))) : (React.createElement(Box, { className: classes.emptyBox },
|
|
454
|
+
React.createElement(MessageEditor, { send: () => sendMessage(), isSending: sending, getMessage: handleMessage, getMessageFile: handleMessageFile, autoHide: !isFollowed })))) : (React.createElement(Box, { className: classes.emptyBox },
|
|
446
455
|
React.createElement(Typography, { component: "h3" },
|
|
447
456
|
React.createElement(FormattedMessage, { id: "ui.thread.emptyBox.message", defaultMessage: "ui.thread.emptyBox.message" }))))));
|
|
448
457
|
}
|
|
@@ -450,14 +459,14 @@ export default function Thread(inProps) {
|
|
|
450
459
|
if (!scUserContext.user) {
|
|
451
460
|
return null;
|
|
452
461
|
}
|
|
453
|
-
if (loading &&
|
|
462
|
+
if (loading && userObj) {
|
|
454
463
|
return React.createElement(ThreadSkeleton, null);
|
|
455
464
|
}
|
|
456
465
|
/**
|
|
457
466
|
* Renders the component (if not hidden by autoHide prop)
|
|
458
467
|
*/
|
|
459
468
|
if (!autoHide) {
|
|
460
|
-
return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }),
|
|
469
|
+
return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }), userObj ? renderThread() : renderNewOrNoMessageBox()));
|
|
461
470
|
}
|
|
462
471
|
return null;
|
|
463
472
|
}
|