From b3d2bea6197ce8c8af959b87f7abcf4e7a53f1d9 Mon Sep 17 00:00:00 2001 From: Andrey Shimagin Date: Tue, 19 Apr 2022 17:04:38 +0300 Subject: [PATCH] [SSE] Fix Bug 56714 --- .../mobile/src/controller/ContextMenu.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx index d21cff870..8deb76aa2 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx @@ -14,6 +14,7 @@ import EditorUIController from '../lib/patch'; canComments: stores.storeAppOptions.canComments, canViewComments: stores.storeAppOptions.canViewComments, canCoAuthoring: stores.storeAppOptions.canCoAuthoring, + isRestrictedEdit: stores.storeAppOptions.isRestrictedEdit, users: stores.users, isDisconnected: stores.users.isDisconnected, storeSheets: stores.sheets, @@ -215,12 +216,12 @@ class ContextMenu extends ContextMenuController { const { t } = this.props; const _t = t("ContextMenu", { returnObjects: true }); - const { isEdit, isDisconnected } = this.props; + const { isEdit, isRestrictedEdit, isDisconnected } = this.props; if (isEdit && EditorUIController.ContextMenu) { return EditorUIController.ContextMenu.mapMenuItems(this); } else { - const {canViewComments} = this.props; + const {canViewComments, canCoAuthoring, canComments} = this.props; const api = Common.EditorApi.get(); const cellinfo = api.asc_getCellInfo(); @@ -262,6 +263,13 @@ class ContextMenu extends ContextMenuController { event: 'viewcomment' }); } + + if (iscellmenu && !api.isCellEdited && isRestrictedEdit && canCoAuthoring && canComments && hasComments && hasComments.length<1) { + itemsText.push({ + caption: _t.menuAddComment, + event: 'addcomment' + }); + } } return itemsIcon.concat(itemsText);