Skip to content

🔥 The free & Open Source DocuSign alternative

fix: expired document redirect wrong route in opensign-drive

RaktimaNXG9a3b70de43b0
diff --git a/microfrontends/SignDocuments/src/Component/DraftDocument.js b/microfrontends/SignDocuments/src/Component/DraftDocument.js
index 570271efa..6e292296a 100644
--- a/microfrontends/SignDocuments/src/Component/DraftDocument.js
+++ b/microfrontends/SignDocuments/src/Component/DraftDocument.js
@@ -61,8 +61,11 @@ function DraftDocument() {
isExpire = true;
}
//checking if document has completed
+ //checking if document has completed
if (data?.IsCompleted && signerExist?.length > 0) {
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
+
+ // window.location.hash = `/pdfRequestFiles/${data.objectId}`;
} else if (data?.IsCompleted && signerExist?.length === 0) {
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
}
@@ -71,22 +74,30 @@ function DraftDocument() {
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
//checking draft type document
} else if (
- isExpire &&
- signerExist?.length === 0 &&
- isPlaceholder?.length === 0 &&
+ (isExpire || !isExpire) &&
+ !signerExist &&
+ !isPlaceholder &&
!signUrl
) {
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
} else if (
(isExpire || !isExpire) &&
- isPlaceholder?.length > 0 &&
+ isPlaceholder &&
signerExist?.length > 0
) {
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
- } else if (signerExist?.length > 0 && isPlaceholder?.length === 0) {
+ } else if (
+ (isExpire || !isExpire) &&
+ signerExist?.length > 0 &&
+ !isPlaceholder
+ ) {
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
//checking draft type document
- } else if (signerExist?.length === 0 && isPlaceholder?.length > 0) {
+ } else if (
+ (isExpire || !isExpire) &&
+ signerExist?.length === 0 &&
+ isPlaceholder
+ ) {
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
}
//checking document is draft and signyourself type then user can sign document
diff --git a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
index 31076af3c..9c69c80c1 100644
--- a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
+++ b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
@@ -118,11 +118,11 @@ function PdfFileComponent({
const signUrl = data.SignedUrl && data.SignedUrl;
const isDecline = data.IsDeclined && data.IsDeclined;
const isPlaceholder = data.Placeholders && data.Placeholders;
-
let isExpire = false;
if (currDate > expireUpdateDate) {
isExpire = true;
}
+
//checking if document has completed
if (data?.IsCompleted && signerExist?.length > 0) {
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
@@ -136,22 +136,30 @@ function PdfFileComponent({
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
//checking draft type document
} else if (
- isExpire &&
- signerExist?.length === 0 &&
- isPlaceholder?.length === 0 &&
+ (isExpire || !isExpire) &&
+ !signerExist &&
+ !isPlaceholder &&
!signUrl
) {
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
} else if (
(isExpire || !isExpire) &&
- isPlaceholder?.length > 0 &&
+ isPlaceholder &&
signerExist?.length > 0
) {
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
- } else if (signerExist?.length > 0 && isPlaceholder?.length === 0) {
+ } else if (
+ (isExpire || !isExpire) &&
+ signerExist?.length > 0 &&
+ !isPlaceholder
+ ) {
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
//checking draft type document
- } else if (signerExist?.length === 0 && isPlaceholder?.length > 0) {
+ } else if (
+ (isExpire || !isExpire) &&
+ signerExist?.length === 0 &&
+ isPlaceholder
+ ) {
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
}
//checking document is draft and signyourself type then user can sign document