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

Feature/bug fixes
This commit is contained in:
maxkadushkin 2021-10-18 18:39:18 +03:00 committed by GitHub
commit d937867f96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 71 additions and 85 deletions

View file

@ -85,15 +85,15 @@ class SearchView extends Component {
constructor(props) {
super(props);
const $$ = Dom7;
this.state = {
searchQuery: '',
replaceQuery: ''
};
const $$ = Dom7;
$$(document).on('page:init', (e, page) => {
if ( page.name == 'home' ) {
if(!this.searchbar) {
this.searchbar = f7.searchbar.create({
el: '.searchbar',
customSearch: true,
@ -107,26 +107,10 @@ class SearchView extends Component {
}
});
// function iOSVersion() {
// var ua = navigator.userAgent;
// var m;
// return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
// }
const $editor = $$('#editor_sdk');
// const $replaceLink = $$('#replace-link');
if (false /* iOSVersion < 13 */) {
// $editor.on('mousedown touchstart', this.onEditorTouchStart.bind(this));
// $editor.on('mouseup touchend', this.onEditorTouchEnd.bind(this));
} else {
// $editor.on('pointerdown', this.onEditorTouchStart.bind(this));
// $editor.on('pointerup', this.onEditorTouchEnd.bind(this));
}
$editor.on('pointerdown', this.onEditorTouchStart.bind(this));
$editor.on('pointerup', this.onEditorTouchEnd.bind(this));
// $replaceLink.on('click', this.onReplaceHold.bind(this));
$editor.on('pointerup', this.onEditorTouchEnd.bind(this));
}
});
@ -140,6 +124,14 @@ class SearchView extends Component {
this.$replace = $$('#idx-replace-val');
}
componentWillUnmount() {
const $$ = Dom7;
const $editor = $$('#editor_sdk');
$editor.off('pointerdown', this.onEditorTouchStart.bind(this));
$editor.off('pointerup', this.onEditorTouchEnd.bind(this));
}
onSettingsClick(e) {
if ( Device.phone ) {
f7.popup.open('.search-settings-popup');
@ -306,7 +298,7 @@ class SearchView extends Component {
</div>
</form>
)
}
}
}
const SearchViewWithObserver = observer(SearchView);

View file

@ -32,24 +32,26 @@ class EncodingController extends Component {
this.mode = mode;
this.advOptions = advOptions;
this.formatOptions = formatOptions;
this.pages = [];
this.pagesName = [];
this.encodeData = [];
const recommendedSettings = this.advOptions.asc_getRecommendedSettings();
this.initPages();
this.initEncodeData();
this.valueEncoding = recommendedSettings.asc_getCodePage();
this.setState({
isOpen: true
isOpen: true
});
}
}
initPages() {
initEncodeData() {
for (let page of this.advOptions.asc_getCodePages()) {
this.pages.push(page.asc_getCodePage());
this.pagesName.push(page.asc_getCodePageName());
this.encodeData.push({
value: page.asc_getCodePage(),
displayValue: page.asc_getCodePageName(),
lcid: page.asc_getLcid()
});
}
}
@ -78,8 +80,7 @@ class EncodingController extends Component {
closeModal={this.closeModal}
mode={this.mode}
onSaveFormat={this.onSaveFormat}
pages={this.pages}
pagesName={this.pagesName}
encodeData={this.encodeData}
valueEncoding={this.valueEncoding}
/>
);

View file

@ -6,10 +6,10 @@ import { Device } from '../../../../common/mobile/utils/device';
const PageEncoding = props => {
const { t } = useTranslation();
const _t = t("Settings", { returnObjects: true });
const pagesName = props.pagesName;
const pages = props.pages;
const encodeData = props.encodeData;
const [stateEncoding, setStateEncoding] = useState(props.valueEncoding);
const nameEncoding = pagesName[pages.indexOf(stateEncoding)];
const getIndexNameEncoding = () => encodeData.findIndex(encoding => encoding.value === stateEncoding);
const nameEncoding = encodeData[getIndexNameEncoding()].displayValue;
const mode = props.mode;
const changeStateEncoding = value => {
@ -24,8 +24,7 @@ const PageEncoding = props => {
<List>
<ListItem title={nameEncoding} link="/encoding-list/" routeProps={{
stateEncoding,
pages: props.pages,
pagesName: props.pagesName,
encodeData,
changeStateEncoding
}}></ListItem>
</List>
@ -45,19 +44,18 @@ const PageEncodingList = props => {
const { t } = useTranslation();
const _t = t("Settings", { returnObjects: true });
const [currentEncoding, changeCurrentEncoding] = useState(props.stateEncoding);
const pages = props.pages;
const pagesName = props.pagesName;
const encodeData = props.encodeData;
return (
<Page>
<Navbar title={_t.txtDownloadTxt} backLink={_t.textBack} />
<BlockTitle>{_t.textChooseEncoding}</BlockTitle>
<List>
{pagesName.map((name, index) => {
{encodeData.map((encoding, index) => {
return (
<ListItem radio checked={currentEncoding === pages[index]} title={name} key={index} value={pages[index]} onChange={() => {
changeCurrentEncoding(pages[index]);
props.changeStateEncoding(pages[index]);
<ListItem radio checked={currentEncoding === encoding.value} title={encoding.displayValue} key={index} value={encoding.value} after={encoding.lcid} onChange={() => {
changeCurrentEncoding(encoding.value);
props.changeStateEncoding(encoding.value);
f7.views.current.router.back();
}}></ListItem>
)
@ -79,8 +77,7 @@ class EncodingView extends Component {
onSaveFormat={this.props.onSaveFormat}
closeModal={this.props.closeModal}
mode={this.props.mode}
pages={this.props.pages}
pagesName={this.props.pagesName}
encodeData={this.props.encodeData}
valueEncoding={this.props.valueEncoding}
/>
</Popup>
@ -108,8 +105,7 @@ const Encoding = props => {
closeModal={props.closeModal}
onSaveFormat={props.onSaveFormat}
mode={props.mode}
pages={props.pages}
pagesName={props.pagesName}
encodeData={props.encodeData}
valueEncoding={props.valueEncoding}
/>
)

View file

@ -296,7 +296,7 @@ const PageTransition = props => {
onRangeChanged={(value) => {props.onDelay(value)}}
></Range>
</div>
<div slot='inner-end' style={{minWidth: '60px', textAlign: 'right'}}>
<div slot='inner-end' style={{minWidth: '75px', textAlign: 'right'}}>
{stateRange + ' ' + _t.textSec}
</div>
</ListItem>

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -216,7 +216,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download or print it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -216,7 +216,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download or print it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded",
"errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but you won't be able to download it until the connection is restored and the page is reloaded.",
"errorWrongBracketsCount": "An error in the formula.<br>Wrong number of brackets.",
"errorWrongOperator": "An error in the entered formula. The wrong operator is used.<br>Correct the error or use the Esc button to cancel the formula editing.",
"errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br> Please correct the error.",
"notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

@ -38,12 +38,11 @@ class EncodingController extends Component {
this.mode = mode;
this.advOptions = advOptions;
this.formatOptions = formatOptions;
this.pages = [];
this.pagesName = [];
this.encodeData = [];
const recommendedSettings = this.advOptions.asc_getRecommendedSettings();
this.initPages();
this.initEncodeData();
this.valueEncoding = recommendedSettings.asc_getCodePage();
this.valueDelimeter = recommendedSettings && recommendedSettings.asc_getDelimiter() ? recommendedSettings.asc_getDelimiter() : 4;
@ -53,10 +52,13 @@ class EncodingController extends Component {
}
}
initPages() {
initEncodeData() {
for (let page of this.advOptions.asc_getCodePages()) {
this.pages.push(page.asc_getCodePage());
this.pagesName.push(page.asc_getCodePageName());
this.encodeData.push({
value: page.asc_getCodePage(),
displayValue: page.asc_getCodePageName(),
lcid: page.asc_getLcid()
});
}
}
@ -85,8 +87,7 @@ class EncodingController extends Component {
closeModal={this.closeModal}
mode={this.mode}
onSaveFormat={this.onSaveFormat}
pages={this.pages}
pagesName={this.pagesName}
encodeData={this.encodeData}
namesDelimeter={this.namesDelimeter}
valueEncoding={this.valueEncoding}
valueDelimeter={this.valueDelimeter}

View file

@ -6,13 +6,13 @@ import { Device } from '../../../../common/mobile/utils/device';
const PageEncoding = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
const pagesName = props.pagesName;
const pages = props.pages;
const encodeData = props.encodeData;
const valuesDelimeter = props.valuesDelimeter;
const namesDelimeter = props.namesDelimeter;
const [stateEncoding, setStateEncoding] = useState(props.valueEncoding);
const [stateDelimeter, setStateDelimeter] = useState(props.valueDelimeter);
const nameEncoding = pagesName[pages.indexOf(stateEncoding)];
const getIndexNameEncoding = () => encodeData.findIndex(encoding => encoding.value === stateEncoding);
const nameEncoding = encodeData[getIndexNameEncoding()].displayValue;
const nameDelimeter = namesDelimeter[valuesDelimeter.indexOf(stateDelimeter)];
const mode = props.mode;
@ -41,8 +41,7 @@ const PageEncoding = props => {
<List>
<ListItem title={nameEncoding} link="/encoding-list/" routeProps={{
stateEncoding,
pages: props.pages,
pagesName: props.pagesName,
encodeData,
changeStateEncoding
}}></ListItem>
</List>
@ -62,19 +61,18 @@ const PageEncodingList = props => {
const { t } = useTranslation();
const _t = t("View.Settings", { returnObjects: true });
const [currentEncoding, changeCurrentEncoding] = useState(props.stateEncoding);
const pages = props.pages;
const pagesName = props.pagesName;
const encodeData = props.encodeData;
return (
<Page>
<Navbar title={_t.txtDownloadCsv} backLink={_t.textBack} />
<BlockTitle>{_t.textChooseEncoding}</BlockTitle>
<List>
{pagesName.map((name, index) => {
{encodeData.map((encoding, index) => {
return (
<ListItem radio checked={currentEncoding === pages[index]} title={name} key={index} value={pages[index]} onChange={() => {
changeCurrentEncoding(pages[index]);
props.changeStateEncoding(pages[index]);
<ListItem radio checked={currentEncoding === encoding.value} title={encoding.displayValue} key={index} value={encoding.value} after={encoding.lcid} onChange={() => {
changeCurrentEncoding(encoding.value);
props.changeStateEncoding(encoding.value);
f7.views.current.router.back();
}}></ListItem>
)
@ -122,8 +120,7 @@ class EncodingView extends Component {
onSaveFormat={this.props.onSaveFormat}
closeModal={this.props.closeModal}
mode={this.props.mode}
pages={this.props.pages}
pagesName={this.props.pagesName}
encodeData={this.props.encodeData}
namesDelimeter={this.props.namesDelimeter}
valueEncoding={this.props.valueEncoding}
valueDelimeter={this.props.valueDelimeter}
@ -158,8 +155,7 @@ const Encoding = props => {
closeModal={props.closeModal}
onSaveFormat={props.onSaveFormat}
mode={props.mode}
pages={props.pages}
pagesName={props.pagesName}
encodeData={props.encodeData}
namesDelimeter={props.namesDelimeter}
valueEncoding={props.valueEncoding}
valueDelimeter={props.valueDelimeter}