Merge pull request #1325 from ONLYOFFICE/feature/bug-fixes

Feature/bug fixes
This commit is contained in:
maxkadushkin 2021-11-16 18:28:40 +03:00 committed by GitHub
commit 8da52eb9fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 7 deletions

View file

@ -26,7 +26,7 @@ class ContextMenuView extends Component {
onPopoverClosed={e => this.props.onMenuClosed()}
>
<List className="list-block">
{buttons.map((b, index) =>
{buttons.length && buttons.map((b, index) =>
!b.icon ?
<ListButton title={b.caption} key={index} onClick={e => this.props.onMenuItemClick(b.event)} /> :
<ListButton key={index} onClick={e => this.props.onMenuItemClick(b.event)}>

View file

@ -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.<br>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",

View file

@ -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;

View file

@ -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' : ''));

View file

@ -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 ?
'<div class="input-field"><input type="password" class="modal-text-input" name="modal-password" placeholder="' + _t.advDRMPassword + '" id="modal-password"></div>' : '<div class="input-field"><div class="inputs-list list inline-labels"><ul><li><div class="item-content item-input"><div class="item-inner"><div class="item-input-wrap"><input type="password" name="modal-password" id="modal-password" placeholder=' + _t.advDRMPassword + '></div></div></div></li></ul></div></div>',
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();
}
};

View file

@ -140,7 +140,7 @@ class MainPage extends Component {
{appOptions.isDocReady &&
<Fragment key='filter-context'>
<FilterOptionsController />
<FilterOptionsController wsProps={wsProps} />
<ContextMenu openOptions={this.handleClickToOpenOptions.bind(this)} />
</Fragment>
}