From 2a55c0378815f2ef357e8e6bcc3acf53cd983704 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Tue, 21 Nov 2023 13:36:42 +0530 Subject: [PATCH 1/2] fix no data found on signers login page --- .../SignDocuments/src/Component/PdfRequestFiles.js | 2 +- .../SignDocuments/src/Component/placeHolderSign.js | 2 +- microfrontends/SignDocuments/src/utils/Utils.js | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js index 9adca6778..bfcfd7cb3 100644 --- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js +++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js @@ -1033,7 +1033,7 @@ function PdfRequestFiles() {

- This document has been signed by all Sigers. + This document has been signed by all Signers.

diff --git a/microfrontends/SignDocuments/src/Component/placeHolderSign.js b/microfrontends/SignDocuments/src/Component/placeHolderSign.js index a9464269a..c7161193b 100644 --- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js +++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js @@ -231,7 +231,7 @@ function PlaceHolderSign() { setHandleError("Error: Something went wrong!"); setIsLoading(loadObj); } else if (res.length === 0) { - const res = await contactBook(jsonSender.objectId); + const res = await contactBook(jsonSender.objectId, true); if (res[0] && res.length) { setSignerUserId(res[0].objectId); const tourstatus = res[0].TourStatus && res[0].TourStatus; diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js index 9274d9235..9aaeb777a 100644 --- a/microfrontends/SignDocuments/src/utils/Utils.js +++ b/microfrontends/SignDocuments/src/utils/Utils.js @@ -274,12 +274,15 @@ export const contractUsers = async (email) => { }; //function for getting contracts_contactbook details -export const contactBook = async (objectId) => { +export const contactBook = async (objectId, isUser) => { + const condition = isUser + ? `{"UserId": {"__type": "Pointer","className": "_User", "objectId":"${objectId}"}}` + : `{"objectId":"${objectId}"}`; const result = await axios .get( `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( "_appName" - )}_Contactbook?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${objectId}"}}`, + )}_Contactbook?where=${condition}`, { headers: { "Content-Type": "application/json", From f7bd439df51d32066e41bd81840a1f019f639c85 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Tue, 21 Nov 2023 14:14:01 +0530 Subject: [PATCH 2/2] remove contracts_contactbook class query from placeholderSign.js --- .../src/Component/placeHolderSign.js | 24 +++++-------------- .../SignDocuments/src/utils/Utils.js | 7 ++---- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/microfrontends/SignDocuments/src/Component/placeHolderSign.js b/microfrontends/SignDocuments/src/Component/placeHolderSign.js index c7161193b..298ee3633 100644 --- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js +++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js @@ -231,24 +231,12 @@ function PlaceHolderSign() { setHandleError("Error: Something went wrong!"); setIsLoading(loadObj); } else if (res.length === 0) { - const res = await contactBook(jsonSender.objectId, true); - if (res[0] && res.length) { - setSignerUserId(res[0].objectId); - const tourstatus = res[0].TourStatus && res[0].TourStatus; - if (tourstatus && tourstatus.length > 0) { - setTourStatus(tourstatus); - const checkTourRecipients = tourstatus.filter( - (data) => data.placeholder - ); - if (checkTourRecipients && checkTourRecipients.length > 0) { - setCheckTourStatus(checkTourRecipients[0].placeholder); - } - } - const loadObj = { - isLoad: false - }; - setIsLoading(loadObj); - } + setNoData(true); + + const loadObj = { + isLoad: false + }; + setIsLoading(loadObj); } }; diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js index 9aaeb777a..ecf6d0359 100644 --- a/microfrontends/SignDocuments/src/utils/Utils.js +++ b/microfrontends/SignDocuments/src/utils/Utils.js @@ -274,15 +274,12 @@ export const contractUsers = async (email) => { }; //function for getting contracts_contactbook details -export const contactBook = async (objectId, isUser) => { - const condition = isUser - ? `{"UserId": {"__type": "Pointer","className": "_User", "objectId":"${objectId}"}}` - : `{"objectId":"${objectId}"}`; +export const contactBook = async (objectId) => { const result = await axios .get( `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem( "_appName" - )}_Contactbook?where=${condition}`, + )}_Contactbook?where={"objectId":"${objectId}"}`, { headers: { "Content-Type": "application/json",