From 356d2e81c5af9f5e12b7599e905f1e412a81cfcb Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Sun, 5 Nov 2023 19:09:15 +0530 Subject: [PATCH 01/18] Update Document & Self Signed Cert added --- .env.local_dev | 58 ++++++++++++++++++++++++++++++++++++-- .gitignore | 2 ++ INSTALLATION.md | 43 +++++++++++++++++++++++++++- cert/local-dev_base64_pfx | 55 ++++++++++++++++++++++++++++++++++++ cert/local_dev.crt | 21 ++++++++++++++ cert/local_dev.key | 30 ++++++++++++++++++++ cert/local_dev.pfx | Bin 0 -> 2611 bytes 7 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 cert/local-dev_base64_pfx create mode 100644 cert/local_dev.crt create mode 100644 cert/local_dev.key create mode 100644 cert/local_dev.pfx diff --git a/.env.local_dev b/.env.local_dev index 7d0a4a251..da4368e73 100644 --- a/.env.local_dev +++ b/.env.local_dev @@ -42,7 +42,7 @@ DO_SECRET_ACCESS_KEY= # Digital ocean spaces region or AWS s3 region DO_REGION=us-west # local storage -USE_LOCAL=TRUE +USE_LOCAL=FALSE # Email mailgun config (The app will not initialize if any of these 3 variables are not set) ********************************************************************************************************************* MAILGUN_API_KEY=XXXXX @@ -50,4 +50,58 @@ MAILGUN_DOMAIN=mail.yourdomain.com MAILGUN_SENDER=postmaster@mail.yourdomain.com # Base64 encoded PFX or p12 document signing certificate file ********************************************************************************************************************* -PFX_BASE64= +PFX_BASE64='MIIKLwIBAzCCCeUGCSqGSIb3DQEHAaCCCdYEggnSMIIJzjCCBEIGCSqGSIb3DQEH +BqCCBDMwggQvAgEAMIIEKAYJKoZIhvcNAQcBMFcGCSqGSIb3DQEFDTBKMCkGCSqG +SIb3DQEFDDAcBAh6cQqVpHfTzAICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQME +ASoEEFKEIGJTTRo3voO/FvsXs7yAggPAI7rMCboTFFBfdMuuV3Y9/xfphAgdGD7P +0xAN10CcmXlMtedc8cRxOaD9n3Q7zJx5iIbqEGD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AgIIAA==' \ No newline at end of file diff --git a/.gitignore b/.gitignore index cc964cb27..8e62b9ce7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +apps/OpenSign/public/mfbuild/* +microfrontends/SignDocuments/build/* \ No newline at end of file diff --git a/INSTALLATION.md b/INSTALLATION.md index e10a73caa..a489eb8fe 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -88,5 +88,46 @@ You can install all 3 components on digital ocean using the button below - ## Localhost(Docker) +For local Setup we need to need following prerequisite: + +Environment Varaibles: + +| Environment Varibale | Value | Description | +| ------------- | ------------- | ------------- | +| CI | false | Set CI to false while running the app locally | +| PUBLIC_URL | http://localhost:3000 | Set it to the URL form where the app home page will be accessed | +| GENERATE_SOURCEMAP | false | Set it to true if you want to generate the Sourcemap for debugging | +| REACT_APP_SERVERURL | http://localhost:8080/app | Set it to the URL from where APIs will be accessible, for local development it should be localhost:3000/api/app (use your local port number instead) | +| REACT_APP_APPID | http://localhost:3000 | Set it to the URL form where the app home page will be accessed | +| PUBLIC_URL | opensignstgn | A 12 character long random app identifier. The value of this should be same as APP_ID which is a variable used by backend API. | +| APP_ID | opensignstgn | A 12 character long random app identifier. The value of this should be same as REACT_APP_APPID which is a variable used by Frontend React App. | +| appName | open_sign_server | Name of the app. It will be visible in the verification emails sent out. | +| MASTER_KEY | XnAadwKxxByMr | A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database. | +| MONGODB_URI | mongodb://host.docker.internal:27017/OpenSignDB | Mongodb URI to connect to | +| PARSE_MOUNT |/app | Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions. | +| SERVER_URL | http://127.0.0.1:8080/app | Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead) | +| DO_SPACE | DOSPACENAME | Digital ocean space name or AWS S3 bucket name for uploading documents | +| DO_ENDPOINT | ams3.digitaloceanspaces.com | Digital ocean spaces endpoint or AWS S3 endpoint for uploading documents | +| DO_BASEURL |https://DOSPACENAME.ams3.digitaloceanspaces.com | Digital ocean baseurl or AWS S3 base URL | +| DO_ACCESS_KEY_ID | YOUR_S3_ACCESS_ID | Digital ocean spaces access key ID or AWS s3 Access key ID for uploading the docs | +| DO_SECRET_ACCESS_KEY | YOUR_S3_ACCESS_KEY | Digital ocean spaces secret access key or AWS s3 secret access key for uploading the docs | +| DO_REGION | YOUR_S3_REGION | Digital ocean spaces region or AWS s3 region | +| USE_LOCAL | FALSE | To use local file storage to save file | +| MAILGUN_API_KEY | YOUR_MAILGUNAPI_KEY | Mailgun API Key | +| MAILGUN_DOMAIN | YOUR_MAILGUNAPI_DOMAIN | Mailgun API Domain | +| MAILGUN_SENDER | - | Mailgun Sender Mail ID | +| PFX_BASE64 | - | Base64 encoded PFX or p12 document signing certificate file. You can generate base64 encoded self sign certificate using the passphrase `emudhra` | + +# Steps to Generate Self Sign Certificate +``` +# execute below command and use passphrase emudhra +openssl genrsa -des3 -out ./cert/local_dev.key 2048 +openssl req -key ./cert/local_dev.key -new -x509 -days 365 -out ./cert/local_dev.crt +openssl pkcs12 -inkey ./cert/local_dev.key -in ./cert/local_dev.crt -export -out ./cert/local_dev.pfx +openssl base64 -in ./cert/local_dev.pfx -out ./cert/base64_pfx +``` + +#Build Local Environment + Below are the steps to follow - -- Execute `make build` \ No newline at end of file +- Execute `make build` diff --git a/cert/local-dev_base64_pfx b/cert/local-dev_base64_pfx new file mode 100644 index 000000000..85e11a24d --- /dev/null +++ b/cert/local-dev_base64_pfx @@ -0,0 +1,55 @@ +MIIKLwIBAzCCCeUGCSqGSIb3DQEHAaCCCdYEggnSMIIJzjCCBEIGCSqGSIb3DQEH +BqCCBDMwggQvAgEAMIIEKAYJKoZIhvcNAQcBMFcGCSqGSIb3DQEFDTBKMCkGCSqG +SIb3DQEFDDAcBAh6cQqVpHfTzAICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQME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Sz7PlBO5VzTDqC/foidPWrMjkw +MEEwMTANBglghkgBZQMEAgEFAAQgPlLuG+67SxPOEPbgFuEnVgewvY6LUzFmrprx +c6yryFgECIld0S5kDk7JAgIIAA== diff --git a/cert/local_dev.crt b/cert/local_dev.crt new file mode 100644 index 000000000..b04e8924b --- /dev/null +++ b/cert/local_dev.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIUdpdDPiNqilWn26oMvcpT9qmMtoswDQYJKoZIhvcNAQEL +BQAwPjELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAk5JMQowCAYDVQQHDAFOMQowCAYD +VQQKDAFTMQowCAYDVQQLDAFTMB4XDTIzMTEwNTEzMDg1OFoXDTI0MTEwNDEzMDg1 +OFowPjELMAkGA1UEBhMCSU4xCzAJBgNVBAgMAk5JMQowCAYDVQQHDAFOMQowCAYD +VQQKDAFTMQowCAYDVQQLDAFTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAzT30t7Adb6XdXWywzC4RF03r3piTt5MF4MZClvorsl8bySNKrYkl7i5+igpz +36SfLp090Dal0cUZ7it9QCxaxrWv3m8OFAwfwK5ePuzUryF6/QJcoF560Sq4k3Pb +640PJ5UlFwvUqsXQN8A/pAA6S96MqpwCrPQE0u5OcRQuVIsZxBL2s17lv5eROjX+ +Ufx/6qtmuZscn9xKDP6GNO8aa6X0YZMoVXlll14iEn4bg0yagiY7QhvVCzK8q7nB +9yKCLvw/28eSoD08yJnHnUZnIOoNrn+cZKTkl8VcyKW55IeOiUilb5h3a07JD6bj +Q/VroPQE5UtveajB9CBa3eUCiwIDAQABo1MwUTAdBgNVHQ4EFgQUIQGrIwhvSNkG +L3ATZra96d4cDE4wHwYDVR0jBBgwFoAUIQGrIwhvSNkGL3ATZra96d4cDE4wDwYD +VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAp2mCfhRf6Jft6lSgL4hi +I8xHfqcUjG+XnDM1Pi7gKVxxclwVQ67vVtfO0rU1SBPWUO3nIaaLN9Wyzcx+LXPV +4e3pyHlq2T6Z6ENuozOsMhHeY9+ows6wPBcxq57KLLHnBpx3lJiKHKOp0ueiAbkz +LaI+Mm+VQo0MbzhCw7KXs8VPFt8YO+S3XircVMWaa007VgGY/NjYF62hlG35fD/v +CTHccRj5Y3coQ2MjosTUQTd4u3N5VhgxdRbyMdpjpwDxu0u9BE7ISXKMBhnBLV/w ++/mxoF2bqExBuPiZS8vT6yW9rehdi/KR9c26GUreTsKLtjXyveeP6VLoTJ60T3D9 +Jg== +-----END CERTIFICATE----- diff --git a/cert/local_dev.key b/cert/local_dev.key new file mode 100644 index 000000000..9b8949775 --- /dev/null +++ b/cert/local_dev.key @@ -0,0 +1,30 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIJvntFBuTIWACAggA +MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECEE+1CDDu5XvBIIEyEwR/61HhjJ0 +P6oGr1E+uDTKVcUqK++fbsrhqxYq+oEoj+w5C1KOgUxQYQTm2he6PhfGkPh56V9w +OaArJ+QrGrSFRUdTtLZG+qBbfyWKQyah9VxwYhmG9Ptf6RyQXDJnup4WtgJWI2sw +fAcJ6QqPQkSFUq/0cn0s/RLNCy6P8qKfUjdVugEv0K9dsc7dFNWZQEQlpyKeZdbY +rJfKjf85qSmDpFfRnP1B0n//vzlPWK03fNH2be4EnBTFW7l1sDnju6iwasLSP7P+ +EuGq8Bw9YGlf3I/STWGgfxWWLZACCjgVDiRjLakstkodLqC1tZAWawOKcDQGPyKG +nRrF/yF4H0ChmcMBA9Ur4zxBd4uayWujwqIPehfWU+ODYYaVDluSVrxiTaSHGAP2 +XnT6vrOnR5sg/uzgsbuApHTbHCW+lplof/R0swvwyt15fKaD8HsngNMN6R75e0ar +6+ltI/BLgcSbu0f7Fe8qMumBNrJiU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WF6mUI06iLIRhLyNwBrtEjJHL1k8fIOvO/MUKtj72VBGt/fnoutS0WifZLvfn +mFXB4iaMX0hGcgzpK4iNcg== +-----END ENCRYPTED PRIVATE KEY----- diff --git a/cert/local_dev.pfx b/cert/local_dev.pfx new file mode 100644 index 0000000000000000000000000000000000000000..fecfe55316ab18e467ec99d66d73ebc1f2754021 GIT binary patch literal 2611 zcmai$X*3iJ7sqGD3??-8sBB{ig^@i(B#b3n#+rQzWzATM8oRL+1`U&SBI{Ta!$d-| zHX@XrknC&3>pAaxdOp4%?z!jw{^y?i?RPE$b4CgTq(NYy^R!U$Xr1UiCLkR!7Xuvz zW1yc;aUTK$*7!G~&BcIaPSNQS;IxVUn*b50zXOB`fkcS?J2E0Jg6Tti&)^Et)E*Fs z9)Mt^rT_0W5EKGH@X$i-qji8TG+>}OnAs$f-_g|Iyh2L^h4b)S4fzR%=AB?;544eu z-N-KBQw1te_2k@ABs~w;^?oWd(};TZi(vh_A2u89zDl`&asrflvV&uzmznLU{@V6M z&m|su(q`1a){0}EUut#H{5BFiPT)|KuMm($u_jwK%9+>V)XehgsU&ZbiH6%o{$#w$ z=+J`7*Zg@gBs4vLMbqZR^O>0|`LgcXq!Z7rF!+$&fa>n+wp;O=1s&Fs!o)#q3cE(a zf=BF4V=-`1ib=aKWK%<$5MPrObkyF4S}FDWly_w#9Dw&1+k|J|(2Rc2(|*iycT`@& z>F&N}{rPF*#Ai9A_qDlSs=X{Df(Cl%1D)m-ii?|d-$8;yEpLVtqBoB@{aVi6`SF!$ z&-0R(ZOelZFV07jjE|&Z)*Bg>b5&A_JOv_oJ?W`s8f3@9i8OJ|5EgS@dP(H;VDJ^R zhEH^p)K=`Dy@&S%}dBF=8 zn!@tKZNjRv|vh7<>(^CzTs^5mc66*B=AYxuXz<#Re_5Oz5Ud8tZS*ErQq z#01(z%>oar^nRP;h8tE;>U(;a37w%XJVfKMc~K#S!-;BRLgaIYbJe}MDP`V!>FK)4 z6K{!pl>_~Y4+5d{s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wdd(G}py>OaoXI+j#VQqh?ilzVKsY+h;fHFCzkHyzztlq}1z0FW(J zyFXG%g|e7C_^R||%^B<2fj+=d1kl*{=~khshm92(Lmc zkm-w?QIRjjDXjhtDq#&C! z?y9+2#L?h;q&3-34An(A5S-gLRYWEi9iEBVDbJ#07W?U1zow2K8)D`HV z^VU+f4C;zUmMs&v=&khH5*`q?2s`=$C zJ*?&+Ad;Wyzymdbu;6$};r>)&xbY8>{^nPM+7V_+A;0RIBj*?g9>p@9uZ@aZ5p0gu zR-YkQ3mfl51^DV6?AiDkDWI-Co!%!%QCaIO1SU>Kikz}33>~786oG|7DYy@_U)*dO zp>&sc6w4jknBth6s>DJbTMtmYXUfC7wnD`@Z8JAsMhZ>vMQ|wYK2_Ho$BF?qX8hF` z&J#17cfQ=kEJQUOX#G-QOVo$)vfNg8T{UsiVTMyYfh2fvdY33#Y}%420@QO8 zK`q~daAx6axdwb2w!3|}czy3AMpWpC+ozkmH2*eG9G=k~x zy9EM50AT*>CaV`#oAlWFn0Kc*r!Se)k(!gRrqZqz_znNE(k=@yeVpx}r1M$BkN>Fl EKi6E!1ONa4 literal 0 HcmV?d00001 From 96ae95a97ce5224369943aba2a6a00e72fa403bc Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Sun, 5 Nov 2023 19:13:54 +0530 Subject: [PATCH 02/18] Fix the generation of remoteentry.js for docker development --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 35fa55901..d95af2762 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ build: cp .env.local_dev .env + rm -rf apps/OpenSign/public/mfbuild/* + cd microfrontends/SignDocuments && npm install && npm run build docker compose up -d \ No newline at end of file From 73978ebce4ac064c5a59d5ca945e78a006ba9564 Mon Sep 17 00:00:00 2001 From: rishabjasrotia Date: Sun, 5 Nov 2023 19:20:34 +0530 Subject: [PATCH 03/18] Fix issue --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index d95af2762..35fa55901 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ build: cp .env.local_dev .env - rm -rf apps/OpenSign/public/mfbuild/* - cd microfrontends/SignDocuments && npm install && npm run build docker compose up -d \ No newline at end of file From fe37f3e021ff061b17f4621d728663a0f89f3de6 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 6 Nov 2023 14:51:33 +0530 Subject: [PATCH 04/18] fix: expired and decline document block whole screeen --- .../src/Component/PdfRequestFiles.js | 99 +++++++------------ .../src/Component/component/CustomModal.js | 51 ++++++++++ .../Component/component/defaultSignature.js | 4 +- .../src/Component/component/emailComponent.js | 2 +- .../src/Component/recipientSignPdf.js | 81 ++++++--------- .../SignDocuments/src/css/customModal.css | 61 ++++++++++++ .../SignDocuments/src/css/signature.css | 1 + .../SignDocuments/src/utils/Utils.js | 38 ++++--- 8 files changed, 201 insertions(+), 136 deletions(-) create mode 100644 microfrontends/SignDocuments/src/Component/component/CustomModal.js create mode 100644 microfrontends/SignDocuments/src/css/customModal.css diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js index 012f4e347..a851baac3 100644 --- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js +++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js @@ -11,15 +11,13 @@ import { HTML5Backend } from "react-dnd-html5-backend"; import { useParams } from "react-router-dom"; import SignPad from "./component/signPad"; import RenderAllPdfPage from "./component/renderAllPdfPage"; -import { - getBase64FromIMG, - getBase64FromUrl -} from "../utils/Utils"; +import { getBase64FromIMG, getBase64FromUrl } from "../utils/Utils"; import Loader from "./component/loader"; import HandleError from "./component/HandleError"; import Nodata from "./component/Nodata"; import Header from "./component/header"; import RenderPdf from "./component/renderPdf"; +import CustomModal from "./component/CustomModal"; function PdfRequestFiles() { const { docId } = useParams(); @@ -191,7 +189,7 @@ function PdfRequestFiles() { //comparison auditTrail user details with signers user details for (let i = 0; i < signerRes.length; i++) { const signerId = signerRes[i].objectId; - + let isSigned = false; for (let j = 0; j < checkDocIdExist.length; j++) { const signedExist = @@ -912,6 +910,7 @@ function PdfRequestFiles() { //function for set decline true on press decline button const declineDoc = async () => { + setIsDecline({ isDeclined: false }); const data = { IsDeclined: true }; @@ -984,6 +983,36 @@ function PdfRequestFiles() { )}
+ {/* this modal is used to show decline alert */} + + Are you sure want to decline this document ? +

+ ) : isDecline.currnt === "YouDeclined" ? ( +

You have declined this document!

+ ) : ( + isDecline.currnt === "another" && ( +

+ You cannot sign this document as it has been declined by + one or more person(s). +

+ ) + ) + } + footerMessage={isDecline.currnt === "Sure"} + declineDoc={declineDoc} + setIsDecline={setIsDecline} + /> + {/* this modal is used for show expired alert */} + {/* this component used to render all pdf pages in left side */} 500 && "20px" }} > - - - Document Expired! - - - -

- This Document is no longer available. -

-
-
- {/* this modal is used for show decline alert */} - - - Document Declined Alert! - - - - {isDecline.currnt === "Sure" ? ( -

- Are you sure want to decline this document ? -

- ) : isDecline.currnt === "YouDeclined" ? ( -

You have declined this document!

- ) : ( - isDecline.currnt === "another" && ( -

- You cannot sign this document as it has been declined by - one or more person(s). -

- ) - )} -
- - {isDecline.currnt === "Sure" && ( - <> - - - - )} - -
{/* this modal is used show this document is already sign */} diff --git a/microfrontends/SignDocuments/src/Component/component/CustomModal.js b/microfrontends/SignDocuments/src/Component/component/CustomModal.js new file mode 100644 index 000000000..dad3790b6 --- /dev/null +++ b/microfrontends/SignDocuments/src/Component/component/CustomModal.js @@ -0,0 +1,51 @@ +import React from "react"; +import "../../css/customModal.css"; +import "../../css/signature.css"; + +function CustomModal({ + show, + headMsg, + bodyMssg, + footerMessage, + declineDoc, + setIsDecline +}) { + return ( + show && ( +
+
+
{headMsg && headMsg}
+
+

{bodyMssg && bodyMssg}

+
+ {footerMessage && ( +
+ + +
+ )} +
+
+ ) + ); +} + +export default CustomModal; diff --git a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js index 782133bea..5bc7fedd9 100644 --- a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js +++ b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js @@ -1,5 +1,5 @@ -import React, { useEffect } from "react"; -import axios from "axios"; +import React from "react"; + function DefaultSignature({ themeColor, diff --git a/microfrontends/SignDocuments/src/Component/component/emailComponent.js b/microfrontends/SignDocuments/src/Component/component/emailComponent.js index af6ecf0e4..bdbb1eb52 100644 --- a/microfrontends/SignDocuments/src/Component/component/emailComponent.js +++ b/microfrontends/SignDocuments/src/Component/component/emailComponent.js @@ -26,7 +26,7 @@ function EmailComponent({ //function for send email const sendEmail = async () => { setIsLoading(true); - let sendMail, recipent; + let sendMail; for (let i = 0; i < emailCount.length; i++) { try { diff --git a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js index a60627218..1acd56a64 100644 --- a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js +++ b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js @@ -23,8 +23,8 @@ import Loader from "./component/loader"; import HandleError from "./component/HandleError"; import Nodata from "./component/Nodata"; import Header from "./component/header"; -import ModalComponent from "./component/modalComponent"; import RenderPdf from "./component/renderPdf"; +import CustomModal from "./component/CustomModal"; function EmbedPdfImage() { const { id, contactBookId } = useParams(); const [isSignPad, setIsSignPad] = useState(false); @@ -953,6 +953,34 @@ function EmbedPdfImage() { ) : (
+ {/* this modal is used to show decline alert */} + Are you sure want to decline this document ?

+ ) : isDecline.currnt === "YouDeclined" ? ( +

You have declined this document!

+ ) : ( + isDecline.currnt === "another" && ( +

+ You cannot sign this document as it has been declined by one + or more person(s). +

+ ) + ) + } + footerMessage={isDecline.currnt === "Sure"} + declineDoc={declineDoc} + setIsDecline={setIsDecline} + /> + {/* this modal is used for show expired alert */} + {/* this component used for UI interaction and show their functionality */} {pdfLoadFail.status && !isExpired && @@ -975,57 +1003,6 @@ function EmbedPdfImage() { marginRight: pdfOriginalWidth > 500 && "20px" }} > - {/* this modal is used for show decline alert */} - - - Document Declined Alert! - - - - {isDecline.currnt === "Sure" ? ( -

Are you sure want to decline this document ?

- ) : isDecline.currnt === "YouDeclined" ? ( -

You have declined this document!

- ) : ( - isDecline.currnt === "another" && ( -

- You cannot sign this document as it has been declined by - one or more person(s). -

- ) - )} -
- - {isDecline.currnt === "Sure" && ( - <> - - - - )} - -
- - {/* this modal component is used for show expired document */} - - {/* this modal is used show this document is already sign */} diff --git a/microfrontends/SignDocuments/src/css/customModal.css b/microfrontends/SignDocuments/src/css/customModal.css new file mode 100644 index 000000000..05d62e699 --- /dev/null +++ b/microfrontends/SignDocuments/src/css/customModal.css @@ -0,0 +1,61 @@ +.parentDiv { + width: 100%; + height: 100%; + background: gray; + position: absolute; + z-index: 100; + background-color: rgba(0, 0, 0, 0.75); + display: flex; + flex-direction: column; + /* justify-content: center; */ + align-items: center; +} + +.childDiv { + width: 50%; + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + background-color: #fff; + margin:30px 20px; + border: 0px 1px 1px 1px solid rgba(0, 0, 0, .2); + border-radius: 0.3rem; + outline: 0; +} + +.modalHeadDiv { + padding: 10px; + color: #fff; + border-top-left-radius: 0.3rem; + border-top-right-radius: 0.3rem; + font-size: 17px; + font-weight: 500; +} + +.modalBodyDIv { + padding: 20px; +} + +.spanTagHead { + color: white !important; + font-size: 17px; + font-weight: 500; +} + +.pTagBody { + + font-size: 15px !important; +} +.modalFooterDiv{ + margin: 10px; + display: flex; + justify-content: flex-end; +} + +@media screen and (max-width:500px) { + .childDiv { + margin: 50px 7px; + width: 90%; + } +} \ No newline at end of file diff --git a/microfrontends/SignDocuments/src/css/signature.css b/microfrontends/SignDocuments/src/css/signature.css index d3e16258a..a8c724680 100644 --- a/microfrontends/SignDocuments/src/css/signature.css +++ b/microfrontends/SignDocuments/src/css/signature.css @@ -341,6 +341,7 @@ flex-direction: row; justify-content: space-between; background-color: #ebebeb; + position:"relative" /* max-height: 800px; */ /* overflow: auto; */ } diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js index 138b22e62..0b915423d 100644 --- a/microfrontends/SignDocuments/src/utils/Utils.js +++ b/microfrontends/SignDocuments/src/utils/Utils.js @@ -57,37 +57,41 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { (data, ind) => data.key === signKey && data.Width && data.Height && data.SignUrl ); + if (updateFilter.length > 0) { - let newWidth, nweHeight; + let newWidth, newHeight; const aspectRatio = imgWH.width / imgWH.height; + const getXYdata = xyPostion[index].pos; - + if (aspectRatio === 1) { newWidth = aspectRatio * 100; - nweHeight = aspectRatio * 100; + newHeight = aspectRatio * 100; } else if (aspectRatio < 2) { newWidth = aspectRatio * 100; - nweHeight = 100; + newHeight = 100; } else if (aspectRatio > 2 && aspectRatio < 4) { newWidth = aspectRatio * 70; - nweHeight = 70; + newHeight = 70; } else if (aspectRatio > 4) { newWidth = aspectRatio * 40; - nweHeight = 40; + newHeight = 40; } else if (aspectRatio > 5) { newWidth = aspectRatio * 10; - nweHeight = 10; + newHeight = 10; } - - let getPosData = xyPostion[index].pos.filter((data) => data.key === signKey); - + + let getPosData = xyPostion[index].pos.filter( + (data) => data.key === signKey + ); + const addSign = getXYdata.map((url, ind) => { if (url.key === signKey) { return { ...url, - Width: getPosData[0].Width ? getPosData[0].Width : 150, - Height: getPosData[0].Height ? getPosData[0].Height : 60, + Width: getPosData[0].Width ? getPosData[0].Width : newWidth, + Height: getPosData[0].Height ? getPosData[0].Height : newHeight, SignUrl: image.src, ImageType: image.imgType }; @@ -106,7 +110,9 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { } else { const getXYdata = xyPostion[index].pos; - let getPosData = xyPostion[index].pos.filter((data) => data.key === signKey); + let getPosData = xyPostion[index].pos.filter( + (data) => data.key === signKey + ); const aspectRatio = imgWH.width / imgWH.height; let newWidth, newHeight; @@ -131,9 +137,9 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) { if (url.key === signKey) { return { ...url, - Width: getPosData[0].Width ? getPosData[0].Width : 150, - Height: getPosData[0].Height ? getPosData[0].Height : 60, - SignUrl: image.src, + Width: getPosData[0].Width ? getPosData[0].Width : newWidth, + Height: getPosData[0].Height ? getPosData[0].Height : newHeight, + SignUrl: image.src, ImageType: image.imgType }; } From d42e11c5c155d6e448261ba975a01f4b4e55fb4b Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Tue, 7 Nov 2023 11:32:25 +0530 Subject: [PATCH 05/18] fix: blocking screen by warning for expired and decline document --- .../src/Component/PdfRequestFiles.js | 15 +- .../src/Component/component/CustomModal.js | 12 +- .../src/Component/recipientSignPdf.js | 15 +- .../SignDocuments/src/css/customModal.css | 12 +- .../SignDocuments/src/css/signature.css | 1548 ++++++++--------- 5 files changed, 808 insertions(+), 794 deletions(-) diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js index a851baac3..6d2d33061 100644 --- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js +++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js @@ -62,7 +62,8 @@ function PdfRequestFiles() { const [isSigned, setIsSigned] = useState(false); const [isExpired, setIsExpired] = useState(false); const [alreadySign, setAlreadySign] = useState(false); - + const [containerWH, setContainerWH] = useState({}); + const divRef = useRef(null); const rowLevel = localStorage.getItem("rowlevel") && JSON.parse(localStorage.getItem("rowlevel")); @@ -94,6 +95,14 @@ function PdfRequestFiles() { getDocumentDetails(); } }, []); + useEffect(() => { + if (divRef.current) { + setContainerWH({ + width: divRef.current.offsetWidth, + height: divRef.current.offsetHeight + }); + } + }, [divRef.current]); //function for get document details for perticular signer with signer'object id const getDocumentDetails = async () => { @@ -982,9 +991,10 @@ function PdfRequestFiles() {
)} -
+
{/* this modal is used to show decline alert */} {/* this modal is used for show expired alert */} +
{headMsg && headMsg}
diff --git a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js index 1acd56a64..8d35da7fc 100644 --- a/microfrontends/SignDocuments/src/Component/recipientSignPdf.js +++ b/microfrontends/SignDocuments/src/Component/recipientSignPdf.js @@ -67,12 +67,13 @@ function EmbedPdfImage() { status: false, type: "load" }); - + const [containerWH, setContainerWH] = useState({}); const docId = id && id; const isMobile = window.innerWidth < 767; const index = xyPostion.findIndex((object) => { return object.pageNumber === pageNumber; }); + const divRef = useRef(null); useEffect(() => { const clientWidth = window.innerWidth; @@ -82,6 +83,14 @@ function EmbedPdfImage() { setPdfNewWidth(pdfWidth); getDocumentDetails(); }, []); + useEffect(() => { + if (divRef.current) { + setContainerWH({ + width: divRef.current.offsetWidth, + height: divRef.current.offsetHeight + }); + } + }, [divRef.current]); //function for get document details for perticular signer with signer'object id const getDocumentDetails = async () => { @@ -952,9 +961,10 @@ function EmbedPdfImage() { ) : noData ? ( ) : ( -
+
{/* this modal is used to show decline alert */} {/* this modal is used for show expired alert */}