Web: Editor: Added conditions for creating a file in my documents folder when filling out a form.

This commit is contained in:
Tatiana Lopaeva 2021-11-19 10:28:57 +03:00
parent 981dede88a
commit 2eb6843e46
2 changed files with 26 additions and 1 deletions

View File

@ -783,3 +783,11 @@ export function getPresignedUri(fileId) {
url: `files/file/${fileId}/presigned`,
});
}
export function checkFillFormDraft(fileId) {
return request({
method: "post",
url: `files/masterform/${fileId}/checkfillformdraft`,
data: { fileId },
});
}

View File

@ -27,6 +27,7 @@ import {
markAsFavorite,
getPresignedUri,
convertFile,
checkFillFormDraft,
} from "@appserver/common/api/files";
import FilesFilter from "@appserver/common/api/files/filter";
@ -67,7 +68,7 @@ let successAuth;
let isSharingAccess;
let user = null;
let personal;
const url = window.location.href;
let url = window.location.href;
const filesUrl = url.substring(0, url.indexOf("/doceditor"));
toast.configure();
@ -288,6 +289,22 @@ const Editor = () => {
const config = await openEdit(fileId, version, doc, view);
if (
!view &&
fileInfo &&
fileInfo.canWebRestrictedEditing &&
fileInfo.canFillForms &&
!fileInfo.canEdit
) {
try {
const formUrl = await checkFillFormDraft(fileId);
history.pushState({}, null, formUrl);
url = window.location.href;
} catch (err) {
console.error(err);
}
}
actionLink = config?.editorConfig?.actionLink;
if (isDesktop) {