[all] Add c_oAscError.ID.ForcedViewMode error; For bug 76155

This commit is contained in:
Sergey Konovalov
2025-08-21 14:18:49 +03:00
parent 60f1d1f6a1
commit c79988faf6
4 changed files with 12 additions and 4 deletions

View File

@ -1927,7 +1927,8 @@
};
this.CoAuthoringApi.onWarning = function(code)
{
t.sendEvent('asc_onError', code || c_oAscError.ID.Warning, c_oAscError.Level.NoCritical);
const error = undefined !== code ? AscCommon.mapAscServerErrorToAscError(code) : c_oAscError.ID.Warning;
t.sendEvent('asc_onError', error, c_oAscError.Level.NoCritical);
};
this.CoAuthoringApi.onMeta = function(data)
{

View File

@ -1102,7 +1102,7 @@
} else if (code === c_oAscServerCommandErrors.NotModified) {
this.onForceSave({type: c_oAscForceSaveTypes.Button, refuse: true});
} else {
this.onWarning(Asc.c_oAscError.ID.Unknown);
this.onWarning(AscCommon.c_oAscServerError.Unknown);
}
};
DocsCoApi.prototype._onForceSave = function(data) {
@ -1512,7 +1512,7 @@
};
DocsCoApi.prototype._onWarning = function(data) {
this.onWarning(Asc.c_oAscError.ID.Warning);
this.onWarning(data.code);
};
DocsCoApi.prototype._onLicense = function(data) {

View File

@ -1119,6 +1119,9 @@
case c_oAscServerError.ChangeDocInfo :
nRes = Asc.c_oAscError.ID.AccessDeny;
break;
case c_oAscServerError.ForcedViewMode :
nRes = Asc.c_oAscError.ID.ForcedViewMode;
break;
case c_oAscServerError.Storage :
case c_oAscServerError.StorageFileNoFound :
case c_oAscServerError.StorageRead :
@ -1716,7 +1719,9 @@
VKeyKeyExpire: -122,
VKeyUserCountExceed: -123,
Password: -180
Password: -180,
ForcedViewMode: -200
};
//todo get from server config
@ -15444,6 +15449,7 @@
window["AscCommon"].openFileCommand = openFileCommand;
window["AscCommon"].sendCommand = sendCommand;
window["AscCommon"].sendSaveFile = sendSaveFile;
window["AscCommon"].c_oAscServerError = c_oAscServerError;
window["AscCommon"].mapAscServerErrorToAscError = mapAscServerErrorToAscError;
window["AscCommon"].joinUrls = joinUrls;
window["AscCommon"].getFullImageSrc2 = getFullImageSrc2;

View File

@ -136,6 +136,7 @@
UserDrop : -100,
Warning : -101,
UpdateVersion : -102,
ForcedViewMode : -103,
PrintMaxPagesCount : -110,