Skip to content

Commit 3a55c35

Browse files
feat: add create document btn in dashboard, update menu & change Root to Opensign™ drive in folder input
1 parent 08476ba commit 3a55c35

File tree

6 files changed

+808
-11
lines changed

6 files changed

+808
-11
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from "react";
2+
import "../../styles/loader.css";
3+
import { useNavigate } from "react-router-dom";
4+
import { openInNewTab } from "../../constant/Utils";
5+
6+
const DashboardButton = (props) => {
7+
const navigate = useNavigate();
8+
9+
function openReport() {
10+
if (props.Data && props.Data.Redirect_type) {
11+
const Redirect_type = props.Data.Redirect_type;
12+
const id = props.Data.Redirect_id;
13+
if (Redirect_type === "Form") {
14+
navigate(`/form/${id}`);
15+
} else if (Redirect_type === "Report") {
16+
navigate(`/report/${id}`);
17+
} else if (Redirect_type === "Url") {
18+
openInNewTab(id);
19+
}
20+
}
21+
}
22+
return (
23+
<div
24+
onClick={() => openReport()}
25+
className={`${
26+
props.Data && props.Data.Redirect_type
27+
? "cursor-pointer"
28+
: "cursor-default"
29+
} w-full px-3 py-2 flex text-white rounded-md shadow overflow-hidden`}
30+
>
31+
<div className="flex items-center justify-start gap-5">
32+
<span className="rounded-full bg-black bg-opacity-20 w-[60px] h-[60px] self-start flex justify-center items-center">
33+
<i
34+
className={`${
35+
props.Icon ? props.Icon : "fa fa-solid fa-info"
36+
} text-[25px] lg:text-[30px]`}
37+
></i>
38+
</span>
39+
<div className="">
40+
<div className="text-base lg:text-lg text-black"> {props.Label}</div>
41+
</div>
42+
</div>
43+
</div>
44+
);
45+
};
46+
47+
export default DashboardButton;

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

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,51 @@
11
import React, { Suspense, lazy } from "react";
2+
const DashboardButton = lazy(() => import("./DashboardButton"));
23
const DashboardCard = lazy(() => import("./DashboardCard"));
34
const DashboardReport = lazy(() => import("./DashboardReport"));
4-
5+
const buttonList = [
6+
{
7+
label: "Sign yourself",
8+
redirectId: "sHAnZphf69",
9+
redirectType: "Form"
10+
},
11+
{
12+
label: "Request signature",
13+
redirectId: "8mZzFxbG1z",
14+
redirectType: "Form"
15+
}
16+
];
517
const GetDashboard = (props) => {
18+
const Button = ({ label, redirectId, redirectType }) => (
19+
<div className={"bg-white rounded-md shadow w-full"}>
20+
<Suspense
21+
fallback={
22+
<div style={{ height: "300px" }}>
23+
<div
24+
style={{
25+
marginLeft: "45%",
26+
marginTop: "150px",
27+
fontSize: "45px",
28+
color: "#3dd3e0"
29+
}}
30+
className="loader-37"
31+
></div>
32+
</div>
33+
}
34+
>
35+
<DashboardButton
36+
Icon={"fa-solid fa-plus"}
37+
Label={label}
38+
Data={{ Redirect_type: redirectType, Redirect_id: redirectId }}
39+
/>
40+
</Suspense>
41+
</div>
42+
);
643
const renderSwitchWithTour = (col) => {
744
switch (col.widget.type) {
845
case "Card":
946
return (
1047
<div
11-
className={"bg-[#2ed8b6] rounded-md shadow mb-4 md:mb-0"}
48+
className={"bg-[#2ed8b6] rounded-md shadow mb-3 md:mb-0"}
1249
data-tut={col.widget.data.tourSection}
1350
style={{ background: col.widget.bgColor }}
1451
>
@@ -42,7 +79,7 @@ const GetDashboard = (props) => {
4279
return (
4380
<div data-tut={col.widget.data.tourSection}>
4481
<Suspense fallback={<div>please wait</div>}>
45-
<div className="mb-4 md:mb-0">
82+
<div className="mb-3 md:mb-0">
4683
<DashboardReport Record={col.widget} />
4784
</div>
4885
</Suspense>
@@ -58,7 +95,7 @@ const GetDashboard = (props) => {
5895
case "Card":
5996
return (
6097
<div
61-
className={"bg-[#2ed8b6] rounded-md shadow mb-4 md:mb-0"}
98+
className={"bg-[#2ed8b6] rounded-md shadow mb-3 md:mb-0"}
6299
style={{ background: col.widget.bgColor }}
63100
>
64101
<Suspense fallback={<div>please wait</div>}>
@@ -76,7 +113,7 @@ const GetDashboard = (props) => {
76113
case "report": {
77114
return (
78115
<Suspense fallback={<div>please wait</div>}>
79-
<div className="mb-4 md:mb-0">
116+
<div className="mb-3 md:mb-0">
80117
<DashboardReport Record={col.widget} />
81118
</div>
82119
</Suspense>
@@ -88,6 +125,21 @@ const GetDashboard = (props) => {
88125
};
89126
return (
90127
<div>
128+
<div className="mb-3">
129+
<div
130+
data-tut={"tourbutton"}
131+
className="flex flex-col md:flex-row gap-6 md:gap-8"
132+
>
133+
{buttonList.map((btn) => (
134+
<Button
135+
key={btn.label}
136+
label={btn.label}
137+
redirectType={btn.redirectType}
138+
redirectId={btn.redirectId}
139+
/>
140+
))}
141+
</div>
142+
</div>
91143
{props.dashboard.map((val, key) => (
92144
<div key={"a" + key} className="row">
93145
{val.columns.map((col, i) =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ function DropdownWidgetOption(props) {
377377
/>
378378

379379
<label className="ml-1" htmlFor="ishidelabel">
380-
Hide label
380+
Hide labels
381381
</label>
382382
</div>
383383
</div>

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {
9393

9494
// `handleSubmit` is used to pass folderPtr to parent component
9595
const handleSubmit = () => {
96-
let url = "Root";
96+
let url = "OpenSign™ Drive";
9797
tabList.forEach((t) => {
9898
url = url + " / " + t.Name;
9999
});
@@ -180,7 +180,9 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {
180180
<div className="font-semibold ">
181181
<div className="flex items-center gap-2">
182182
<p>
183-
{selectFolder && selectFolder.Name ? selectFolder.Name : "Root"}
183+
{selectFolder && selectFolder.Name
184+
? selectFolder.Name
185+
: "OpenSign™ Drive"}
184186
</p>
185187
<div className="text-black text-sm" onClick={() => SetIsOpen(true)}>
186188
<i
@@ -207,14 +209,14 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {
207209
isOpen={isOpen}
208210
handleClose={handleCancel}
209211
>
210-
<div className="w-full min-w-[300px] md:min-w-[500px] px-3">
212+
<div className="w-full min-w-[300px] md:min-w-[500px] max-w-[500px] px-3">
211213
<div className="py-2 text-[#ac4848] text-[14px] font-[500]">
212214
<span
213215
className="cursor-pointer"
214-
title="Root"
216+
title="OpenSign™ Drive"
215217
onClick={(e) => removeTabListItem(e)}
216218
>
217-
Root /{" "}
219+
OpenSign™ Drive /{" "}
218220
</span>
219221
{tabList &&
220222
tabList.map((tab, i) => (

apps/OpenSign/src/layout/HomeLayout.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ const HomeLayout = () => {
9494
position: "top"
9595
// style: { backgroundColor: "#abd4d2" },
9696
},
97+
{
98+
selector: '[data-tut="tourbutton"]',
99+
content: `To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.`,
100+
position: "top"
101+
// style: { backgroundColor: "#abd4d2" },
102+
},
97103
...resArr,
98104
{
99105
selector: '[data-tut="reactourLast"]',

0 commit comments

Comments
 (0)