From fc953a91fa9920108f9e6dc5d81c49eb6a6f4b09 Mon Sep 17 00:00:00 2001 From: VishakhaSainani Date: Mon, 30 Oct 2023 21:51:49 +0530 Subject: [PATCH 01/19] Copyright notice updated --- apps/OpenSign/src/components/Footer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/OpenSign/src/components/Footer.js b/apps/OpenSign/src/components/Footer.js index 38327e7ed..e256174c2 100644 --- a/apps/OpenSign/src/components/Footer.js +++ b/apps/OpenSign/src/components/Footer.js @@ -2,7 +2,6 @@ import React, { useEffect, useState } from "react"; import Package from "../../package.json"; const Footer = () => { - let footer = localStorage.getItem("_appName"); const [showButton, setShowButton] = useState(false); const handleScroll = () => { if (window.pageYOffset >= 50) { @@ -24,11 +23,14 @@ const Footer = () => { window.removeEventListener("scroll", handleScroll); }; }, []); + + const appName = "OpenSign"; + return ( <>
All Rights Reserved © {new Date().getFullYear()}   - {footer && `${footer.charAt(0).toUpperCase()}${footer.slice(1)}`}{" "} + {appName}{" "} (version:{" "} {localStorage.getItem("appVersion") && `${Package.version}.${localStorage.getItem("appVersion")}`} From 7f50445657738788aadbd31be75c0b0a5b9b9af3 Mon Sep 17 00:00:00 2001 From: Andrew <148278535+andrew-opensignlabs@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:13:22 +0530 Subject: [PATCH 02/19] doc: Fix localhost url --- INSTALLATION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 2f726be84..f96ee51a0 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -19,9 +19,9 @@ Below are the steps to follow - ``` git clone https://github.com/OpenSignLabs/OpenSign.git ``` -- Rename the .env.frontend_dev file to .env using below command +- Copy the .env.frontend_dev file to .env using below command(on mac & linux). For windows use COPY command instead. ``` - mv .env.frontend_dev .env + cp .env.frontend_dev .env ``` - CD to /apps/OpenSign directory - Install NPM packages using @@ -32,7 +32,7 @@ Below are the steps to follow - ``` npm run start ``` -You should be able to access the application from https://localhost:3000 after this. +You should be able to access the application from http://localhost:3000 after this. Create an account by signing-up and start contributing. From dedabc0e6e136b7f871875398d65d581f05bee57 Mon Sep 17 00:00:00 2001 From: Andrew <148278535+andrew-opensignlabs@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:38:38 +0530 Subject: [PATCH 03/19] docs: fix the .env path for running locally --- INSTALLATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index f96ee51a0..78dbcf142 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -19,9 +19,9 @@ Below are the steps to follow - ``` git clone https://github.com/OpenSignLabs/OpenSign.git ``` -- Copy the .env.frontend_dev file to .env using below command(on mac & linux). For windows use COPY command instead. +- Copy the .env.frontend_dev file to apps/OpenSign/.env using below command(on mac & linux). For windows use COPY command instead. ``` - cp .env.frontend_dev .env + cp .env.frontend_dev apps/OpenSign/.env ``` - CD to /apps/OpenSign directory - Install NPM packages using From f40ef1621886d022e67ce4b452e723b22ef94269 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Tue, 31 Oct 2023 17:52:19 +0530 Subject: [PATCH 04/19] =?UTF-8?q?change=20open=20sign=20to=20OpenSign?= =?UTF-8?q?=E2=84=A2=20in=20completed=20mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js b/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js index 6d34147b2..f9e5994e7 100644 --- a/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js +++ b/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js @@ -86,7 +86,7 @@ async function sendCompletedMail(e) { s = e.pdfName, a = { url: a, - from: "Open sign", + from: "OpenSign™", recipient: e.receiver, subject: `Document ${s} has been signed by all parties`, pdfName: s, From adb13ff6c2f8ca14a709f65577e314a3c14adf8e Mon Sep 17 00:00:00 2001 From: Andrey Didenko Date: Tue, 31 Oct 2023 20:46:56 +0500 Subject: [PATCH 05/19] Fix the popup layout for "Add contact" --- apps/OpenSign/src/components/fields/MultiSelectField.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/OpenSign/src/components/fields/MultiSelectField.js b/apps/OpenSign/src/components/fields/MultiSelectField.js index 48aaef090..d3b10fbd2 100644 --- a/apps/OpenSign/src/components/fields/MultiSelectField.js +++ b/apps/OpenSign/src/components/fields/MultiSelectField.js @@ -656,7 +656,8 @@ const MultiSelectField = (props) => { right: 0, bottom: 0, backgroundColor: "rgba(255, 255, 255, 0.75)", - zIndex: 50 + zIndex: 50, + maxHeight: 450 } }} > From 8c4123d3d83524fcfc1fb2def1d940d0010ec2d9 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Tue, 31 Oct 2023 22:08:25 +0530 Subject: [PATCH 06/19] fix: signpdf cloud function not working properly --- .../cloud/parsefunction/pdf/PDF.min.js | 398 +++++++++--------- 1 file changed, 208 insertions(+), 190 deletions(-) diff --git a/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js b/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js index f9e5994e7..a7d141891 100644 --- a/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js +++ b/apps/OpenSignServer/cloud/parsefunction/pdf/PDF.min.js @@ -1,204 +1,222 @@ -import SignPDF from "./SignPDF.min.cjs"; -import fs from "node:fs"; -import axios from "axios"; -import FormData from "form-data"; -import plainplaceholder from "./customSignPdf/plainplaceholder.min.js"; -import { - plainAddPlaceholder -} from "node-signpdf/dist/helpers/index.js"; +import SignPDF from './SignPDF.min.cjs'; +import fs from 'node:fs'; +import axios from 'axios'; +import FormData from 'form-data'; +import plainplaceholder from './customSignPdf/plainplaceholder.min.js'; +import { plainAddPlaceholder } from 'node-signpdf/dist/helpers/index.js'; const serverUrl = process.env.SERVER_URL, - APPID = process.env.APP_ID, - masterKEY = process.env.MASTER_KEY; + APPID = process.env.APP_ID, + masterKEY = process.env.MASTER_KEY; async function uploadFile(a) { - try { - var e = new FormData, - t = (e.append("file", fs.createReadStream(a)), { - "content-type": "multipart/form-data", - "X-Parse-Application-Id": process.env.APP_ID - }), - s = process.env.SERVER_URL.slice(0, -4) + "/file_upload"; - return (await axios.post(s, e, { - headers: t - })).data - } catch (e) { - console.log("err ", e), fs.unlinkSync(a) - } + try { + var e = new FormData(), + t = + (e.append('file', fs.createReadStream(a)), + { 'content-type': 'multipart/form-data', 'X-Parse-Application-Id': process.env.APP_ID }), + s = process.env.SERVER_URL.slice(0, -4) + '/file_upload'; + return (await axios.post(s, e, { headers: t })).data; + } catch (e) { + console.log('err ', e), fs.unlinkSync(a); + } } -async function updateDoc(t, s, i, r, n, o) { - try { - var d = { - UserPtr: { - __type: "Pointer", - className: o, - objectId: i - }, - SignedUrl: s, - Activity: "Signed", - ipAddress: r - }; - let e; - var l = (e = n.AuditTrail && 0 < n.AuditTrail.length ? [...n.AuditTrail, d] : [d]).filter(e => "Signed" === e.Activity); - let a = !1; - !(n.Signers && 0 < n.Signers.length && l.length !== n.Signers.length || !(a = !0)); - var p = { - SignedUrl: s, - AuditTrail: e, - IsCompleted: a - }; - await axios.put(serverUrl + "/classes/contracts_Document/" + t, p, { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": APPID, - "X-Parse-Master-Key": masterKEY - } - }); - return { - isCompleted: a, - message: "success" - } - } catch (e) { - return console.log("update doc err ", e), "err" - } +async function updateDoc(t, s, r, i, o, n) { + try { + var d = { + UserPtr: { __type: 'Pointer', className: n, objectId: r }, + SignedUrl: s, + Activity: 'Signed', + ipAddress: i, + }; + let e; + var l = (e = o.AuditTrail && 0 < o.AuditTrail.length ? [...o.AuditTrail, d] : [d]).filter( + e => 'Signed' === e.Activity + ); + let a = !1; + !((o.Signers && 0 < o.Signers.length && l.length !== o.Signers.length) || !(a = !0)); + var p = { SignedUrl: s, AuditTrail: e, IsCompleted: a }; + await axios.put(serverUrl + '/classes/contracts_Document/' + t, p, { + headers: { + 'Content-Type': 'application/json', + 'X-Parse-Application-Id': APPID, + 'X-Parse-Master-Key': masterKEY, + }, + }); + return { isCompleted: a, message: 'success' }; + } catch (e) { + return console.log('update doc err ', e), 'err'; + } } async function sendMail(e) { - var a = e.url, - t = e.sender, - s = e.pdfName, - a = { - url: a, - from: "OpenSign™", - recipient: e.receiver, - subject: "You have signed the doc - " + s, - pdfName: s, - html: "

Document Copy

A copy of the document " + s + " Standard is attached to this email. Kindly download the document from the attachment.

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender " + t.Mail + " directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

" - }; - await axios.post(serverUrl + "/functions/sendmailv3", a, { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": APPID, - "X-Parse-Master-Key": masterKEY - } - }) + var a = e.url, + t = e.sender, + s = e.pdfName, + a = { + url: a, + from: 'OpenSign™', + recipient: e.receiver, + subject: 'You have signed the doc - ' + s, + pdfName: s, + html: + "

Document Copy

A copy of the document " + + s + + ' Standard is attached to this email. Kindly download the document from the attachment.

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender ' + + t.Mail + + ' directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

', + }; + await axios.post(serverUrl + '/functions/sendmailv3', a, { + headers: { + 'Content-Type': 'application/json', + 'X-Parse-Application-Id': APPID, + 'X-Parse-Master-Key': masterKEY, + }, + }); } async function sendCompletedMail(e) { - var a = e.url, - t = e.sender, - s = e.pdfName, - a = { - url: a, - from: "OpenSign™", - recipient: e.receiver, - subject: `Document ${s} has been signed by all parties`, - pdfName: s, - html: "

Document signed successfully

All parties have successfully signed the document " + s + ". Kindly download the document from the attachment.

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender " + t.Mail + " directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

" - }; - await axios.post(serverUrl + "/functions/sendmailv3", a, { + var a = e.url, + t = e.sender, + s = e.pdfName, + a = { + url: a, + from: 'OpenSign™', + recipient: e.receiver, + subject: `Document ${s} has beeen signed by all parties`, + pdfName: s, + html: + "

Document sign successfully

All parties have successfully signed the document" + + s + + '. Kindly download the document from the attachment.

This is an automated email from Open Sign. For any queries regarding this email, please contact the sender ' + + t.Mail + + ' directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.

', + }; + await axios.post(serverUrl + '/functions/sendmailv3', a, { + headers: { + 'Content-Type': 'application/json', + 'X-Parse-Application-Id': APPID, + 'X-Parse-Master-Key': masterKEY, + }, + }); +} +async function PDF(s, r) { + try { + var i = s.params.sign, + e = s.params.docId, + o = s.params.userId, + n = await axios.get(serverUrl + '/classes/contracts_Document/' + e + '?include=ExtUserPtr', { headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": APPID, - "X-Parse-Master-Key": masterKEY - } - }) -} -async function PDF(s, i) { - try { - var r = s.params.sign, - e = s.params.docId, - n = await axios.get(serverUrl + "/classes/contracts_Document/" + e + "?include=ExtUserPtr", { + 'Content-Type': 'application/json', + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + }), + d = await axios.get(serverUrl + '/users/me', { + headers: { + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + }); + if (!d.data || !d.data.objectId) return { status: 'error', message: 'this user not allowed!' }; + { + var l, + p, + c, + m = JSON.stringify({ objectId: o }); + let a, t; + t = o + ? (l = await axios.get(serverUrl + '/classes/contracts_Contactbook?where=' + m, { + headers: { + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + })).data && 0 < l.data.results.length + ? ((a = l), 'contracts_Contactbook') + : ((a = await axios.get(serverUrl + '/classes/contracts_Users?where=' + m, { + headers: { + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + })), + 'contracts_Users') + : ((p = JSON.stringify({ + UserId: { __type: 'Pointer', className: '_User', objectId: d.data.objectId }, + })), + (c = await axios.get(serverUrl + '/classes/contracts_Users?where=' + p, { + headers: { + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + })).data && 0 < c.data.results.length + ? ((a = c), 'contracts_Users') + : ((a = await axios.get(serverUrl + '/classes/contracts_Contactbook?where=' + p, { headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": APPID, - "X-Parse-Session-Token": s.headers.sessiontoken - } - }), - o = await axios.get(serverUrl + "/users/me", { - headers: { - "X-Parse-Application-Id": APPID, - "X-Parse-Session-Token": s.headers.sessiontoken - } + 'X-Parse-Application-Id': APPID, + 'X-Parse-Session-Token': s.headers.sessiontoken, + }, + })), + 'contracts_Contactbook')); + var g = a.data.results[0].Name, + h = a.data.results[0].Email; + if (!s.params.pdfFile) return { status: 'error', message: 'pdf file not present!' }; + { + let e = Buffer.from(s.params.pdfFile, 'base64'); + var u = process.env.PFX_BASE64, + f = Buffer.from(u, 'base64'); + e = i + ? plainplaceholder({ + pdfBuffer: e, + reason: 'Digitally signed by Open sign for ' + g + ' <' + h + '>', + location: 'test location', + signatureLength: 1e4, + sign: i, + }) + : plainAddPlaceholder({ + pdfBuffer: e, + reason: 'Digitally signed by Open sign for ' + g + ' <' + h + '>', + location: 'test location', + signatureLength: 1e4, }); - if (!o.data || !o.data.objectId) return { - status: "error", - message: "this user not allowed!" - }; { - var d = JSON.stringify({ - UserId: { - __type: "Pointer", - className: "_User", - objectId: o.data.objectId - } - }); - let a, t; - var l = await axios.get(serverUrl + "/classes/contracts_Users?where=" + d, { - headers: { - "X-Parse-Application-Id": APPID, - "X-Parse-Session-Token": s.headers.sessiontoken - } + var y = await new SignPDF(e, f).signPDF(), + v = `./exports/exported_file_${Math.floor(5e3 * Math.random())}.pdf`, + P = (fs.writeFileSync(v, y), await uploadFile(v)); + if (P && P.imageUrl) { + const r = await updateDoc( + s.params.docId, + P.imageUrl, + a.data.results[0].objectId, + s.headers['x-real-ip'], + n.data, + t + ); + return ( + sendMail({ + url: P.imageUrl, + sender: { Mail: n.data.ExtUserPtr.Email, Name: n.data.ExtUserPtr.Name }, + pdfName: n.data.Name, + receiver: h, }), - p = (t = l.data && 0 < l.data.results.length ? (a = l, "contracts_Users") : (a = await axios.get(serverUrl + "/classes/contracts_Contactbook?where=" + d, { - headers: { - "X-Parse-Application-Id": APPID, - "X-Parse-Session-Token": s.headers.sessiontoken - } - }), "contracts_Contactbook"), a.data.results[0].Name), - c = a.data.results[0].Email; - if (!s.params.pdfFile) return { - status: "error", - message: "pdf file not present!" - }; { - let e = Buffer.from(s.params.pdfFile, "base64"); - var m = fs.readFileSync("pdfFile/emudhra-test-class2.pfx"); - e = r ? plainplaceholder({ - pdfBuffer: e, - reason: "Digitally signed by Open sign for " + p + " <" + c + ">", - location: "test location", - signatureLength: 1e4, - sign: r - }) : plainAddPlaceholder({ - pdfBuffer: e, - reason: "Digitally signed by Open sign for " + p + " <" + c + ">", - location: "test location", - signatureLength: 1e4 - }); - var g = await new SignPDF(e, m).signPDF(), - u = `./exports/exported_file_${Math.floor(5e3 * Math.random())}.pdf`, - f = (fs.writeFileSync(u, g), await uploadFile(u)); - if (f && f.imageUrl) { - const i = await updateDoc(s.params.docId, f.imageUrl, a.data.results[0].objectId, s.headers["x-real-ip"], n.data, t); - return sendMail({ - url: f.imageUrl, - sender: { - Mail: n.data.ExtUserPtr.Email, - Name: n.data.ExtUserPtr.Name - }, - pdfName: n.data.Name, - receiver: c - }), i && i.isCompleted && sendCompletedMail({ - url: f.imageUrl, - sender: { - Mail: n.data.ExtUserPtr.Email, - Name: "Open sign" - }, - pdfName: n.data.Name, - receiver: n.data.ExtUserPtr.Email - }), fs.unlinkSync(u), console.log("New Signed PDF created called: " + u), "success" === i.message ? { - status: "success", - data: f.imageUrl - } : { - status: "error", - message: "please provide required parameters!" - } - } - } - } - } catch (e) { - return console.log("Err ", e), "ERR_BAD_REQUEST" === e.code ? { - status: "error", - message: "Invalid session token!" - } : { - status: "error", - message: "Encrypted files are currently not supported!" + r && + r.isCompleted && + sendCompletedMail({ + url: P.imageUrl, + sender: { Mail: n.data.ExtUserPtr.Email, Name: 'Open sign' }, + pdfName: n.data.Name, + receiver: n.data.ExtUserPtr.Email, + }), + fs.unlinkSync(v), + console.log('New Signed PDF created called: ' + v), + 'success' === r.message + ? { status: 'success', data: P.imageUrl } + : { status: 'error', message: 'please provide required parameters!' } + ); } + } } + } catch (e) { + return ( + console.log('Err ', e), + 'ERR_BAD_REQUEST' === e.code + ? { status: 'error', message: 'Invalid session token!' } + : { status: 'error', message: 'Encrypted files are currently not supported!' } + ); + } } -export default PDF; \ No newline at end of file +export default PDF; From 8e2c9c02691f090915cb3b9c8d1e06948e332c18 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:47:53 +0000 Subject: [PATCH 07/19] docs: update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a9cd0e20b..a5d3d34ed 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,9 @@ We would like to thank all our contributors and users for their support and feed Aria
Aria

💻 Soumyadipto Pal
Soumyadipto Pal

💻 + + Andrey Didenko
Andrey Didenko

💻 + From 366b89a0b9df2e5d49ea5d96d11e5f701c4bc54e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:47:54 +0000 Subject: [PATCH 08/19] docs: update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 65fa59897..d7669b4d0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -133,6 +133,15 @@ "contributions": [ "code" ] + }, + { + "login": "AndreyCurious", + "name": "Andrey Didenko", + "avatar_url": "https://avatars.githubusercontent.com/u/105622604?v=4", + "profile": "https://github.com/AndreyCurious", + "contributions": [ + "code" + ] } ] } From 1195eb408c5580e826dc9d4cf1e2c19539e4db25 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Wed, 1 Nov 2023 15:51:17 +0530 Subject: [PATCH 09/19] feat: add yourself check box in add signer form --- .../src/components/AppendFormInForm.js | 1539 +++-------------- .../src/components/fields/MultiSelectField.js | 68 +- apps/OpenSign/src/json/FormJson.js | 10 +- apps/OpenSign/src/json/ReportJson.js | 2 +- .../src/primitives/GetReportDisplay.js | 18 +- 5 files changed, 353 insertions(+), 1284 deletions(-) diff --git a/apps/OpenSign/src/components/AppendFormInForm.js b/apps/OpenSign/src/components/AppendFormInForm.js index 494936742..d090348e3 100644 --- a/apps/OpenSign/src/components/AppendFormInForm.js +++ b/apps/OpenSign/src/components/AppendFormInForm.js @@ -1,1269 +1,304 @@ -import React, { Component } from "react"; -import { connect } from "react-redux"; -import { - removeState, - removeLevel2State, - removeLevel3State -} from "../redux/actions/index"; -import Engine from "json-rules-engine-simplified"; -import applyRules from "rjsf-conditionals"; -import Form from "@rjsf/core"; -import validator from "@rjsf/validator-ajv8"; -import "../styles/form.css"; -import "../styles/toast.css"; +import React, { useState, useEffect } from "react"; import Parse from "parse"; -import "../styles/loader.css"; -import LayoutField from "./fields/Rjsf-layout"; -import TimeWidget from "./fields/TimeWidget"; import axios from "axios"; -import { Navigate } from "react-router-dom"; -import HiddenField from "./fields/HiddenField"; -import ErrorBoundary from "./ErrorBoundary"; -import parse from "html-react-parser"; -import { formJson } from "../json/FormJson"; -const widget = { - TimeWidget: TimeWidget -}; -const fields = () => { - return { - layout: LayoutField, - HiddenField: HiddenField - }; -}; +const AppendFormInForm = (props) => { + const [name, setName] = useState(""); + const [phone, setPhone] = useState(""); + const [email, setEmail] = useState(""); + const [addYourself, setAddYourself] = useState(false); + const [isLoader, setIsLoader] = useState(false); + const [isUserExist, setIsUserExist] = useState(false); + const parseBaseUrl = localStorage.getItem("baseUrl"); + const parseAppId = localStorage.getItem("parseAppId"); -class AppendFormInForm extends Component { - state = { - schema: {}, - ui_schema: {}, - extraActions: undefined, - rules: [], - isAppRequest: false, - formData: {}, - persistentFields: [], - successMassage: "Record inserted successfully.", - title: "", - active: true, - buttons: {}, - schemaState: {}, - noValidate: false, - liveValidate: false, - _validate: null, - userSchema: {}, - loading: false, - parseBaseUrl: localStorage.getItem("baseUrl"), - parseAppId: localStorage.getItem("parseAppId"), - toastColor: "#5cb85c", - toastDescription: "", - redirect_type: "", - redirect_id: "", - FormACL: null, - help: "", - link: "" - }; - - async getForm(id) { - this.setState({ - loading: true - }); - try { - // get json from data(jsonschema, uischema) - const results = formJson(id); - // console.log("results", id, results); - if (results) { - const resultjson = results; - if (resultjson.userSchema !== undefined) { - this.setState({ - userSchema: resultjson.userSchema - }); - } - for (let [value] of Object.entries(resultjson.jsonSchema.properties)) { - if (typeof value === "object") { - for (let [k, v] of Object.entries(value)) { - if (k === "format" && v === "date") { - let today = new Date(); - let date = - today.getFullYear() + - "-" + - ("0" + (today.getMonth() + 1)).slice(-2) + - "-" + - ("0" + today.getDate()).slice(-2); - value.default = date; - } - if (k === "component" && v === "DateTime") { - value.default = new Date().toISOString(); - } - } - } - } - let txt, - link, - successMsg, - _rules = [], - persistentFields = [], - _extraActions = {}; - if (resultjson.help) { - if (resultjson.help.htmlbody) { - txt = resultjson.help.htmlbody; - } - if (resultjson.help.link) { - link = resultjson.help.link; - } - } - if (resultjson.rules) { - _rules = resultjson.rules; - } - if (resultjson.persistentFields) { - persistentFields = resultjson.persistentFields; - } - if (resultjson.extraActions) { - _extraActions = this.setExtraActions(resultjson.extraActions); - } - if (resultjson.success_message) { - successMsg = resultjson.success_message; - } else { - successMsg = this.state.successMassage; - } - let _jsonSchema = JSON.stringify(resultjson.jsonSchema); - _jsonSchema = _jsonSchema.replace("#$", "$"); - _jsonSchema = _jsonSchema.replace("#*", "$"); - _jsonSchema = _jsonSchema.replace("_DOT_", "."); - - let _replaceJSONSchema = JSON.parse(_jsonSchema); - this.setState({ - redirect_type: resultjson.success_redirect, - redirect_id: resultjson.redirect_id, - FormACL: resultjson.formACL, - help: txt, - link: link, - persistentFields: persistentFields, - successMassage: successMsg, - buttons: resultjson.buttons.add, - schemaState: _replaceJSONSchema, - ui_schema: resultjson.uiSchema, - rules: _rules, - extraActions: _extraActions, - title: resultjson.class, - _validate: resultjson.validFunction, - noValidate: resultjson.noValidate, - liveValidate: resultjson.liveValidate && resultjson.liveValidate, - loading: false - }); - localStorage.setItem( - "jsonschema", - JSON.stringify(resultjson.jsonSchema) - ); - } else { - alert("form not found"); - } - } catch (e) { - if (e.message === "Invalid session token") { - let appdata = localStorage.getItem("userSettings"); - let applogo = localStorage.getItem("appLogo"); - let appName = localStorage.getItem("appName"); - let defaultmenuid = localStorage.getItem("defaultmenuid"); - let PageLanding = localStorage.getItem("PageLanding"); - let domain = localStorage.getItem("domain"); - let _appName = localStorage.getItem("_appName"); - let baseUrl = localStorage.getItem("BaseUrl12"); - let appid = localStorage.getItem("AppID12"); - - localStorage.clear(); - - localStorage.setItem("appLogo", applogo); - localStorage.setItem("appName", appName); - localStorage.setItem("_appName", _appName); - localStorage.setItem("defaultmenuid", defaultmenuid); - localStorage.setItem("PageLanding", PageLanding); - localStorage.setItem("domain", domain); - localStorage.setItem("userSettings", appdata); - localStorage.setItem("BaseUrl12", baseUrl); - localStorage.setItem("AppID12", appid); - - return ; - } - console.log(e.message); - console.error("Problem", e); - this.setState({ - loading: false - }); - } - } - - wrap = (s) => "{ return " + s + " };"; - - // func = new Function(wrap(body)); - - dynamicValidate = (formData, errors) => { - try { - let body = atob(this.state._validate); - let res = new Function(this.wrap(body)) - .call(null) - .call(null, formData, errors); - return res; - } catch (error) { - console.log(error); - } - }; - - setExtraActions = (actions) => { - try { - let result = {}; - Object.entries(actions).forEach(([key, value]) => { - let body = atob(value); - let res = new Function(this.wrap(body)).call(null); - result[key] = res; - }); - return result; - } catch (error) { - console.log(error); - } - }; - - handleSubmit = async ({ formData }) => { - this.setState({ active: false, loading: true }); - if ( - this.state.userSchema && - Object.entries(this.state.userSchema).length !== 0 && - this.state.userSchema.constructor === Object - ) { - try { - let RowData = formData; - RowData && - Object.entries(RowData).forEach(([key, value]) => { - if (typeof value === "string") { - RowData[key] = value.trim(); - } - }); - let UserData = {}; - let RoleField = ""; - let _scanData = this.state.schemaState; - if (_scanData.dependencies) { - Object.keys(_scanData.dependencies).forEach((key) => { - if (_scanData.dependencies[key].oneOf) { - _scanData.dependencies[key].oneOf.forEach((val) => { - Object.keys(val.properties).forEach((k) => { - if (typeof val.properties[k] === "object") { - if (val.properties[k].format === "date") { - if (RowData[k]) { - let newdate = new Date(RowData[k]); - RowData[k] = newdate; - } - } - if (val.properties[k].component === "HtmlEditor") { - if (RowData[k]) { - let newHtml = RowData[k] - .replace(/]*>/g, "") - .replace(/<\/p>/g, " "); - RowData[k] = newHtml; - } - } - if (val.properties[k].component === "DateTime") { - if (RowData[k]) { - let newDate11 = new Date(RowData[k]); - RowData[k] = newDate11; - } - } - if (val.properties[k].component === "CurrencyInput") { - if (val.properties[k].currencyColumn) { - RowData[`${val.properties[k].currencyColumn}`] = - val.properties[k].defaultcurrency; - } - } - if (val.properties[k].type === "string") { - if (typeof RowData[k] === "string") - RowData[k] = RowData[k].trim(); - } - if (val.properties[k].data !== undefined) { - if (val.properties[k].data.isPointer) { - let pointer = undefined; - if (val.properties[k].data.class) { - if (val.properties[k].data.savePointerClass) { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: - val.properties[k].data.savePointerClass, - objectId: RowData[k] - }; - } - } else { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: val.properties[k].data.class, - objectId: RowData[k] - }; - } - } - } else { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: localStorage.getItem("extended_class"), - objectId: RowData[k] - }; - } - } - RowData[k] = pointer; - } - if (val.properties[k].data.FolderTypeValue) { - if (RowData[k]) { - let obj = { - __type: "Pointer", - className: val.properties[k].data.ClassName, - objectId: RowData[k] - }; - RowData[k] = obj; - } - } - } - } - }); - }); - } - }); - } - let _userScheama = this.state.userSchema; - - Object.keys(_scanData).forEach(function (key) { - let _dd = _scanData[key]; - typeof _dd === "object" && - Object.keys(_dd).forEach(function (k) { - if (_dd[k].type === "array" && _dd[k].items) { - let _prop = _dd[k].items.properties; - - if (_prop && Array.isArray(RowData[k])) { - let newRow = []; - RowData[k].forEach((t) => { - let _newObj = t; - if (typeof t === "object") { - Object.keys(_prop).forEach(function (l) { - if (_prop[l].data && _prop[l].data.isPointer) { - if (typeof t[l] === "object") { - let obj = { - __type: "Pointer", - className: _prop[l].data.class, - objectId: t[l].objectId - }; - _newObj = { ..._newObj, [l]: obj }; - } else { - let obj = { - __type: "Pointer", - className: _prop[l].data.class, - objectId: t[l] - }; - _newObj = { ..._newObj, [l]: obj }; - } - } - }); - } - newRow.push(_newObj); - }); - RowData[k] = newRow; - } - } - - if (_dd[k].component === "AutoSuggest" && _dd[k].isPointer) { - if (RowData[k]) { - let pointer = { - __type: "Pointer", - className: _dd[k].class, - objectId: RowData[k] - }; - RowData[k] = pointer; - } - } - if (_dd[k].format === "date") { - let newdate = new Date(RowData[k]); - RowData[k] = newdate; - } - if (_dd[k].component === "CurrencyInput") { - RowData[`${_dd[k].currencyColumn}`] = _dd[k].defaultcurrency; - } - if (_dd[k].component === "HtmlEditor") { - if (RowData[k]) { - let newHtml = RowData[k] - .replace(/]*>/g, "") - .replace(/<\/p>/g, " "); - RowData[k] = newHtml; - } - } - if (_dd[k].component === "DateTime") { - let newDate; - if (!RowData[k]) { - newDate = new Date(); - } else { - newDate = new Date(RowData[k]); - } - RowData[k] = newDate; - } - if (_dd[k].data !== undefined) { - if (_dd[k].data.isPointer) { - let pointer = undefined; - if (_dd[k].data.savePointerClass) { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: _dd[k].data.savePointerClass, - objectId: RowData[k] - }; - RowData[k] = pointer; - } - } else if (RowData[k]) { - if (_dd[k].data.class) { - pointer = { - __type: "Pointer", - className: _dd[k].data.class, - objectId: RowData[k] - }; - } else { - pointer = { - __type: "Pointer", - className: localStorage.getItem("extended_class"), - objectId: RowData[k] - }; - } - - RowData[k] = pointer; - } - } - if (_dd[k].data.FolderTypeValue) { - if (RowData[k]) { - let obj = { - __type: "Pointer", - className: _dd[k].data.ClassName, - objectId: RowData[k] - }; - RowData[k] = obj; - } - } - } - if (_dd[k].type === "string") { - let d = RowData[k]; - if (typeof d === "string") { - RowData[k] = d.trim(); - } - } - }); - }); - - Object.keys(_userScheama).forEach(function (kkey) { - Object.keys(RowData).forEach(function (_k) { - if (_userScheama[kkey].startsWith("$")) { - let _uuu = _userScheama[kkey].replace("$", ""); - if (kkey === "Role" || kkey === "role") { - if (RowData[_uuu] === RowData[_k]) { - RoleField = RowData[_uuu]; - } - } else if (_uuu === _k) { - UserData[kkey] = RowData[_k]; - } - } else { - RoleField = _userScheama[kkey]; - } - }); - }); - Parse.serverURL = this.state.parseBaseUrl; - Parse.initialize(this.state.parseAppId); - var _users = Parse.Object.extend("User"); - var _user = new _users(); - let _uname = UserData.name; - _user.set("name", _uname.toString().trim()); - if (UserData.username) { - let _u_un = UserData.username; - _user.set("username", _u_un.toString().trim()); - if (UserData.email) { - let _email = UserData.email; - _user.set("email", _email.trim()); - } - } else if (UserData.email) { - let _email = UserData.email; - _user.set("email", _email.trim()); - _user.set("username", _email.trim()); - } else { - _user.set("username", UserData.phone.toString().trim()); - } - _user.set("phone", UserData.phone); - _user.set("password", UserData.password); - _user.save().then( - (u) => { - let roleurl = `${this.state.parseBaseUrl}functions/AddUserToRole`; - const headers = { - "Content-Type": "application/json", - "X-Parse-Application-Id": this.state.parseAppId, - sessionToken: localStorage.getItem("accesstoken") - }; - let body = { - appName: localStorage.getItem("_appName"), - roleName: RoleField, - userId: u.id - }; - axios.post(roleurl, body, { headers: headers }).then(() => { - const currentUser = Parse.User.current(); - let _fname = this.state.title; - var forms = Parse.Object.extend(_fname); - var form = new forms(); - form.set( - "CreatedBy", - Parse.User.createWithoutData(currentUser.id) - ); - if (localStorage.getItem("TenetId")) { - form.set("TenantId", { - __type: "Pointer", - className: "partners_Tenant", - objectId: localStorage.getItem("TenetId") - }); - } - form.set("UserId", u); - form.set("UserRole", RoleField); - if (this.state["FormACL"]) { - let ACL = {}; - for (let [key, value] of Object.entries( - this.state["FormACL"] - )) { - if (key === "*") { - ACL[key] = value; - } - if (key === "#currentUser#") { - ACL[Parse.User.current().id] = value; - } - if (key.startsWith("role")) { - ACL[key] = value; - } - } - form.setACL(new Parse.ACL(ACL)); - } - form.save(RowData).then( - (formd) => { - const parseData = JSON.parse(JSON.stringify(formd)); - this.props.details({ - value: parseData[this.props.valueKey], - label: parseData[this.props.displayKey] - }); - if (this.props.closePopup) { - this.props.closePopup(); - } - let filtered = {}; - if (this.state.redirect_type === "clearData") { - if ( - this.state.persistentFields && - this.state.persistentFields.length - ) { - filtered = Object.keys(RowData) - .filter((key) => - this.state.persistentFields.includes(key) - ) - .reduce((obj, key) => { - obj[key] = RowData[key]; - return obj; - }, {}); - } - } else { - RowData = {}; - } - this.setState( - { - formData: filtered, - active: true, - loading: false, - toastColor: "#5cb85c", - toastDescription: this.state.successMassage - }, - () => { - this.props.removeState(); - this.props.removeLevel2State(); - this.props.removeLevel3State(); - var x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - ); - }, - (error) => { - console.log("error", error.message); - this.setState({ - loading: false, - active: true, - toastColor: "#d9534f", - toastDescription: error.message - }); - - var x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - ); - }); - }, - async (error) => { - if (error.code === 202) { - let params; - if (UserData.username) { - params = { username: UserData.username }; - } else if (UserData.email) { - params = { email: UserData.email }; - } else { - params = { username: UserData.phone }; - } - const userRes = await Parse.Cloud.run("getUserId", params); - - try { - let _emp = { - __type: "Pointer", - className: "_User", - objectId: userRes.id - }; - let roleurl = `${this.state.parseBaseUrl}functions/AddUserToRole`; - const headers = { - "Content-Type": "application/json", - "X-Parse-Application-Id": this.state.parseAppId, - sessionToken: localStorage.getItem("accesstoken") - }; - let body = { - appName: localStorage.getItem("_appName"), - roleName: RoleField, - userId: userRes.id - }; - await axios - .post(roleurl, body, { headers: headers }) - .then(() => { - const currentUser = Parse.User.current(); - let _fname = this.state.title; - var forms = Parse.Object.extend(_fname); - var form = new forms(); - form.set( - "CreatedBy", - Parse.User.createWithoutData(currentUser.id) - ); - if (localStorage.getItem("TenetId")) { - form.set("TenantId", { - __type: "Pointer", - className: "partners_Tenant", - objectId: localStorage.getItem("TenetId") - }); - } - form.set("UserId", _emp); - form.set("UserRole", RoleField); - if (this.state["FormACL"]) { - let ACL = {}; - for (let [key, value] of Object.entries( - this.state["FormACL"] - )) { - if (key === "*") { - ACL[key] = value; - } - if (key === "#currentUser#") { - ACL[Parse.User.current().id] = value; - } - if (key.startsWith("role")) { - ACL[key] = value; - } - } - form.setACL(new Parse.ACL(ACL)); - } - form.save(RowData).then( - (formd) => { - const parseData = JSON.parse(JSON.stringify(formd)); - this.props.details({ - value: parseData[this.props.valueKey], - label: parseData[this.props.displayKey] - }); - if (this.props.closePopup) { - this.props.closePopup(); - } - let filtered = {}; - if (this.state.redirect_type === "clearData") { - if ( - this.state.persistentFields && - this.state.persistentFields.length - ) { - filtered = Object.keys(RowData) - .filter((key) => - this.state.persistentFields.includes(key) - ) - .reduce((obj, key) => { - obj[key] = RowData[key]; - return obj; - }, {}); - } - } else { - RowData = {}; - } - this.setState({ - formData: filtered, - active: true, - loading: false, - toastColor: "#5cb85c", - toastDescription: "Record inserted successfully." - }); - // this.props.removeState(); - // this.props.removeLevel2State(); - // this.props.removeLevel3State(); - // var x = document.getElementById("snackbar"); - // x.className = "show"; - // setTimeout(function () { - // x.className = x.className.replace("show", ""); - // }, 2000); - }, - (error) => { - this.setState({ - loading: false, - active: true, - toastColor: "#d9534f", - toastDescription: error.message - }); - - var x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - ); - }); - } catch (error) { - this.setState({ - loading: false, - active: true, - toastColor: "#d9534f", - toastDescription: error.message - }); - - const x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - } - } - ); - } catch (e) { - console.log("Problem", e.message); - this.setState({ loading: false, active: true }); - } - } else { - try { - let RowData = formData; - let _scanData = this.state.schemaState; - if (_scanData.dependencies) { - Object.keys(_scanData.dependencies).forEach((key) => { - if (_scanData.dependencies[key].oneOf) { - _scanData.dependencies[key].oneOf.forEach((val) => { - Object.keys(val.properties).forEach((k) => { - if (typeof val.properties[k] === "object") { - if (val.properties[k].format === "date") { - if (RowData[k]) { - let newdate = new Date(RowData[k]); - RowData[k] = newdate; - } - } - if (val.properties[k].component === "HtmlEditor") { - if (RowData[k]) { - let newHtml = RowData[k] - .replace(/]*>/g, "") - .replace(/<\/p>/g, " "); - RowData[k] = newHtml; - } - } - if (val.properties[k].component === "DateTime") { - if (RowData[k]) { - let newDate11 = new Date(RowData[k]); - RowData[k] = newDate11; - } - } - if (val.properties[k].component === "CurrencyInput") { - if (val.properties[k].currencyColumn) { - RowData[`${val.properties[k].currencyColumn}`] = - val.properties[k].defaultcurrency; - } - } - if (val.properties[k].type === "string") { - if (typeof RowData[k] === "string") - RowData[k] = RowData[k].trim(); - } - if (val.properties[k].data !== undefined) { - if (val.properties[k].data.isPointer) { - let pointer = undefined; - if (val.properties[k].data.savePointerClass) { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: - val.properties[k].data.savePointerClass, - objectId: RowData[k] - }; - } - } else if (val.properties[k].data.class) { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: val.properties[k].data.class, - objectId: RowData[k] - }; - } - } else { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: localStorage.getItem("extended_class"), - objectId: RowData[k] - }; - } - } - - RowData[k] = pointer; - } - if (val.properties[k].data.FolderTypeValue) { - if (RowData[k]) { - let obj = { - __type: "Pointer", - className: val.properties[k].data.ClassName, - objectId: RowData[k] - }; - RowData[k] = obj; - } - } - } - } - }); - }); - } - }); - } - Object.keys(_scanData).forEach(function (key) { - let _dd = _scanData[key]; - if (typeof _dd === "object") { - Object.keys(_dd).forEach(function (k) { - if (_dd[k].type === "array" && _dd[k].items) { - let _prop = _dd[k].items.properties; - if (_prop && Array.isArray(RowData[k])) { - let newRow = []; - RowData[k].forEach((t) => { - let _newObj = t; - if (typeof t === "object") { - Object.keys(_prop).forEach(function (l) { - if (_prop[l].data && _prop[l].data.isPointer) { - if (typeof t[l] === "object") { - let obj = { - __type: "Pointer", - className: _prop[l].data.class, - objectId: t[l].objectId - }; - _newObj = { ..._newObj, [l]: obj }; - } else { - let obj = { - __type: "Pointer", - className: _prop[l].data.class, - objectId: t[l] - }; - _newObj = { ..._newObj, [l]: obj }; - } - } - }); - } - newRow.push(_newObj); - }); - RowData[k] = newRow; - } - } - - if (_dd[k].component === "AutoSuggest" && _dd[k].isPointer) { - if (RowData[k]) { - let pointer = { - __type: "Pointer", - className: _dd[k].class, - objectId: RowData[k] - }; - RowData[k] = pointer; - } - } - if (_dd[k].format === "date") { - let newdate = new Date(RowData[k]); - RowData[k] = newdate; - } - if (_dd[k].component === "HtmlEditor") { - if (RowData[k]) { - let newHtml = RowData[k] - .replace(/]*>/g, "") - .replace(/<\/p>/g, " "); - RowData[k] = newHtml; - } - } - if (_dd[k].component === "DateTime") { - let newDate11; - if (!RowData[k]) { - newDate11 = new Date(); - } else { - newDate11 = new Date(RowData[k]); - } - RowData[k] = newDate11; - } - if (_dd[k].component === "CurrencyInput") { - if (_dd[k].currencyColumn) { - RowData[`${_dd[k].currencyColumn}`] = _dd[k].defaultcurrency; - } - } - if (_dd[k].data !== undefined) { - if (_dd[k].data.isPointer) { - let pointer = undefined; - if (RowData[k] && RowData[k] !== "Select") { - if (_dd[k].type === "array") { - pointer = []; - RowData[k] && - RowData[k].forEach((a) => { - let _kk = {}; - if (_dd[k].data.savePointerClass) { - _kk = { - __type: "Pointer", - className: _dd[k].data.savePointerClass, - objectId: a - }; - } else { - _kk = { - __type: "Pointer", - className: _dd[k].data.class, - objectId: a - }; - } - - pointer.push(_kk); - }); - } else if (_dd[k].data.class) { - if (_dd[k].data.savePointerClass) { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: _dd[k].data.savePointerClass, - objectId: RowData[k] - }; - } - } else if (RowData[k]) { - pointer = { - __type: "Pointer", - className: _dd[k].data.class, - objectId: RowData[k] - }; - } - } else { - if (RowData[k]) { - pointer = { - __type: "Pointer", - className: localStorage.getItem("extended_class"), - objectId: RowData[k] - }; - } - } - - RowData[k] = pointer; - } - } - if (_dd[k].data.FolderTypeValue) { - if (RowData[k]) { - let obj = { - __type: "Pointer", - className: _dd[k].data.ClassName, - objectId: RowData[k] - }; - RowData[k] = obj; - } - } - } - if (_dd[k].type === "string") { - let d = RowData[k]; - if (typeof d === "string") { - RowData[k] = d.trim(); - } - } - }); - } - }); - Parse.serverURL = this.state.parseBaseUrl; - Parse.initialize(this.state.parseAppId); - const currentUser = Parse.User.current(); - let _fname = this.state.title; - var forms = Parse.Object.extend(_fname); - - var form = new forms(); - - form.set("CreatedBy", Parse.User.createWithoutData(currentUser.id)); - - if (this.state["FormACL"]) { - let ACL = {}; - for (let [key, value] of Object.entries(this.state["FormACL"])) { - if (key === "*") { - ACL[key] = value; - } - if (key === "#currentUser#") { - ACL[Parse.User.current().id] = value; - } else if (key.startsWith("#")) { - let arr = key.split("#"); - let new_arr = arr.filter((x) => x !== ""); - if (new_arr.length === 2) { - let l = RowData[new_arr[0]]; - try { - const Agent = Parse.Object.extend(l.className); - const qu = new Parse.Query(Agent); - qu.equalTo("objectId", l.objectId); - qu.include(new_arr[1]); - await qu.first(); - } catch (err) { - console.log("Error while fetching Agent", err.massage); - } - } - } - if (key.startsWith("role")) { - ACL[key] = value; - } - } - form.setACL(new Parse.ACL(ACL)); - } - - form.save(RowData).then( - (form) => { - const parseData = JSON.parse(JSON.stringify(form)); - this.props.details({ - value: parseData[this.props.valueKey], - label: parseData[this.props.displayKey] - }); - if (this.props.closePopup) { - this.props.closePopup(); - } - let filtered = {}; - if (this.state.redirect_type === "clearData") { - if ( - this.state.persistentFields && - this.state.persistentFields.length - ) { - filtered = Object.keys(RowData) - .filter((key) => this.state.persistentFields.includes(key)) - .reduce((obj, key) => { - obj[key] = RowData[key]; - return obj; - }, {}); - } - } else { - RowData = {}; - } - - this.setState( - { - formData: filtered, - active: true, - loading: false, - toastColor: "#5cb85c", - toastDescription: this.state.successMassage - }, - () => { - var x = document.getElementById("snackbar"); - this.props.removeState(); - this.props.removeLevel2State(); - this.props.removeLevel3State(); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - ); - }, - (error) => { - this.setState({ - loading: false, - active: true, - toastColor: "#d9534f", - toastDescription: error.message - }); - - var x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - ); - } catch (error) { - this.setState({ - loading: false, - active: true, - toastColor: "#d9534f", - toastDescription: error.message - }); - - var x = document.getElementById("snackbar"); - x.className = "show"; - setTimeout(function () { - x.className = x.className.replace("show", ""); - }, 2000); - } - } - }; - - componentDidMount() { - let url = window.location.hash; - if (url.includes("_app")) { - this.setState({ isAppRequest: true }); - } - let id = this.props.id; - this.getForm(id); - } - - render() { - if (localStorage.getItem("accesstoken") === null) { - return ; - } - let schema = this.state.schemaState; - let uiSchema = this.state.ui_schema; - let rules = this.state.rules; - let extraActions = this.state.extraActions; - - let FormToDisplay = applyRules( - schema, - uiSchema, - rules, - Engine, - extraActions - )(Form); - let formView = ( - - -
- {this.state.active && this.state.buttons.submitText ? ( - - ) : ( - this.state.buttons.submitText && ( - - ) - )} -    - {this.state.buttons.resetText && ( - - )} -
-
-
+ useEffect(() => { + checkUserExist(); + }, []); + // Load user details from localStorage when the component mounts + useEffect(() => { + const savedUserDetails = JSON.parse( + localStorage.getItem("UserInformation") ); + if (savedUserDetails && addYourself) { + setName(savedUserDetails.name); + setPhone(savedUserDetails.phone); + setEmail(savedUserDetails.email); + } + }, [addYourself]); - if (this.state.loading) { - formView = ( -
+ const checkUserExist = async () => { + const user = Parse.User.current(); + try { + const query = new Parse.Query("contracts_Contactbook"); + query.equalTo("CreatedBy", user); + query.equalTo("Email", user.getEmail()); + const res = await query.first(); + // console.log(res); + if (!res) { + setIsUserExist(true); + } + } catch (err) { + console.log("err", err); + } + }; + // Define a function to handle form submission + const handleSubmit = async (e) => { + e.preventDefault(); + setIsLoader(true); + Parse.serverURL = parseBaseUrl; + Parse.initialize(parseAppId); + try { + const contactQuery = new Parse.Object("contracts_Contactbook"); + contactQuery.set("Name", name); + contactQuery.set("Phone", phone); + contactQuery.set("Email", email); + contactQuery.set("UserRole", "contracts_Guest"); + + if (localStorage.getItem("TenetId")) { + contactQuery.set("TenantId", { + __type: "Pointer", + className: "partners_Tenant", + objectId: localStorage.getItem("TenetId") + }); + } + + try { + const _users = Parse.Object.extend("User"); + const _user = new _users(); + _user.set("name", name); + _user.set("username", email); + _user.set("email", email); + _user.set("phone", phone); + _user.set("password", phone); + + const user = await _user.save(); + if (user) { + const roleurl = `${parseBaseUrl}functions/AddUserToRole`; + const headers = { + "Content-Type": "application/json", + "X-Parse-Application-Id": parseAppId, + sessionToken: localStorage.getItem("accesstoken") + }; + const body = { + appName: localStorage.getItem("_appName"), + roleName: "contracts_Guest", + userId: user.id + }; + await axios.post(roleurl, body, { headers: headers }); + const currentUser = Parse.User.current(); + contactQuery.set( + "CreatedBy", + Parse.User.createWithoutData(currentUser.id) + ); + + contactQuery.set("UserId", user); + const acl = new Parse.ACL(); + acl.setPublicReadAccess(true); + acl.setPublicWriteAccess(true); + acl.setReadAccess(currentUser.id, true); + acl.setWriteAccess(currentUser.id, true); + + contactQuery.setACL(acl); + + const res = await contactQuery.save(); + + const parseData = JSON.parse(JSON.stringify(res)); + props.details({ + value: parseData[props.valueKey], + label: parseData[props.displayKey] + }); + if (props.closePopup) { + props.closePopup(); + } + + setIsLoader(false); + // Reset the form fields + setAddYourself(false); + setName(""); + setPhone(""); + setEmail(""); + } + } catch (err) { + console.log("err ", err); + if (err.code === 202) { + const params = { email: email }; + const userRes = await Parse.Cloud.run("getUserId", params); + const roleurl = `${parseBaseUrl}functions/AddUserToRole`; + const headers = { + "Content-Type": "application/json", + "X-Parse-Application-Id": parseAppId, + sessionToken: localStorage.getItem("accesstoken") + }; + const body = { + appName: localStorage.getItem("_appName"), + roleName: "contracts_Guest", + userId: userRes.id + }; + await axios.post(roleurl, body, { headers: headers }); + const currentUser = Parse.User.current(); + contactQuery.set( + "CreatedBy", + Parse.User.createWithoutData(currentUser.id) + ); + + contactQuery.set("UserId", { + __type: "Pointer", + className: "_User", + objectId: userRes.id + }); + const acl = new Parse.ACL(); + acl.setPublicReadAccess(true); + acl.setPublicWriteAccess(true); + acl.setReadAccess(currentUser.id, true); + acl.setWriteAccess(currentUser.id, true); + + contactQuery.setACL(acl); + const res = await contactQuery.save(); + + const parseData = JSON.parse(JSON.stringify(res)); + props.details({ + value: parseData[props.valueKey], + label: parseData[props.displayKey] + }); + if (props.closePopup) { + props.closePopup(); + } + setIsLoader(false); + // Reset the form fields + setAddYourself(false); + setName(""); + setPhone(""); + setEmail(""); + } + } + } catch (err) { + // console.log("err", err); + setIsLoader(false); + alert("something went wrong!"); + } + }; + + // Define a function to handle the "add yourself" checkbox + const handleAddYourselfChange = () => { + if (addYourself) { + setAddYourself(false); + setName(""); + setPhone(""); + setEmail(""); + } else { + setAddYourself(true); + } + }; + const handleReset = () => { + setAddYourself(false); + }; + + return ( +
+ {isLoader && ( +
- ); - } - return ( - - {/* */} - <ErrorBoundary> - <div className="row"> - <div className="col-md-12"> - {this.state.help ? ( - <div className="dropdown" style={{ marginTop: "-30px" }}> - <i - className="far fa-question-circle dropdown-toggle hovereffect" - aria-hidden="true" - id="dropdownMenuButton" - data-toggle="dropdown" - aria-haspopup="true" - aria-expanded="false" - style={{ - fontSize: "18px", - color: "purple", - cursor: "pointer !important", - position: "relative", - top: "40px", - left: "98%" - }} - ></i> - <div - className="dropdown-menu" - aria-labelledby="dropdownMenuButton" - style={{ - marginleft: "-121px", - margintop: "-14px", - position: "absolute", - padding: "10px", - width: "300px", - top: "102px!important" - }} - > - {parse(` - ${this.state.help} - `)} - <br /> - {this.state.link ? ( - <a - onClick={(e) => { - e.preventDefault(); - window.location.href = this.state.link; - }} - target="_blank" - className="btn btn-xs btn-primary" - > - Read more.. - </a> - ) : null} - </div> - </div> - ) : null} - <div style={{ fontSize: "13px" }}>{formView}</div> - </div> + )} + <div className="w-full mx-auto p-2"> + {isUserExist && ( + <div className="mb-3"> + <input + type="checkbox" + id="addYourself" + checked={addYourself} + onChange={handleAddYourselfChange} + className="form-checkbox" + /> + <label htmlFor="addYourself" className="ml-2 text-gray-700"> + Add Yourself + </label> </div> - <div id="snackbar" style={{ backgroundColor: this.state.toastColor }}> - {this.state.toastDescription} + )} + <form onSubmit={handleSubmit}> + <div className="mb-3"> + <label + htmlFor="name" + className="block text-xs text-gray-700 font-semibold" + > + Name + <span style={{ color: "red", fontSize: 13 }}> *</span> + </label> + <input + type="text" + id="name" + value={name} + onChange={(e) => setName(e.target.value)} + required + disabled={addYourself} + className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" + /> </div> - </ErrorBoundary> - </React.Fragment> - ); - } -} -export default connect(null, { - removeState, - removeLevel2State, - removeLevel3State -})(AppendFormInForm); + <div className="mb-3"> + <label + htmlFor="phone" + className="block text-xs text-gray-700 font-semibold" + > + Phone + <span style={{ color: "red", fontSize: 13 }}> *</span> + </label> + <input + type="text" + id="phone" + value={phone} + onChange={(e) => setPhone(e.target.value)} + required + disabled={addYourself} + className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" + /> + </div> + + <div className="mb-3"> + <label + htmlFor="email" + className="block text-xs text-gray-700 font-semibold" + > + Email + <span style={{ color: "red", fontSize: 13 }}> *</span> + </label> + <input + type="email" + id="email" + value={email} + onChange={(e) => setEmail(e.target.value)} + required + disabled={addYourself} + className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" + /> + </div> + + <div className="mt-4 flex justify-start"> + <button + type="submit" + className="bg-[#1ab6ce] text-sm text-white px-4 py-2 rounded shadow focus:outline-none" + > + Submit + </button> + <button + type="button" + onClick={() => handleReset()} + className="bg-[#188ae2] text-sm text-white px-4 py-2 rounded ml-2 shadow focus:outline-none" + > + Reset + </button> + </div> + </form> + </div> + </div> + ); +}; + +export default AppendFormInForm; diff --git a/apps/OpenSign/src/components/fields/MultiSelectField.js b/apps/OpenSign/src/components/fields/MultiSelectField.js index d3b10fbd2..520e9398f 100644 --- a/apps/OpenSign/src/components/fields/MultiSelectField.js +++ b/apps/OpenSign/src/components/fields/MultiSelectField.js @@ -19,6 +19,7 @@ function arrayMove(array, from, to) { */ const MultiSelectField = (props) => { + Modal.setAppElement("body"); const [parseBaseUrl] = useState(localStorage.getItem("baseUrl")); const [parseAppId] = useState(localStorage.getItem("parseAppId")); const [state, setState] = useState(undefined); @@ -647,42 +648,51 @@ const MultiSelectField = (props) => { <Modal isOpen={modalIsOpen} onRequestClose={handleModalCloseClick} + shouldCloseOnOverlayClick={false} contentLabel="Modal" style={{ + content: { + top: "50%", + left: "50%", + right: "auto", + bottom: "auto", + transform: "translate(-50%, -50%)", + padding: 0 + }, overlay: { - position: "fixed", - top: 0, - left: 0, - right: 0, - bottom: 0, - backgroundColor: "rgba(255, 255, 255, 0.75)", - zIndex: 50, - maxHeight: 450 + width: "100%", + backgroundColor: "rgba(0, 0, 0, 0.75)", + zIndex: 50 } }} > - <div - type="button" - style={{ display: "flex", justifyContent: "space-between" }} - > - <div style={{ color: "transparent", width: "100%" }}>.</div> - <button onClick={handleModalCloseClick}> - <i - style={{ fontSize: 25 }} - className="fa fa-times-circle" - aria-hidden="true" - ></i> - </button> + <div className="min-w-full md:min-w-[500px]"> + <div + type="button" + className="flex justify-between items-center p-3 border-b-[1px] border-gray-300" + > + <div className=" text-black text-xl font-semibold pl-3"> + Add Signer + </div> + <button onClick={handleModalCloseClick}> + <i + style={{ fontSize: 25 }} + className="fa fa-times-circle" + aria-hidden="true" + ></i> + </button> + </div> + + {isModal && ( + <AppendFormInForm + id={props.schema.data.quickAddFormId} + valueKey={props.schema.data.valueKey} + displayKey={props.schema.data.displayKey} + details={handleNewDetails} + closePopup={handleModalCloseClick} + /> + )} </div> - {isModal && ( - <AppendFormInForm - id={props.schema.data.quickAddFormId} - valueKey={props.schema.data.valueKey} - displayKey={props.schema.data.displayKey} - details={handleNewDetails} - closePopup={handleModalCloseClick} - /> - )} </Modal> </div> </React.Fragment> diff --git a/apps/OpenSign/src/json/FormJson.js b/apps/OpenSign/src/json/FormJson.js index e7276a9a4..bf67053a9 100644 --- a/apps/OpenSign/src/json/FormJson.js +++ b/apps/OpenSign/src/json/FormJson.js @@ -1,3 +1,4 @@ +import Parse from "parse"; export const formJson = (id) => { let formData; //json form for signYourself @@ -104,6 +105,12 @@ export const formJson = (id) => { } //json form for request signature else if (id === "8mZzFxbG1z") { + const user = Parse.User.current(); + const userPtr = JSON.stringify({ + __type: "Pointer", + className: "_User", + objectId: user.id + }); formData = { jsonSchema: { title: "New Document", @@ -140,7 +147,7 @@ export const formJson = (id) => { class: "contracts_Contactbook", displayKey: "Name", valueKey: "objectId", - query: "keys=Name", + query: `where={"CreatedBy":${userPtr}}&keys=Name`, isPointer: true, helpbody: "", helplink: "", @@ -575,3 +582,4 @@ export const formJson = (id) => { return formData; } }; + diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.js index 39d78c608..abdda66ca 100644 --- a/apps/OpenSign/src/json/ReportJson.js +++ b/apps/OpenSign/src/json/ReportJson.js @@ -37,7 +37,7 @@ export default function reportJson(id) { textColor: "white", btnIcon: "fa fa-plus", redirectUrl: - "remoteUrl=aHR0cDovL2xvY2FsaG9zdDozMDAwL21mYnVpbGQvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument" + "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument" } ] }; diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 2956e9439..22cea983d 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -16,9 +16,25 @@ const ReportTable = ({ ReportName, List, actions }) => { }; const handlemicroapp = (item, url) => { localStorage.removeItem("rowlevel"); + // const params = new URLSearchParams(url); + // let arr = []; + // for (let [key, value] of params.entries()) { + // if (key === "remoteUrl") { + // arr.push( + // `${key}=${window.btoa( + // window.location.origin + "/mfbuild/remoteEntry.js" + // )}` + // ); + // } else { + // arr.push(`${key}=${value}`); + // } + // } + // const remoteUrl = arr.join("&"); + // console.log("arr", remoteUrl); + navigate("/rpmf/" + url); localStorage.setItem("rowlevel", JSON.stringify(item)); - // localStorage.setItem("rowlevelMicro") + // localStorage.setItem("rowlevelMicro"); }; const handlebtn = () => { console.log("clicked"); From 449ee1b6232d2da36469a4fffa96abd63608d978 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <prafull.navkar@nxglabs.com> Date: Wed, 1 Nov 2023 16:10:12 +0530 Subject: [PATCH 10/19] fix: overlay issue folder popup --- apps/OpenSign/src/components/TreeWidget.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/OpenSign/src/components/TreeWidget.js b/apps/OpenSign/src/components/TreeWidget.js index 70550e14b..8b322d854 100644 --- a/apps/OpenSign/src/components/TreeWidget.js +++ b/apps/OpenSign/src/components/TreeWidget.js @@ -528,12 +528,15 @@ const TreeWidget = (props) => { bottom: "20%", marginRight: "-50%", transform: "translate(-50%, -50%)", - zIndex: "50", backgroundColor: "white", padding: "0px", maxWidth: "100%", // Set a maximum width for the modal maxHeight: "100vh", height: "300px" + }, + overlay: { + backgroundColor: "rgba(0, 0, 0, 0.75)", + zIndex: 50 } }; @@ -618,6 +621,7 @@ const TreeWidget = (props) => { <Modal isOpen={isShowModal} onRequestClose={() => setIsShowModal(false)} + shouldCloseOnOverlayClick={false} contentLabel="Modal" style={customStyles} > From 3327219835756e790f53db385f6641a0b4d8cd83 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <prafull.navkar@nxglabs.com> Date: Wed, 1 Nov 2023 17:06:51 +0530 Subject: [PATCH 11/19] change ui of folder popup --- apps/OpenSign/src/components/TreeEditForm.js | 4 ++-- apps/OpenSign/src/components/TreeWidget.js | 24 ++++++++------------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/OpenSign/src/components/TreeEditForm.js b/apps/OpenSign/src/components/TreeEditForm.js index 3574a03df..4de7e9c2f 100644 --- a/apps/OpenSign/src/components/TreeEditForm.js +++ b/apps/OpenSign/src/components/TreeEditForm.js @@ -375,11 +375,11 @@ const TreeEditForm = (props) => { > <div> {active ? ( - <button className="btn btn-info pull-right" type="submit"> + <button className="bg-[#1ab6ce] px-3 py-2 rounded text-white text-sm" type="submit"> Update </button> ) : ( - <button className="btn btn-info" type="submit" disabled> + <button className="bg-[#1ab6ce] px-3 py-2 rounded text-white text-sm" type="submit" disabled> Update </button> )} diff --git a/apps/OpenSign/src/components/TreeWidget.js b/apps/OpenSign/src/components/TreeWidget.js index 8b322d854..24aa61689 100644 --- a/apps/OpenSign/src/components/TreeWidget.js +++ b/apps/OpenSign/src/components/TreeWidget.js @@ -522,19 +522,17 @@ const TreeWidget = (props) => { }, [defaultState]); const customStyles = { content: { - top: "40%", + top: "50%", left: "50%", - right: "20%", - bottom: "20%", + right: "auto", + bottom: "auto", marginRight: "-50%", transform: "translate(-50%, -50%)", backgroundColor: "white", - padding: "0px", - maxWidth: "100%", // Set a maximum width for the modal - maxHeight: "100vh", - height: "300px" + padding: 0 }, overlay: { + width:"100%", backgroundColor: "rgba(0, 0, 0, 0.75)", zIndex: 50 } @@ -563,7 +561,7 @@ const TreeWidget = (props) => { > <div style={{ width: "20%" }}> <div - className=" pull-left" + className="pull-left" title="Select Folder" style={{ color: "#33bbff", @@ -625,7 +623,7 @@ const TreeWidget = (props) => { contentLabel="Modal" style={customStyles} > - <div> + <div className="w-full min-w-[300px] md:min-w-[500px]"> {/* header */} <div style={{ @@ -640,7 +638,7 @@ const TreeWidget = (props) => { </div> <div style={{ padding: "10px" }}> <button - className=" btn btn-sm pull-right" + className="btn btn-sm pull-right" data-dismiss="modal" title="Select Folder" style={{ @@ -666,10 +664,9 @@ const TreeWidget = (props) => { </div> <hr /> {/* body */} - <div className="pt-3 pb-3 pl-6 pr-6 space-y-6"> + <div className="p-3 space-y-6"> <div style={{ - height: "40px", color: "#ac4848", cursor: "pointer", fontSize: "14px", @@ -759,7 +756,6 @@ const TreeWidget = (props) => { border: "1px solid gray", borderRadius: "1px", marginTop: "8px", - marginRight: "8px", transition: "all 0.75s ease", WebkitTransition: "all 0.5s ease", MozTransition: "all 0.5s ease", @@ -830,7 +826,7 @@ const TreeWidget = (props) => { </div> {/* footer */} - <div className="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600 justify-between"> + <div className="flex items-center p-3 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600 justify-between"> <button className="btn btn-sm float-left createFolder" title="Create New Folder" From a7b25d0ac71b0294919e2d884f91e4b2f9d67a36 Mon Sep 17 00:00:00 2001 From: Amol <amol@nxglabs.in> Date: Wed, 1 Nov 2023 17:32:07 +0530 Subject: [PATCH 12/19] Update Footer.js --- apps/OpenSign/src/components/Footer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/OpenSign/src/components/Footer.js b/apps/OpenSign/src/components/Footer.js index e256174c2..30d0acecb 100644 --- a/apps/OpenSign/src/components/Footer.js +++ b/apps/OpenSign/src/components/Footer.js @@ -24,7 +24,7 @@ const Footer = () => { }; }, []); - const appName = "OpenSign"; + const appName = "OpenSign™"; return ( <> From ea8ca25acdd44b15f6a3916475cf11bc6e399d2e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:05:05 +0000 Subject: [PATCH 13/19] docs: update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a5d3d34ed..5da6f9b9a 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ We would like to thank all our contributors and users for their support and feed </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/AndreyCurious"><img src="https://avatars.githubusercontent.com/u/105622604?v=4?s=100" width="100px;" alt="Andrey Didenko"/><br /><sub><b>Andrey Didenko</b></sub></a><br /><a href="#code-AndreyCurious" title="Code">💻</a></td> + <td align="center" valign="top" width="14.28%"><a href="https://github.com/VishakhaSainani"><img src="https://avatars.githubusercontent.com/u/113436770?v=4?s=100" width="100px;" alt="VishakhaSainani"/><br /><sub><b>VishakhaSainani</b></sub></a><br /><a href="#code-VishakhaSainani" title="Code">💻</a></td> </tr> </tbody> </table> From b00118a5554b9cce84c2d27786c591b74e7ab452 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:05:06 +0000 Subject: [PATCH 14/19] docs: update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d7669b4d0..fc0876395 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -142,6 +142,15 @@ "contributions": [ "code" ] + }, + { + "login": "VishakhaSainani", + "name": "VishakhaSainani", + "avatar_url": "https://avatars.githubusercontent.com/u/113436770?v=4", + "profile": "https://github.com/VishakhaSainani", + "contributions": [ + "code" + ] } ] } From 36e643a0a4787a42cd3cea9528cf5a7bc4652e36 Mon Sep 17 00:00:00 2001 From: Amol <amol@nxglabs.in> Date: Wed, 1 Nov 2023 17:39:11 +0530 Subject: [PATCH 15/19] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5da6f9b9a..05ef8b13c 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,6 @@ We would like to thank all our contributors and users for their support and feed <tbody> <tr> <td align="center" valign="top" width="14.28%"><a href="https://aleksandarjakovljevic.com/"><img src="https://avatars.githubusercontent.com/u/2115393?v=4?s=100" width="100px;" alt="Aleksandar Jakovljevic"/><br /><sub><b>Aleksandar Jakovljevic</b></sub></a><br /><a href="#code-ajakov" title="Code">💻</a></td> - <td align="center" valign="top" width="14.28%"><a href="https://github.com/nxglabs"><img src="https://avatars.githubusercontent.com/u/5486116?v=4?s=100" width="100px;" alt="Amol"/><br /><sub><b>Amol</b></sub></a><br /><a href="#code-nxglabs" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/BuilderPrid"><img src="https://avatars.githubusercontent.com/u/106882895?v=4?s=100" width="100px;" alt="Priyanshu Dwivedi"/><br /><sub><b>Priyanshu Dwivedi</b></sub></a><br /><a href="#code-BuilderPrid" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Tashuuuu"><img src="https://avatars.githubusercontent.com/u/85075827?v=4?s=100" width="100px;" alt="Akriti Sengar"/><br /><sub><b>Akriti Sengar</b></sub></a><br /><a href="#code-Tashuuuu" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/parthrc"><img src="https://avatars.githubusercontent.com/u/101104958?v=4?s=100" width="100px;" alt="Parth Chawande"/><br /><sub><b>Parth Chawande</b></sub></a><br /><a href="#code-parthrc" title="Code">💻</a></td> From 8a4e00fe168010f52ac6fc4ba44fb2d8a5ab4357 Mon Sep 17 00:00:00 2001 From: Amol <amol@nxglabs.in> Date: Wed, 1 Nov 2023 17:40:16 +0530 Subject: [PATCH 16/19] Update .all-contributorsrc --- .all-contributorsrc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index fc0876395..2d2c22e6f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -17,15 +17,6 @@ "code" ] }, - { - "login": "nxglabs", - "name": "Amol", - "avatar_url": "https://avatars.githubusercontent.com/u/5486116?v=4", - "profile": "https://github.com/nxglabs", - "contributions": [ - "code" - ] - }, { "login": "BuilderPrid", "name": "Priyanshu Dwivedi", From 9e39ed9fa4054050bc2abd39d760f25b763cf90f Mon Sep 17 00:00:00 2001 From: Amol <amol@nxglabs.in> Date: Wed, 1 Nov 2023 17:41:19 +0530 Subject: [PATCH 17/19] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 05ef8b13c..7feb7df25 100644 --- a/README.md +++ b/README.md @@ -112,18 +112,18 @@ We would like to thank all our contributors and users for their support and feed <td align="center" valign="top" width="14.28%"><a href="https://github.com/parthrc"><img src="https://avatars.githubusercontent.com/u/101104958?v=4?s=100" width="100px;" alt="Parth Chawande"/><br /><sub><b>Parth Chawande</b></sub></a><br /><a href="#code-parthrc" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/Rishabh-git10"><img src="https://avatars.githubusercontent.com/u/107680241?v=4?s=100" width="100px;" alt="Rishabh Dewangan"/><br /><sub><b>Rishabh Dewangan</b></sub></a><br /><a href="#code-Rishabh-git10" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/LemonDrop847"><img src="https://avatars.githubusercontent.com/u/106615670?v=4?s=100" width="100px;" alt="Nitin Mishra"/><br /><sub><b>Nitin Mishra</b></sub></a><br /><a href="#code-LemonDrop847" title="Code">💻</a></td> + <td align="center" valign="top" width="14.28%"><a href="http://jobinselvanose.com"><img src="https://avatars.githubusercontent.com/u/63976083?v=4?s=100" width="100px;" alt="Jobin Selvanose"/><br /><sub><b>Jobin Selvanose</b></sub></a><br /><a href="#doc-Jobin-S" title="Documentation">📖</a></td> </tr> <tr> - <td align="center" valign="top" width="14.28%"><a href="http://jobinselvanose.com"><img src="https://avatars.githubusercontent.com/u/63976083?v=4?s=100" width="100px;" alt="Jobin Selvanose"/><br /><sub><b>Jobin Selvanose</b></sub></a><br /><a href="#doc-Jobin-S" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/HansF"><img src="https://avatars.githubusercontent.com/u/1503?v=4?s=100" width="100px;" alt="Hans Fraiponts"/><br /><sub><b>Hans Fraiponts</b></sub></a><br /><a href="#doc-HansF" title="Documentation">📖</a></td> <td align="center" valign="top" width="14.28%"><a href="http://linktr.ee/monilprajapati"><img src="https://avatars.githubusercontent.com/u/99136041?v=4?s=100" width="100px;" alt="Monil Prajapati"/><br /><sub><b>Monil Prajapati</b></sub></a><br /><a href="#code-Monilprajapati" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://emm-dev0.github.io/portfolio/"><img src="https://avatars.githubusercontent.com/u/97445413?v=4?s=100" width="100px;" alt="Edogbanya Emmanuel"/><br /><sub><b>Edogbanya Emmanuel</b></sub></a><br /><a href="#bug-Emm-dev0" title="Bug reports">🐛</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/pranav514"><img src="https://avatars.githubusercontent.com/u/76992202?v=4?s=100" width="100px;" alt="pranav514"/><br /><sub><b>pranav514</b></sub></a><br /><a href="#code-pranav514" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/arianxq"><img src="https://avatars.githubusercontent.com/u/122199576?v=4?s=100" width="100px;" alt="Aria"/><br /><sub><b>Aria</b></sub></a><br /><a href="#code-arianxq" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/SoumyadiptoPal"><img src="https://avatars.githubusercontent.com/u/119007659?v=4?s=100" width="100px;" alt="Soumyadipto Pal"/><br /><sub><b>Soumyadipto Pal</b></sub></a><br /><a href="#code-SoumyadiptoPal" title="Code">💻</a></td> + <td align="center" valign="top" width="14.28%"><a href="https://github.com/AndreyCurious"><img src="https://avatars.githubusercontent.com/u/105622604?v=4?s=100" width="100px;" alt="Andrey Didenko"/><br /><sub><b>Andrey Didenko</b></sub></a><br /><a href="#code-AndreyCurious" title="Code">💻</a></td> </tr> <tr> - <td align="center" valign="top" width="14.28%"><a href="https://github.com/AndreyCurious"><img src="https://avatars.githubusercontent.com/u/105622604?v=4?s=100" width="100px;" alt="Andrey Didenko"/><br /><sub><b>Andrey Didenko</b></sub></a><br /><a href="#code-AndreyCurious" title="Code">💻</a></td> <td align="center" valign="top" width="14.28%"><a href="https://github.com/VishakhaSainani"><img src="https://avatars.githubusercontent.com/u/113436770?v=4?s=100" width="100px;" alt="VishakhaSainani"/><br /><sub><b>VishakhaSainani</b></sub></a><br /><a href="#code-VishakhaSainani" title="Code">💻</a></td> </tr> </tbody> From bae9f77f419adb33e8578fd548aab17965753328 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:11:52 +0000 Subject: [PATCH 18/19] docs: update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7feb7df25..3a5062026 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ We would like to thank all our contributors and users for their support and feed </tr> <tr> <td align="center" valign="top" width="14.28%"><a href="https://github.com/VishakhaSainani"><img src="https://avatars.githubusercontent.com/u/113436770?v=4?s=100" width="100px;" alt="VishakhaSainani"/><br /><sub><b>VishakhaSainani</b></sub></a><br /><a href="#code-VishakhaSainani" title="Code">💻</a></td> + <td align="center" valign="top" width="14.28%"><a href="https://github.com/andrew-opensignlabs"><img src="https://avatars.githubusercontent.com/u/148278535?v=4?s=100" width="100px;" alt="Andrew"/><br /><sub><b>Andrew</b></sub></a><br /><a href="#code-andrew-opensignlabs" title="Code">💻</a></td> </tr> </tbody> </table> From fd56627f8f2b94616cb1b29a8d3fc07160f4352e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:11:53 +0000 Subject: [PATCH 19/19] docs: update .all-contributorsrc --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2d2c22e6f..94a854af3 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -142,6 +142,15 @@ "contributions": [ "code" ] + }, + { + "login": "andrew-opensignlabs", + "name": "Andrew", + "avatar_url": "https://avatars.githubusercontent.com/u/148278535?v=4", + "profile": "https://github.com/andrew-opensignlabs", + "contributions": [ + "code" + ] } ] }