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`,
|
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,
|
markAsFavorite,
|
||||||
getPresignedUri,
|
getPresignedUri,
|
||||||
convertFile,
|
convertFile,
|
||||||
|
checkFillFormDraft,
|
||||||
} from "@appserver/common/api/files";
|
} from "@appserver/common/api/files";
|
||||||
import FilesFilter from "@appserver/common/api/files/filter";
|
import FilesFilter from "@appserver/common/api/files/filter";
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ let successAuth;
|
|||||||
let isSharingAccess;
|
let isSharingAccess;
|
||||||
let user = null;
|
let user = null;
|
||||||
let personal;
|
let personal;
|
||||||
const url = window.location.href;
|
let url = window.location.href;
|
||||||
const filesUrl = url.substring(0, url.indexOf("/doceditor"));
|
const filesUrl = url.substring(0, url.indexOf("/doceditor"));
|
||||||
|
|
||||||
toast.configure();
|
toast.configure();
|
||||||
@ -288,6 +289,22 @@ const Editor = () => {
|
|||||||
|
|
||||||
const config = await openEdit(fileId, version, doc, view);
|
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;
|
actionLink = config?.editorConfig?.actionLink;
|
||||||
|
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
|
Loading…
Reference in New Issue
Block a user