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

Feature/bug fixes
This commit is contained in:
maxkadushkin 2021-10-22 14:47:48 +03:00 committed by GitHub
commit 2b31602fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 27 deletions

View file

@ -613,9 +613,9 @@ class ViewCommentsController extends Component {
render() {
return(
<Fragment>
{this.props.allComments && <ViewComments onCommentMenuClick={this.onCommentMenuClick} onResolveComment={this.onResolveComment}
{this.props.allComments && <ViewComments wsProps={this.props?.storeWorksheets?.wsProps} onCommentMenuClick={this.onCommentMenuClick} onResolveComment={this.onResolveComment}
showComment={this.showComment} />}
{this.state.isOpenViewCurComments && <ViewCurrentComments opened={this.state.isOpenViewCurComments}
{this.state.isOpenViewCurComments && <ViewCurrentComments wsProps={this.props?.storeWorksheets?.wsProps} opened={this.state.isOpenViewCurComments}
closeCurComments={this.closeViewCurComments}
onCommentMenuClick={this.onCommentMenuClick}
onResolveComment={this.onResolveComment}
@ -625,14 +625,22 @@ class ViewCommentsController extends Component {
}
}
class ViewCommentsSheetsController extends ViewCommentsController {
constructor(props) {
super(props);
}
}
const _CommentsController = inject('storeAppOptions', 'storeComments', 'users', "storeApplicationSettings")(observer(CommentsController));
const _AddCommentController = inject('storeAppOptions', 'storeComments', 'users')(observer(AddCommentController));
const _EditCommentController = inject('storeComments', 'users')(observer(EditCommentController));
const _ViewCommentsController = inject('storeComments', 'users', "storeApplicationSettings")(observer(withTranslation()(ViewCommentsController)));
const _ViewCommentsController = inject('storeComments', 'users', "storeApplicationSettings", "storeReview", "storeAppOptions")(observer(withTranslation()(ViewCommentsController)));
const _ViewCommentsSheetsController = inject('storeComments', 'users', "storeApplicationSettings", "storeWorksheets", "storeReview", "storeAppOptions")(observer(withTranslation()(ViewCommentsSheetsController)));
export {
_CommentsController as CommentsController,
_AddCommentController as AddCommentController,
_EditCommentController as EditCommentController,
_ViewCommentsController as ViewCommentsController
_ViewCommentsController as ViewCommentsController,
_ViewCommentsSheetsController as ViewCommentsSheetsController
};

View file

@ -8,7 +8,7 @@ import {Device} from "../../../utils/device";
import {ReviewController, ReviewChangeController} from "../../controller/collaboration/Review";
import {PageDisplayMode} from "./Review";
import {ViewCommentsController} from "../../controller/collaboration/Comments";
import {ViewCommentsController, ViewCommentsSheetsController} from "../../controller/collaboration/Comments";
const PageUsers = inject("users")(observer(props => {
const { t } = useTranslation();
@ -76,7 +76,7 @@ const routes = [
},
{
path: '/comments/',
component: ViewCommentsController,
asyncComponent: () => window.editorType == 'sse' ? ViewCommentsSheetsController : ViewCommentsController,
options: {
props: {
allComments: true
@ -123,7 +123,6 @@ const PageCollaboration = inject('storeAppOptions', 'users')(observer(props => {
)
}));
class CollaborationView extends Component {
constructor(props) {
super(props);

View file

@ -628,7 +628,8 @@ const pickLink = (message) => {
}
// View comments
const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment, storeReview}) => {
const ViewComments = inject("storeComments", "storeAppOptions", "storeReview")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment, storeReview, wsProps}) => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android;
@ -673,8 +674,8 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
</div>
{!viewMode &&
<div className='right'>
{(comment.editable && displayMode === 'markup') && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'} /></div> }
{displayMode === 'markup' &&
{(comment.editable && displayMode === 'markup' && !wsProps?.Objects) && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'} /></div> }
{(displayMode === 'markup' && !wsProps?.Objects) &&
<div className='comment-menu'
onClick={() => {setComment(comment); openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
@ -736,12 +737,9 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
<ReplyActions comment={clickComment} reply={reply} onCommentMenuClick={onCommentMenuClick} opened={replyActionsOpened} openActionReply={openActionReply}/>
</Page>
)
};
}));
const _ViewComments = inject('storeComments', 'storeAppOptions', "storeReview")(observer(ViewComments));
const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, storeReview}) => {
const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, storeReview, wsProps}) => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android;
@ -784,8 +782,8 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob
return (
<Fragment>
<Toolbar position='bottom'>
{!viewMode &&
<Link className='btn-add-reply' href='#' onClick={() => {onCommentMenuClick('addReply', comment);}}>{_t.textAddReply}</Link>
{!viewMode &&
<Link className={`btn-add-reply${wsProps?.Objects ? ' disabled' : ''}`} href='#' onClick={() => {onCommentMenuClick('addReply', comment);}}>{_t.textAddReply}</Link>
}
<div className='comment-navigation row'>
<Link href='#' onClick={onViewPrevComment}><Icon slot='media' icon='icon-prev'/></Link>
@ -806,8 +804,8 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob
</div>
{!viewMode &&
<div className='right'>
{(comment.editable && displayMode === 'markup') && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'}/></div>}
{displayMode === 'markup' &&
{(comment.editable && displayMode === 'markup' && !wsProps?.Objects) && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'}/></div>}
{(displayMode === 'markup' && !wsProps?.Objects) &&
<div className='comment-menu'
onClick={() => {openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
@ -870,7 +868,7 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob
}));
const ViewCommentSheet = ({closeCurComments, onCommentMenuClick, onResolveComment}) => {
const ViewCommentSheet = ({closeCurComments, onCommentMenuClick, onResolveComment, wsProps}) => {
useEffect(() => {
f7.sheet.open('#view-comment-sheet');
});
@ -916,18 +914,19 @@ const ViewCommentSheet = ({closeCurComments, onCommentMenuClick, onResolveCommen
<div id='swipe-handler' className='swipe-container' onTouchStart={handleTouchStart} onTouchMove={handleTouchMove} onTouchEnd={handleTouchEnd}>
<Icon icon='icon-swipe'/>
</div>
<CommentList onCommentMenuClick={onCommentMenuClick} onResolveComment={onResolveComment}/>
<CommentList wsProps={wsProps} onCommentMenuClick={onCommentMenuClick} onResolveComment={onResolveComment}/>
</Sheet>
)
};
const ViewCommentPopover = ({onCommentMenuClick, onResolveComment}) => {
const ViewCommentPopover = ({onCommentMenuClick, onResolveComment, wsProps}) => {
useEffect(() => {
f7.popover.open('#view-comment-popover', '#btn-coauth');
});
return (
<Popover id='view-comment-popover' style={{height: '410px'}} closeByOutsideClick={false}>
<CommentList onCommentMenuClick={onCommentMenuClick} onResolveComment={onResolveComment} />
<CommentList wsProps={wsProps} onCommentMenuClick={onCommentMenuClick} onResolveComment={onResolveComment} />
</Popover>
)
};
@ -945,6 +944,6 @@ export {
EditComment,
AddReply,
EditReply,
_ViewComments as ViewComments,
ViewComments,
ViewCurrentComments
};

View file

@ -393,7 +393,7 @@ const PageFillColor = props => {
const storePalette = props.storePalette;
const storeSlideSettings = props.storeSlideSettings;
const customColors = storePalette.customColors;
const fillColor = storeSlideSettings.fillColor ? storeSlideSettings.fillColor : storeSlideSettings.getFillColor(slideObject);
const fillColor = storeSlideSettings.getFillColor(slideObject);
const changeColor = (color, effectId, effectValue) => {
if (color !== 'empty') {

View file

@ -10,7 +10,7 @@ import {
AddCommentController,
CommentsController,
EditCommentController,
ViewCommentsController
ViewCommentsSheetsController
} from "../../../../common/mobile/lib/controller/collaboration/Comments";
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
import LongActionsController from "./LongActions";
@ -887,7 +887,7 @@ class MainController extends Component {
<CommentsController />
<AddCommentController />
<EditCommentController />
<ViewCommentsController />
<ViewCommentsSheetsController />
<PluginsController />
<EncodingController />
</Fragment>