Web: Editor: Added conditions for creating a file in my documents folder when filling out a form.
This commit is contained in:
parent
981dede88a
commit
2eb6843e46
@ -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 },
|
||||
});
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user