Merge pull request #2016 from ONLYOFFICE/feature/fix-bugs

[SSE mobile] For Bug 59015
This commit is contained in:
maxkadushkin 2022-10-20 15:06:00 +03:00 committed by GitHub
commit 411de187d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,8 @@ import EditorUIController from '../lib/patch';
wsProps: stores.storeWorksheets.wsProps,
wsLock: stores.storeWorksheets.wsLock,
objects: stores.storeFocusObjects.objects,
focusOn: stores.storeFocusObjects.focusOn
focusOn: stores.storeFocusObjects.focusOn,
isResolvedComments: stores.storeApplicationSettings.isResolvedComments
}))
class ContextMenu extends ContextMenuController {
constructor(props) {
@ -248,7 +249,7 @@ class ContextMenu extends ContextMenuController {
if (isEdit && EditorUIController.ContextMenu) {
return EditorUIController.ContextMenu.mapMenuItems(this);
} else {
const {canViewComments, canCoAuthoring, canComments} = this.props;
const {canViewComments, canCoAuthoring, canComments, isResolvedComments} = this.props;
const api = Common.EditorApi.get();
const cellinfo = api.asc_getCellInfo();
@ -258,7 +259,8 @@ class ContextMenu extends ContextMenuController {
let iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu;
const seltype = cellinfo.asc_getSelectionType();
const hasComments = cellinfo.asc_getComments(); //prohibit adding multiple comments in one cell;
const comments = cellinfo.asc_getComments(); //prohibit adding multiple comments in one cell;
const isSolvedComment = comments[0].asc_getSolved();
switch (seltype) {
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
@ -286,16 +288,16 @@ class ContextMenu extends ContextMenuController {
caption: t("ContextMenu.menuEditLink"),
event: 'editlink'
});
}
}``
if(!isDisconnected) {
if (canViewComments && hasComments && hasComments.length>0) {
if (canViewComments && comments && comments.length && ((!isSolvedComment && !isResolvedComments) || isResolvedComments)) {
itemsText.push({
caption: _t.menuViewComment,
event: 'viewcomment'
});
}
if (iscellmenu && !api.isCellEdited && isRestrictedEdit && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
if (iscellmenu && !api.isCellEdited && isRestrictedEdit && canCoAuthoring && canComments && comments && comments.length<1) {
itemsText.push({
caption: _t.menuAddComment,
event: 'addcomment'