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) { constructor(props) {
super(props); super(props);
const $$ = Dom7;
this.state = { this.state = {
searchQuery: '', searchQuery: '',
replaceQuery: '' replaceQuery: ''
}; };
const $$ = Dom7;
$$(document).on('page:init', (e, page) => { $$(document).on('page:init', (e, page) => {
if ( page.name == 'home' ) { if(!this.searchbar) {
this.searchbar = f7.searchbar.create({ this.searchbar = f7.searchbar.create({
el: '.searchbar', el: '.searchbar',
customSearch: true, 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 $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('pointerdown', this.onEditorTouchStart.bind(this));
$editor.on('pointerup', this.onEditorTouchEnd.bind(this)); $editor.on('pointerup', this.onEditorTouchEnd.bind(this));
// $replaceLink.on('click', this.onReplaceHold.bind(this));
} }
}); });
@ -140,6 +124,14 @@ class SearchView extends Component {
this.$replace = $$('#idx-replace-val'); 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) { onSettingsClick(e) {
if ( Device.phone ) { if ( Device.phone ) {
f7.popup.open('.search-settings-popup'); f7.popup.open('.search-settings-popup');

View file

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

View file

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

View file

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

View file

@ -214,7 +214,7 @@
"errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "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", "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.", "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.", "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", "notcriticalErrorTitle": "Warning",
"openErrorText": "An error has occurred while opening the file", "openErrorText": "An error has occurred while opening the file",
"pastInMergeAreaError": "Cannot change a part of a merged cell", "pastInMergeAreaError": "Cannot change a part of a merged cell",

View file

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

View file

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