mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
Merge pull request #90 from raktima-opensignlabs/main
This commit is contained in:
@@ -2,13 +2,11 @@ import React from "react";
|
||||
import Modal from "react-bootstrap/Modal";
|
||||
import ModalHeader from "react-bootstrap/esm/ModalHeader";
|
||||
|
||||
function ModalComponent({ isShow, type,setIsShowEmail }) {
|
||||
function ModalComponent({ isShow, type, setIsShowEmail }) {
|
||||
return (
|
||||
<Modal show={isShow}>
|
||||
<ModalHeader className="bg-danger" style={{ color: "white" }}>
|
||||
{type === "pdfFail" ? (
|
||||
<span>Failed to load pdf!</span>
|
||||
) : type === "signersAlert" ? (
|
||||
{type === "signersAlert" ? (
|
||||
<span>Select signers</span>
|
||||
) : (
|
||||
<span>Document Expired!</span>
|
||||
@@ -16,27 +14,26 @@ function ModalComponent({ isShow, type,setIsShowEmail }) {
|
||||
</ModalHeader>
|
||||
|
||||
<Modal.Body>
|
||||
{type === "pdfFail" ? (
|
||||
<p>Something went wrong failed to load pdf file!</p>
|
||||
) : type === "signersAlert" ? (
|
||||
{type === "signersAlert" ? (
|
||||
<p>Please select signer for add placeholder!</p>
|
||||
) : (
|
||||
<p>This Document is no longer available.</p>
|
||||
)}
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
{type === "signersAlert" &&(
|
||||
<button
|
||||
onClick={() => {
|
||||
setIsShowEmail(false)
|
||||
setIsShowEmail(false);
|
||||
}}
|
||||
style={{
|
||||
color: "black",
|
||||
color: "black"
|
||||
}}
|
||||
type="button"
|
||||
className="finishBtn"
|
||||
>
|
||||
Ok
|
||||
</button>
|
||||
Ok
|
||||
</button>)}
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useEffect } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
// import { useHistory } from "react-router-dom/cjs/react-router-dom.min";
|
||||
function Login() {
|
||||
const { id, userMail, serverUrl } = useParams();
|
||||
const { id, userMail,contactBookId, serverUrl } = useParams();
|
||||
let navigate = useNavigate();
|
||||
// const history = useHistory();
|
||||
|
||||
@@ -137,7 +137,7 @@ function Login() {
|
||||
setLoading(false);
|
||||
//navigate user to on signature page
|
||||
// history.push(`/recipientSignPdf/${id}/${_user.phone}`);
|
||||
navigate(`/recipientSignPdf/${id}/${_user.phone}`);
|
||||
navigate(`/recipientSignPdf/${id}/${contactBookId}`);
|
||||
}
|
||||
} catch (error) {}
|
||||
} else {
|
||||
|
||||
@@ -740,12 +740,12 @@ function PlaceHolderSign() {
|
||||
};
|
||||
const serverUrl = localStorage.getItem("baseUrl");
|
||||
const newServer = serverUrl.replaceAll("/", "%2F");
|
||||
|
||||
const objectId = signerMail[i].objectId;
|
||||
const serverParams = `${newServer}&${localStorage.getItem(
|
||||
"parseAppId"
|
||||
)}&${localStorage.getItem("_appName")}`;
|
||||
|
||||
let signPdf = `https://qik-ai-org.github.io/Sign-MicroappV2/#/login/${signersdata.objectId}/${signerMail[i].Email}/${serverParams}`;
|
||||
let signPdf = `https://qik-ai-org.github.io/Sign-MicroappV2/#/login/${signersdata.objectId}/${signerMail[i].Email}/${objectId}/${serverParams}`;
|
||||
|
||||
const themeBGcolor = themeColor();
|
||||
let params = {
|
||||
@@ -1025,7 +1025,7 @@ function PlaceHolderSign() {
|
||||
|
||||
<a
|
||||
style={{ color: "white" }}
|
||||
href={`https://qik-ai-org.github.io/Sign-MicroappV2/#/recipientSignPdf/${documentId}/${currentEmail[0].Phone}`}
|
||||
href={`https://qik-ai-org.github.io/Sign-MicroappV2/#/recipientSignPdf/${documentId}/${currentEmail[0].objectId}`}
|
||||
>
|
||||
<button
|
||||
style={{
|
||||
|
||||
@@ -26,8 +26,7 @@ import Header from "./component/header";
|
||||
import ModalComponent from "./component/modalComponent";
|
||||
import RenderPdf from "./component/renderPdf";
|
||||
function EmbedPdfImage() {
|
||||
const { id, userPhone } = useParams();
|
||||
|
||||
const { id, contactBookId } = useParams();
|
||||
const [isSignPad, setIsSignPad] = useState(false);
|
||||
const [pdfUrl, setPdfUrl] = useState();
|
||||
const [allPages, setAllPages] = useState(null);
|
||||
@@ -88,7 +87,7 @@ function EmbedPdfImage() {
|
||||
const getDocumentDetails = async () => {
|
||||
//aspfUo7wRl
|
||||
let currUserId, userObjectId;
|
||||
const json = await contactBookName(userPhone, "_Users");
|
||||
const json = await contactBookName(contactBookId, "_Users");
|
||||
|
||||
if (json !== "Error: Something went wrong!" && json && json.results[0]) {
|
||||
setContractName("_Users");
|
||||
@@ -124,7 +123,7 @@ function EmbedPdfImage() {
|
||||
setHandleError("Error: Something went wrong!");
|
||||
setIsLoading(loadObj);
|
||||
} else {
|
||||
const json = await contactBookName(userPhone, "_Contactbook");
|
||||
const json = await contactBookName(contactBookId, "_Contactbook");
|
||||
if (json && json.results[0]) {
|
||||
setContractName("_Contactbook");
|
||||
if (json.results[0]) {
|
||||
|
||||
@@ -23,7 +23,7 @@ function AppRoutes() {
|
||||
<Route path="/signaturePdf/:docId" element={<SignYourselfPdf />} />
|
||||
{/* recipient signature route with no rowlevel data using docId from url */}
|
||||
<Route
|
||||
path="/recipientSignPdf/:id/:userPhone"
|
||||
path="/recipientSignPdf/:id/:contactBookId"
|
||||
element={<RecipientSignPdf />}
|
||||
/>
|
||||
{/* recipient placeholder set route with rowlevel data */}
|
||||
@@ -33,7 +33,7 @@ function AppRoutes() {
|
||||
{/*Add default signature of user route */}
|
||||
<Route path="/managesign" element={<ManageSign />} />
|
||||
{/* login page route */}
|
||||
<Route path="/login/:id/:userMail/:serverUrl" element={<Login />} />
|
||||
<Route path="/login/:id/:userMail/:contactBookId/:serverUrl" element={<Login />} />
|
||||
{/* draft document route to handle and navigate route page accordiing to document status */}
|
||||
<Route path="/draftDocument" element={<DraftDocument />} />
|
||||
{/* for user signature (need your sign route) with row level data */}
|
||||
|
||||
@@ -260,7 +260,7 @@ export const contactBookName = async (userPhone, className) => {
|
||||
.get(
|
||||
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
|
||||
"_appName"
|
||||
)}${className}?where={"Phone":"${userPhone}"}`,
|
||||
)}${className}?where={"objectId":"${userPhone}"}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user