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

Feature/bug fixes
This commit is contained in:
maxkadushkin 2021-06-11 23:47:12 +03:00 committed by GitHub
commit 6b97f80337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 57 deletions

View file

@ -4,6 +4,7 @@ import { SearchController, SearchView, SearchSettingsView } from '../../../../co
import { f7 } from 'framework7-react'; import { f7 } from 'framework7-react';
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import { Device } from '../../../../common/mobile/utils/device'; import { Device } from '../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react";
class SearchSettings extends SearchSettingsView { class SearchSettings extends SearchSettingsView {
constructor(props) { constructor(props) {
@ -22,6 +23,8 @@ class SearchSettings extends SearchSettingsView {
const show_popover = !Device.phone; const show_popover = !Device.phone;
const { t } = this.props; const { t } = this.props;
const _t = t("Settings", {returnObjects: true}); const _t = t("Settings", {returnObjects: true});
const storeAppOptions = this.props.storeAppOptions;
const isEdit = storeAppOptions.isEdit;
const markup = ( const markup = (
<Page> <Page>
@ -34,9 +37,14 @@ class SearchSettings extends SearchSettingsView {
</Navbar> </Navbar>
<List> <List>
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} /> <ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} /> {isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll} <ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
onClick={e => this.onFindReplaceClick('replace')} />
: null}
{isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem> onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
: null}
</List> </List>
<List> <List>
<ListItem title={_t.textCaseSensitive}> <ListItem title={_t.textCaseSensitive}>
@ -115,6 +123,6 @@ const Search = withTranslation()(props => {
return <DESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} /> return <DESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
}); });
const SearchSettingsWithTranslation = withTranslation()(SearchSettings); const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
export {Search, SearchSettingsWithTranslation as SearchSettings} export {Search, SearchSettingsWithTranslation as SearchSettings}

View file

@ -71,6 +71,11 @@ export class storeTextSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }
resetFontName (font) { resetFontName (font) {

View file

@ -4,6 +4,7 @@ import { SearchController, SearchView, SearchSettingsView } from '../../../../co
import { f7 } from 'framework7-react'; import { f7 } from 'framework7-react';
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import { Device } from '../../../../common/mobile/utils/device'; import { Device } from '../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react";
class SearchSettings extends SearchSettingsView { class SearchSettings extends SearchSettingsView {
constructor(props) { constructor(props) {
@ -15,6 +16,8 @@ class SearchSettings extends SearchSettingsView {
const show_popover = !Device.phone; const show_popover = !Device.phone;
const { t } = this.props; const { t } = this.props;
const _t = t("View.Settings", {returnObjects: true}); const _t = t("View.Settings", {returnObjects: true});
const storeAppOptions = this.props.storeAppOptions;
const isEdit = storeAppOptions.isEdit;
const markup = ( const markup = (
<Page> <Page>
@ -27,9 +30,14 @@ class SearchSettings extends SearchSettingsView {
</Navbar> </Navbar>
<List> <List>
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} /> <ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} /> {isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll} <ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem> onClick={e => this.onFindReplaceClick('replace')} />
: null}
{isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
: null}
</List> </List>
<List> <List>
<ListItem title={_t.textCaseSensitive}> <ListItem title={_t.textCaseSensitive}>
@ -97,6 +105,6 @@ const Search = withTranslation()(props => {
return <PESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} /> return <PESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
}); });
const SearchSettingsWithTranslation = withTranslation()(SearchSettings); const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
export {Search, SearchSettingsWithTranslation as SearchSettings} export {Search, SearchSettingsWithTranslation as SearchSettings}

View file

@ -75,6 +75,11 @@ export class storeTextSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }

View file

@ -116,11 +116,7 @@ const PageLink = props => {
placeholder={_t.textLink} placeholder={_t.textLink}
value={link} value={link}
onChange={(event) => { onChange={(event) => {
if (link.includes('https://')) {
setDisplay(link)
}
setLink(event.target.value) setLink(event.target.value)
setDisplay(event.target.value)
}} }}
/> : /> :
<ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{ <ListItem link={'/add-link-to/'} title={_t.textLinkTo} after={displayTo} routeProps={{

View file

@ -1,8 +1,9 @@
import React, {Component, useEffect} from 'react'; import React, {Component, useEffect} from 'react';
import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react'; import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react';
import { withTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import {f7} from 'framework7-react'; import {f7} from 'framework7-react';
import {Device} from '../../../../../common/mobile/utils/device'; import {Device} from '../../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react";
import ApplicationSettingsController from "../../controller/settings/ApplicationSettings"; import ApplicationSettingsController from "../../controller/settings/ApplicationSettings";
import { MacrosSettings } from "./ApplicationSettings"; import { MacrosSettings } from "./ApplicationSettings";
import DownloadController from "../../controller/settings/Download"; import DownloadController from "../../controller/settings/Download";
@ -56,8 +57,8 @@ const routes = [
]; ];
const SettingsList = withTranslation()(props => { const SettingsList = inject("storeAppOptions")(observer(props => {
const {t} = props; const { t } = useTranslation();
const _t = t('View.Settings', {returnObjects: true}); const _t = t('View.Settings', {returnObjects: true});
const navbar = <Navbar title={_t.textSettings}> const navbar = <Navbar title={_t.textSettings}>
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>} {!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
@ -107,13 +108,20 @@ const SettingsList = withTranslation()(props => {
window.open(url, "_blank"); window.open(url, "_blank");
}; };
const appOptions = props.storeAppOptions;
let _isEdit = false;
if (!appOptions.isDisconnected) {
_isEdit = appOptions.isEdit;
}
return ( return (
<View style={props.style} stackPages={true} routes={routes}> <View style={props.style} stackPages={true} routes={routes}>
<Page> <Page>
{navbar} {navbar}
<List> <List>
{!props.inPopover && {!props.inPopover &&
<ListItem title={_t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'> <ListItem disabled={appOptions.readerMode ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
<Icon slot="media" icon="icon-search"></Icon> <Icon slot="media" icon="icon-search"></Icon>
</ListItem> </ListItem>
} }
@ -147,7 +155,7 @@ const SettingsList = withTranslation()(props => {
</Page> </Page>
</View> </View>
) )
}); }));
class SettingsView extends Component { class SettingsView extends Component {
constructor(props) { constructor(props) {

View file

@ -5,6 +5,7 @@ import { f7 } from 'framework7-react';
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import { Dom7 } from 'framework7'; import { Dom7 } from 'framework7';
import { Device } from '../../../../common/mobile/utils/device'; import { Device } from '../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react";
class SearchSettings extends SearchSettingsView { class SearchSettings extends SearchSettingsView {
constructor(props) { constructor(props) {
@ -23,6 +24,8 @@ class SearchSettings extends SearchSettingsView {
const show_popover = !Device.phone; const show_popover = !Device.phone;
const { t } = this.props; const { t } = this.props;
const _t = t("View.Settings", { returnObjects: true }); const _t = t("View.Settings", { returnObjects: true });
const storeAppOptions = this.props.storeAppOptions;
const isEdit = storeAppOptions.isEdit;
const markup = ( const markup = (
<Page> <Page>
@ -35,9 +38,14 @@ class SearchSettings extends SearchSettingsView {
</Navbar> </Navbar>
<List> <List>
<ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} /> <ListItem radio title={_t.textFind} name="find-replace-checkbox" checked={!this.state.useReplace} onClick={e => this.onFindReplaceClick('find')} />
<ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace} onClick={e => this.onFindReplaceClick('replace')} /> {isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll} <ListItem radio title={_t.textFindAndReplace} name="find-replace-checkbox" checked={this.state.useReplace}
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem> onClick={e => this.onFindReplaceClick('replace')} />
: null}
{isEdit ?
<ListItem radio title={_t.textFindAndReplaceAll} name="find-replace-checkbox" checked={this.state.isReplaceAll}
onClick={() => this.onFindReplaceClick('replace-all')}></ListItem>
: null}
</List> </List>
<BlockTitle>{_t.textSearchIn}</BlockTitle> <BlockTitle>{_t.textSearchIn}</BlockTitle>
<List> <List>
@ -206,6 +214,6 @@ const Search = withTranslation()(props => {
return <SESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} /> return <SESearchView _t={_t} onSearchQuery={onSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />
}); });
const SearchSettingsWithTranslation = withTranslation()(SearchSettings); const SearchSettingsWithTranslation = inject("storeAppOptions")(observer(withTranslation()(SearchSettings)));
export {Search, SearchSettingsWithTranslation as SearchSettings} export {Search, SearchSettingsWithTranslation as SearchSettings}

View file

@ -195,12 +195,13 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
if (index == api.asc_getActiveWorksheetIndex()) { if (index == api.asc_getActiveWorksheetIndex()) {
if (!opened) { if (!opened) {
if (!isDisconnected) { if (isEdit && !isDisconnected) {
api.asc_closeCellEditor(); api.asc_closeCellEditor();
f7.popover.open('#idx-tab-context-menu-popover', target); f7.popover.open('#idx-tab-context-menu-popover', target);
} }
} }
} else { }
else {
f7.popover.close('#idx-tab-context-menu-popover', false); f7.popover.close('#idx-tab-context-menu-popover', false);
onTabClicked(i); onTabClicked(i);
// Common.Notifications.trigger('sheet:active', index); // Common.Notifications.trigger('sheet:active', index);

View file

@ -140,6 +140,10 @@ export class storeCellSettings {
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }

View file

@ -74,6 +74,10 @@ export class storeTextSettings {
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }

View file

@ -8,12 +8,13 @@ const viewStyle = {
height: 30 height: 30
}; };
const StatusbarView = inject('sheets')(observer(props => { const StatusbarView = inject('sheets', "storeAppOptions")(observer(props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Statusbar', {returnObjects: true}); const _t = t('Statusbar', {returnObjects: true});
const isAndroid = Device.android; const isAndroid = Device.android;
const isPhone = Device.isPhone; const isPhone = Device.isPhone;
const { sheets } = props; const { sheets, storeAppOptions } = props;
const isEdit = storeAppOptions.isEdit;
const hiddenSheets = sheets.hiddenWorksheets(); const hiddenSheets = sheets.hiddenWorksheets();
const allSheets = sheets.sheets; const allSheets = sheets.sheets;
const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`; const getTabClassList = model => `tab ${model.active ? 'active' : ''} ${model.locked ? 'locked' : ''}`;
@ -134,30 +135,32 @@ const StatusbarView = inject('sheets')(observer(props => {
</ul> </ul>
</div> </div>
</View> </View>
<Popover id="idx-tab-context-menu-popover" {isEdit ?
className="document-menu" <Popover id="idx-tab-context-menu-popover"
backdrop={false} className="document-menu"
closeByBackdropClick={false} backdrop={false}
closeByOutsideClick={false} closeByBackdropClick={false}
> closeByOutsideClick={false}
{isPhone || isAndroid ? ( >
<List className="list-block"> {isPhone || isAndroid ? (
<ListButton title={_t.textDuplicate} onClick={() => props.onTabMenu('copy')} /> <List className="list-block">
<ListButton title={_t.textDelete} onClick={() => props.onTabMenu('del')} /> <ListButton title={_t.textDuplicate} onClick={() => props.onTabMenu('copy')} />
<ListButton title={_t.textMore} onClick={() => props.onTabMenu('showMore')} /> <ListButton title={_t.textDelete} onClick={() => props.onTabMenu('del')} />
</List> <ListButton title={_t.textMore} onClick={() => props.onTabMenu('showMore')} />
) : ( </List>
<List className="list-block"> ) : (
<ListButton title={_t.textDuplicate} onClick={() => props.onTabMenu('copy')} /> <List className="list-block">
<ListButton title={_t.textDelete} onClick={() => props.onTabMenu('del')} /> <ListButton title={_t.textDuplicate} onClick={() => props.onTabMenu('copy')} />
<ListButton title={_t.textRename} onClick={() => props.onTabMenu('ren')} /> <ListButton title={_t.textDelete} onClick={() => props.onTabMenu('del')} />
<ListButton title={_t.textHide} onClick={() => props.onTabMenu('hide')} /> <ListButton title={_t.textRename} onClick={() => props.onTabMenu('ren')} />
{hiddenSheets.length ? ( <ListButton title={_t.textHide} onClick={() => props.onTabMenu('hide')} />
<ListButton title={_t.textUnhide} onClick={() => props.onTabMenu('unhide')} /> {hiddenSheets.length ? (
) : null} <ListButton title={_t.textUnhide} onClick={() => props.onTabMenu('unhide')} />
</List> ) : null}
)} </List>
</Popover> )}
</Popover>
: null}
{isPhone || isAndroid ? ( {isPhone || isAndroid ? (
<Actions id="idx-tab-menu-actions" backdrop={true} closeByBackdropClick={true}> <Actions id="idx-tab-menu-actions" backdrop={true} closeByBackdropClick={true}>
<ActionsGroup> <ActionsGroup>

View file

@ -88,11 +88,7 @@ const AddLinkView = props => {
placeholder={_t.textLink} placeholder={_t.textLink}
value={link} value={link}
onChange={(event) => { onChange={(event) => {
if (link.includes('https://')) {
setDisplayText(link)
}
setLink(event.target.value) setLink(event.target.value)
setDisplayText(event.target.value)
}} }}
className={isIos ? 'list-input-right' : ''} className={isIos ? 'list-input-right' : ''}
/> />

View file

@ -1,8 +1,9 @@
import React, {Component, useEffect} from 'react'; import React, {Component, useEffect} from 'react';
import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react'; import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react';
import { withTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import {f7} from 'framework7-react'; import {f7} from 'framework7-react';
import {Device} from '../../../../../common/mobile/utils/device'; import {Device} from '../../../../../common/mobile/utils/device';
import { observer, inject } from "mobx-react";
import SpreadsheetSettingsController from '../../controller/settings/SpreadsheetSettings.jsx'; import SpreadsheetSettingsController from '../../controller/settings/SpreadsheetSettings.jsx';
import ApplicationSettingsController from '../../controller/settings/ApplicationSettings.jsx'; import ApplicationSettingsController from '../../controller/settings/ApplicationSettings.jsx';
import SpreadsheetInfoController from '../../controller/settings/SpreadsheetInfo.jsx'; import SpreadsheetInfoController from '../../controller/settings/SpreadsheetInfo.jsx';
@ -64,8 +65,8 @@ const routes = [
]; ];
const SettingsList = withTranslation()(props => { const SettingsList = inject("storeAppOptions")(observer(props => {
const {t} = props; const { t } = useTranslation();
const _t = t('View.Settings', {returnObjects: true}); const _t = t('View.Settings', {returnObjects: true});
const navbar = <Navbar title={_t.textSettings}> const navbar = <Navbar title={_t.textSettings}>
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>} {!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
@ -115,14 +116,20 @@ const SettingsList = withTranslation()(props => {
window.open(url, "_blank"); window.open(url, "_blank");
}; };
const appOptions = props.storeAppOptions;
let _isEdit = false;
if (!appOptions.isDisconnected) {
_isEdit = appOptions.isEdit;
}
return ( return (
<View style={props.style} stackPages={true} routes={routes}> <View style={props.style} stackPages={true} routes={routes}>
<Page> <Page>
{navbar} {navbar}
<List> <List>
{!props.inPopover && {!props.inPopover &&
<ListItem title={_t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'> <ListItem disabled={appOptions.readerMode ? true : false} title={!_isEdit ? _t.textFind : _t.textFindAndReplace} link="#" searchbarEnable='.searchbar' onClick={closeModal} className='no-indicator'>
<Icon slot="media" icon="icon-search"></Icon> <Icon slot="media" icon="icon-search"></Icon>
</ListItem> </ListItem>
} }
@ -156,7 +163,7 @@ const SettingsList = withTranslation()(props => {
</Page> </Page>
</View> </View>
) )
}); }));
class SettingsView extends Component { class SettingsView extends Component {
constructor(props) { constructor(props) {