@@ -42,7 +79,7 @@ const GetDashboard = (props) => {
return (
+
@@ -58,7 +95,7 @@ const GetDashboard = (props) => {
case "Card":
return (
please wait
}>
@@ -76,7 +113,7 @@ const GetDashboard = (props) => {
case "report": {
return (
please wait
+
@@ -88,6 +125,21 @@ const GetDashboard = (props) => {
};
return (
+
+
+ {buttonList.map((btn) => (
+
+ ))}
+
+
{props.dashboard.map((val, key) => (
{val.columns.map((col, i) =>
diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
index b4d3b1dd6..09abff5d4 100644
--- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
+++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
@@ -377,7 +377,7 @@ function DropdownWidgetOption(props) {
/>
- Hide label
+ Hide labels
diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js
index d786efa9b..41f96a550 100644
--- a/apps/OpenSign/src/components/pdf/Placeholder.js
+++ b/apps/OpenSign/src/components/pdf/Placeholder.js
@@ -215,7 +215,8 @@ function Placeholder(props) {
"company",
"job title",
"date",
- "email"
+ "email",
+ textWidget
].includes(props.pos.type);
if (widgetTypeExist) {
@@ -594,7 +595,7 @@ function Placeholder(props) {
disableDragging={
props.isNeedSign
? true
- : props.isPlaceholder && props.pos.type !== "date"
+ : props.isPlaceholder && ![textWidget].includes(props.pos.type)
? false
: !isDraggingEnabled
}
@@ -652,8 +653,18 @@ function Placeholder(props) {
style={{
left: props.xPos(props.pos, props.isSignYourself),
top: props.yPos(props.pos, props.isSignYourself),
- width: "auto", //props.posWidth(props.pos, props.isSignYourself),
+ width:
+ props.pos.type === radioButtonWidget ||
+ props.pos.type === "checkbox"
+ ? "auto"
+ : props.posWidth(props.pos, props.isSignYourself),
+ // "auto", //props.posWidth(props.pos, props.isSignYourself),
// height: props.posHeight(props.pos, props.isSignYourself),
+ height:
+ props.pos.type === radioButtonWidget ||
+ props.pos.type === "checkbox"
+ ? "auto"
+ : props.posHeight(props.pos, props.isSignYourself),
zIndex: "10"
}}
onTouchEnd={() => handleOnClickPlaceholder()}
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js
index 182f85991..d64aab3c2 100644
--- a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js
+++ b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js
@@ -4,7 +4,8 @@ import {
defaultWidthHeight,
isMobile,
radioButtonWidget,
- resizeBorderExtraWidth
+ resizeBorderExtraWidth,
+ textWidget
} from "../../constant/Utils";
function PlaceholderBorder(props) {
const getResizeBorderExtraWidth = resizeBorderExtraWidth();
@@ -31,7 +32,10 @@ function PlaceholderBorder(props) {
};
return (
!isMobile && props?.setDraggingEnabled(true)}
+ onTouchEnd={() =>
+ props.pos.type === textWidget && props?.setDraggingEnabled(true)
+ }
className="borderResize"
style={{
borderColor: themeColor,
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js
index 0b851f258..52137b19a 100644
--- a/apps/OpenSign/src/components/pdf/PlaceholderType.js
+++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js
@@ -2,6 +2,7 @@ import React, { useEffect, useState, forwardRef, useRef } from "react";
import {
getMonth,
getYear,
+ isMobile,
onChangeInput,
radioButtonWidget,
range,
@@ -741,6 +742,7 @@ function PlaceholderType(props) {
placeholder="Enter label"
rows={1}
value={textValue}
+ onBlur={handleInputBlur}
onChange={(e) => {
setTextValue(e.target.value);
onChangeInput(
@@ -753,7 +755,11 @@ function PlaceholderType(props) {
false
);
}}
- className="labelTextArea"
+ className={
+ isMobile
+ ? "labelTextArea labelWidthMobile"
+ : "labelTextArea labelWidthDesktop"
+ }
style={{ whiteSpace: "pre-wrap" }}
cols="50"
/>
diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.js
index 101095648..f59ca7117 100644
--- a/apps/OpenSign/src/components/pdf/WidgetComponent.js
+++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js
@@ -239,8 +239,8 @@ function WidgetComponent({
const updateWidgets = isSignYourself
? filterWidgets
: isTemplateFlow
- ? textWidgetData
- : widget;
+ ? textWidgetData
+ : widget;
return (
<>
@@ -264,11 +264,7 @@ function WidgetComponent({
alignItems: "center",
justifyContent: "center"
}}
- onClick={() => {
- // if (signersdata?.length) {
- handleModal();
- // }
- }}
+ onClick={() => handleModal()}
>
{
return (
-
+
{
diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
index 329dea3e6..4471af317 100644
--- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js
+++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
@@ -129,18 +129,7 @@ const WidgetNameModal = (props) => {
>
{
// onBlur={() => handleBlurRegex()}
/>
handleChange(e)}
diff --git a/apps/OpenSign/src/components/shared/fields/SelectFolder.js b/apps/OpenSign/src/components/shared/fields/SelectFolder.js
index eb4cac824..138648f03 100644
--- a/apps/OpenSign/src/components/shared/fields/SelectFolder.js
+++ b/apps/OpenSign/src/components/shared/fields/SelectFolder.js
@@ -93,7 +93,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {
// `handleSubmit` is used to pass folderPtr to parent component
const handleSubmit = () => {
- let url = "Root";
+ let url = "OpenSign™ Drive";
tabList.forEach((t) => {
url = url + " / " + t.Name;
});
@@ -180,7 +180,9 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {
- {selectFolder && selectFolder.Name ? selectFolder.Name : "Root"}
+ {selectFolder && selectFolder.Name
+ ? selectFolder.Name
+ : "OpenSign™ Drive"}
SetIsOpen(true)}>
{
isOpen={isOpen}
handleClose={handleCancel}
>
-
+
removeTabListItem(e)}
>
- Root /{" "}
+ OpenSign™ Drive /{" "}
{tabList &&
tabList.map((tab, i) => (
diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js
index ba6556930..11fa10f74 100644
--- a/apps/OpenSign/src/constant/Utils.js
+++ b/apps/OpenSign/src/constant/Utils.js
@@ -288,26 +288,14 @@ export const getWidgetType = (item, marginLeft) => {
marginLeft: marginLeft && `${marginLeft}px`
}}
>
-
-
-
+
+ {!isMobile && (
+
+ )}
+
{item.type}
@@ -1090,8 +1078,8 @@ export const multiSignEmbed = async (
position.type === radioButtonWidget
? 10
: position.type === "checkbox"
- ? 10
- : newUpdateHeight;
+ ? 10
+ : newUpdateHeight;
const newHeight = ind ? (ind > 0 ? widgetHeight : 0) : widgetHeight;
if (signyourself) {
diff --git a/apps/OpenSign/src/layout/HomeLayout.js b/apps/OpenSign/src/layout/HomeLayout.js
index 8f4c26379..d3cfd8188 100644
--- a/apps/OpenSign/src/layout/HomeLayout.js
+++ b/apps/OpenSign/src/layout/HomeLayout.js
@@ -94,6 +94,12 @@ const HomeLayout = () => {
position: "top"
// style: { backgroundColor: "#abd4d2" },
},
+ {
+ selector: '[data-tut="tourbutton"]',
+ content: `To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.`,
+ position: "top"
+ // style: { backgroundColor: "#abd4d2" },
+ },
...resArr,
{
selector: '[data-tut="reactourLast"]',
diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js
index 4aa442bda..24fa145d5 100644
--- a/apps/OpenSign/src/pages/Form.js
+++ b/apps/OpenSign/src/pages/Form.js
@@ -28,6 +28,7 @@ function Form() {
}
const Forms = (props) => {
+ const maxFileSize = 20;
const navigate = useNavigate();
const [signers, setSigners] = useState([]);
const [folder, setFolder] = useState({ ObjectId: "", Name: "" });
@@ -56,17 +57,17 @@ const Forms = (props) => {
try {
let files = e.target.files;
if (typeof files[0] !== "undefined") {
- const mb = Math.round(files[0].bytes / Math.pow(1024, 2));
- if (mb > 10) {
+ const mb = Math.round(files[0].size / Math.pow(1024, 2));
+ if (mb > maxFileSize) {
alert(
- `The selected file size is too large. Please select a file less than ${Math.round(
- 10
- )} MB`
+ `The selected file size is too large. Please select a file less than ${maxFileSize} MB`
);
+ setFileUpload([]);
+ e.target.value = "";
return;
+ } else {
+ handleFileUpload(files[0]);
}
-
- handleFileUpload(files[0]);
} else {
alert("Please select file.");
return false;
@@ -114,10 +115,10 @@ const Forms = (props) => {
const url = file.link;
const mb = Math.round(file.bytes / Math.pow(1024, 2));
- if (mb > 10) {
+ if (mb > maxFileSize) {
setTimeout(() => {
alert(
- `The selected file size is too large. Please select a file less than 10 MB`
+ `The selected file size is too large. Please select a file less than ${maxFileSize} MB`
);
}, 500);
return;
diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js
index bdb017394..7f2bf551d 100644
--- a/apps/OpenSign/src/pages/PdfRequestFiles.js
+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js
@@ -988,7 +988,7 @@ function PdfRequestFiles() {
: isDecline.currnt === "YouDeclined"
? "You have declined this document!"
: isDecline.currnt === "another" &&
- "You cannot sign this document as it has been declined by one or more person(s)."
+ "You cannot sign this document as it has been declined by one or more recipient(s)."
}
footerMessage={isDecline.currnt === "Sure"}
declineDoc={declineDoc}
diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js
index 35351be3e..1d8496a80 100644
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@ -102,6 +102,10 @@ function PlaceHolderSign() {
const [widgetName, setWidgetName] = useState(false);
const [mailStatus, setMailStatus] = useState("");
const [isCurrUser, setIsCurrUser] = useState(false);
+ const [isAlreadyPlace, setIsAlreadyPlace] = useState({
+ status: false,
+ message: ""
+ });
const color = [
"#93a3db",
"#e6c3db",
@@ -193,15 +197,49 @@ function PlaceHolderSign() {
//getting document details
const documentData = await contractDocument(documentId);
if (documentData && documentData.length > 0) {
- // const alreadyPlaceholder =
- // documentData[0].Placeholders && documentData[0].Placeholders;
- // if (alreadyPlaceholder && alreadyPlaceholder.length > 0) {
- // setIsAlreadyPlace(true);
- // }
- // setSignersData(documentData[0]);
- // setIsSelectId(0);
- // setSignerObjId(documentData[0].Signers[0].objectId);
- // setContractName(documentData[0].Signers[0].className);
+ const alreadyPlaceholder = documentData[0]?.SignedUrl;
+ // Check if document is sent for signing
+ if (alreadyPlaceholder) {
+ // Check if the document is completed
+ const isCompleted =
+ documentData[0].IsCompleted && documentData[0]?.IsCompleted;
+ // Get the expiration date of the document
+ const expireDate = documentData[0].ExpiryDate.iso;
+ // Check if the document has been declined
+ const declined =
+ documentData[0].IsDeclined && documentData[0]?.IsDeclined;
+ // Get the expiration update date in milliseconds
+ const expireUpdateDate = new Date(expireDate).getTime();
+ // Get the current date in milliseconds
+ const currDate = new Date().getTime();
+ if (isCompleted) {
+ // If document is completed
+ setIsAlreadyPlace({
+ status: true,
+ message: "This document has been signed by all Signers."
+ });
+ } else if (declined) {
+ // If document has been declined
+ setIsAlreadyPlace({
+ status: true,
+ message:
+ "This document has been declined by one or more recipient(s)."
+ });
+ } else if (currDate > expireUpdateDate) {
+ // If document has expired
+ setIsAlreadyPlace({
+ status: true,
+ message: "This Document is no longer available."
+ });
+ } else {
+ // If document is dispatched for signing
+ setIsAlreadyPlace({
+ status: true,
+ message: "The document has already been dispatched for signing."
+ });
+ }
+ }
+
setPdfDetails(documentData);
if (documentData[0].Signers && documentData[0].Signers.length > 0) {
@@ -317,9 +355,6 @@ function PlaceHolderSign() {
//function for setting position after drop signature button over pdf
const addPositionOfSignature = (item, monitor) => {
- if (item && item.text) {
- setWidgetName(item.text);
- }
getSignerPos(item, monitor);
};
@@ -336,7 +371,6 @@ function PlaceHolderSign() {
let dropData = [];
let placeHolder;
const dragTypeValue = item?.text ? item.text : monitor.type;
-
if (item === "onclick") {
const dropObj = {
//onclick put placeholder center on pdf
@@ -487,15 +521,11 @@ function PlaceHolderSign() {
setIsCheckbox(true);
} else if (dragTypeValue === radioButtonWidget) {
setIsRadio(true);
- } else if (
- dragTypeValue !== textWidget &&
- dragTypeValue !== "signature"
- ) {
- setIsNameModal(true);
}
setWidgetType(dragTypeValue);
setSignKey(key);
setCurrWidgetsDetails({});
+ setWidgetName(dragTypeValue);
}
}
};
@@ -1760,7 +1790,33 @@ function PlaceHolderSign() {
+
+
+
{isAlreadyPlace.message}
+
+
handleRecipientSign()}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ View
+
+
+
{
setIsCheckbox(true);
} else if (dragTypeValue === radioButtonWidget) {
setIsRadio(true);
- } else if (
- dragTypeValue !== textWidget &&
- dragTypeValue !== "signature"
- ) {
- setIsNameModal(true);
- }
+ }
setCurrWidgetsDetails({});
setWidgetType(dragTypeValue);
setSignKey(key);
diff --git a/apps/OpenSign/src/styles/AddUser.css b/apps/OpenSign/src/styles/AddUser.css
index f703f1528..d8daf6d46 100644
--- a/apps/OpenSign/src/styles/AddUser.css
+++ b/apps/OpenSign/src/styles/AddUser.css
@@ -60,6 +60,7 @@
color: #ffffff;
outline: none;
}
+
/* For classes: bg-[#188ae2] text-sm text-white px-4 py-2 rounded ml-2 shadow focus:outline-none */
.resetbutton {
background-color: #188ae2;
@@ -75,3 +76,29 @@
outline: none;
margin-left: 8px;
}
+
+.validationlist {
+ position: absolute;
+ left: 0;
+ z-index: 1;
+ appearance: none;
+ -moz-appearance: "none";
+ -webkit-appearance: "none";
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAnUlEQVR4nO2QMQrCQBBFX51NbWMp2uox7Gw8h22uYEguIZNKyB0lMIElTNzdGBvdB8PC8Gces5DJ/Cxn4Aa4QM5pbsgncQF6rQYoZ3IFcPey11jByRsaqzYuctqfZo8xki3QBURuRtDpfBQ74GEsaYHN5It8wYFEhgExlj2NniwRhC7qP70gRSRrCN6JZE2BJZJvCEb2QKVvJvMvvAD2WzaK/35kGAAAAABJRU5ErkJggg==");
+ background-repeat: no-repeat;
+ background-position: right 0.7rem top 50%;
+ background-size: 1rem auto;
+}
+
+
+@media (max-width: 375px) {
+ .validationlist {
+ background-position: right 0.5rem top 50%;
+ }
+}
+
+@media (min-width:375px) and (max-width: 767px) {
+ .validationlist {
+ background-position: right 1rem top 50%;
+ }
+}
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/signature.css b/apps/OpenSign/src/styles/signature.css
index 8229cdb05..c50fa7d8e 100644
--- a/apps/OpenSign/src/styles/signature.css
+++ b/apps/OpenSign/src/styles/signature.css
@@ -163,7 +163,6 @@
.signatureBtn {
border: 1.5px solid #47a3ad;
-
border-radius: 3px;
display: flex;
padding: 0px;
@@ -838,10 +837,18 @@ option {
justify-content: flex-start;
}
-.labelTextArea {
- font-size: 12px;
+.labelWidthDesktop {
min-width: 100%;
min-height: 100%;
+}
+
+.labelWidthMobile {
+ width: 100%;
+ height: 100%;
+}
+
+.labelTextArea {
+ font-size: 12px;
border: 1px solid #007bff;
outline: none;
z-index: 999;
@@ -945,7 +952,7 @@ option {
to prevent sudden quick movement (as the
navigation bar gets a new position at the top of the
page (position:fixed and top:0) */
- .stickyHead + .content {
+ .stickyHead+.content {
padding-top: 60px;
}
@@ -1174,6 +1181,7 @@ option {
font-size: 12px;
margin-left: 5px;
}
+
.defaultOptions:focus {
outline: none;
}
@@ -1193,6 +1201,10 @@ option {
overflow-y: auto;
}
+ .signatureBtn {
+ width: max-content;
+ }
+
.dropdownModal {
position: fixed;
top: 50%;
@@ -1222,4 +1234,4 @@ option {
min-width: 78%;
overflow-y: auto;
}
-}
+}
\ No newline at end of file
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
index 33b276be0..ba7d7b22d 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
@@ -165,29 +165,26 @@ export default async function createDocumentwithCoordinate(request, response) {
'Signers',
contact?.map(x => x.contactPtr)
);
- let updatePlaceholders = contact.map((signer, index) => {
+ let updatePlaceholders = contact.map(signer => {
const placeHolder = [];
for (const widget of signer.widgets) {
const pageNumber = widget.page;
const page = placeHolder.find(page => page.pageNumber === pageNumber);
-
+ const signOpt = { name: 'signature', status: 'required' };
const widgetData = {
- xPosition: widget.x,
- yPosition: widget.y,
isStamp: widget.type === 'stamp',
key: randomId(),
isDrag: false,
- firstXPos: widget.x,
- firstYPos: widget.y,
- yBottom: 0,
scale: 1,
isMobile: false,
zIndex: 1,
type: widget.type,
- widgetValue: '',
+ options: widget.type === 'signature' ? signOpt : widget.options,
Width: widget.w,
Height: widget.h,
+ xPosition: widget.x,
+ yPosition: widget.y,
};
if (page) {
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplate.js
index df8b6eacd..2219dc2df 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplate.js
@@ -123,7 +123,7 @@ export default async function createTemplate(request, response) {
}
return response.json({
objectId: res.id,
- url: baseUrl.origin + '/load/signmicroapp/template/' + res.id,
+ url: baseUrl.origin + '/template/' + res.id,
});
} else {
return response.status(405).json({ error: 'Invalid API Token!' });
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplatewithCoordinate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplatewithCoordinate.js
index 62cab68da..b2a4d2aef 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplatewithCoordinate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplatewithCoordinate.js
@@ -129,23 +129,20 @@ export default async function createTemplatewithCoordinate(request, response) {
for (const widget of signer.widgets) {
const pageNumber = widget.page;
const page = placeHolder.find(page => page.pageNumber === pageNumber);
-
+ const signOpt = { name: 'signature', status: 'required' };
const widgetData = {
- xPosition: widget.x,
- yPosition: widget.y,
isStamp: widget.type === 'stamp',
key: randomId(),
isDrag: false,
- firstXPos: widget.x,
- firstYPos: widget.y,
- yBottom: 0,
scale: 1,
isMobile: false,
zIndex: 1,
type: widget.type,
- widgetValue: '',
+ options: widget.type === 'signature' ? signOpt : widget.options,
Width: widget.w,
Height: widget.h,
+ xPosition: widget.x,
+ yPosition: widget.y,
};
if (page) {
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/draftDocument.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/draftDocument.js
index a2ba41d3c..3dda24f5d 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/draftDocument.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/draftDocument.js
@@ -14,6 +14,7 @@ export default async function draftDocument(request, response) {
const SendinOrder = request.body.sendInOrder || false;
// console.log('fileData ', fileData);
const protocol = customAPIurl();
+ const baseUrl = new URL(process.env.SERVER_URL);
try {
const reqToken = request.headers['x-api-token'];
@@ -135,7 +136,7 @@ export default async function draftDocument(request, response) {
}
return response.json({
objectId: res.id,
- url: protocol + '/load/signmicroapp/placeholdersign/' + res.id,
+ url: `${baseUrl.origin}/placeholdersign/${res.id}`,
});
} else {
if (request.posthog) {
diff --git a/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs b/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs
new file mode 100644
index 000000000..d6894077f
--- /dev/null
+++ b/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs
@@ -0,0 +1,690 @@
+/**
+ *
+ * @param {Parse} Parse
+ */
+exports.up = async Parse => {
+ const className = 'w_menu';
+ const userMenu = new Parse.Query(className);
+ const updateUserMenu = await userMenu.get('H9vRfEYKhT');
+ updateUserMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'Templates',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-file-signature',
+ title: 'Create template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Manage templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSign™ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+
+ const AdminMenu = new Parse.Query(className);
+ const updateAdminMenu = await AdminMenu.get('VPh91h0ZHk');
+ updateAdminMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'Templates',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-file-signature',
+ title: 'Create template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Manage templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSign™ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'far fa-user',
+ title: 'Add User',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'lM0xRnM3iE',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+ // TODO: Set the schema here
+ // Example:
+ // schema.addString('name').addNumber('cash');
+ const batch = [updateUserMenu, updateAdminMenu];
+ return Parse.Object.saveAll(batch, { useMasterKey: true });
+};
+
+/**
+ *
+ * @param {Parse} Parse
+ */
+exports.down = async Parse => {
+ // TODO: set className here
+ const className = 'w_menu';
+ const userMenu = new Parse.Query(className);
+ const revertUserMenu = await userMenu.get('H9vRfEYKhT');
+ revertUserMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSign™ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+
+ const adminMenu = new Parse.Query(className);
+ const revertAdminMenu = await adminMenu.get('VPh91h0ZHk');
+ revertAdminMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSign™ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'far fa-user',
+ title: 'Add User',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'lM0xRnM3iE',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+
+ const batch = [revertUserMenu, revertAdminMenu];
+ return Parse.Object.saveAll(batch, { useMasterKey: true });
+};
diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js
index a5d627607..7812b0c6d 100644
--- a/apps/OpenSignServer/index.js
+++ b/apps/OpenSignServer/index.js
@@ -54,26 +54,39 @@ if (process.env.USE_LOCAL !== 'TRUE') {
let transporterMail;
let mailgunClient;
let mailgunDomain;
-
+let isMailAdapter = false;
if (process.env.SMTP_ENABLE) {
- transporterMail = createTransport({
- host: process.env.SMTP_HOST,
- port: process.env.SMTP_PORT || 465,
- secure: process.env.SMTP_SECURE || true,
- auth: {
- user: process.env.SMTP_USER_EMAIL,
- pass: process.env.SMTP_PASS,
- },
- });
+ try {
+ transporterMail = createTransport({
+ host: process.env.SMTP_HOST,
+ port: process.env.SMTP_PORT || 465,
+ secure: process.env.SMTP_SECURE || true,
+ auth: {
+ user: process.env.SMTP_USER_EMAIL,
+ pass: process.env.SMTP_PASS,
+ },
+ });
+ await transporterMail.verify();
+ isMailAdapter = true;
+ } catch (err) {
+ isMailAdapter = false;
+ console.log('Please provide valid SMTP credentials');
+ }
} else if (process.env.MAILGUN_API_KEY) {
- const mailgun = new Mailgun(formData);
- mailgunClient = mailgun.client({
- username: 'api',
- key: process.env.MAILGUN_API_KEY,
- });
-
- mailgunDomain = process.env.MAILGUN_DOMAIN;
+ try {
+ const mailgun = new Mailgun(formData);
+ mailgunClient = mailgun.client({
+ username: 'api',
+ key: process.env.MAILGUN_API_KEY,
+ });
+ mailgunDomain = process.env.MAILGUN_DOMAIN;
+ isMailAdapter = true;
+ } catch (error) {
+ isMailAdapter = false;
+ console.log('Please provide valid Mailgun credentials');
+ }
}
+
export const config = {
databaseURI:
process.env.DATABASE_URI || process.env.MONGODB_URI || 'mongodb://localhost:27017/dev',
@@ -82,17 +95,18 @@ export const config = {
},
appId: process.env.APP_ID || 'myAppId',
maxLimit: 500,
+ maxUploadSize: '30mb',
masterKey: process.env.MASTER_KEY, //Add your master key here. Keep it secret!
masterKeyIps: ['0.0.0.0/0', '::/0'], // '::1'
- serverURL: process.env.SERVER_URL || 'http://localhost:8080/app', // Don't forget to change to https if needed
- verifyUserEmails: process.env.SMTP_ENABLE || process.env.MAILGUN_API_KEY ? true : false,
+ serverURL: 'http://localhost:8080/app', // Don't forget to change to https if needed
+ verifyUserEmails: isMailAdapter === true ? true : false,
publicServerURL: process.env.SERVER_URL || 'http://localhost:8080/app',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Open Sign',
allowClientClassCreation: false,
allowExpiredAuthDataToken: false,
encodeParseObjectInCloudFunction: true,
- ...(process.env.SMTP_ENABLE || process.env.MAILGUN_API_KEY
+ ...(isMailAdapter === true
? {
emailAdapter: {
module: 'parse-server-api-mail-adapter',