🔥 The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
create getDocument cloud function & minor UI changes
prafull-opensignlabsed6f44fd6247
diff --git a/apps/OpenSign/src/components/LoginFacebook.js b/apps/OpenSign/src/components/LoginFacebook.jsindex 442fcb3e7..1aeef2c73 100644--- a/apps/OpenSign/src/components/LoginFacebook.js+++ b/apps/OpenSign/src/components/LoginFacebook.js@@ -211,18 +211,18 @@ const LoginFacebook = ({<div><buttontype="button"- className="btn btn-secondary"- onClick={() => setIsModal(false)}- style={{ marginRight: 10, width: 90 }}+ onClick={() => handleSubmitbtn()}+ className="btn btn-info">- Cancel+ Sign up</button><buttontype="button"- onClick={() => handleSubmitbtn()}- className="btn btn-info"+ className="btn btn-secondary"+ onClick={() => setIsModal(false)}+ style={{ marginRight: 10, width: 90 }}>- Sign up+ Cancel</button></div></form>diff --git a/apps/OpenSign/src/components/LoginGoogle.js b/apps/OpenSign/src/components/LoginGoogle.jsindex 7e00b8e8c..1038b21bb 100644--- a/apps/OpenSign/src/components/LoginGoogle.js+++ b/apps/OpenSign/src/components/LoginGoogle.js@@ -263,17 +263,17 @@ const GoogleSignInBtn = ({</div><div className="form-group"><label- htmlFor="Destination"+ htmlFor="JobTitle"style={{ display: "flex" }}className="col-form-label">- Destination{" "}+ Job Title{" "}<span style={{ fontSize: 13, color: "red" }}>*</span></label><inputtype="text"className="form-control"- id="Destination"+ id="JobTitle"value={userDetails.Destination}onChange={(e) =>setUserDetails({@@ -287,18 +287,18 @@ const GoogleSignInBtn = ({<div><buttontype="button"- className="bg-[#6c757d] p-2 text-white rounded"- onClick={handleCloseModal}- style={{ marginRight: 10, width: 90 }}+ className="bg-[#17a2b8] p-2 text-white rounded"+ onClick={() => handleSubmitbtn()}>- Cancel+ Sign up</button><buttontype="button"- className="bg-[#17a2b8] p-2 text-white rounded"- onClick={() => handleSubmitbtn()}+ className="bg-[#6c757d] p-2 text-white rounded"+ onClick={handleCloseModal}+ style={{ marginRight: 10, width: 90 }}>- Sign up+ Cancel</button></div></form>diff --git a/apps/OpenSign/src/json/plansArr.json b/apps/OpenSign/src/json/plansArr.jsonindex 57439a344..ed75ffcb9 100644--- a/apps/OpenSign/src/json/plansArr.json+++ b/apps/OpenSign/src/json/plansArr.json@@ -26,7 +26,7 @@"planName": "THANKS PLAN","currency": "$","price": "29.99",- "subtitle": "Use code 'FREEBETA' to get this for free(First 100 users)",+ "subtitle": "Use code 'FREEBETA' to get this for free(First 1000 users)","btnText": "Subscribe","url": "https://subscriptions.zoho.in/subscribe/ef798486e6a0a11ea65f2bae8f2af901dbadf3175d495584fd25b9af5d2f2b9e/thanks","benefits": [diff --git a/apps/OpenSign/src/routes/Pgsignup.js b/apps/OpenSign/src/routes/Pgsignup.jsindex 75a34c253..79f033a6c 100644--- a/apps/OpenSign/src/routes/Pgsignup.js+++ b/apps/OpenSign/src/routes/Pgsignup.js@@ -151,6 +151,7 @@ const PgSignUp = (props) => {if (res) {const params = {userDetails: {+ jobTitle: zohoRes.data.result.jobTitle,company: zohoRes.data.result.company,name: zohoRes.data.result.name,email: zohoRes.data.result.email,@@ -438,10 +439,10 @@ const PgSignUp = (props) => {) : (<form id="signup" className="pgsignup-content" onSubmit={handleSubmit}><div className="pgsignup-container">- <h1 className="text-4xl font-bold">Choose Password</h1>+ <h1 className="text-2xl md:text-3xl font-bold">Choose Password</h1><hr className="hrt" /><label htmlFor="password">- <b>Password</b>+ <b className="text-[13px]">Password</b></label><inputtype="password"@@ -454,7 +455,7 @@ const PgSignUp = (props) => {/><label htmlFor="confirmPassword">- <b>Confirm Password</b>+ <b className="text-[13px]">Confirm Password</b></label><inputtype="password"diff --git a/apps/OpenSign/src/routes/PlanSubscriptions.js b/apps/OpenSign/src/routes/PlanSubscriptions.jsindex 88d9d3ed2..ad149b49c 100644--- a/apps/OpenSign/src/routes/PlanSubscriptions.js+++ b/apps/OpenSign/src/routes/PlanSubscriptions.js@@ -2,14 +2,14 @@ import React, { useState, useEffect } from "react";import { useNavigate } from "react-router";import { NavLink } from "react-router-dom";import checkmark from "../assets/images/checkmark.png";-import plansArr from '../json/plansArr.json'+import plansArr from "../json/plansArr.json";import Title from "../components/Title";const listItemStyle = {- paddingLeft: '20px', // Add padding to create space for the image+ paddingLeft: "20px", // Add padding to create space for the imagebackgroundImage: `url(${checkmark})`, // Set your image as the list style image- backgroundPosition: 'left',- backgroundRepeat: 'no-repeat',- backgroundSize: '16px 16px', // Adjust the size of the image+ backgroundPosition: "left",+ backgroundRepeat: "no-repeat",+ backgroundSize: "16px 16px" // Adjust the size of the image};const PlanSubscriptions = () => {@@ -28,7 +28,12 @@ const PlanSubscriptions = () => {: "";const phone =userDetails && userDetails.phone ? "&mobile=" + userDetails.phone : "";- const details = "?shipping_country_code=US&" + name + email + company + phone;+ const details =+ "?shipping_country_code=US&billing_country_code=US&billing_state_code=CA&" ++ name ++ email ++ company ++ phone;useEffect(() => {if (localStorage.getItem("accesstoken")) {setIsLoader(false);@@ -41,7 +46,7 @@ const PlanSubscriptions = () => {return (<>- <Title title={"Subscriptions"} />+ <Title title={"Subscriptions"} />{isLoader ? (<divstyle={{@@ -131,15 +136,13 @@ const PlanSubscriptions = () => {<p>{item.subtitle}</p></div></div>- <div className="bg-[#002862] w-full text-white py-2 rounded">- <NavLink- to={item.url + details}- className="rounded uppercase hover:no-underline hover:text-white"- target="_self"- >- {item.btnText}- </NavLink>- </div>+ <NavLink+ to={item.url + details}+ className="bg-[#002862] w-full text-white py-2 rounded uppercase hover:no-underline hover:text-white"+ target="_self"+ >+ {item.btnText}+ </NavLink></div><hr className="w-full bg-gray-300 p-[.5px]" /><ul className="mx-1 p-3 text-left break-words text-sm list-none">diff --git a/apps/OpenSign/src/routes/Signup.js b/apps/OpenSign/src/routes/Signup.jsindex 3ae28e34c..8c7332a16 100644--- a/apps/OpenSign/src/routes/Signup.js+++ b/apps/OpenSign/src/routes/Signup.js@@ -52,50 +52,27 @@ const Signup = (props) => {res.then(async (r) => {if (r) {- let roleurl = `${parseBaseUrl}functions/AddUserToRole`;- const headers = {- "Content-Type": "application/json",- "X-Parse-Application-Id": parseAppId,- sessionToken:- r.getSessionToken() || localStorage.getItem("accesstoken")- };- let body = {- appName: props.appInfo.appname,- roleName: props.appInfo.defaultRole,- userId: r.id- };- await axios.post(roleurl, body, { headers: headers });-let roleData = props.appInfo.settings;if (roleData && roleData.length > 0) {- roleData.forEach((rld) => {- if (rld.role === props.appInfo.defaultRole) {- const extCls = Parse.Object.extend(rld.extended_class);- const newObj = new extCls();- newObj.set("UserId", {- __type: "Pointer",- className: "_User",- objectId: r.id- });- newObj.set("UserRole", props.appInfo.defaultRole);- newObj.set("Email", email);- newObj.set("Name", name);- newObj.set("Phone", phone);- newObj.set("Company", company);- newObj.set("JobTitle", jobTitle);- newObj- .save()- .then((ex) => {- if (ex) {- handleNavigation(r.getSessionToken());- }- })- .catch((err) => {- alert(err.message);- setState({ loading: false });- });+ const params = {+ userDetails: {+ jobTitle: jobTitle,+ company: company,+ name: name,+ email: email,+ phone: phone,+ role: props.appInfo.defaultRole}- });+ };+ try {+ const usersignup = await Parse.Cloud.run("usersignup", params);+ if (usersignup) {+ handleNavigation(r.getSessionToken());+ }+ } catch (err) {+ alert(err.message);+ setState({ loading: false });+ }}}})diff --git a/apps/OpenSign/src/routes/UserProfile.js b/apps/OpenSign/src/routes/UserProfile.jsindex ae86ca1ba..f252f3644 100644--- a/apps/OpenSign/src/routes/UserProfile.js+++ b/apps/OpenSign/src/routes/UserProfile.js@@ -214,26 +214,11 @@ function UserProfile() {</li></ul><div className="flex justify-center pb-4">- <button- type="button"- onClick={() => {- if (editmode) {- setEditMode(false);- } else {- navigate("/changepassword");- }- }}- className={`rounded shadow text-white bg-[#3598dc] mr-4 ${- editmode ? "px-4 py-2 " : "p-2"- }`}- >- {editmode ? "Cancel" : "Change Password"}- </button>{editmode ? (<buttontype="button"onClick={handleSubmit}- className="rounded bg-white border-[1px] border-[#15b4e9] text-[#15b4e9] px-4 py-2"+ className="rounded bg-white border-[1px] border-[#15b4e9] text-[#15b4e9] px-4 py-2 mr-4">Save</button>@@ -243,11 +228,26 @@ function UserProfile() {onClick={() => {setEditMode(true);}}- className="rounded shadow text-white bg-[#e7505a] px-4 py-2"+ className="rounded shadow text-white bg-[#e7505a] px-4 py-2 mr-4">Edit</button>)}+ <button+ type="button"+ onClick={() => {+ if (editmode) {+ setEditMode(false);+ } else {+ navigate("/changepassword");+ }+ }}+ className={`rounded shadow text-white bg-[#3598dc] ${+ editmode ? "px-4 py-2 " : "p-2"+ }`}+ >+ {editmode ? "Cancel" : "Change Password"}+ </button></div></div>)}diff --git a/apps/OpenSign/src/styles/pgsignup.css b/apps/OpenSign/src/styles/pgsignup.cssindex fab477b35..102a878de 100644--- a/apps/OpenSign/src/styles/pgsignup.css+++ b/apps/OpenSign/src/styles/pgsignup.css@@ -1,12 +1,14 @@/* Full-width input fields */.inputt {width: 100%;- padding: 15px;- margin: 5px 0 22px 0;+ padding: 8px;+ margin-bottom: 10px;+ /* margin: 5px 0 14px 0; */display: inline-block;border: none;background: #f1f1f1;color: black;+ font-size: 12px;}/* Add a background color when the inputs get focus */@@ -18,11 +20,12 @@.confirmInputt {width: 100%;- padding: 15px;- margin: 5px 0 1px 0;+ padding: 8px;+ /* margin: 5px 0 14px 0; */display: inline-block;background: #f1f1f1;color: black;+ font-size: 12px;}.inputt::placeholder,@@ -42,11 +45,10 @@.signupbtn {background-color: #15b4e9;color: white;- padding: 14px 20px;+ padding: 12px 12px;margin: 8px 0;border: none;cursor: pointer;- width: 100%;opacity: 0.9;float: left;width: 50%;@@ -87,7 +89,7 @@margin: 5% auto 15% auto;/* 5% from the top, 15% from the bottom and centered */border: 1px solid #888;- width: 80%;+ width: 50%;/* Could be more or less, depending on screen size */}@@ -111,8 +113,26 @@}/* Change styles for cancel button and signup button on extra small screens */-@media screen and (max-width: 300px) {+@media screen and (max-width: 768px) {++ /* pgsignup Content/Box */+ .pgsignup-content {+ background-color: #fefefe;+ margin: 5% auto 15% auto;+ /* 5% from the top, 15% from the bottom and centered */+ border: 1px solid #888;+ width: 90%;+ /* Could be more or less, depending on screen size */+ }+.signupbtn {width: 100%;+ font-size: 16px;}-}++ /* Style the horizontal ruler */+ .hrt {+ border: 1px solid #f1f1f1;+ margin-bottom: 16px;+ }+}\ No newline at end of filediff --git a/apps/OpenSignServer/cloud/main.js b/apps/OpenSignServer/cloud/main.jsindex 2facd600c..634677ed7 100644--- a/apps/OpenSignServer/cloud/main.js+++ b/apps/OpenSignServer/cloud/main.js@@ -14,6 +14,8 @@ import SendMailv1 from './parsefunction/SendMailv1.js';import AuthLoginAsMail from './parsefunction/AuthLoginAsMail.js';import getUserId from './parsefunction/getUserId.js';import getUserDetails from './parsefunction/getUserDetails.js';+import getDocument from './parsefunction/getDocument.js';+import getInProgressReport from './parsefunction/getInProgressReport.js';Parse.Cloud.define('AddUserToRole', addUserToGroups);Parse.Cloud.define('UserGroups', getUserGroups);@@ -31,3 +33,4 @@ Parse.Cloud.define('sendmail', SendMailv1);Parse.Cloud.define('AuthLoginAsMail', AuthLoginAsMail);Parse.Cloud.define('getUserId', getUserId);Parse.Cloud.define('getUserDetails', getUserDetails);+Parse.Cloud.define('getDocument', getDocument);diff --git a/apps/OpenSignServer/cloud/parsefunction/getDocument.js b/apps/OpenSignServer/cloud/parsefunction/getDocument.jsnew file mode 100644index 000000000..e2e1d514c--- /dev/null+++ b/apps/OpenSignServer/cloud/parsefunction/getDocument.js@@ -0,0 +1,23 @@+export default async function getDocument(request) {+ const docId = request.params.docId;+ const userId = request.params.userId;+ if (docId && userId) {+ try {+ const query = new Parse.Query('contracts_Document');+ query.equalTo('objectId', docId);+ query.equalTo('ACL', new Parse.ACL(userId));+ query.include('ExtUserPtr');+ query.include('CreatedBy');+ query.include('Signers');+ query.include('AuditTrail.UserPtr');+ query.include('Placeholders');+ const res = await query.first({ useMasterKey: true });+ return res;+ } catch (err) {+ console.log('err', err);+ return err;+ }+ } else {+ return { error: 'Please pass required parameters!' };+ }+}