diff --git a/apps/common/mobile/lib/view/ContextMenu.jsx b/apps/common/mobile/lib/view/ContextMenu.jsx index 264565226..50e5fc1a2 100644 --- a/apps/common/mobile/lib/view/ContextMenu.jsx +++ b/apps/common/mobile/lib/view/ContextMenu.jsx @@ -26,7 +26,7 @@ class ContextMenuView extends Component { onPopoverClosed={e => this.props.onMenuClosed()} > - {buttons.map((b, index) => + {buttons.length && buttons.map((b, index) => !b.icon ? this.props.onMenuItemClick(b.event)} /> : this.props.onMenuItemClick(b.event)}> diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index c0fa31b41..cd34092f3 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -226,7 +226,8 @@ "unknownErrorText": "Unknown error.", "uploadImageExtMessage": "Unknown image format.", "uploadImageFileCountMessage": "No images uploaded.", - "uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB." + "uploadImageSizeMessage": "The image is too big. The maximum size is 25 MB.", + "textErrorPasswordIsNotCorrect": "The password you supplied is not correct.
Verify that the CAPS LOCK key is off and be sure to use the correct capitalization." }, "LongActions": { "applyChangesTextText": "Loading data...", @@ -262,7 +263,12 @@ "txtEditingMode": "Set editing mode...", "uploadImageTextText": "Uploading image...", "uploadImageTitleText": "Uploading Image", - "waitText": "Please, wait..." + "waitText": "Please, wait...", + "textErrorWrongPassword": "The password you supplied is not correct.", + "textUnlockRange": "Unlock Range", + "textUnlockRangeWarning": "A range you are trying to change is password protected.", + "advDRMPassword": "Password", + "textCancel": "Cancel" }, "Statusbar": { "notcriticalErrorTitle": "Warning", diff --git a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx index c372fbb96..fc0b1108a 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx @@ -311,6 +311,10 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu config.msg = _t.errorLoadingFont; break; + case Asc.c_oAscError.ID.PasswordIsNotCorrect: + config.msg = t('Error.textErrorPasswordIsNotCorrect'); + break; + default: config.msg = _t.errorDefaultMessage.replace('%1', id); break; diff --git a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx index 1166dff4e..7cb6ac993 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/FilterOptions.jsx @@ -4,8 +4,9 @@ import { f7,Sheet,Popover } from 'framework7-react'; import { Device } from '../../../../common/mobile/utils/device'; import { useTranslation } from 'react-i18next'; -const FilterOptionsController = memo( () => { +const FilterOptionsController = memo(props => { const { t } = useTranslation(); + const wsProps = props.wsProps; const _t = t('View.Edit', {returnObjects: true}); const configRef = useRef(); @@ -32,9 +33,12 @@ const FilterOptionsController = memo( () => { } }, []); - const onApiFilterOptions= (config) => { + const onApiFilterOptions = (config) => { setDataFilterCells(config); configRef.current = config; + + if (wsProps.PivotTables && config.asc_getPivotObj() || + wsProps.AutoFilter && !config.asc_getPivotObj()) return; setCheckSort((config.asc_getSortState() === Asc.c_oAscSortOptions.Ascending ? 'down' : '') || (config.asc_getSortState() === Asc.c_oAscSortOptions.Descending ? 'up' : '')); diff --git a/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx b/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx index 34d2f7d8f..c7617d8fd 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx @@ -2,6 +2,7 @@ import React, { useEffect } from 'react'; import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; import IrregularStack from "../../../../common/mobile/utils/IrregularStack"; +import { Device } from '../../../../common/mobile/utils/device'; const LongActionsController = () => { const {t} = useTranslation(); @@ -181,7 +182,9 @@ const LongActionsController = () => { }; - const onConfirmAction = (id, apiCallback) => { + const onConfirmAction = (id, apiCallback, data) => { + const api = Common.EditorApi.get(); + if (id === Asc.c_oAscConfirm.ConfirmReplaceRange || id === Asc.c_oAscConfirm.ConfirmReplaceFormulaInTable) { f7.dialog.create({ title: _t.notcriticalErrorTitle, @@ -208,6 +211,27 @@ const LongActionsController = () => { }}, ], }).open(); + } else if (id == Asc.c_oAscConfirm.ConfirmChangeProtectRange) { + f7.dialog.create({ + title: t('LongActions.textUnlockRange'), + text: t('LongActions.textUnlockRangeWarning'), + content: Device.ios ? + '
' : '
', + buttons: [ + { + text: t('LongActions.textOk'), + onClick: () => { + let password = document.getElementById('modal-password').value; + if(apiCallback) { + apiCallback(true ? api.asc_checkProtectedRangesPassword(password, data) : false, false); + } + } + }, + { + text: t('LongActions.textCancel') + } + ] + }).open(); } }; diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx index 2dec5360c..ffd2a0ac4 100644 --- a/apps/spreadsheeteditor/mobile/src/page/main.jsx +++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx @@ -140,7 +140,7 @@ class MainPage extends Component { {appOptions.isDocReady && - + }