fix: shift the fonts.css file to CDN, ensure emails are sent to all signers when sendInOrder is set to false in public-sign, and add validation for the sequence of public roles when sendInOrder is enabled

This commit is contained in:
RaktimaNXG
2024-07-18 18:56:42 +05:30
parent 4b1e13d39a
commit c59c921a8b
16 changed files with 228 additions and 28518 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -11,7 +11,7 @@
<link rel="manifest" href="/manifest.json" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />
<link rel="stylesheet" href="/css/fonts.css" />
<link rel="stylesheet" href="https://cdn.opensignlabs.com/fonts.css" />
<title>OpenSign™</title>
</head>
<body>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from "react";
import { isEnableSubscription, themeColor } from "../constant/const";
import { isEnableSubscription, isStaging, themeColor } from "../constant/const";
import { PDFDocument } from "pdf-lib";
import "../styles/signature.css";
import Parse from "parse";
@@ -949,9 +949,9 @@ function PdfRequestFiles(props) {
`${pdfDetails?.[0].objectId}/${user.Email}`
);
}
// let signPdf = `${hostUrl}/login/${encodeBase64}`;
const hostPublicUrl =
"https://staging-app.opensignlabs.com";
const hostPublicUrl = isStaging
? "https://staging-app.opensignlabs.com"
: "https://app.opensignlabs.com/";
let signPdf = props?.templateId
? `${hostPublicUrl}/login/${encodeBase64}`
: `${hostUrl}/login/${encodeBase64}`;
+1 -3
View File
@@ -446,9 +446,7 @@ function UserProfile() {
Public profile :{" "}
<Tooltip
maxWidth="max-w-[250px]"
message={`this is your public URL. Copy or share it
with the signer, and you will be able to see
all your publicly set templates.`}
message={`This is your public URL. Copy or share it with the signer, and you will be able to see all your publicly set templates.`}
/>
</span>
<div className="flex md:flex-row flex-col md:items-center">
@@ -922,40 +922,61 @@ const ReportTable = (props) => {
//function to handle change template status is public or private
const handlePublicChange = async (e, item) => {
const getPlaceholder = item?.Placeholders;
//condiiton to check role is exist or not
//conditon to check role is exist or not
if (getPlaceholder && getPlaceholder.length > 0) {
const checkIsSignatureExistt = getPlaceholder?.every((placeholderObj) =>
placeholderObj?.placeHolder?.some((holder) =>
holder?.pos?.some((posItem) => posItem?.type === "signature")
)
);
const signers = item?.Signers;
//condition to check there should be attached all role to signers except one public role
if (getPlaceholder.length - 1 === signers?.length) {
if (checkIsSignatureExistt) {
let extendUser = JSON.parse(localStorage.getItem("Extand_Class"));
const userName = extendUser[0]?.UserName;
setIsPublicUserName(extendUser[0]?.UserName);
//condition to check user have public url or not
if (userName) {
props.setIsPublic((prevStates) => ({
...prevStates,
[item.objectId]: e.target.checked
}));
const getRole = item.Placeholders.find((data) => !data.signerObjId);
if (getRole?.Role) {
setSelectedPublicRole(getRole?.Role);
//check template send in order
const IsSendInOrder = item?.SendinOrder;
//get role to set public role
const getRole = item.Placeholders.find((data) => !data.signerObjId);
//get public role index to check order
const getIndex = item.Placeholders.findIndex(
(obj) => obj.Role === getRole?.Role
);
//condition for if send in order true then public role order should be on top
//if send in order false and do not need to check order of public role
if ((IsSendInOrder && getIndex === 0) || !IsSendInOrder) {
const checkIsSignatureExist = getPlaceholder?.every(
(placeholderObj) =>
placeholderObj?.placeHolder?.some((holder) =>
holder?.pos?.some((posItem) => posItem?.type === "signature")
)
);
//condition for validate signature widgets should be all signers
if (checkIsSignatureExist) {
let extendUser = JSON.parse(localStorage.getItem("Extand_Class"));
const userName = extendUser[0]?.UserName;
setIsPublicUserName(extendUser[0]?.UserName);
//condition to check user have public url or not
if (userName) {
props.setIsPublic((prevStates) => ({
...prevStates,
[item.objectId]: e.target.checked
}));
if (getRole?.Role) {
setSelectedPublicRole(getRole?.Role);
}
setIsMakePublic({ [item.objectId]: true });
} else {
setIsPublicProfile({ [item.objectId]: true });
}
setIsMakePublic({ [item.objectId]: true });
} else {
setIsPublicProfile({ [item.objectId]: true });
setIsAlert(true);
setAlertMsg({
type: "danger",
message:
" Please ensure there's at least one signature widget added for all signers."
});
setTimeout(() => setIsAlert(false), 5000);
}
} else {
} else if (IsSendInOrder) {
setIsAlert(true);
setAlertMsg({
type: "danger",
message:
" Please ensure there's at least one signature widget added for all recipients."
"The send-in-order for this template is enabled, and the public role must be at the top."
});
setTimeout(() => setIsAlert(false), 5000);
}
@@ -972,7 +993,8 @@ const ReportTable = (props) => {
setIsAlert(true);
setAlertMsg({
type: "danger",
message: "Please assign at least one role to make this template public."
message:
"Please assign at least one public role to make this template public."
});
setTimeout(() => setIsAlert(false), 5000);
}
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react";
import { Tooltip as ReactTooltip } from "react-tooltip";
import { openInNewTab } from "../constant/Utils";
const Tooltip = ({ id, message, url, iconColor }) =>
const Tooltip = ({ id, message, url, iconColor, maxWidth }) =>
url ? (
<button onClick={() => openInNewTab(url)} className={"text-center"}>
<sup>
@@ -33,7 +33,7 @@ const Tooltip = ({ id, message, url, iconColor }) =>
</a>
<ReactTooltip
id={id ? id : "my-tooltip"}
className="max-w-[200px] z-[200]"
className={`${maxWidth ? maxWidth : "max-w-[200px]"} z-[200]`}
/>
</>
);
+1 -1
View File
@@ -33,7 +33,7 @@ const scriptComponent = document.createElement("div");
scriptComponent.id = "script-component";
document.body.appendChild(scriptComponent);
const link = document.createElement("link");
link.href = "https://staging-app.opensignlabs.com/css/fonts.css";
link.href = "https://cdn.opensignlabs.com/fonts.css";
link.rel = "stylesheet";
document.head.appendChild(link);