Merge pull request #1705 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2022-04-18 20:45:55 +03:00 committed by GitHub
commit 95234dd34b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 29 deletions

View file

@ -1527,7 +1527,7 @@ define([
Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this));
Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this));
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.loadCoAuthSettings();
this.applyModeCommonElements();

View file

@ -80,8 +80,8 @@ class MainController extends Component {
};
const loadConfig = data => {
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
EditorUIController.isSupportEditFeature();
this.editorConfig = Object.assign({}, this.editorConfig, data.config);
@ -177,13 +177,15 @@ class MainController extends Component {
const onEditorPermissions = params => {
const licType = params.asc_getLicenseType();
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
// check licType
if (Asc.c_oLicenseResult.Expired === licType ||
Asc.c_oLicenseResult.Error === licType ||
Asc.c_oLicenseResult.ExpiredTrial === licType) {
f7.dialog.create({
title : this._t.titleLicenseExp,
text : this._t.warnLicenseExp
title : _t.titleLicenseExp,
text : _t.warnLicenseExp
}).open();
return;
}
@ -403,7 +405,9 @@ class MainController extends Component {
this.api.asc_continueSaving();
}, 500);
return this._t.leavePageText;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
return _t.leavePageText;
}
}
@ -520,7 +524,8 @@ class MainController extends Component {
onServerVersion (buildVersion) {
if (this.changeServerVersion) return true;
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
this.changeServerVersion = true;
@ -791,7 +796,9 @@ class MainController extends Component {
this.api.asc_OnSaveEnd(data.result);
if (data && data.result === false) {
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.errorProcessSaveResult : data.message,
_t.criticalErrorTitle
@ -808,7 +815,9 @@ class MainController extends Component {
Common.Notifications.trigger('api:disconnect');
if (!old_rights) {
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.warnProcessRightsChange : data.message,
_t.notcriticalErrorTitle,
@ -821,7 +830,9 @@ class MainController extends Component {
onDownloadAs () {
const appOptions = this.props.storeAppOptions;
if ( !appOptions.canDownload && !appOptions.canDownloadOrigin) {
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this._t.errorAccessDeny);
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, _t.errorAccessDeny);
return;
}
@ -848,7 +859,8 @@ class MainController extends Component {
}
onUpdateVersion (callback) {
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
this.needToUpdateVersion = true;
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
@ -940,7 +952,8 @@ class MainController extends Component {
if (value === 1) {
this.api.asc_runAutostartMacroses();
} else if (value === 0) {
const _t = this._t;
const { t } = this.props;
const _t = t('Main', {returnObjects:true});
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: _t.textHasMacros,

View file

@ -1179,7 +1179,7 @@ define([
this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout);
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
this.loadCoAuthSettings();
this.applyModeCommonElements();

View file

@ -73,7 +73,8 @@ class MainController extends Component {
};
const loadConfig = data => {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
EditorUIController.isSupportEditFeature();
@ -284,7 +285,9 @@ class MainController extends Component {
this.api.asc_continueSaving();
}, 500);
return this._t.leavePageText;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
return _t.leavePageText;
}
}
@ -592,7 +595,8 @@ class MainController extends Component {
}
onUpdateVersion (callback) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
this.needToUpdateVersion = true;
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
@ -611,7 +615,8 @@ class MainController extends Component {
onServerVersion (buildVersion) {
if (this.changeServerVersion) return true;
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
if (About.appVersion() !== buildVersion && !window.compareVersions) {
this.changeServerVersion = true;
@ -759,7 +764,8 @@ class MainController extends Component {
if (value === 1) {
this.api.asc_runAutostartMacroses();
} else if (value === 0) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: _t.textHasMacros,
@ -801,7 +807,8 @@ class MainController extends Component {
this.api.asc_OnSaveEnd(data.result);
if (data && data.result === false) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.errorProcessSaveResult : data.message,
_t.criticalErrorTitle
@ -818,7 +825,8 @@ class MainController extends Component {
Common.Notifications.trigger('api:disconnect');
if (!old_rights) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.warnProcessRightsChange : data.message,
_t.notcriticalErrorTitle,

View file

@ -1276,7 +1276,7 @@ define([
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.appOptions.canCoAuthoring &&
!(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge) {
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);

View file

@ -91,7 +91,8 @@ class MainController extends Component {
};
const loadConfig = data => {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
EditorUIController.isSupportEditFeature();
@ -735,7 +736,8 @@ class MainController extends Component {
if (value === 1) {
this.api.asc_runAutostartMacroses();
} else if (value === 0) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.create({
title: _t.notcriticalErrorTitle,
text: _t.textHasMacros,
@ -782,7 +784,8 @@ class MainController extends Component {
}
onBeforeUnload () {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
LocalStorage.save();
@ -804,7 +807,8 @@ class MainController extends Component {
}
onUpdateVersion (callback) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
this.needToUpdateVersion = true;
Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument);
@ -823,7 +827,8 @@ class MainController extends Component {
onServerVersion (buildVersion) {
if (this.changeServerVersion) return true;
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
if (About.appVersion() !== buildVersion && !About.compareVersions()) {
this.changeServerVersion = true;
@ -909,7 +914,8 @@ class MainController extends Component {
this.api.asc_OnSaveEnd(data.result);
if (data && data.result === false) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.errorProcessSaveResult : data.message,
_t.criticalErrorTitle
@ -926,7 +932,8 @@ class MainController extends Component {
Common.Notifications.trigger('api:disconnect');
if (!old_rights) {
const _t = this._t;
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
f7.dialog.alert(
(!data.message) ? _t.warnProcessRightsChange : data.message,
_t.notcriticalErrorTitle,
@ -938,7 +945,9 @@ class MainController extends Component {
onDownloadAs () {
if ( this.props.storeAppOptions.canDownload) {
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this._t.errorAccessDeny);
const { t } = this.props;
const _t = t('Controller.Main', {returnObjects:true});
Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, _t.errorAccessDeny);
return;
}
this._state.isFromGatewayDownloadAs = true;