Skip to content

Commit 9a3b70d

Browse files
fix: expired document redirect wrong route in opensign-drive
1 parent 742b8f7 commit 9a3b70d

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

microfrontends/SignDocuments/src/Component/DraftDocument.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ function DraftDocument() {
6161
isExpire = true;
6262
}
6363
//checking if document has completed
64+
//checking if document has completed
6465
if (data?.IsCompleted && signerExist?.length > 0) {
6566
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
67+
68+
// window.location.hash = `/pdfRequestFiles/${data.objectId}`;
6669
} else if (data?.IsCompleted && signerExist?.length === 0) {
6770
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
6871
}
@@ -71,22 +74,30 @@ function DraftDocument() {
7174
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
7275
//checking draft type document
7376
} else if (
74-
isExpire &&
75-
signerExist?.length === 0 &&
76-
isPlaceholder?.length === 0 &&
77+
(isExpire || !isExpire) &&
78+
!signerExist &&
79+
!isPlaceholder &&
7780
!signUrl
7881
) {
7982
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
8083
} else if (
8184
(isExpire || !isExpire) &&
82-
isPlaceholder?.length > 0 &&
85+
isPlaceholder &&
8386
signerExist?.length > 0
8487
) {
8588
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
86-
} else if (signerExist?.length > 0 && isPlaceholder?.length === 0) {
89+
} else if (
90+
(isExpire || !isExpire) &&
91+
signerExist?.length > 0 &&
92+
!isPlaceholder
93+
) {
8794
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
8895
//checking draft type document
89-
} else if (signerExist?.length === 0 && isPlaceholder?.length > 0) {
96+
} else if (
97+
(isExpire || !isExpire) &&
98+
signerExist?.length === 0 &&
99+
isPlaceholder
100+
) {
90101
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
91102
}
92103
//checking document is draft and signyourself type then user can sign document

microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ function PdfFileComponent({
118118
const signUrl = data.SignedUrl && data.SignedUrl;
119119
const isDecline = data.IsDeclined && data.IsDeclined;
120120
const isPlaceholder = data.Placeholders && data.Placeholders;
121-
122121
let isExpire = false;
123122
if (currDate > expireUpdateDate) {
124123
isExpire = true;
125124
}
125+
126126
//checking if document has completed
127127
if (data?.IsCompleted && signerExist?.length > 0) {
128128
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
@@ -136,22 +136,30 @@ function PdfFileComponent({
136136
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
137137
//checking draft type document
138138
} else if (
139-
isExpire &&
140-
signerExist?.length === 0 &&
141-
isPlaceholder?.length === 0 &&
139+
(isExpire || !isExpire) &&
140+
!signerExist &&
141+
!isPlaceholder &&
142142
!signUrl
143143
) {
144144
navigate(`${hostUrl}signaturePdf/${data.objectId}`);
145145
} else if (
146146
(isExpire || !isExpire) &&
147-
isPlaceholder?.length > 0 &&
147+
isPlaceholder &&
148148
signerExist?.length > 0
149149
) {
150150
navigate(`${hostUrl}pdfRequestFiles/${data.objectId}`);
151-
} else if (signerExist?.length > 0 && isPlaceholder?.length === 0) {
151+
} else if (
152+
(isExpire || !isExpire) &&
153+
signerExist?.length > 0 &&
154+
!isPlaceholder
155+
) {
152156
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
153157
//checking draft type document
154-
} else if (signerExist?.length === 0 && isPlaceholder?.length > 0) {
158+
} else if (
159+
(isExpire || !isExpire) &&
160+
signerExist?.length === 0 &&
161+
isPlaceholder
162+
) {
155163
navigate(`${hostUrl}placeHolderSign/${data.objectId}`);
156164
}
157165
//checking document is draft and signyourself type then user can sign document

0 commit comments

Comments
 (0)