{Device.android &&
-
{userInfo.initials}
+
{userInfo.initials}
}
{userInfo.name}
@@ -123,12 +123,107 @@ const AddComment = props => {
)
};
-// View comments
-const ViewComments = ({storeComments}) => {
+// Actions
+const CommentActions = ({comment, onCommentMenuClick, opened, openActionComment}) => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
+ return (
+
+ )
+};
+// Edit comment
+const EditCommentPopup = ({comment, onEditComment, opened, close}) => {
+ const { t } = useTranslation();
+ const _t = t('Common.Collaboration', {returnObjects: true});
+ const [stateText, setText] = useState(comment.comment);
+ console.log(comment);
+ return (
+
+
+
+ {
+ close();
+ //f7.popup.close('.edit-comment-popup');
+ }}>{_t.textCancel}
+
+ {_t.textEditComment}
+
+ {
+ onEditComment(comment, stateText);
+ close();
+ //f7.popup.close('.edit-comment-popup');
+ }}
+ >
+ {Device.android ? : _t.textDone}
+
+
+
+
+
+ {Device.android &&
+
{comment.userInitials}
+ }
+
+
{comment.userName}
+
{comment.date}
+
+
+
+ {setText(event.target.value);}}>
+
+
+
+ )
+};
+
+const EditComment = ({editProps, opened, close}) => {
+ return (
+ Device.phone ?
+
:
+
+ )
+};
+
+// View comments
+const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment}) => {
+ const { t } = useTranslation();
+ const _t = t('Common.Collaboration', {returnObjects: true});
+ const isAndroid = Device.android;
+
+ const viewMode = !storeAppOptions.canComments;
const comments = storeComments.sortComments;
+ const sliceQuote = (text) => {
+ if (text) {
+ let sliced = text.slice(0, 100);
+ if (sliced.length < text.length) {
+ sliced += '...';
+ return sliced;
+ }
+ return text;
+ }
+ };
+
+ const [clickComment, setClickComment] = useState();
+ const [commentActionsOpened, openActionComment] = useState(false);
+
return (
@@ -138,12 +233,25 @@ const ViewComments = ({storeComments}) => {
{comments.map((comment, indexComment) => {
return (
-
-
{comment.userName}
-
{comment.date}
+
+
+ {isAndroid &&
{comment.userInitials}
}
+
+
{comment.userName}
+
{comment.date}
+
+
+ {!viewMode &&
+
+
{onResolveComment(comment);}}>
+
{setClickComment(comment); openActionComment(true);}}
+ >
+
+ }
-
{comment.quote}
+ {comment.quote &&
{sliceQuote(comment.quote)}
}
{comment.replies.length > 0 &&
@@ -155,9 +263,19 @@ const ViewComments = ({storeComments}) => {
-
-
{reply.userName}
-
{reply.date}
+
+
+ {isAndroid &&
{reply.userInitials}
}
+
+
{reply.userName}
+
{reply.date}
+
+
+ {!viewMode &&
+
+ }
@@ -177,13 +295,15 @@ const ViewComments = ({storeComments}) => {
}
+
)
};
-const _ViewComments = inject('storeComments')(observer(ViewComments));
+const _ViewComments = inject('storeComments', 'storeAppOptions')(observer(ViewComments));
export {
AddComment,
+ EditComment,
_ViewComments as ViewComments
}
diff --git a/apps/common/mobile/resources/less/comments.less b/apps/common/mobile/resources/less/comments.less
index 1dd0092d00..abc2140adf 100644
--- a/apps/common/mobile/resources/less/comments.less
+++ b/apps/common/mobile/resources/less/comments.less
@@ -39,9 +39,25 @@
}
.comment-list {
- .item-inner {
+ .item-content .item-inner {
padding-right: 0;
padding-bottom: 0;
+ padding-top: 16px;
+ .comment-header {
+ display: flex;
+ justify-content: space-between;
+ padding-right: 16px;
+ .right {
+ display: flex;
+ justify-content: space-between;
+ width: 70px;
+ }
+ }
+ .reply-header {
+ display: flex;
+ justify-content: space-between;
+ padding-right: 16px;
+ }
}
.item-title {
width: 100%;
@@ -77,29 +93,14 @@
padding-right: 15px;
pre {
white-space: pre-wrap;
+ overflow-wrap: break-word;
}
}
.list-reply {
padding-left: 26px;
}
- .reply-item {
- &:after {
- content: none;
- }
- &:before {
- content: '';
- position: absolute;
- left: auto;
- bottom: 0;
- right: auto;
- top: 0;
- height: 1px;
- width: 100%;
- background-color: @separator-color;
- display: block;
- z-index: 15;
- -webkit-transform-origin: 50% 100%;
- transform-origin: 50% 100%;
- }
- }
+}
+
+.edit-comment-popup {
+ z-index: 20000;
}
\ No newline at end of file
diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less
index d82f183f3c..ea41f12844 100644
--- a/apps/common/mobile/resources/less/common-ios.less
+++ b/apps/common/mobile/resources/less/common-ios.less
@@ -1,6 +1,9 @@
.device-ios {
@blockTitleColor: #6d6d72;
+ @item-border-color: #c8c7cc;
+
+ --f7-list-item-border-color: @item-border-color;
--f7-navbar-link-color: @themeColor;
--f7-navbar-text-color: @black;
diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less
index 77a1b4a643..690e482269 100644
--- a/apps/common/mobile/resources/less/common.less
+++ b/apps/common/mobile/resources/less/common.less
@@ -9,7 +9,6 @@
@autoColor: @black;
@comment-date: #6d6d72;
-@separator-color: #c8c7cc;
.popup, .popover, .sheet-modal {
.list {
diff --git a/apps/common/mobile/resources/less/ios/comments.less b/apps/common/mobile/resources/less/ios/comments.less
index ab3627426c..0f25bb3534 100644
--- a/apps/common/mobile/resources/less/ios/comments.less
+++ b/apps/common/mobile/resources/less/ios/comments.less
@@ -1,2 +1,24 @@
.device-ios {
+ .comment-list {
+ .reply-item {
+ .item-inner:after {
+ content: none !important;
+ }
+ &:before {
+ content: '';
+ position: absolute;
+ left: auto;
+ bottom: 0;
+ right: auto;
+ top: 0;
+ height: 1px;
+ width: 100%;
+ background-color: var(--f7-list-item-border-color);
+ display: block;
+ z-index: 15;
+ -webkit-transform-origin: 50% 100%;
+ transform-origin: 50% 100%;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index 3c63789cdc..00f9f0ea65 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -116,7 +116,16 @@
"textAddComment": "Add Comment",
"textCancel": "Cancel",
"textDone": "Done",
- "textNoComments": "This document doesn't contain comments"
+ "textNoComments": "This document doesn't contain comments",
+ "textEdit": "Edit",
+ "textResolve": "Resolve",
+ "textReopen": "Reopen",
+ "textAddReply": "Add Reply",
+ "textDeleteComment": "Delete Comment",
+ "textMessageDeleteComment": "Do you really want to delete this comment?",
+ "textMessageDeleteReply": "Do you really want to delete this reply?",
+ "textDeleteReply": "Delete Reply",
+ "textEditComment": "Edit Comment"
}
},
"Settings": {