[SSE] Fix Bug 54924

This commit is contained in:
ShimaginAndrey 2022-01-27 16:44:29 +03:00
parent ad011826f8
commit 3cb046e343
2 changed files with 16 additions and 23 deletions

View file

@ -214,7 +214,7 @@ class ContextMenu extends ContextMenuController {
if (isEdit && EditorUIController.ContextMenu) {
return EditorUIController.ContextMenu.mapMenuItems(this);
} else {
const {canViewComments, canCoAuthoring, canComments } = this.props;
const {canViewComments} = this.props;
const api = Common.EditorApi.get();
const cellinfo = api.asc_getCellInfo();
@ -238,32 +238,25 @@ class ContextMenu extends ContextMenuController {
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
}
itemsIcon.push({
event: 'copy',
icon: 'icon-copy'
});
if (iscellmenu && cellinfo.asc_getHyperlink()) {
itemsText.push({
caption: _t.menuOpenLink,
event: 'openlink'
itemsIcon.push({
event: 'copy',
icon: 'icon-copy'
});
}
if(!isDisconnected) {
if (canViewComments && hasComments && hasComments.length>0) {
itemsText.push({
caption: _t.menuViewComment,
event: 'viewcomment'
});
}
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
if (iscellmenu && cellinfo.asc_getHyperlink()) {
itemsText.push({
caption: _t.menuAddComment,
event: 'addcomment'
caption: _t.menuOpenLink,
event: 'openlink'
});
}
}
if(!isDisconnected) {
if (canViewComments && hasComments && hasComments.length>0) {
itemsText.push({
caption: _t.menuViewComment,
event: 'viewcomment'
});
}
}
return itemsIcon.concat(itemsText);
}

View file

@ -90,7 +90,7 @@ export class storeAppOptions {
this.canEdit = permissions.edit !== false && // can edit or review
(this.config.canRequestEditRights || this.config.mode !== 'view') && isSupportEditFeature; // if mode=="view" -> canRequestEditRights must be defined
// (!this.isReviewOnly || this.canLicense) && // if isReviewOnly==true -> canLicense must be true
this.isEdit = (this.canLicense || this.isEditDiagram || this.isEditMailMerge) && permissions.edit !== false && this.config.mode !== 'view' && true;
this.isEdit = (this.canLicense || this.isEditDiagram || this.isEditMailMerge) && permissions.edit !== false && this.config.mode !== 'view' && isSupportEditFeature && true;
this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view');
this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);