From 8bb21c7e04e98d66922a1c08df5c531c6436ac06 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Thu, 2 Dec 2021 13:55:01 +0300 Subject: [PATCH] [DE] Fix Bug 54137 --- .../mobile/src/controller/ContextMenu.jsx | 17 ++++++++++++++++- .../mobile/src/store/appOptions.js | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 347b3a67e..45906ad60 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -15,6 +15,7 @@ import EditorUIController from '../lib/patch'; canViewComments: stores.storeAppOptions.canViewComments, canCoAuthoring: stores.storeAppOptions.canCoAuthoring, canReview: stores.storeAppOptions.canReview, + canFillForms: stores.storeAppOptions.canFillForms, users: stores.users, isDisconnected: stores.users.isDisconnected, displayMode: stores.storeReview.displayMode @@ -212,7 +213,7 @@ class ContextMenu extends ContextMenuController { initMenuItems() { if ( !Common.EditorApi ) return []; - const { isEdit } = this.props; + const { isEdit, canFillForms } = this.props; if (isEdit && EditorUIController.ContextMenu) { return EditorUIController.ContextMenu.mapMenuItems(this); @@ -258,6 +259,20 @@ class ContextMenu extends ContextMenuController { }); } + if ( canFillForms && canCopy && !locked ) { + itemsIcon.push({ + event: 'cut', + icon: 'icon-cut' + }); + } + + if ( canFillForms && !locked ) { + itemsIcon.push({ + event: 'paste', + icon: 'icon-paste' + }); + } + if ( canViewComments && this.isComments ) { itemsText.push({ caption: _t.menuViewComment, diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index ff7aacfad..982cc421f 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -118,7 +118,8 @@ export class storeAppOptions { this.canEditStyles = this.canLicense && this.canEdit; this.canPrint = (permissions.print !== false); this.fileKey = document.key; - this.canFillForms = this.canLicense && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view'); + const typeForm = /^(?:(oform))$/.exec(document.fileType); // can fill forms only in oform format + this.canFillForms = this.canLicense && !!(typeForm && typeof typeForm[1] === 'string') && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view'); this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms); if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms this.canComments = false;