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

Feature/bug fixes
This commit is contained in:
Julia Radzhabova 2021-08-04 17:53:25 +03:00 committed by GitHub
commit 7211050c0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 64 additions and 47 deletions

View file

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

View file

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

View file

@ -252,7 +252,7 @@
"textNoStyles": "Для этого типа диаграмм нет стилей.", "textNoStyles": "Для этого типа диаграмм нет стилей.",
"textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"", "textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"",
"textNumbers": "Нумерация", "textNumbers": "Нумерация",
"textOpacity": "Прозрачность", "textOpacity": "Непрозрачность",
"textOptions": "Параметры", "textOptions": "Параметры",
"textOrphanControl": "Запрет висячих строк", "textOrphanControl": "Запрет висячих строк",
"textPageBreakBefore": "С новой страницы", "textPageBreakBefore": "С новой страницы",

View file

@ -16,7 +16,8 @@ import EditorUIController from '../lib/patch';
canCoAuthoring: stores.storeAppOptions.canCoAuthoring, canCoAuthoring: stores.storeAppOptions.canCoAuthoring,
canReview: stores.storeAppOptions.canReview, canReview: stores.storeAppOptions.canReview,
users: stores.users, users: stores.users,
isDisconnected: stores.users.isDisconnected isDisconnected: stores.users.isDisconnected,
displayMode: stores.storeReview.displayMode
})) }))
class ContextMenu extends ContextMenuController { class ContextMenu extends ContextMenuController {
constructor(props) { constructor(props) {

View file

@ -13,7 +13,7 @@ import {storeLinkSettings} from './linkSettings';
import {storeApplicationSettings} from './applicationSettings'; import {storeApplicationSettings} from './applicationSettings';
import {storeAppOptions} from "./appOptions"; import {storeAppOptions} from "./appOptions";
import {storePalette} from "./palette"; 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 {storeComments} from "../../../../common/mobile/lib/store/comments";
import {storeToolbarSettings} from "./toolbar"; import {storeToolbarSettings} from "./toolbar";

View file

@ -202,7 +202,7 @@ class AddView extends Component {
const show_popover = this.props.usePopover; const show_popover = this.props.usePopover;
return ( return (
show_popover ? show_popover ?
<Popover id="add-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}> <Popover id="add-popover" className="popover__titled" closeByOutsideClick={false} onPopoverClosed={() => this.props.onclosed()}>
<AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels} /> <AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels} />
</Popover> : </Popover> :
<Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}> <Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}>

View file

@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
const PageApplicationSettings = props => { const PageApplicationSettings = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t("Settings", { returnObjects: true }); const _t = t("Settings", { returnObjects: true });
const displayMode = props.storeReview.displayMode;
const store = props.storeApplicationSettings; const store = props.storeApplicationSettings;
const unitMeasurement = store.unitMeasurement; const unitMeasurement = store.unitMeasurement;
const isSpellChecking = store.isSpellChecking; const isSpellChecking = store.isSpellChecking;
@ -49,7 +50,7 @@ const PageApplicationSettings = props => {
</ListItem> </ListItem>
</List> </List>
<List> <List>
<ListItem title={_t.textNoCharacters}>{/*ToDo: if (DisplayMode == "final" || DisplayMode == "original") {disabled} */} <ListItem title={_t.textNoCharacters} disabled={displayMode !== 'markup'}>{/*ToDo: if (DisplayMode == "final" || DisplayMode == "original") {disabled} */}
<Toggle checked={isNonprintingCharacters} <Toggle checked={isNonprintingCharacters}
onChange={() => { onChange={() => {
store.changeNoCharacters(!isNonprintingCharacters); store.changeNoCharacters(!isNonprintingCharacters);
@ -57,7 +58,7 @@ const PageApplicationSettings = props => {
}} }}
/> />
</ListItem> </ListItem>
<ListItem title={_t.textHiddenTableBorders}>{/*ToDo: if (DisplayMode == "final" || DisplayMode == "original") {disabled} */} <ListItem title={_t.textHiddenTableBorders} disabled={displayMode !== 'markup'}>{/*ToDo: if (DisplayMode == "final" || DisplayMode == "original") {disabled} */}
<Toggle checked={isHiddenTableBorders} <Toggle checked={isHiddenTableBorders}
onChange={() => { onChange={() => {
store.changeShowTableEmptyLine(!isHiddenTableBorders); store.changeShowTableEmptyLine(!isHiddenTableBorders);
@ -124,7 +125,7 @@ const PageMacrosSettings = props => {
); );
}; };
const ApplicationSettings = inject("storeApplicationSettings", "storeAppOptions")(observer(PageApplicationSettings)); const ApplicationSettings = inject("storeApplicationSettings", "storeAppOptions", "storeReview")(observer(PageApplicationSettings));
const MacrosSettings = inject("storeApplicationSettings")(observer(PageMacrosSettings)); const MacrosSettings = inject("storeApplicationSettings")(observer(PageMacrosSettings));
export {ApplicationSettings, MacrosSettings}; export {ApplicationSettings, MacrosSettings};

View file

@ -57,9 +57,11 @@ const routes = [
]; ];
const SettingsList = inject("storeAppOptions")(observer(props => { const SettingsList = inject("storeAppOptions", "storeReview")(observer(props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Settings', {returnObjects: true}); const _t = t('Settings', {returnObjects: true});
const storeReview = props.storeReview;
const displayMode = storeReview.displayMode;
const navbar = <Navbar title={_t.textSettings}> const navbar = <Navbar title={_t.textSettings}>
{!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>} {!props.inPopover && <NavRight><Link popupClose=".settings-popup">{_t.textDone}</Link></NavRight>}
</Navbar>; </Navbar>;
@ -139,7 +141,8 @@ const SettingsList = inject("storeAppOptions")(observer(props => {
</ListItem> </ListItem>
} }
{_isEdit && {_isEdit &&
<ListItem link="#" title={_t.textDocumentSettings} onClick={onoptionclick.bind(this, '/document-settings/')}> <ListItem link="#" title={_t.textDocumentSettings} disabled={displayMode !== 'markup'}
onClick={onoptionclick.bind(this, '/document-settings/')}>
<Icon slot="media" icon="icon-doc-setup"></Icon> <Icon slot="media" icon="icon-doc-setup"></Icon>
</ListItem> </ListItem>
} }

View file

@ -327,7 +327,7 @@
"textNoTextFound": "Текст не найден", "textNoTextFound": "Текст не найден",
"textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"", "textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"",
"textNumbers": "Нумерация", "textNumbers": "Нумерация",
"textOpacity": "Прозрачность", "textOpacity": "Непрозрачность",
"textOptions": "Параметры", "textOptions": "Параметры",
"textPictureFromLibrary": "Рисунок из библиотеки", "textPictureFromLibrary": "Рисунок из библиотеки",
"textPictureFromURL": "Рисунок по URL", "textPictureFromURL": "Рисунок по URL",

View file

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

View file

@ -141,7 +141,7 @@ class AddView extends Component {
const show_popover = this.props.usePopover; const show_popover = this.props.usePopover;
return ( return (
show_popover ? show_popover ?
<Popover id="add-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}> <Popover id="add-popover" className="popover__titled" closeByOutsideClick={false} onPopoverClosed={() => this.props.onclosed()}>
<AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels} /> <AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels} />
</Popover> : </Popover> :
<Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}> <Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}>

View file

@ -453,7 +453,7 @@
"textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"", "textNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"",
"textNumber": "Числовой", "textNumber": "Числовой",
"textOnTickMarks": "Деления", "textOnTickMarks": "Деления",
"textOpacity": "Прозрачность", "textOpacity": "Непрозрачность",
"textOut": "Снаружи", "textOut": "Снаружи",
"textOuterTop": "Снаружи сверху", "textOuterTop": "Снаружи сверху",
"textOutsideBorders": "Внешние границы", "textOutsideBorders": "Внешние границы",

View file

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

View file

@ -161,7 +161,7 @@ class AddView extends Component {
const show_popover = this.props.usePopover; const show_popover = this.props.usePopover;
return ( return (
show_popover ? show_popover ?
<Popover id="add-popover" className="popover__titled" onPopoverClosed={() => this.props.onclosed()}> <Popover id="add-popover" className="popover__titled" closeByOutsideClick={false} onPopoverClosed={() => this.props.onclosed()}>
<AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels}/> <AddTabs inPopover={true} onOptionClick={this.onoptionclick} style={{height: '410px'}} showPanels={this.props.showPanels}/>
</Popover> : </Popover> :
<Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}> <Popup className="add-popup" onPopupClosed={() => this.props.onclosed()}>