From a14533a9d4a2463994826e4b1df93eaaec0b97dd Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 24 Jan 2022 19:07:47 +0300 Subject: [PATCH 1/6] [DE forms] Bug 54910 --- .../app/controller/ApplicationController.js | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 1a49a998c..394dae778 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -103,6 +103,8 @@ define([ this.api.asc_registerCallback('asc_onCountPages', this.onCountPages.bind(this)); this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this)); this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); + Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); // Initialize api gateway Common.Gateway.on('init', this.loadConfig.bind(this)); @@ -671,7 +673,7 @@ define([ } if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) { - this.disableEditing(true); + Common.NotificationCenter.trigger('api:disconnect'); } var value = Common.localStorage.getItem("de-license-warning"); @@ -1775,9 +1777,21 @@ define([ } }, - disableEditing: function(state) { - this.view && this.view.btnClear && this.view.btnClear.setDisabled(state); - this._isDisabled = state; + onApiServerDisconnect: function(enableDownload) { + this._state.isDisconnected = true; + this._isDisabled = true; + this.view && this.view.btnClear && this.view.btnClear.setDisabled(true); + if (!enableDownload) { + this.appOptions.canPrint = this.appOptions.canDownload = false; + this.view && this.view.btnDownload.setDisabled(true); + this.view && this.view.btnSubmit.setDisabled(true); + if (this.view && this.view.btnOptions && this.view.btnOptions.menu) { + this.view.btnOptions.menu.items[0].setDisabled(true); // print + this.view.btnOptions.menu.items[2].setDisabled(true); // download + this.view.btnOptions.menu.items[3].setDisabled(true); // download docx + this.view.btnOptions.menu.items[4].setDisabled(true); // download pdf + } + } }, errorDefaultMessage : 'Error code: %1', From 95291a2e062bffad4403d6ba42a6377177d8e3bf Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Fri, 4 Feb 2022 20:08:37 +0300 Subject: [PATCH 2/6] [DE PE SSE] Fix bug 55356 --- apps/common/main/lib/component/HintManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/HintManager.js b/apps/common/main/lib/component/HintManager.js index b3aab207a..f798efdb8 100644 --- a/apps/common/main/lib/component/HintManager.js +++ b/apps/common/main/lib/component/HintManager.js @@ -471,7 +471,9 @@ Common.UI.HintManager = new(function() { match = false; var keyCode = e.keyCode; if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) { - curLetter = _lang === 'en' ? ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : e.key; + curLetter = _lang === 'en' ? + ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : + (/[.*+?^${}()|[\]\\]/g.test(e.key) ? null : e.key); } if (curLetter) { var curr; From 207e67b724e321415e79c7e84a94bfd1fd83a063 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 5 Feb 2022 00:48:02 +0300 Subject: [PATCH 3/6] [PE SSE mobile] for Bug 55043 --- .../mobile/src/view/settings/Settings.jsx | 6 +-- .../mobile/src/view/settings/Settings.jsx | 52 +++++++++++++++---- .../mobile/src/store/appOptions.js | 6 ++- .../mobile/src/view/settings/Settings.jsx | 52 +++++++++++++++---- 4 files changed, 93 insertions(+), 23 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/settings/Settings.jsx b/apps/documenteditor/mobile/src/view/settings/Settings.jsx index 654004353..0147c9b79 100644 --- a/apps/documenteditor/mobile/src/view/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/Settings.jsx @@ -152,9 +152,9 @@ const SettingsList = inject("storeAppOptions", "storeReview")(observer(props => } {_canDownloadOrigin && - - - + + + } {_canPrint && diff --git a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx index c82a192ec..afc2f4402 100644 --- a/apps/presentationeditor/mobile/src/view/settings/Settings.jsx +++ b/apps/presentationeditor/mobile/src/view/settings/Settings.jsx @@ -112,11 +112,36 @@ const SettingsList = inject("storeAppOptions", "storeToolbarSettings")(observer( }; const appOptions = props.storeAppOptions; - let _isEdit = false; + let _isEdit = false, + _canDownload = false, + _canDownloadOrigin = false, + _canAbout = true, + _canHelp = true, + _canPrint = false; - if (!appOptions.isDisconnected) { + if (appOptions.isDisconnected) { + _isEdit = false; + if (!appOptions.enableDownload) + _canPrint = _canDownload = _canDownloadOrigin = false; + } else { _isEdit = appOptions.isEdit; - } + _canDownload = appOptions.canDownload; + _canDownloadOrigin = appOptions.canDownloadOrigin; + _canPrint = appOptions.canPrint; + if (appOptions.customization && appOptions.canBrandingExt) { + _canAbout = (appOptions.customization.about!==false); + } + if (appOptions.customization) { + _canHelp = (appOptions.customization.help!==false); + } + } + + const onDownloadOrigin = () => { + closeModal(); + setTimeout(() => { + Common.EditorApi.get().asc_DownloadOrigin(); + }, 0); + }; return ( @@ -141,12 +166,21 @@ const SettingsList = inject("storeAppOptions", "storeToolbarSettings")(observer( - - - - - - + {_canDownload && + + + + } + {_canDownloadOrigin && + + + + } + {_canPrint && + + + + } diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index c97af127b..d68660519 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -100,8 +100,10 @@ export class storeAppOptions { this.canPrint = (permissions.print !== false); this.isRestrictedEdit = !this.isEdit && this.canComments; this.trialMode = params.asc_getLicenseMode(); - this.canDownloadOrigin = permissions.download !== false; - this.canDownload = permissions.download !== false; + + const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType); + this.canDownloadOrigin = permissions.download !== false && (type && typeof type[1] === 'string'); + this.canDownload = permissions.download !== false && (!type || typeof type[1] !== 'string'); this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization && this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object')); this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups; diff --git a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx index c3098cedb..28f4826ba 100644 --- a/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/settings/Settings.jsx @@ -117,11 +117,36 @@ const SettingsList = inject("storeAppOptions")(observer(props => { }; const appOptions = props.storeAppOptions; - let _isEdit = false; + let _isEdit = false, + _canDownload = false, + _canDownloadOrigin = false, + _canAbout = true, + _canHelp = true, + _canPrint = false; - if (!appOptions.isDisconnected) { + if (appOptions.isDisconnected) { + _isEdit = false; + if (!appOptions.enableDownload) + _canPrint = _canDownload = _canDownloadOrigin = false; + } else { _isEdit = appOptions.isEdit; - } + _canDownload = appOptions.canDownload; + _canDownloadOrigin = appOptions.canDownloadOrigin; + _canPrint = appOptions.canPrint; + if (appOptions.customization && appOptions.canBrandingExt) { + _canAbout = (appOptions.customization.about!==false); + } + if (appOptions.customization) { + _canHelp = (appOptions.customization.help!==false); + } + } + + const onDownloadOrigin = () => { + closeModal(); + setTimeout(() => { + Common.EditorApi.get().asc_DownloadOrigin(); + }, 0); + }; return ( @@ -146,12 +171,21 @@ const SettingsList = inject("storeAppOptions")(observer(props => { - - - - - - + {_canDownload && + + + + } + {_canDownloadOrigin && + + + + } + {_canPrint && + + + + } From 40d983a66de795eb7c2ea088e47577dad5bbb3db Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Feb 2022 18:56:58 +0300 Subject: [PATCH 4/6] [DE] Fix right panel --- apps/documenteditor/main/app/controller/RightMenu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 8143676de..8cd9380d3 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -131,6 +131,10 @@ define([ this.rightmenu.fireEvent('editcomplete', this.rightmenu); }, + onApiFocusObject: function(SelectedObjects) { + this.onFocusObject(SelectedObjects); + }, + onFocusObject: function(SelectedObjects, forceSignature) { if (!this.editMode && !forceSignature) return; @@ -339,7 +343,7 @@ define([ createDelayedElements: function() { var me = this; if (this.api) { - this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); + this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this)); this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this)); if (this.rightmenu.mergeSettings) { this.rightmenu.mergeSettings.setDocumentName(this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption()); From 44700f5f9b8d2aba7c140099272a516e045768c5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 18 Feb 2022 18:01:23 +0300 Subject: [PATCH 5/6] Fix about: empty customer logo --- apps/common/main/lib/view/About.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/view/About.js b/apps/common/main/lib/view/About.js index e588215ae..04f3530eb 100644 --- a/apps/common/main/lib/view/About.js +++ b/apps/common/main/lib/view/About.js @@ -235,10 +235,10 @@ define([ this.lblCompanyLic.parents('tr').addClass('hidden'); value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark); - value.length ? + value && value.length ? this.divCompanyLogo.html('') : this.divCompanyLogo.parents('tr').addClass('hidden'); - value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); + value && value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); } else { this.cntLicenseeInfo.addClass('hidden'); this.cntLicensorInfo.addClass('margin-bottom'); From de1c5ba1937ff20f11978156b7fa9d2ed2d05055 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 24 Feb 2022 16:39:09 +0300 Subject: [PATCH 6/6] [mobile] fix bug 55742, 55744 --- apps/documenteditor/mobile/src/store/textSettings.js | 10 +++++----- .../mobile/src/store/textSettings.js | 10 +++++----- .../spreadsheeteditor/mobile/src/store/textSettings.js | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/documenteditor/mobile/src/store/textSettings.js b/apps/documenteditor/mobile/src/store/textSettings.js index 2e8ae3122..9e35a9144 100644 --- a/apps/documenteditor/mobile/src/store/textSettings.js +++ b/apps/documenteditor/mobile/src/store/textSettings.js @@ -101,11 +101,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio(); diff --git a/apps/presentationeditor/mobile/src/store/textSettings.js b/apps/presentationeditor/mobile/src/store/textSettings.js index 0abfd0e62..74d018cd0 100644 --- a/apps/presentationeditor/mobile/src/store/textSettings.js +++ b/apps/presentationeditor/mobile/src/store/textSettings.js @@ -102,11 +102,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio(); diff --git a/apps/spreadsheeteditor/mobile/src/store/textSettings.js b/apps/spreadsheeteditor/mobile/src/store/textSettings.js index 9b57d4350..b034ad03f 100644 --- a/apps/spreadsheeteditor/mobile/src/store/textSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/textSettings.js @@ -105,11 +105,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio();