Skip to content

Commit d9fd2a5

Browse files
authored
Merge pull request #533 from OpenSignLabs/premium_alert
2 parents a24ebe2 + cd4fd6e commit d9fd2a5

File tree

17 files changed

+259
-187
lines changed

17 files changed

+259
-187
lines changed

apps/OpenSign/src/components/dashboard/DashboardCard.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Parse from "parse";
44
import getReplacedHashQuery from "../../constant/getReplacedHashQuery";
55
import "../../styles/loader.css";
66
import { useNavigate } from "react-router-dom";
7+
import Tooltip from "../../primitives/Tooltip";
78

89
const DashboardCard = (props) => {
910
const navigate = useNavigate();
@@ -335,7 +336,7 @@ const DashboardCard = (props) => {
335336
props.Data && props.Data.Redirect_type
336337
? "cursor-pointer"
337338
: "cursor-default"
338-
} w-full h-[140px] px-3 pt-4 pb-10 text-white rounded-md shadow overflow-hidden`}
339+
} w-full h-[140px] px-3 pt-4 pb-10 text-white rounded-md shadow overflow-hidden relative`}
339340
>
340341
<div className="flex items-center justify-start gap-5">
341342
<span className="rounded-full bg-black bg-opacity-20 w-[60px] h-[60px] self-start flex justify-center items-center">
@@ -352,6 +353,9 @@ const DashboardCard = (props) => {
352353
</div>
353354
</div>
354355
</div>
356+
<div className="text-xs absolute top-1 right-1">
357+
<Tooltip id={props.Label} iconColor={"white"} message={props?.Data?.tourMessage} />
358+
</div>
355359
</div>
356360
);
357361
};

apps/OpenSign/src/components/pdf/DropdownWidgetOption.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
22
import { themeColor } from "../../constant/const";
33
import ModalUi from "../../primitives/ModalUi";
44
import { radioButtonWidget } from "../../constant/Utils";
5+
import PremiumAlertHeader from "../../primitives/PremiumAlertHeader";
56
function DropdownWidgetOption(props) {
67
const [dropdownOptionList, setDropdownOptionList] = useState([
78
"option-1",
@@ -144,21 +145,15 @@ function DropdownWidgetOption(props) {
144145
};
145146

146147
return (
147-
//props.showDropdown
148-
<ModalUi
149-
// styleClass={"dropdownModal"}
150-
isOpen={props.showDropdown}
151-
title={props.title}
152-
showClose={false}
153-
>
154-
<div style={{ height: "100%", padding: 20 }}>
148+
<ModalUi isOpen={props.showDropdown} title={props.title} showClose={false}>
149+
<div className="h-full p-[15px]">
155150
<form
156151
onSubmit={(e) => {
157152
e.preventDefault();
158153
handleSaveOption();
159154
}}
160155
>
161-
<div className="dropdownContainer">
156+
<div>
162157
<label style={{ fontSize: "13px", fontWeight: "600" }}>
163158
Name<span style={{ color: "red", fontSize: 13 }}> *</span>
164159
</label>
@@ -383,17 +378,22 @@ function DropdownWidgetOption(props) {
383378
</div>
384379
)}
385380
</div>
381+
{props.type === "checkbox" && !props.isSignYourself && (
382+
<PremiumAlertHeader
383+
message={
384+
"Field validations are free in beta, this feature will incur a fee later."
385+
}
386+
/>
387+
)}
386388
<div
387-
style={{
388-
height: "1px",
389-
backgroundColor: "#9f9f9f",
390-
width: "100%",
391-
marginTop: "15px",
392-
marginBottom: "15px"
393-
}}
389+
className={`${
390+
props.type === "checkbox" && !props.isSignYourself
391+
? "mb-[15px]"
392+
: "my-[15px]"
393+
} w-full h-[1px] bg-[#9f9f9f]`}
394394
></div>
395+
395396
<button
396-
// onClick={() => handleSaveOption()}
397397
disabled={dropdownOptionList.length === 0 && true}
398398
style={{
399399
background: themeColor,

apps/OpenSign/src/components/pdf/WidgetNameModal.js

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ModalUi from "../../primitives/ModalUi";
33
import "../../styles/AddUser.css";
44
import RegexParser from "regex-parser";
55
import { textInputWidget } from "../../constant/Utils";
6+
import PremiumAlertHeader from "../../primitives/PremiumAlertHeader";
67

78
const WidgetNameModal = (props) => {
89
const [formdata, setFormdata] = useState({
@@ -14,7 +15,7 @@ const WidgetNameModal = (props) => {
1415
});
1516
const [isValid, setIsValid] = useState(true);
1617
const statusArr = ["Required", "Optional"];
17-
const inputOpt = ["email", "number"];
18+
const inputOpt = ["text", "email", "number"];
1819

1920
useEffect(() => {
2021
if (props.defaultdata) {
@@ -70,7 +71,7 @@ const WidgetNameModal = (props) => {
7071
return "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/";
7172
case "number":
7273
return "/^\\d+$/";
73-
case textInputWidget:
74+
case "text":
7475
return "/^[a-zA-Zs]+$/";
7576
default:
7677
return type;
@@ -98,7 +99,23 @@ const WidgetNameModal = (props) => {
9899
handleClose={props.handleClose && props.handleClose}
99100
title={"Widget info"}
100101
>
101-
<form onSubmit={handleSubmit} style={{ padding: 20 }}>
102+
{(props.defaultdata?.type === textInputWidget ||
103+
props.widgetName === textInputWidget) && (
104+
<PremiumAlertHeader
105+
message={
106+
"Field validations are free in beta, this feature will incur a fee later."
107+
}
108+
/>
109+
)}
110+
<form
111+
onSubmit={handleSubmit}
112+
className={`${
113+
props.defaultdata?.type === textInputWidget ||
114+
props.widgetName === textInputWidget
115+
? "pt-0"
116+
: ""
117+
} p-[20px]`}
118+
>
102119
<div className="form-section">
103120
<label htmlFor="name" style={{ fontSize: 13 }}>
104121
Name
@@ -170,25 +187,22 @@ const WidgetNameModal = (props) => {
170187
name="defaultValue"
171188
value={formdata.defaultValue}
172189
onChange={(e) => handledefaultChange(e)}
173-
onBlur={() =>
174-
isValid === false &&
175-
setFormdata({ ...formdata, defaultValue: "" })
176-
}
190+
autoComplete="off"
191+
onBlur={() => {
192+
if (isValid === false) {
193+
setFormdata({ ...formdata, defaultValue: "" });
194+
setIsValid(true);
195+
}
196+
}}
177197
/>
178-
{isValid === false ? (
179-
<p style={{ color: "Red", fontSize: 8 }}>
198+
{isValid === false && (
199+
<div className="warning defaultvalueWarning" style={{ fontSize: 12 }}>
200+
<i
201+
className="fas fa-exclamation-circle"
202+
style={{ color: "#fab005", fontSize: 15 }}
203+
></i>{" "}
180204
invalid default value
181-
</p>
182-
) : (
183-
<p
184-
style={{
185-
color: "transparent",
186-
fontSize: 10,
187-
margin: "3px 8px"
188-
}}
189-
>
190-
.
191-
</p>
205+
</div>
192206
)}
193207
</div>
194208
</>

apps/OpenSign/src/components/shared/fields/SignersInput.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Select from "react-select";
33
import AddSigner from "../../AddSigner";
44
import Modal from "react-modal";
55
import Parse from "parse";
6+
import Tooltip from "../../../primitives/Tooltip";
67
function arrayMove(array, from, to) {
78
array = array.slice();
89
array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
@@ -107,6 +108,12 @@ const SignersInput = (props) => {
107108
<label className="block">
108109
Signers
109110
{props.required && <span className="text-red-500 text-[13px]">*</span>}
111+
<span className="absolute ml-1 text-xs z-50">
112+
<Tooltip
113+
id={"signer-tooltip"}
114+
message={"Begin typing a contact's name to see suggested signers from your saved contacts or add new ones. Arrange the signing order by adding signers in the desired sequence. Use the '+' button to include signers and the 'x' to remove them. Each signer will receive an email prompt to sign the document in the order listed."}
115+
/>
116+
</span>
110117
</label>
111118
<div style={{ display: "flex", gap: 5 }}>
112119
<div style={{ flexWrap: "wrap", width: "100%" }}>

apps/OpenSign/src/json/ReportJson.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export default function reportJson(id) {
1818
btnIcon: "fa fa-plus",
1919
redirectUrl: "draftDocument"
2020
}
21-
]
21+
],
22+
helpMsg: "This are documents you have started but have not finalized for sending."
2223
};
2324
// Need your sign report
2425
case "4Hhwbp482K":
@@ -33,7 +34,9 @@ export default function reportJson(id) {
3334
btnIcon: "fa fa-eye",
3435
redirectUrl: "pdfRequestFiles"
3536
}
36-
]
37+
],
38+
helpMsg:
39+
"This is a list of documents that are waiting for your signature"
3740
};
3841
// In progess report
3942
case "1MwEuxLEkF":
@@ -48,7 +51,9 @@ export default function reportJson(id) {
4851
btnIcon: "fa fa-eye",
4952
redirectUrl: "pdfRequestFiles"
5053
}
51-
]
54+
],
55+
helpMsg:
56+
"This is a list of documents you've sent to other parties for signature."
5257
};
5358
// completed documents report
5459
case "kQUoW4hUXz":
@@ -63,7 +68,8 @@ export default function reportJson(id) {
6368
btnIcon: "fa fa-eye",
6469
redirectUrl: "draftDocument"
6570
}
66-
]
71+
],
72+
helpMsg: "This is a list of documents that have been signed by all parties."
6773
};
6874
// declined documents report
6975
case "UPr2Fm5WY3":
@@ -78,7 +84,8 @@ export default function reportJson(id) {
7884
btnIcon: "fa fa-eye",
7985
redirectUrl: "draftDocument"
8086
}
81-
]
87+
],
88+
helpMsg: "This is a list of documents that have been declined by one of the signers."
8289
};
8390
// Expired Documents report
8491
case "zNqBHXHsYH":
@@ -93,7 +100,8 @@ export default function reportJson(id) {
93100
btnIcon: "fa fa-eye",
94101
redirectUrl: "draftDocument"
95102
}
96-
]
103+
],
104+
helpMsg: "This is a list of documents that have reached their expiration date."
97105
};
98106
// Recently sent for signatures report show on dashboard
99107
case "d9k3UfYHBc":
@@ -153,7 +161,8 @@ export default function reportJson(id) {
153161
btnIcon: "fa-solid fa-trash"
154162
}
155163
],
156-
form: "ContactBook"
164+
form: "ContactBook",
165+
helpMsg: "This is a list of contacts/signers added by you. These will appear as suggestions when you try to add signers to a new document."
157166
};
158167
// template report
159168
case "6TeaPr321t":
@@ -175,7 +184,9 @@ export default function reportJson(id) {
175184
btnIcon: "fa fa-plus",
176185
redirectUrl: "template"
177186
}
178-
]
187+
],
188+
helpMsg:
189+
"This is a list of templates that are available to you for creating documents. You can click the 'use' button to create a new document using a template, modify the document & add signers in the next step."
179190
};
180191
default:
181192
return null;

apps/OpenSign/src/pages/Form.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Forms = (props) => {
3535
const [formData, setFormData] = useState({
3636
Name: "",
3737
Description: "",
38-
Note: "Please review and sign this document",
38+
Note: "",
3939
TimeToCompleteDays: 15,
4040
SendinOrder: "false"
4141
});
@@ -51,6 +51,7 @@ const Forms = (props) => {
5151
};
5252
useEffect(() => {
5353
handleReset();
54+
// eslint-disable-next-line react-hooks/exhaustive-deps
5455
}, [props.title]);
5556
const handleFileInput = (e) => {
5657
setpercentage(0);
@@ -235,7 +236,10 @@ const Forms = (props) => {
235236
setFormData({
236237
Name: "",
237238
Description: "",
238-
Note: "Please review and sign this document",
239+
Note:
240+
props.title === "Sign Yourself"
241+
? "Note to myself"
242+
: "Please review and sign this document",
239243
TimeToCompleteDays: 15,
240244
SendinOrder: "true"
241245
});
@@ -326,7 +330,10 @@ const Forms = (props) => {
326330
</div>
327331
<div className="text-xs mt-2">
328332
<label className="block">
329-
Title<span className="text-red-500 text-[13px]">*</span>
333+
{props.title === "New Template"
334+
? "Template Title"
335+
: "Document Title"}
336+
<span className="text-red-500 text-[13px]">*</span>
330337
</label>
331338
<input
332339
name="Name"

apps/OpenSign/src/pages/GenerateToken.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import Alert from "../primitives/Alert";
55
import ModalUi from "../primitives/ModalUi";
66
import { rejectBtn, submitBtn } from "../constant/const";
77
import { openInNewTab } from "../constant/Utils";
8+
import PremiumAlertHeader from "../primitives/PremiumAlertHeader";
9+
import Tooltip from "../primitives/Tooltip";
810

911
function GenerateToken() {
1012
const [parseBaseUrl] = useState(localStorage.getItem("baseUrl"));
@@ -115,7 +117,13 @@ function GenerateToken() {
115117
</div>
116118
) : (
117119
<div className="bg-white flex flex-col justify-center shadow rounded">
118-
<h1 className="ml-4 mt-3 mb-2 font-semibold">API Token</h1>
120+
<PremiumAlertHeader />
121+
<h1 className="ml-4 mt-3 mb-2 font-semibold">
122+
API Token{" "}
123+
<Tooltip
124+
url={"https://docs.opensignlabs.com/docs/API-docs/opensign-api-v-1"}
125+
/>
126+
</h1>
119127
<ul className="w-full flex flex-col p-2 text-sm">
120128
<li
121129
className={`flex justify-between items-center border-y-[1px] border-gray-300 break-all py-2`}

0 commit comments

Comments
 (0)