Merge pull request #1917 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
maxkadushkin 2022-08-26 20:13:55 +03:00 committed by GitHub
commit b797fe25a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 25 deletions

View file

@ -81,15 +81,15 @@ const Settings = props => {
}, 0);
};
const onChangeMobileView = () => {
const api = Common.EditorApi.get()
const onChangeMobileView = async () => {
const api = Common.EditorApi.get();
const appOptions = props.storeAppOptions;
appOptions.changeMobileView();
api.ChangeReaderMode();
await appOptions.changeMobileView();
await api.ChangeReaderMode();
if(Device.phone) {
closeModal();
await closeModal();
}
}

View file

@ -203,4 +203,4 @@ class MainPage extends Component {
}
}
export default inject("storeAppOptions")(observer(withTranslation()(MainPage)));
export default withTranslation()(inject("storeAppOptions")(observer(MainPage)));

View file

@ -57,11 +57,11 @@ const ToolbarView = props => {
<Link className={props.disabledControls ? 'disabled' : ''} icon='icon-edit' href={false} onClick={props.onEditDocument}></Link>
}
{props.isEdit && isAvailableExt && !isViewer && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({
disabled: disableEditBtn || props.disabledControls,
onEditClick: e => props.openOptions('edit'),
onAddClick: e => props.openOptions('add')
disabled: disableEditBtn || props.disabledControls,
onEditClick: e => props.openOptions('edit'),
onAddClick: e => props.openOptions('add')
})}
{isViewer && isAvailableExt && <Link icon='icon-edit-mode' className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} href={false} onClick={() => props.turnOffViewerMode()}></Link>}
{isViewer && isAvailableExt && props.isEdit && <Link icon='icon-edit-mode' className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} href={false} onClick={() => props.turnOffViewerMode()}></Link>}
{Device.phone ? null : <Link className={(props.disabledControls || props.readerMode) && 'disabled'} icon='icon-search' searchbarEnable='.searchbar' href={false}></Link>}
{props.displayCollaboration && window.matchMedia("(min-width: 360px)").matches ? <Link className={props.disabledControls && 'disabled'} id='btn-coauth' href={false} icon='icon-collaboration' onClick={e => props.openOptions('coauth')}></Link> : null}
<Link className={(props.disabledSettings || props.disabledControls || isDisconnected) && 'disabled'} id='btn-settings' icon='icon-settings' href={false} onClick={e => props.openOptions('settings')}></Link>

View file

@ -24,13 +24,14 @@ const PageApplicationSettings = props => {
// set mode
const appOptions = props.storeAppOptions;
const isViewer = appOptions.isViewer;
const _isEdit = appOptions.isEdit;
const _isShowMacros = (!appOptions.isDisconnected && appOptions.customization) ? appOptions.customization.macros !== false : true;
return (
<Page>
<Navbar title={_t.textApplicationSettings} backLink={_t.textBack} />
{_isEdit &&
{_isEdit && !isViewer &&
<Fragment>
<BlockTitle>{_t.textUnitOfMeasurement}</BlockTitle>
<List>
@ -90,7 +91,6 @@ const PageApplicationSettings = props => {
/>
</ListItem>
</List>
<List>
<ListItem title={'Dark theme'}>
<Toggle checked={isThemeDark}
@ -98,11 +98,12 @@ const PageApplicationSettings = props => {
</Toggle>
</ListItem>
</List>
<List mediaList>
<ListItem title={t('Settings.textDirection')} link="/direction/" routeProps={{changeDirection: props.changeDirection}}></ListItem>
</List>
{!isViewer &&
<List mediaList>
<ListItem title={t('Settings.textDirection')} link="/direction/"
routeProps={{changeDirection: props.changeDirection}}></ListItem>
</List>
}
{_isShowMacros &&
<List mediaList>
<ListItem title={_t.textMacrosSettings} link="/macros-settings/" routeProps={{

View file

@ -166,9 +166,9 @@ const SettingsList = inject("storeAppOptions", "storeReview")(observer(props =>
<Toggle checked={isMobileView} onToggleChange={() => {
props.onChangeMobileView();
props.openOptions('snackbar');
setTimeout( () => {
setTimeout(() => {
props.closeOptions('snackbar');
}, 1000);
}, 1000);
}} />
</ListItem>
}
@ -178,12 +178,10 @@ const SettingsList = inject("storeAppOptions", "storeReview")(observer(props =>
<Icon slot="media" icon="icon-doc-setup"></Icon>
</ListItem>
}
{!isViewer &&
<ListItem title={_t.textApplicationSettings} link="#"
onClick={onoptionclick.bind(this, "/application-settings/")}>
<Icon slot="media" icon="icon-app-settings"></Icon>
</ListItem>
}
<ListItem title={_t.textApplicationSettings} link="#"
onClick={onoptionclick.bind(this, "/application-settings/")}>
<Icon slot="media" icon="icon-app-settings"></Icon>
</ListItem>
{_canDownload &&
<ListItem title={_t.textDownload} link="#" onClick={onoptionclick.bind(this, "/download/")}>
<Icon slot="media" icon="icon-download"></Icon>