Skip to content

πŸ”₯ The free & Open Source DocuSign alternative

Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into patch-1

prafull-opensignlabs724fa7c27ece
diff --cc apps/OpenSign/src/pages/PdfRequestFiles.js
index efea4e25a,e810cf503..e14b86fbb
--- a/apps/OpenSign/src/pages/PdfRequestFiles.js
+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js
@@@ -90,7 -89,7 +92,8 @@@ function PdfRequestFiles()
const [widgetsTour, setWidgetsTour] = useState(false);
const [minRequiredCount, setminRequiredCount] = useState();
const [sendInOrder, setSendInOrder] = useState(false);
+ const [currWidgetsDetails, setCurrWidgetsDetails] = useState({});
+ const [isSubscribed, setIsSubscribed] = useState(false);
const divRef = useRef(null);
const isMobile = window.innerWidth < 767;
const rowLevel =
@@@ -928,58 -901,75 +935,68 @@@
return (
<DndProvider backend={HTML5Backend}>
<Title title={"Request Sign"} />
- {isLoading.isLoad ? (
- <Loader isLoading={isLoading} />
- ) : handleError ? (
- <HandleError handleError={handleError} />
+ {isSubscribed ? (
+ <ModalUi
+ title={"Subscription Expired"}
+ isOpen={isSubscribed}
+ showClose={false}
+ >
+ <div className="flex flex-col justify-center items-center py-4 md:py-5 gap-5">
+ <p className="text-sm md:text-lg font-normal">
+ Owner&apos;s subscription has expired.
+ </p>
+ </div>
+ </ModalUi>
) : (
- <div>
- {isUiLoading && (
- <div
- style={{
- position: "absolute",
- height: "100vh",
- width: "100%",
- display: "flex",
- justifyContent: "center",
- flexDirection: "column",
- alignItems: "center",
- zIndex: "999",
- backgroundColor: "#e6f2f2",
- opacity: 0.8
- }}
- >
- <img
- alt="no img"
- src={loader}
- style={{ width: "100px", height: "100px" }}
- />
- <span style={{ fontSize: "13px", fontWeight: "bold" }}>
- This might take some time
- </span>
- </div>
- )}
-
- <div
- className="signatureContainer"
- style={{
- pointerEvents:
- isExpired ||
- (isDecline.isDeclined && isDecline.currnt === "another")
- ? "none"
- : "auto"
- }}
- ref={divRef}
- >
- <ModalUi
- headerColor={"#dc3545"}
- isOpen={isAlert.isShow}
- title={"Alert message"}
- handleClose={() => {
- setIsAlert({
- isShow: false,
- alertMessage: ""
- });
- }}
- >
- <div style={{ height: "100%", padding: 20 }}>
- <p>{isAlert.alertMessage}</p>
-
+ <>
+ {isLoading.isLoad ? (
+ <Loader isLoading={isLoading} />
+ ) : handleError ? (
+ <HandleError handleError={handleError} />
+ ) : (
+ <div>
+ {isUiLoading && (
<div
style={{
- height: "1px",
- backgroundColor: "#9f9f9f",
+ position: "absolute",
+ height: "100vh",
width: "100%",
- marginTop: "15px",
- marginBottom: "15px"
+ display: "flex",
+ justifyContent: "center",
+ flexDirection: "column",
+ alignItems: "center",
+ zIndex: "999",
+ backgroundColor: "#e6f2f2",
+ opacity: 0.8
}}
- ></div>
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "100px", height: "100px" }}
+ />
+ <span style={{ fontSize: "13px", fontWeight: "bold" }}>
+ This might take some time
+ </span>
+ </div>
+ )}
- <div className="signatureContainer" ref={divRef}>
- <button
- onClick={() => {
++ <div
++ className="signatureContainer"
++ style={{
++ pointerEvents:
++ isExpired ||
++ (isDecline.isDeclined && isDecline.currnt === "another")
++ ? "none"
++ : "auto"
++ }}
++ ref={divRef}
++ >
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isAlert.isShow}
+ title={"Alert message"}
+ handleClose={() => {
setIsAlert({
isShow: false,
alertMessage: ""
@@@ -1009,381 -1064,289 +1026,384 @@@
type="button"
className="finishBtn cancelBtn"
>
- Close
+ Ok
</button>
- </>
- ) : (
- <button
- onClick={() => {
- setIsAlert({
- isShow: false,
- alertMessage: ""
- });
- }}
- type="button"
- className="finishBtn cancelBtn"
- >
- Ok
- </button>
- )}
- </div>
- </ModalUi>
- {/* this component used to render all pdf pages in left side */}
- <RenderAllPdfPage
- signPdfUrl={pdfDetails[0].URL}
- allPages={allPages}
- setAllPages={setAllPages}
- setPageNumber={setPageNumber}
- pageNumber={pageNumber}
- />
+ </div>
+ </ModalUi>
- {/* pdf render view */}
- <div
- style={{
- marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
- marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
- }}
- >
- {/* this modal is used show this document is already sign */}
- <ModalUi
- isOpen={isCompleted.isModal}
- title={"Sign Documents"}
- handleClose={() => {
- setIsCompleted({ isModal: false, isCertificate: true });
- }}
- >
- <div style={{ height: "100%", padding: 20 }}>
- <p>This document has been signed by all Signers.</p>
+ <Tour
+ showNumber={false}
+ showNavigation={false}
+ showNavigationNumber={false}
+ onRequestClose={closeTour}
+ steps={tourConfig}
+ isOpen={widgetsTour}
+ rounded={5}
+ closeWithMask={false}
+ />
- <div
- style={{
- height: "1px",
- backgroundColor: "#9f9f9f",
- width: "100%",
- marginTop: "15px",
- marginBottom: "15px"
- }}
- ></div>
- <button
- type="button"
- className="finishBtn cancelBtn"
- onClick={() =>
- setIsCompleted({ isModal: false, isCertificate: true })
- }
- >
- Close
- </button>
- </div>
- </ModalUi>
+ {/* this modal is used to show decline alert */}
+ <PdfDeclineModal
+ containerWH={containerWH}
+ show={isDecline.isDeclined}
+ headMsg="Document Declined"
+ bodyMssg={
+ 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 recipient(s)."
+ }
+ footerMessage={isDecline.currnt === "Sure"}
+ declineDoc={declineDoc}
+ setIsDecline={setIsDecline}
+ />
+ {/* this modal is used for show expired alert */}
+ <PdfDeclineModal
+ containerWH={containerWH}
+ show={isExpired}
+ headMsg="Document Expired!"
- bodyMssg="This Document is no longer available."
++ bodyMssg={`This document expired on ${expiredDate} and is no longer available to sign.`}
+ />
- {/* this component is used for signature pad modal */}
- <SignPad
- isSignPad={isSignPad}
- isStamp={isStamp}
- setIsImageSelect={setIsImageSelect}
- setIsSignPad={setIsSignPad}
- setImage={setImage}
- isImageSelect={isImageSelect}
- imageRef={imageRef}
- onImageChange={onImageChange}
- setSignature={setSignature}
- image={image}
- onSaveImage={saveImage}
- onSaveSign={saveSign}
- defaultSign={defaultSignImg}
- myInitial={myInitial}
- isInitial={isInitial}
- setIsInitial={setIsInitial}
- setIsStamp={setIsStamp}
- currWidgetsDetails={currWidgetsDetails}
- setCurrWidgetsDetails={setCurrWidgetsDetails}
- />
- {/* pdf header which contain funish back button */}
- <Header
- isPdfRequestFiles={true}
- pageNumber={pageNumber}
- allPages={allPages}
- changePage={changePage}
- pdfDetails={pdfDetails}
- signerPos={signerPos}
- isSigned={isSigned}
- isCompleted={isCompleted}
- embedWidgetsData={embedWidgetsData}
- isShowHeader={true}
- setIsDecline={setIsDecline}
- decline={true}
- currentSigner={currentSigner}
- pdfUrl={pdfUrl}
- alreadySign={alreadySign}
- />
- {containerWH && (
- <RenderPdf
+ <ModalUi
+ headerColor={defaultSignImg ? themeColor : "#dc3545"}
+ isOpen={defaultSignAlert.isShow}
+ title={"Auto sign"}
+ handleClose={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{defaultSignAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ {defaultSignImg ? (
+ <>
+ <button
+ onClick={() => addDefaultSignature()}
+ style={{
+ background: themeColor
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </>
+ ) : (
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ )}
+ </div>
+ </ModalUi>
+ {/* this component used to render all pdf pages in left side */}
+ <RenderAllPdfPage
+ signPdfUrl={pdfDetails[0].URL}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
pageNumber={pageNumber}
- pdfOriginalWidth={pdfOriginalWidth}
- pdfNewWidth={pdfNewWidth}
- setIsSignPad={setIsSignPad}
- setIsStamp={setIsStamp}
- setSignKey={setSignKey}
- pdfDetails={pdfDetails}
- signerPos={signerPos}
- successEmail={false}
- pdfUrl={pdfUrl}
- numPages={numPages}
- pageDetails={pageDetails}
- pdfRequest={true}
- signerObjectId={signerObjectId}
- signedSigners={signedSigners}
- setCurrentSigner={setCurrentSigner}
- setPdfLoadFail={setPdfLoadFail}
- pdfLoadFail={pdfLoadFail}
- setSignerPos={setSignerPos}
- containerWH={containerWH}
- setIsInitial={setIsInitial}
- setValidateAlert={setValidateAlert}
- unSignedWidgetId={unSignedWidgetId}
- setSelectWidgetId={setSelectWidgetId}
- selectWidgetId={selectWidgetId}
- setCurrWidgetsDetails={setCurrWidgetsDetails}
/>
- )}
- </div>
- <div>
- <div className="signerComponent">
+
+ {/* pdf render view */}
<div
- style={{ maxHeight: window.innerHeight - 70 + "px" }}
- className="autoSignScroll"
+ style={{
+ marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
>
- {signedSigners.length > 0 && (
- <>
+ {/* this modal is used show this document is already sign */}
+ <ModalUi
+ isOpen={isCompleted.isModal}
+ title={"Sign Documents"}
+ handleClose={() => {
+ setIsCompleted({ isModal: false, isCertificate: true });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>This document has been signed by all Signers.</p>
+
<div
- style={{ background: themeColor }}
- className="signedStyle"
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={() =>
+ setIsCompleted({
+ isModal: false,
+ isCertificate: true
+ })
+ }
>
- Signed by
- </div>
- <div style={{ marginTop: "2px" }}>
- {signedSigners.map((obj, ind) => {
- return (
- <div
- style={{
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
- padding: "10px 0",
- background: checkSignerBackColor(obj)
- }}
- key={ind}
- >
- <div
- className="signerStyle"
- style={{
- background: "#abd1d0",
- width: 30,
- height: 30,
- display: "flex",
- borderRadius: 30 / 2,
- justifyContent: "center",
- alignItems: "center",
- margin: "0 10px 0 5px"
- }}
- >
- <span
+ Close
+ </button>
+ </div>
+ </ModalUi>
+
+ {/* this component is used for signature pad modal */}
+ <SignPad
+ isSignPad={isSignPad}
+ isStamp={isStamp}
+ setIsImageSelect={setIsImageSelect}
+ setIsSignPad={setIsSignPad}
+ setImage={setImage}
+ isImageSelect={isImageSelect}
+ imageRef={imageRef}
+ onImageChange={onImageChange}
+ setSignature={setSignature}
+ image={image}
+ onSaveImage={saveImage}
+ onSaveSign={saveSign}
+ defaultSign={defaultSignImg}
+ myInitial={myInitial}
+ isInitial={isInitial}
+ setIsInitial={setIsInitial}
+ setIsStamp={setIsStamp}
++ currWidgetsDetails={currWidgetsDetails}
++ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ {/* pdf header which contain funish back button */}
+ <Header
+ isPdfRequestFiles={true}
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ isSigned={isSigned}
+ isCompleted={isCompleted}
+ embedWidgetsData={embedWidgetsData}
+ isShowHeader={true}
+ setIsDecline={setIsDecline}
+ decline={true}
+ currentSigner={currentSigner}
+ pdfUrl={pdfUrl}
+ alreadySign={alreadySign}
+ />
+ {containerWH && (
+ <RenderPdf
+ pageNumber={pageNumber}
+ pdfOriginalWidth={pdfOriginalWidth}
+ pdfNewWidth={pdfNewWidth}
+ setIsSignPad={setIsSignPad}
+ setIsStamp={setIsStamp}
+ setSignKey={setSignKey}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ successEmail={false}
+ pdfUrl={pdfUrl}
+ numPages={numPages}
+ pageDetails={pageDetails}
+ pdfRequest={true}
+ signerObjectId={signerObjectId}
+ signedSigners={signedSigners}
+ setCurrentSigner={setCurrentSigner}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ setSignerPos={setSignerPos}
+ containerWH={containerWH}
+ setIsInitial={setIsInitial}
+ setValidateAlert={setValidateAlert}
+ unSignedWidgetId={unSignedWidgetId}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
++ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ )}
+ </div>
+ <div>
+ <div className="signerComponent">
+ <div
+ style={{ maxHeight: window.innerHeight - 70 + "px" }}
+ className="autoSignScroll"
+ >
+ {signedSigners.length > 0 && (
+ <>
+ <div
+ style={{ background: themeColor }}
+ className="signedStyle"
+ >
+ Signed by
+ </div>
+ <div style={{ marginTop: "2px" }}>
+ {signedSigners.map((obj, ind) => {
+ return (
+ <div
style={{
- fontSize: "12px",
- textAlign: "center",
- fontWeight: "bold",
- color: "black",
- textTransform: "uppercase"
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
}}
+ key={ind}
>
- {getFirstLetter(obj.Name)}
- </span>
- </div>
- <div
- style={{
- display: "flex",
- flexDirection: "column"
- }}
- >
- <span className="userName">{obj.Name}</span>
- <span className="useEmail">{obj.Email}</span>
- </div>
- </div>
- );
- })}
- </div>
- </>
- )}
+ <div
+ className="signerStyle"
+ style={{
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">
+ {obj.Email}
+ </span>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </>
+ )}
- {unsignedSigners.length > 0 && (
- <>
- <div
- style={{
- background: themeColor,
- color: "white",
- padding: "5px",
- fontFamily: "sans-serif",
- marginTop: signedSigners.length > 0 && "20px"
- }}
- >
- Yet to sign
- </div>
- <div style={{ marginTop: "5px" }}>
- {unsignedSigners.map((obj, ind) => {
- return (
- <div
- style={{
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
- padding: "10px 0",
- background: checkSignerBackColor(obj)
- }}
- key={ind}
- >
- <div
- className="signerStyle"
- style={{
- background: "#abd1d0",
- width: 30,
- height: 30,
- display: "flex",
- borderRadius: 30 / 2,
- justifyContent: "center",
- alignItems: "center",
- margin: "0 10px 0 5px"
- }}
- >
- <span
+ {unsignedSigners.length > 0 && (
+ <>
+ <div
+ style={{
+ background: themeColor,
+ color: "white",
+ padding: "5px",
+ fontFamily: "sans-serif",
+ marginTop: signedSigners.length > 0 && "20px"
+ }}
+ >
+ Yet to sign
+ </div>
+ <div style={{ marginTop: "5px" }}>
+ {unsignedSigners.map((obj, ind) => {
+ return (
+ <div
style={{
- fontSize: "12px",
- textAlign: "center",
- fontWeight: "bold",
- color: "black",
- textTransform: "uppercase"
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
}}
+ key={ind}
>
- {getFirstLetter(obj.Name)}
- </span>
- </div>
- <div
- style={{
- display: "flex",
- flexDirection: "column"
- }}
- >
- <span className="userName">{obj.Name}</span>
- <span className="useEmail">{obj.Email}</span>
- </div>
- <hr />
- </div>
- );
- })}
- </div>
- </>
- )}
- {defaultSignImg && !alreadySign && (
- <DefaultSignature
- defaultSignImg={defaultSignImg}
- setDefaultSignImg={setDefaultSignImg}
- userObjectId={signerObjectId}
- setIsLoading={setIsLoading}
- xyPostion={signerPos}
- setDefaultSignAlert={setDefaultSignAlert}
- />
- )}
+ <div
+ className="signerStyle"
+ style={{
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">
+ {obj.Email}
+ </span>
+ </div>
+ <hr />
+ </div>
+ );
+ })}
+ </div>
+ </>
+ )}
+ {defaultSignImg && !alreadySign && (
+ <DefaultSignature
+ defaultSignImg={defaultSignImg}
+ setDefaultSignImg={setDefaultSignImg}
+ userObjectId={signerObjectId}
+ setIsLoading={setIsLoading}
+ xyPostion={signerPos}
+ setDefaultSignAlert={setDefaultSignAlert}
+ />
+ )}
+ </div>
+ </div>
</div>
</div>
</div>