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

Feature/fix bugs
This commit is contained in:
Julia Radzhabova
2023-07-13 13:46:29 +03:00
committed by GitHub
6 changed files with 18 additions and 12 deletions

View File

@ -17,13 +17,17 @@ class InitReview extends Component {
Common.Notifications.on('document:ready', () => {
const api = Common.EditorApi.get();
const appOptions = props.storeAppOptions;
const isProtected = appOptions.isProtected;
let trackChanges = appOptions.customization && appOptions.customization.review ? appOptions.customization.review.trackChanges : undefined;
(trackChanges===undefined) && (trackChanges = appOptions.customization ? appOptions.customization.trackChanges : undefined);
trackChanges = appOptions.isReviewOnly || trackChanges === true || trackChanges !== false
&& LocalStorage.getBool("de-mobile-track-changes-" + (appOptions.fileKey || ''));
api.asc_SetTrackRevisions(trackChanges);
if(!isProtected) {
api.asc_SetTrackRevisions(trackChanges);
}
// Init display mode
const canViewReview = appOptions.canReview || appOptions.isEdit || api.asc_HaveRevisionsChanges(true);

View File

@ -795,7 +795,7 @@ class MainController extends Component {
const { t } = this.props;
const storeAppOptions = this.props.storeAppOptions;
const props = this.getDocProps(true);
const isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly);
const isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly || props.isTrackedChanges);
let textWarningDialog;
if(!storeAppOptions.isReviewOnly) {
@ -853,7 +853,8 @@ class MainController extends Component {
storeAppOptions.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
storeAppOptions.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
} else {
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None);
// this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None);
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.View);
}
}
};
@ -872,7 +873,8 @@ class MainController extends Component {
isReadOnly: type === Asc.c_oAscEDocProtect.ReadOnly,
isCommentsOnly: type === Asc.c_oAscEDocProtect.Comments,
isReviewOnly: type === Asc.c_oAscEDocProtect.TrackedChanges,
isFormsOnly: type === Asc.c_oAscEDocProtect.Forms
isFormsOnly: type === Asc.c_oAscEDocProtect.Forms,
isTrackedChanges: type === Asc.c_oAscEDocProtect.TrackedChanges
};
}

View File

@ -191,7 +191,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
f7.popover.close('.document-menu.modal-in', false);
appOptions.changeViewerMode();
appOptions.changeViewerMode(true);
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
}

View File

@ -27,9 +27,10 @@ class ProtectionDocumentController extends React.Component {
appOptions.setProtection(true);
appOptions.setTypeProtection(typeProtection);
if(typeProtection !== Asc.c_oAscEDocProtect.TrackedChanges && !isViewer) {
appOptions.changeViewerMode();
}
// if(typeProtection !== Asc.c_oAscEDocProtect.TrackedChanges && !isViewer) {
appOptions.changeViewerMode(true);
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
// }
protection.asc_setEditType(typeProtection);
protection.asc_setPassword(password);

View File

@ -116,7 +116,7 @@ class MainPage extends Component {
f7.popover.close('.document-menu.modal-in', false);
f7.navbar.show('.main-navbar', false);
appOptions.changeViewerMode();
appOptions.changeViewerMode(false);
api.asc_removeRestriction(Asc.c_oAscRestrictionType.View)
api.asc_addRestriction(Asc.c_oAscRestrictionType.None);
};

View File

@ -64,10 +64,9 @@ export class storeAppOptions {
this.isMobileView = !this.isMobileView;
}
isViewer = true;
changeViewerMode() {
this.isViewer = !this.isViewer;
changeViewerMode(value) {
this.isViewer = value;
}
canViewComments = false;