[DE mobile] Fix Bug 51670

This commit is contained in:
SergeyEzhin 2021-08-03 18:14:45 +03:00
parent 90964f12d6
commit 9b31aee15b
5 changed files with 47 additions and 35 deletions

View file

@ -1,24 +1,24 @@
import {action, observable, makeObservable} from 'mobx';
export class storeReview {
constructor() {
makeObservable(this, {
displayMode: observable,
dataChanges: observable,
changeDisplayMode: action,
changeArrReview: action
});
}
displayMode = 'markup';
changeDisplayMode (mode) {
this.displayMode = mode;
}
dataChanges = [];
changeArrReview (data) {
this.dataChanges = data && data.length > 0 ? data : [];
}
import {action, observable, makeObservable} from 'mobx';
export class storeReview {
constructor() {
makeObservable(this, {
displayMode: observable,
dataChanges: observable,
changeDisplayMode: action,
changeArrReview: action
});
}
displayMode = 'markup';
changeDisplayMode (mode) {
this.displayMode = mode;
}
dataChanges = [];
changeArrReview (data) {
this.dataChanges = data && data.length > 0 ? data : [];
}
}

View file

@ -628,10 +628,11 @@ const pickLink = (message) => {
}
// View comments
const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment}) => {
const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, showComment, storeReview}) => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android;
const displayMode = storeReview.displayMode;
const viewMode = !storeAppOptions.canComments;
const comments = storeComments.groupCollectionFilter || storeComments.collectionComments;
@ -672,10 +673,13 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
</div>
{!viewMode &&
<div className='right'>
{comment.editable && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'} /></div> }
<div className='comment-menu'
onClick={() => {setComment(comment); openActionComment(true);}}
><Icon icon='icon-menu-comment'/></div>
{(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' &&
<div className='comment-menu'
onClick={() => {setComment(comment); openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
</div>
}
</div>
}
</div>
@ -734,13 +738,14 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes
)
};
const _ViewComments = inject('storeComments', 'storeAppOptions')(observer(ViewComments));
const _ViewComments = inject('storeComments', 'storeAppOptions', "storeReview")(observer(ViewComments));
const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment}) => {
const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(observer(({storeComments, storeAppOptions, onCommentMenuClick, onResolveComment, storeReview}) => {
const { t } = useTranslation();
const _t = t('Common.Collaboration', {returnObjects: true});
const isAndroid = Device.android;
const displayMode = storeReview.displayMode;
const viewMode = !storeAppOptions.canComments;
const comments = storeComments.showComments;
@ -801,10 +806,13 @@ const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeC
</div>
{!viewMode &&
<div className='right'>
{comment.editable && <div className='comment-resolve' onClick={() => {onResolveComment(comment);}}><Icon icon={comment.resolved ? 'icon-resolve-comment check' : 'icon-resolve-comment'}/></div>}
<div className='comment-menu'
onClick={() => {openActionComment(true);}}
><Icon icon='icon-menu-comment'/></div>
{(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' &&
<div className='comment-menu'
onClick={() => {openActionComment(true);}}>
<Icon icon='icon-menu-comment'/>
</div>
}
</div>
}
</div>

View file

@ -13,7 +13,7 @@ import {storeLinkSettings} from './linkSettings';
import {storeApplicationSettings} from './applicationSettings';
import {storeAppOptions} from "./appOptions";
import {storePalette} from "./palette";
import {storeReview} from "./review";
import {storeReview} from '../../../../common/mobile/lib/store/review';
import {storeComments} from "../../../../common/mobile/lib/store/comments";
import {storeToolbarSettings} from "./toolbar";

View file

@ -16,6 +16,7 @@ import { storeLinkSettings } from "./linkSettings";
// import {storeParagraphSettings} from "./paragraphSettings";
// import {storeShapeSettings} from "./shapeSettings";
// import {storeImageSettings} from "./imageSettings";
import {storeReview} from '../../../../common/mobile/lib/store/review';
import {storeComments} from "../../../../common/mobile/lib/store/comments";
import {storeToolbarSettings} from "./toolbar";
@ -34,6 +35,7 @@ export const stores = {
storeTableSettings: new storeTableSettings(),
storeChartSettings: new storeChartSettings(),
storeLinkSettings: new storeLinkSettings(),
storeReview: new storeReview(),
// storeTextSettings: new storeTextSettings(),
// storeParagraphSettings: new storeParagraphSettings(),
// storeShapeSettings: new storeShapeSettings(),

View file

@ -15,6 +15,7 @@ import {storeAppOptions} from "./appOptions";
// import {storeTableSettings} from "./tableSettings";
import {storeChartSettings} from "./chartSettings";
import {storeSpreadsheetSettings} from "./spreadsheetSettings";
import {storeReview} from '../../../../common/mobile/lib/store/review';
import {storeComments} from "../../../../common/mobile/lib/store/comments";
import {storeToolbarSettings} from "./toolbar";
@ -33,6 +34,7 @@ export const stores = {
storeChartSettings: new storeChartSettings(),
storePalette: new storePalette(),
storeCellSettings: new storeCellSettings(),
storeReview: new storeReview(),
// storeImageSettings: new storeImageSettings(),
// storeTableSettings: new storeTableSettings()
storeComments: new storeComments(),