[mobile][de] Add insert comment

This commit is contained in:
JuliaSvinareva 2021-02-18 18:40:54 +03:00
parent 0b4deb6e01
commit c446eb4db4
18 changed files with 414 additions and 25 deletions

View file

@ -5,7 +5,8 @@ class CollaborationController extends Component {
constructor(props){
super(props);
Common.Notifications.on('engineCreated', api => {
Common.Notifications.on('configOptionsFill', () => {
const api = Common.EditorApi.get();
// this.api = api;
api.asc_registerCallback('asc_onAuthParticipantsChanged', this.onChangeEditUsers.bind(this));
api.asc_registerCallback('asc_onParticipantsChanged', this.onChangeEditUsers.bind(this));
@ -22,6 +23,7 @@ class CollaborationController extends Component {
onChangeEditUsers(users) {
const storeUsers = this.props.users;
storeUsers.reset(users);
storeUsers.setCurrentUser(this.props.storeAppOptions.user.id);
};
render() {
@ -29,4 +31,4 @@ class CollaborationController extends Component {
}
}
export default inject('users')(observer(CollaborationController));
export default inject('users', 'storeAppOptions')(observer(CollaborationController));

View file

@ -0,0 +1,76 @@
import React, {Component} from 'react';
import { inject, observer } from "mobx-react";
import { f7 } from 'framework7-react';
import {Device} from '../../../../../common/mobile/utils/device';
import { withTranslation} from 'react-i18next';
import {AddComment} from '../../view/collaboration/Comments';
// utils
const timeZoneOffsetInMs = (new Date()).getTimezoneOffset() * 60000;
const utcDateToString = (date) => {
if (Object.prototype.toString.call(date) === '[object Date]')
return (date.getTime() - timeZoneOffsetInMs).toString();
return '';
};
const ooDateToString = (date) => {
if (Object.prototype.toString.call(date) === '[object Date]')
return (date.getTime()).toString();
return '';
};
//end utils
@inject('storeComments', 'users')
@observer
class AddCommentController extends Component {
constructor(props) {
super(props);
this.getUserInfo = this.getUserInfo.bind(this);
this.onAddNewComment = this.onAddNewComment.bind(this);
}
getUserInfo () {
this.currentUser = this.props.users.currentUser;
const name = this.currentUser.asc_getUserName();
return {
name: name,
initials: this.props.users.getInitials(name),
color: this.currentUser.asc_getColor()
};
}
onAddNewComment (commentText, documentFlag) {
const api = Common.EditorApi.get();
let comment;
if (typeof Asc.asc_CCommentDataWord !== 'undefined') {
comment = new Asc.asc_CCommentDataWord(null);
} else {
comment = new Asc.asc_CCommentData(null);
}
if (commentText.length > 0) {
comment.asc_putText(commentText);
comment.asc_putTime(utcDateToString(new Date()));
comment.asc_putOnlyOfficeTime(ooDateToString(new Date()));
comment.asc_putUserId(this.currentUser.asc_getIdOriginal());
comment.asc_putUserName(this.currentUser.asc_getUserName());
comment.asc_putSolved(false);
!!comment.asc_putDocumentFlag && comment.asc_putDocumentFlag(documentFlag);
api.asc_addComment(comment);
return true;
}
return false;
}
render() {
const isOpen = this.props.storeComments.isOpenAddComment;
let userInfo;
if (isOpen) {
userInfo = this.getUserInfo();
}
return(
isOpen ? <AddComment userInfo={userInfo} onAddNewComment={this.onAddNewComment} /> : null
)
}
}
export {AddCommentController};

View file

@ -157,17 +157,6 @@ class ReviewChange extends Component {
});
return arr;
}
getInitials (name) {
const fio = Common.Utils.UserInfoParser.getParsedName(name).split(' ');
let initials = fio[0].substring(0, 1).toUpperCase();
for (let i = fio.length-1; i>0; i--) {
if (fio[i][0]!=='(' && fio[i][0]!==')') {
initials += fio[i].substring(0, 1).toUpperCase();
break;
}
}
return initials;
}
checkUserGroups (username) {
const groups = Common.Utils.UserInfoParser.getParsedGroups(username);
return this.currentUserGroups && groups && (this.intersection(this.currentUserGroups, (groups.length>0) ? groups : [""]).length>0);
@ -444,7 +433,7 @@ class ReviewChange extends Component {
userName: Common.Utils.String.htmlEncode(Common.Utils.UserInfoParser.getParsedName(arrChangeReview[0].user)),
color: arrChangeReview[0].userColor.get_hex(),
text: arrChangeReview[0].changeText,
initials: this.getInitials(arrChangeReview[0].user),
initials: this.props.users.getInitials(arrChangeReview[0].user),
editable: arrChangeReview[0].editable
};
goto = arrChangeReview[0].goto;
@ -474,6 +463,6 @@ class ReviewChange extends Component {
const InitReviewController = inject("storeAppOptions", "storeReview")(observer(InitReview));
const ReviewController = inject("storeAppOptions", "storeReview")(observer(Review));
const ReviewChangeController = withTranslation()(inject("storeAppOptions", "storeReview")(observer(ReviewChange)));
const ReviewChangeController = withTranslation()(inject("storeAppOptions", "storeReview", "users")(observer(ReviewChange)));
export {InitReviewController, ReviewController, ReviewChangeController};

View file

@ -0,0 +1,12 @@
import {observable, action} from 'mobx';
export class storeComments {
@observable isOpenAddComment = false;
@action openAddComment (open) {
if (open !== this.isOpenAddComment) {
this.isOpenAddComment = open;
}
}
}

View file

@ -1,10 +1,32 @@
import {observable, action} from 'mobx';
import {observable, action, computed} from 'mobx';
export class storeUsers {
@observable users = []
@observable users = [];
@action reset(users) {
this.users = Object.values(users)
}
@observable currentUser;
@action setCurrentUser(id) {
this.users.forEach((item) => {
if (item.asc_getIdOriginal() === id) {
this.currentUser = item;
}
});
}
getInitials (name) {
const fio = Common.Utils.UserInfoParser.getParsedName(name).split(' ');
let initials = fio[0].substring(0, 1).toUpperCase();
for (let i = fio.length-1; i>0; i--) {
if (fio[i][0]!=='(' && fio[i][0]!==')') {
initials += fio[i].substring(0, 1).toUpperCase();
break;
}
}
return initials;
}
}

View file

@ -0,0 +1,124 @@
import React, {useState, useEffect} from 'react';
import {observer, inject} from "mobx-react";
import { f7, Popup, Navbar, NavLeft, NavRight, NavTitle, Link, Input, Icon } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import {Device} from '../../../utils/device';
const AddCommentPopup = inject("storeComments")(observer(props => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
useEffect(() => {
f7.popup.open('.add-comment-popup');
});
const userInfo = props.userInfo;
const [stateText, setText] = useState('');
return (
<Popup className="add-comment-popup">
<Navbar>
<NavLeft>
<Link onClick={() => {
props.storeComments.openAddComment(false);
f7.popup.close('.add-comment-popup');
}}>{_t.textCancel}</Link>
</NavLeft>
<NavTitle>{_t.textAddComment}</NavTitle>
<NavRight>
<Link className={stateText.length === 0 && 'disabled'}
onClick={() => {
if (props.onAddNewComment(stateText, false)) {
props.storeComments.openAddComment(false);
f7.popup.close('.add-comment-popup');
}
}}>
{Device.android ? <Icon icon='icon-done-comment-white'/> : _t.textDone}
</Link>
</NavRight>
</Navbar>
<div className='wrap-comment'>
<div className="header-comment">
{Device.android &&
<div className='initials' style={{backgroundColor: `${userInfo.color}`}}>{userInfo.initials}</div>
}
<div className='name'>{userInfo.name}</div>
</div>
<div className='wrap-textarea'>
<Input type='textarea' placeholder={_t.textAddComment} autofocus value={stateText} onChange={(event) => {setText(event.target.value);}}></Input>
</div>
</div>
</Popup>
)
}));
const AddCommentDialog = inject("storeComments")(observer(props => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
const userInfo = props.userInfo;
const templateInitials = `<div class="initials" style="background-color: ${userInfo.color};">${userInfo.initials}</div>`;
useEffect(() => {
f7.dialog.create({
destroyOnClose: true,
containerEl: document.getElementById('add-comment-dialog'),
content:
`<div class="navbar">
<div class="navbar-bg"></div>
<div class="navbar-inner sliding">
<div class="left">
<a href="#" id="comment-cancel">${_t.textCancel}</a>
</div>
<div class="title">${_t.textAddComment}</div>
<div class="right">
<a href="#" class="done" id="comment-done">${ Device.android ? '<i class="icon icon-done-comment-white"></i>' : _t.textDone}</a>
</div>
</div>
</div>
<div class='wrap-comment'>
<div class="header-comment">
${Device.android ? templateInitials : ''}
<div class='name'>${userInfo.name}</div>
</div>
<div class='wrap-textarea'>
<textarea id='comment-text' placeholder='${_t.textAddComment}' autofocus></textarea>
</div>
</div>`,
on: {
opened: () => {
const cancel = document.getElementById('comment-cancel');
cancel.addEventListener('click', () => {
f7.dialog.close();
props.storeComments.openAddComment(false);
});
const done = document.getElementById('comment-done');
done.addEventListener('click', () => {
const value = document.getElementById('comment-text').value;
if (value.length > 0 && props.onAddNewComment(value, false)) {
f7.dialog.close();
props.storeComments.openAddComment(false);
}
});
const area = document.getElementById('comment-text');
area.addEventListener('input', (event) => {
if (event.target.value.length === 0 && !done.classList.contains('disabled')) {
done.classList.add('disabled');
} else if (event.target.value.length > 0 && done.classList.contains('disabled')) {
done.classList.remove('disabled');
}
});
done.classList.add('disabled');
}
}
}).open();
});
return (
<div id='add-comment-dialog'></div>
);
}));
const AddComment = props => {
return (
Device.phone ?
<AddCommentPopup userInfo={props.userInfo} onAddNewComment={props.onAddNewComment} /> :
<AddCommentDialog userInfo={props.userInfo} onAddNewComment={props.onAddNewComment} />
)
};
export {AddComment}

View file

@ -0,0 +1,39 @@
@import './ios/comments';
@import './material/comments';
.wrap-comment {
padding: 16px 24px 0 16px;
.name {
font-weight: 600;
font-size: 16px;
}
.wrap-textarea {
margin-top: 6px;
textarea {
font-size: 14px;
margin-top: 0;
min-height: 100px;
padding: 5px 0;
}
}
}
#add-comment-dialog {
.dialog {
--f7-dialog-width: 400px;
.dialog-inner {
padding: 0;
height: 400px;
.wrap-comment {
.name {
text-align: left;
}
.wrap-textarea {
textarea {
color: @black;
width: 100%;
}
}
}
}
}
}

View file

@ -0,0 +1,2 @@
.device-ios {
}

View file

@ -0,0 +1,32 @@
.device-android {
.wrap-comment {
.header-comment {
display: flex;
align-items: center;
.initials {
height: 30px;
width: 30px;
border-radius: 50px;
color: @white;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10px;
font-size: 14px;
}
}
.wrap-textarea {
.input:not(.input-outline):after {
content: none;
}
}
}
#add-comment-dialog {
.dialog {
--f7-dialog-text-color: @black;
.done {
padding-right: 6px;
}
}
}
}

View file

@ -112,7 +112,10 @@
"textTableRowsDel": "<b>Table Rows Deleted</b>",
"textParaMoveTo": "<b>Moved:</b>",
"textParaMoveFromUp": "<b>Moved Up:</b>",
"textParaMoveFromDown": "<b>Moved Down:</b>"
"textParaMoveFromDown": "<b>Moved Down:</b>",
"textAddComment": "Add Comment",
"textCancel": "Cancel",
"textDone": "Done"
}
},
"Settings": {

View file

@ -6,8 +6,18 @@ import { withTranslation } from 'react-i18next';
import CollaborationController from '../../../../common/mobile/lib/controller/collaboration/Collaboration.jsx';
import {InitReviewController as ReviewController} from '../../../../common/mobile/lib/controller/collaboration/Review.jsx';
import { onAdvancedOptions } from './settings/Download.jsx';
import {AddCommentController} from "../../../../common/mobile/lib/controller/collaboration/Comments";
@inject("storeAppOptions", "storeDocumentSettings", "storeFocusObjects", "storeTextSettings", "storeParagraphSettings", "storeTableSettings", "storeDocumentInfo", "storeChartSettings")
@inject(
"storeAppOptions",
"storeDocumentSettings",
"storeFocusObjects",
"storeTextSettings",
"storeParagraphSettings",
"storeTableSettings",
"storeDocumentInfo",
"storeChartSettings"
)
class MainController extends Component {
constructor(props) {
super(props);
@ -48,6 +58,8 @@ class MainController extends Component {
this.props.storeAppOptions.setConfigOptions(this.editorConfig);
this.editorConfig.lang && this.api.asc_setLocale(this.editorConfig.lang);
Common.Notifications.trigger('configOptionsFill');
};
const loadDocument = data => {
@ -321,6 +333,7 @@ class MainController extends Component {
<Fragment>
<CollaborationController />
<ReviewController />
<AddCommentController />
</Fragment>
)
}

View file

@ -279,7 +279,8 @@ class AddOtherController extends Component {
render () {
return (
<AddOther onInsertLink={this.onInsertLink}
<AddOther closeModal={this.closeModal}
onInsertLink={this.onInsertLink}
getDisplayLinkText={this.getDisplayLinkText}
onInsertPageNumber={this.onInsertPageNumber}
onPageBreak={this.onPageBreak}

View file

@ -11,6 +11,7 @@
@import '../../../../common/mobile/resources/less/dataview.less';
@import '../../../../common/mobile/resources/less/search.less';
@import '../../../../common/mobile/resources/less/contextmenu.less';
@import '../../../../common/mobile/resources/less/comments.less';
@import './app-material.less';
@import './app-ios.less';
@import './icons-ios.less';

View file

@ -480,6 +480,28 @@
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M21 3H3V21H21V3ZM3 2H2V3V21V22H3H21H22V21V3V2H21H3ZM15.2929 8H9V7H16.5H17V7.5V15H16V8.70711L7.35355 17.3536L6.64645 16.6464L15.2929 8Z" fill="@{themeColor}"/></svg>');
}
// Comments
&.icon-menu-comment {
width: 30px;
height: 30px;
.encoded-svg-background('<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 15C10 16.6569 8.65685 18 7 18C5.34315 18 4 16.6569 4 15C4 13.3431 5.34315 12 7 12C8.65685 12 10 13.3431 10 15ZM7 16.7143C7.94677 16.7143 8.71429 15.9468 8.71429 15C8.71429 14.0532 7.94677 13.2857 7 13.2857C6.05323 13.2857 5.28571 14.0532 5.28571 15C5.28571 15.9468 6.05323 16.7143 7 16.7143Z" fill="#A3A3A3"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18 15C18 16.6569 16.6569 18 15 18C13.3431 18 12 16.6569 12 15C12 13.3431 13.3431 12 15 12C16.6569 12 18 13.3431 18 15ZM15 16.7143C15.9468 16.7143 16.7143 15.9468 16.7143 15C16.7143 14.0532 15.9468 13.2857 15 13.2857C14.0532 13.2857 13.2857 14.0532 13.2857 15C13.2857 15.9468 14.0532 16.7143 15 16.7143Z" fill="#A3A3A3"/><path fill-rule="evenodd" clip-rule="evenodd" d="M26 15C26 16.6569 24.6569 18 23 18C21.3431 18 20 16.6569 20 15C20 13.3431 21.3431 12 23 12C24.6569 12 26 13.3431 26 15ZM23 16.7143C23.9468 16.7143 24.7143 15.9468 24.7143 15C24.7143 14.0532 23.9468 13.2857 23 13.2857C22.0532 13.2857 21.2857 14.0532 21.2857 15C21.2857 15.9468 22.0532 16.7143 23 16.7143Z" fill="#A3A3A3"/></svg>');
}
&.icon-resolve-comment {
width: 30px;
height: 30px;
.encoded-svg-background('<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.6195 20.8555C11.8237 21.0673 12.1658 21.0577 12.358 20.8349L22.516 9.05783C22.7843 8.74676 22.7528 8.27781 22.4453 8.00545C22.1315 7.72756 21.651 7.7604 21.3779 8.07839L12.3546 18.587C12.1638 18.8092 11.8238 18.8206 11.6186 18.6117L8.10643 15.0366C7.81574 14.7407 7.34084 14.7345 7.04258 15.0228C6.74283 15.3125 6.73444 15.7903 7.02383 16.0904L11.6195 20.8555Z" fill="#A3A3A3"/></svg>');
}
&.icon-resolve-comment.check {
width: 30px;
height: 30px;
.encoded-svg-background('<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 0H30V30H0V0Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.6195 20.8555C11.8237 21.0673 12.1658 21.0577 12.358 20.8349L22.516 9.05783C22.7843 8.74676 22.7528 8.27781 22.4453 8.00545V8.00545C22.1315 7.72756 21.651 7.7604 21.3779 8.07839L12.3546 18.587C12.1638 18.8092 11.8238 18.8206 11.6186 18.6117L8.10643 15.0366C7.81575 14.7407 7.34084 14.7345 7.04258 15.0228V15.0228C6.74283 15.3125 6.73444 15.7903 7.02383 16.0904L11.6195 20.8555Z" fill="@{green}"/></svg>');
}
&.icon-insert-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.1538 9.00708H11.8462C10.8266 9.00708 10 9.83461 10 10.8554V15.1694C10 16.1902 10.8266 17.0177 11.8462 17.0177H13.8329C13.9409 17.0177 14.0454 17.0556 14.1284 17.1248L18.243 20.392C18.5436 20.6428 19 20.4288 19 20.037V17.4798C19 17.2246 19.2066 17.0177 19.4615 17.0177H20.1538C21.1734 17.0177 22 16.1902 22 15.1694V10.8554C22 9.83461 21.1734 9.00708 20.1538 9.00708ZM20 10.0083C20.5523 10.0083 21 10.4565 21 11.0095V15.0154C21 15.5683 20.5523 16.0165 20 16.0165H18.0025L18 18.8995C18 19.2912 18 19 18 19L14.5 16.0165H12C11.4477 16.0165 11 15.5683 11 15.0154V11.0095C11 10.4565 11.4477 10.0083 12 10.0083H20Z" fill="@{themeColor}"/><path d="M14.5 3H4.5C3.18908 3 2 4.2153 2 5.50295V12.0346C2 13.3222 3.18908 14.013 4.5 14.013H5.5C5.82773 14.013 6 14.1917 6 14.5136V17.5183C6 18.0125 6.6135 18.3352 7 18.0189L11 14.9858V13.5L7 16.5V13.0118H4.5C3.78992 13.0118 3 12.732 3 12.0346V5.50295C3 4.80547 3.78992 4.00118 4.5 4.00118H14.5C15.2101 4.00118 16 4.80547 16 5.50295V8.0059H17V5.50295C17 4.2153 15.8109 3 14.5 3Z" fill="@{themeColor}"/></svg>');
}
}
.tab-link-active {
i.icon {

View file

@ -423,5 +423,47 @@
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.5 3.5H3.5V20.5H20.5V3.5ZM3.5 2H2V3.5V20.5V22H3.5H20.5H22V20.5V3.5V2H20.5H3.5ZM14.6893 8.25H9V6.75H16.5H17.25V7.5V15H15.75V9.31066L7.53033 17.5303L6.46967 16.4697L14.6893 8.25Z" fill="@{themeColor}"/></svg>');
}
// Comments
&.icon-menu-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6047 16.5848C17.0078 16.1793 17.4729 15.9766 18 15.9766C18.5271 15.9766 18.9922 16.1793 19.3953 16.5848C19.7984 16.9903 20 17.4581 20 17.9883C20 18.5185 19.7984 18.9864 19.3953 19.3918C18.9922 19.7973 18.5271 20 18 20C17.4729 20 17.0078 19.7973 16.6047 19.3918C16.2016 18.9864 16 18.5185 16 17.9883C16 17.4581 16.2016 16.9903 16.6047 16.5848ZM16.6047 10.5965C17.0078 10.191 17.4729 9.9883 18 9.9883C18.5271 9.9883 18.9922 10.191 19.3953 10.5965C19.7984 11.0019 20 11.4698 20 12C20 12.5302 19.7984 12.9981 19.3953 13.4035C18.9922 13.809 18.5271 14.0117 18 14.0117C17.4729 14.0117 17.0078 13.809 16.6047 13.4035C16.2016 12.9981 16 12.5302 16 12C16 11.4698 16.2016 11.0019 16.6047 10.5965ZM19.3953 7.4152C18.9922 7.82066 18.5271 8.02339 18 8.02339C17.4729 8.02339 17.0078 7.82066 16.6047 7.4152C16.2016 7.00975 16 6.54191 16 6.0117C16 5.48148 16.2016 5.01365 16.6047 4.60819C17.0078 4.20273 17.4729 4 18 4C18.5271 4 18.9922 4.20273 19.3953 4.60819C19.7984 5.01365 20 5.48148 20 6.0117C20 6.54191 19.7984 7.00975 19.3953 7.4152Z" fill="black" fill-opacity="0.6"/></svg>');
}
&.icon-resolve-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.1719L19.5938 5.57812L21 6.98438L9 18.9844L3.42188 13.4062L4.82812 12L9 16.1719Z" fill="black" fill-opacity="0.6"/></svg>');
}
&.icon-resolve-comment.check {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.1719L19.5938 5.57812L21 6.98438L9 18.9844L3.42188 13.4062L4.82812 12L9 16.1719Z" fill="#40865C" fill-opacity="0.6"/></svg>');
}
&.icon-prev-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.4219 7.40625L10.8281 12L15.4219 16.5938L14.0156 18L8.01562 12L14.0156 6L15.4219 7.40625Z" fill="@{themeColor}"/></svg>');
}
&.icon-next-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.98438 6L15.9844 12L9.98438 18L8.57812 16.5938L13.1719 12L8.57812 7.40625L9.98438 6Z" fill="@{themeColor}"/></svg>');
}
&.icon-done-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.1719L19.5938 5.57812L21 6.98438L9 18.9844L3.42188 13.4062L4.82812 12L9 16.1719Z" fill="@{themeColor}"/></svg>');
}
&.icon-insert-comment {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.5 3H4.5C3.18908 3 2 4.2153 2 5.50295V15.0346C2 16.3222 3.18908 17.013 4.5 17.013H5.5C5.82773 17.013 6 17.1917 6 17.5136V21L12 17H20C21.1046 17 22 16.1046 22 15V8H20.5V14.5C20.5 15.0523 20.0523 15.5 19.5 15.5H11.5L7.5 18V15.5H4.5C3.94772 15.5 3.5 15.0523 3.5 14.5V5.5C3.5 4.94772 3.94772 4.5 4.5 4.5H19.5C20.0523 4.5 20.5 4.94772 20.5 5.5V8H22V5.50295C22 4.2153 20.8109 3 19.5 3Z" fill="@{themeColor}"/><path d="M6 7.5H18V9H6L6 7.5Z" fill="@{themeColor}"/><path d="M6 11H18V12.5H6V11Z" fill="@{themeColor}"/></svg>');
}
&.icon-done-comment-white {
width: 24px;
height: 24px;
.encoded-svg-background('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.1719L19.5938 5.57812L21 6.98438L9 18.9844L3.42188 13.4062L4.82812 12L9 16.1719Z" fill="#FFFFFF"/></svg>');
}
}
}

View file

@ -1,10 +1,12 @@
import React, { Component } from 'react';
import React, { Component, Fragment } from 'react';
import { Page, View, Navbar, NavLeft, NavRight, Link, Icon } from 'framework7-react';
import { inject } from "mobx-react";
import EditOptions from '../view/edit/Edit';
import AddOptions from '../view/add/Add';
import Settings from '../view/settings/Settings';
import Collaboration from '../../../../common/mobile/lib/view/collaboration/Collaboration.jsx'
import { AddCommentController } from '../../../../common/mobile/lib/controller/collaboration/Comments.jsx';
import { Device } from '../../../../common/mobile/utils/device'
import { Search, SearchSettings } from '../controller/Search';
import { ContextMenu } from '../controller/ContextMenu';
@ -16,7 +18,7 @@ export default class MainPage extends Component {
editOptionsVisible: false,
addOptionsVisible: false,
settingsVisible: false,
collaborationVisible: false,
collaborationVisible: false
};
}

View file

@ -13,6 +13,7 @@ import {storeApplicationSettings} from './applicationSettings';
import {storeAppOptions} from "./appOptions";
import {storePalette} from "./palette";
import {storeReview} from "./review";
import {storeComments} from "../../../../common/mobile/lib/store/comments";
export const stores = {
storeAppOptions: new storeAppOptions(),
@ -28,6 +29,7 @@ export const stores = {
storeDocumentInfo: new storeDocumentInfo(),
storeApplicationSettings: new storeApplicationSettings(),
storePalette: new storePalette(),
storeReview: new storeReview()
storeReview: new storeReview(),
storeComments: new storeComments()
};

View file

@ -200,7 +200,10 @@ const AddOther = props => {
const _t = t('Add', {returnObjects: true});
return (
<List>
<ListItem title={_t.textComment}>
<ListItem title={_t.textComment} onClick={() => {
props.closeModal();
props.storeComments.openAddComment(true);
}}>
<Icon slot="media" icon="icon-insert-comment"></Icon>
</ListItem>
<ListItem title={_t.textLink} link={'/add-link/'} routeProps={{
@ -234,7 +237,9 @@ const AddOther = props => {
)
};
export {AddOther,
const AddOtherContainer = inject("storeComments")(observer(AddOther));
export {AddOtherContainer as AddOther,
PageLink as PageAddLink,
PageNumber as PageAddNumber,
PageBreak as PageAddBreak,