Merge pull request #949 from OpenSignLabs/raktima-opensignlabs-patch-11

fix: add CDN for icons, issue in public-template flow
This commit is contained in:
prafull-opensignlabs
2024-07-19 11:48:30 +05:30
committed by GitHub
18 changed files with 248 additions and 28542 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.
+2 -2
View File
@@ -677,9 +677,9 @@ function Login() {
onClick={togglePasswordVisibility}
>
{state.passwordVisible ? (
<i className="fa fa-eye-slash text-xs pb-1" /> // Close eye icon
<i className="fa-light fa-eye-slash text-xs pb-1" /> // Close eye icon
) : (
<i className="fa fa-eye text-xs pb-1 " /> // Open eye icon
<i className="fa-light fa-eye text-xs pb-1 " /> // Open eye icon
)}
</span>
</div>
+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}`;
+2 -2
View File
@@ -415,9 +415,9 @@ const Signup = () => {
onClick={togglePasswordVisibility}
>
{showPassword ? (
<i className="fa fa-eye-slash" /> // Close eye icon
<i className="fa-light fa-eye-slash" /> // Close eye icon
) : (
<i className="fa fa-eye" /> // Open eye icon
<i className="fa-light fa-eye" /> // Open eye icon
)}
</span>
</div>
+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">
@@ -47,7 +47,7 @@ const ReportTable = (props) => {
const [isTour, setIsTour] = useState(false);
const [tourStatusArr, setTourStatusArr] = useState([]);
const [isResendMail, setIsResendMail] = useState({});
const [isMakePublic, setIsMakePublic] = useState({});
const [isMakePublicModal, setIsMakePublicModal] = useState({});
const [mail, setMail] = useState({ subject: "", body: "" });
const [userDetails, setUserDetails] = useState({});
const [isNextStep, setIsNextStep] = useState({});
@@ -443,7 +443,7 @@ const ReportTable = (props) => {
const handleClose = (item) => {
setIsRevoke({});
setIsDeleteModal({});
setIsMakePublic({});
setIsMakePublicModal({});
setSelectedPublicRole("");
setIsPublicProfile({});
if (item?.objectId) {
@@ -855,7 +855,7 @@ const ReportTable = (props) => {
const handlePublicTemplate = async (item) => {
if (selectedPublicRole || !props.isPublic[item.objectId]) {
setActLoader({ [item.objectId]: true });
setIsMakePublic(false);
setIsMakePublicModal(false);
try {
const res = await Parse.Cloud.run("createpublictemplate", {
templateid: item.objectId,
@@ -922,40 +922,59 @@ 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
if (getPlaceholder && getPlaceholder.length > 0) {
const checkIsSignatureExistt = getPlaceholder?.every((placeholderObj) =>
placeholderObj?.placeHolder?.some((holder) =>
holder?.pos?.some((posItem) => posItem?.type === "signature")
)
);
//checking index for public role
const getIndex = getPlaceholder.findIndex((obj) => !obj.signerObjId);
//conditon to check empty role is exist or not
if (getPlaceholder && getPlaceholder.length > 0 && getIndex >= 0) {
const signers = item?.Signers;
//condition to check that every role is attached to signers except the 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;
//condition for if send in order true then the public role order should be prioritized.
//When send in order is false and there's no need to verify the public role's order
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) {
//`setIsPublic` variable is used to collect all template public status
props.setIsPublic((prevStates) => ({
...prevStates,
[item.objectId]: e.target.checked
}));
if (getPlaceholder[getIndex]?.Role) {
setSelectedPublicRole(getPlaceholder[getIndex].Role);
}
//`setIsMakePublicModal` is used to open modal after succesfully make public
setIsMakePublicModal({ [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 +991,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);
}
@@ -1236,7 +1256,7 @@ const ReportTable = (props) => {
</label>
</div>
)}
{isMakePublic[item.objectId] && (
{isMakePublicModal[item.objectId] && (
<ModalUi
isOpen
title={
@@ -1245,7 +1265,7 @@ const ReportTable = (props) => {
: "Make template private"
}
handleClose={() => {
setIsMakePublic({});
setIsMakePublicModal({});
setSelectedPublicRole("");
props.setIsPublic((prevStates) => ({
...prevStates,
+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);