From d460ee980c4fb1a8abca5a123aa4ac35665ee30a Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Wed, 11 May 2022 19:23:19 +0400 Subject: [PATCH] [PE SSE mobile] Fix Bug 57113 --- apps/presentationeditor/mobile/locale/en.json | 2 +- .../mobile/src/controller/Main.jsx | 20 ++++++++++++++++++- apps/spreadsheeteditor/mobile/locale/en.json | 2 ++ .../mobile/src/controller/Main.jsx | 19 ++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 90941fd52..9e01a496c 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -115,12 +115,12 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textYes": "Yes", "titleLicenseExp": "License expired", + "warnLicenseExp": "Your license has expired. Please, update your license and refresh the page.", "titleServerVersion": "Editor updated", "titleUpdateVersion": "Version changed", "txtIncorrectPwd": "Password is incorrect", "txtProtected": "Once you enter the password and open the file, the current password to the file will be reset", "warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact your administrator to learn more.", - "warnLicenseExp": "Your license has expired. Please, update it and refresh the page.", "warnLicenseLimitedNoAccess": "License expired. You have no access to document editing functionality. Please, contact your administrator.", "warnLicenseLimitedRenewed": "License needs to be renewed. You have limited access to document editing functionality.
Please contact your administrator to get full access", "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 64508434b..3e2f94e17 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -152,8 +152,26 @@ class MainController extends Component { const onEditorPermissions = params => { const licType = params.asc_getLicenseType(); + const { t } = this.props; + // const _t = t('Controller.Main', { returnObjects:true }); + + if (Asc.c_oLicenseResult.Expired === licType || + Asc.c_oLicenseResult.Error === licType || + Asc.c_oLicenseResult.ExpiredTrial === licType) { - this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); + f7.dialog.create({ + title: t('Controller.Main.titleLicenseExp'), + text: t('Controller.Main.warnLicenseExp') + }).open(); + + return; + } + + if (Asc.c_oLicenseResult.ExpiredLimited === licType) { + this._state.licenseType = licType; + } + + this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); const storeAppOptions = this.props.storeAppOptions; storeAppOptions.setPermissionOptions(this.document, licType, params, this.permissions, EditorUIController.isSupportEditFeature()); diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 61b4d24ed..5066a590a 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -74,6 +74,8 @@ "errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "leavePageText": "You have unsaved changes in this document. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", "notcriticalErrorTitle": "Warning", + "titleLicenseExp": "License expired", + "warnLicenseExp": "Your license has expired. Please, update your license and refresh the page.", "SDK": { "txtAccent": "Accent", "txtAll": "(All)", diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index cfd1f6385..314510a62 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -197,6 +197,25 @@ class MainController extends Component { const onEditorPermissions = params => { const licType = params.asc_getLicenseType(); + const { t } = this.props; + // const _t = t('Controller.Main', { returnObjects:true }); + + if (Asc.c_oLicenseResult.Expired === licType || + Asc.c_oLicenseResult.Error === licType || + Asc.c_oLicenseResult.ExpiredTrial === licType) { + + f7.dialog.create({ + title: t('Controller.Main.titleLicenseExp'), + text: t('Controller.Main.warnLicenseExp') + }).open(); + + return; + } + + if (Asc.c_oLicenseResult.ExpiredLimited === licType) { + this._state.licenseType = licType; + } + this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); const appOptions = this.props.storeAppOptions;