Merge pull request #2173 from ONLYOFFICE/feature/fix-bugs
Feature/fix bugs
This commit is contained in:
commit
1b6480f7fe
|
@ -1,7 +1,6 @@
|
||||||
import React, {useEffect} from 'react';
|
import React, {useEffect} from 'react';
|
||||||
import ViewSharingSettings from "../view/SharingSettings";
|
import ViewSharingSettings from "../view/SharingSettings";
|
||||||
import {observer, inject} from "mobx-react";
|
import {observer, inject} from "mobx-react";
|
||||||
import { f7 } from 'framework7-react';
|
|
||||||
|
|
||||||
const SharingSettingsController = props => {
|
const SharingSettingsController = props => {
|
||||||
const appOptions = props.storeAppOptions;
|
const appOptions = props.storeAppOptions;
|
||||||
|
@ -64,9 +63,7 @@ const SharingSettingsController = props => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewSharingSettings
|
<ViewSharingSettings sharingSettingsUrl={sharingSettingsUrl} />
|
||||||
sharingSettingsUrl={sharingSettingsUrl}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,34 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import { Navbar, Page } from 'framework7-react';
|
import { Navbar, Page } from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Device } from '../../utils/device';
|
||||||
|
|
||||||
const ViewSharingSettings = props => {
|
const ViewSharingSettings = props => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const sharingSettingsUrl = props.sharingSettingsUrl;
|
const sharingSettingsUrl = props.sharingSettingsUrl;
|
||||||
const _t = t('Common.Collaboration', {returnObjects: true});
|
const _t = t('Common.Collaboration', {returnObjects: true});
|
||||||
|
const ref = useRef(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const coauthSheetElem = ref.current.closest('.coauth__sheet');
|
||||||
|
|
||||||
|
if(Device.phone) {
|
||||||
|
coauthSheetElem.style.height = '100%';
|
||||||
|
coauthSheetElem.style.maxHeight = '100%';
|
||||||
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if(Device.phone) {
|
||||||
|
coauthSheetElem.style.height = null;
|
||||||
|
coauthSheetElem.style.maxHeight = '65%';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={t('Common.Collaboration.textSharingSettings')} backLink={_t.textBack} />
|
<Navbar title={t('Common.Collaboration.textSharingSettings')} backLink={_t.textBack} />
|
||||||
<div id="sharing-placeholder" className="sharing-placeholder">
|
<div id="sharing-placeholder" className="sharing-placeholder" ref={ref}>
|
||||||
<iframe width="100%" height="500" frameBorder={0} scrolling="0" align="top" src={sharingSettingsUrl}></iframe>
|
<iframe width="100%" height="500" frameBorder={0} scrolling="0" align="top" src={sharingSettingsUrl}></iframe>
|
||||||
</div>
|
</div>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {Device} from "../../../utils/device";
|
||||||
import {ReviewController, ReviewChangeController} from "../../controller/collaboration/Review";
|
import {ReviewController, ReviewChangeController} from "../../controller/collaboration/Review";
|
||||||
import {PageDisplayMode} from "./Review";
|
import {PageDisplayMode} from "./Review";
|
||||||
import {ViewCommentsController, ViewCommentsSheetsController} from "../../controller/collaboration/Comments";
|
import {ViewCommentsController, ViewCommentsSheetsController} from "../../controller/collaboration/Comments";
|
||||||
// import SharingSettings from "../SharingSettings";
|
|
||||||
import SharingSettingsController from "../../controller/SharingSettings";
|
import SharingSettingsController from "../../controller/SharingSettings";
|
||||||
|
|
||||||
const PageUsers = inject("users")(observer(props => {
|
const PageUsers = inject("users")(observer(props => {
|
||||||
|
@ -146,6 +145,7 @@ class CollaborationView extends Component {
|
||||||
onoptionclick(page){
|
onoptionclick(page){
|
||||||
f7.views.current.router.navigate(page);
|
f7.views.current.router.navigate(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const show_popover = this.props.usePopover;
|
const show_popover = this.props.usePopover;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -94,6 +94,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sheet-modal.coauth__sheet {
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
|
||||||
.disabled, [disabled] {
|
.disabled, [disabled] {
|
||||||
opacity: .55;
|
opacity: .55;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
|
@ -3,16 +3,15 @@ import { f7 } from 'framework7-react';
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { withTranslation} from 'react-i18next';
|
import { withTranslation} from 'react-i18next';
|
||||||
import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage.mjs';
|
import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage.mjs';
|
||||||
|
|
||||||
import ContextMenuController from '../../../../common/mobile/lib/controller/ContextMenu';
|
import ContextMenuController from '../../../../common/mobile/lib/controller/ContextMenu';
|
||||||
import { idContextMenuElement } from '../../../../common/mobile/lib/view/ContextMenu';
|
import { idContextMenuElement } from '../../../../common/mobile/lib/view/ContextMenu';
|
||||||
import { Device } from '../../../../common/mobile/utils/device';
|
|
||||||
import EditorUIController from '../lib/patch';
|
import EditorUIController from '../lib/patch';
|
||||||
|
|
||||||
@inject ( stores => ({
|
@inject ( stores => ({
|
||||||
isEdit: stores.storeAppOptions.isEdit,
|
isEdit: stores.storeAppOptions.isEdit,
|
||||||
canComments: stores.storeAppOptions.canComments,
|
canComments: stores.storeAppOptions.canComments,
|
||||||
canViewComments: stores.storeAppOptions.canViewComments,
|
canViewComments: stores.storeAppOptions.canViewComments,
|
||||||
|
canEditComments: stores.storeAppOptions.canEditComments,
|
||||||
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
|
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
|
||||||
canReview: stores.storeAppOptions.canReview,
|
canReview: stores.storeAppOptions.canReview,
|
||||||
canFillForms: stores.storeAppOptions.canFillForms,
|
canFillForms: stores.storeAppOptions.canFillForms,
|
||||||
|
@ -276,7 +275,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
initMenuItems() {
|
initMenuItems() {
|
||||||
if ( !Common.EditorApi ) return [];
|
if ( !Common.EditorApi ) return [];
|
||||||
|
|
||||||
const { isEdit, canFillForms, isDisconnected, isViewer } = this.props;
|
const { isEdit, canFillForms, isDisconnected, isViewer, canEditComments } = this.props;
|
||||||
|
|
||||||
if (isEdit && EditorUIController.ContextMenu) {
|
if (isEdit && EditorUIController.ContextMenu) {
|
||||||
return EditorUIController.ContextMenu.mapMenuItems(this);
|
return EditorUIController.ContextMenu.mapMenuItems(this);
|
||||||
|
@ -346,7 +345,7 @@ class ContextMenu extends ContextMenuController {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked && !(!isText && isObject) && !isViewer) {
|
if (api.can_AddQuotedComment() !== false && canCoAuthoring && canComments && !locked && !(!isText && isObject) && !isViewer && canEditComments) {
|
||||||
itemsText.push({
|
itemsText.push({
|
||||||
caption: _t.menuAddComment,
|
caption: _t.menuAddComment,
|
||||||
event: 'addcomment'
|
event: 'addcomment'
|
||||||
|
|
|
@ -177,6 +177,8 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
|
||||||
const turnOnViewerMode = () => {
|
const turnOnViewerMode = () => {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
|
||||||
|
f7.popover.close('.document-menu.modal-in', false);
|
||||||
|
|
||||||
appOptions.changeViewerMode();
|
appOptions.changeViewerMode();
|
||||||
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
|
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue