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