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

Feature/fix bugs
This commit is contained in:
maxkadushkin 2022-12-30 11:30:12 +03:00 committed by GitHub
commit 1b6480f7fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 11 deletions

View file

@ -1,7 +1,6 @@
import React, {useEffect} from 'react';
import ViewSharingSettings from "../view/SharingSettings";
import {observer, inject} from "mobx-react";
import { f7 } from 'framework7-react';
const SharingSettingsController = props => {
const appOptions = props.storeAppOptions;
@ -64,9 +63,7 @@ const SharingSettingsController = props => {
}, []);
return (
<ViewSharingSettings
sharingSettingsUrl={sharingSettingsUrl}
/>
<ViewSharingSettings sharingSettingsUrl={sharingSettingsUrl} />
);
};

View file

@ -1,16 +1,34 @@
import React, { useEffect } from 'react';
import React, { useEffect, useRef } from 'react';
import { Navbar, Page } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import { Device } from '../../utils/device';
const ViewSharingSettings = props => {
const { t } = useTranslation();
const sharingSettingsUrl = props.sharingSettingsUrl;
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 (
<Page>
<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>
</div>
</Page>

View file

@ -6,7 +6,6 @@ import {Device} from "../../../utils/device";
import {ReviewController, ReviewChangeController} from "../../controller/collaboration/Review";
import {PageDisplayMode} from "./Review";
import {ViewCommentsController, ViewCommentsSheetsController} from "../../controller/collaboration/Comments";
// import SharingSettings from "../SharingSettings";
import SharingSettingsController from "../../controller/SharingSettings";
const PageUsers = inject("users")(observer(props => {
@ -146,6 +145,7 @@ class CollaborationView extends Component {
onoptionclick(page){
f7.views.current.router.navigate(page);
}
render() {
const show_popover = this.props.usePopover;
return (

View file

@ -94,6 +94,10 @@
}
}
.sheet-modal.coauth__sheet {
transition: all .3s;
}
.disabled, [disabled] {
opacity: .55;
pointer-events: none;

View file

@ -3,16 +3,15 @@ import { f7 } from 'framework7-react';
import { inject, observer } from "mobx-react";
import { withTranslation} from 'react-i18next';
import { LocalStorage } from '../../../../common/mobile/utils/LocalStorage.mjs';
import ContextMenuController from '../../../../common/mobile/lib/controller/ContextMenu';
import { idContextMenuElement } from '../../../../common/mobile/lib/view/ContextMenu';
import { Device } from '../../../../common/mobile/utils/device';
import EditorUIController from '../lib/patch';
@inject ( stores => ({
isEdit: stores.storeAppOptions.isEdit,
canComments: stores.storeAppOptions.canComments,
canViewComments: stores.storeAppOptions.canViewComments,
canEditComments: stores.storeAppOptions.canEditComments,
canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
canReview: stores.storeAppOptions.canReview,
canFillForms: stores.storeAppOptions.canFillForms,
@ -276,7 +275,7 @@ class ContextMenu extends ContextMenuController {
initMenuItems() {
if ( !Common.EditorApi ) return [];
const { isEdit, canFillForms, isDisconnected, isViewer } = this.props;
const { isEdit, canFillForms, isDisconnected, isViewer, canEditComments } = this.props;
if (isEdit && EditorUIController.ContextMenu) {
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({
caption: _t.menuAddComment,
event: 'addcomment'

View file

@ -177,6 +177,8 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
const turnOnViewerMode = () => {
const api = Common.EditorApi.get();
f7.popover.close('.document-menu.modal-in', false);
appOptions.changeViewerMode();
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
}