Merge pull request #1522 from ONLYOFFICE/feature/fix-bug-reactjs

Feature/fix bug reactjs
This commit is contained in:
maxkadushkin 2022-01-31 16:29:58 +03:00 committed by GitHub
commit 0155bb4fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 28 deletions

View file

@ -29,6 +29,8 @@
--f7-range-knob-color: @brandColor;
--f7-range-knob-size: 16px;
--f7-list-item-after-text-color: @text-normal;
--f7-link-highlight-color: transparent;
--f7-link-touch-ripple-color: @touchColor;

View file

@ -50,11 +50,6 @@ const PageApplicationSettings = props => {
}}
/>
</ListItem>
<ListItem title={'Dark theme'}>
<Toggle checked={isThemeDark}
onToggleChange={toggle => {Themes.switchDarkTheme(!toggle), setIsThemeDark(!toggle)}}>
</Toggle>
</ListItem>
</List>
<List>
<ListItem title={_t.textNoCharacters} disabled={displayMode !== 'markup'}>{/*ToDo: if (DisplayMode == "final" || DisplayMode == "original") {disabled} */}
@ -95,6 +90,15 @@ const PageApplicationSettings = props => {
/>
</ListItem>
</List>
<List>
<ListItem title={'Dark theme'}>
<Toggle checked={isThemeDark}
onToggleChange={toggle => {Themes.switchDarkTheme(!toggle), setIsThemeDark(!toggle)}}>
</Toggle>
</ListItem>
</List>
{_isShowMacros &&
<List mediaList>
<ListItem title={_t.textMacrosSettings} link="/macros-settings/" routeProps={{

View file

@ -214,7 +214,7 @@ class ContextMenu extends ContextMenuController {
if (isEdit && EditorUIController.ContextMenu) {
return EditorUIController.ContextMenu.mapMenuItems(this);
} else {
const {canViewComments, canCoAuthoring, canComments } = this.props;
const {canViewComments} = this.props;
const api = Common.EditorApi.get();
const cellinfo = api.asc_getCellInfo();
@ -238,32 +238,25 @@ class ContextMenu extends ContextMenuController {
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
}
itemsIcon.push({
event: 'copy',
icon: 'icon-copy'
});
if (iscellmenu && cellinfo.asc_getHyperlink()) {
itemsText.push({
caption: _t.menuOpenLink,
event: 'openlink'
itemsIcon.push({
event: 'copy',
icon: 'icon-copy'
});
}
if(!isDisconnected) {
if (canViewComments && hasComments && hasComments.length>0) {
itemsText.push({
caption: _t.menuViewComment,
event: 'viewcomment'
});
}
if (iscellmenu && !api.isCellEdited && canCoAuthoring && canComments && hasComments && hasComments.length<1) {
if (iscellmenu && cellinfo.asc_getHyperlink()) {
itemsText.push({
caption: _t.menuAddComment,
event: 'addcomment'
caption: _t.menuOpenLink,
event: 'openlink'
});
}
}
if(!isDisconnected) {
if (canViewComments && hasComments && hasComments.length>0) {
itemsText.push({
caption: _t.menuViewComment,
event: 'viewcomment'
});
}
}
return itemsIcon.concat(itemsText);
}

View file

@ -61,6 +61,8 @@
//font-size: 17px;
text-align: center;
color: @text-normal;
&[disabled] {
color: @gray-darker;
opacity: 0.5;

View file

@ -90,7 +90,7 @@ export class storeAppOptions {
this.canEdit = permissions.edit !== false && // can edit or review
(this.config.canRequestEditRights || this.config.mode !== 'view') && isSupportEditFeature; // if mode=="view" -> canRequestEditRights must be defined
// (!this.isReviewOnly || this.canLicense) && // if isReviewOnly==true -> canLicense must be true
this.isEdit = (this.canLicense || this.isEditDiagram || this.isEditMailMerge) && permissions.edit !== false && this.config.mode !== 'view' && true;
this.isEdit = (this.canLicense || this.isEditDiagram || this.isEditMailMerge) && permissions.edit !== false && this.config.mode !== 'view' && isSupportEditFeature;
this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view');
this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false);
this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false);