Skip to content

Commit f7606bc

Browse files
authored
Merge pull request #507 from OpenSignLabs/staging
v1.3.2-beta
2 parents f08758f + e643d96 commit f7606bc

26 files changed

+1032
-140
lines changed

.env.local_dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ appName=open_sign_server
2020
# A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database.
2121
MASTER_KEY=XnAadwKxxByMr
2222
# Mongodb URI to connect to
23-
MONGODB_URI=mongodb://host.docker.internal:27017/OpenSignDB
23+
MONGODB_URI=mongodb://localhost:27017/OpenSignDB
2424
# Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions.
2525
PARSE_MOUNT=/app
2626
# Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead)

apps/OpenSign/Dockerhubfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN npm install
1414
COPY apps/OpenSign/ .
1515
COPY apps/OpenSign/.husky .
1616

17+
# build
18+
RUN npm run build
19+
1720
# Make port 3000 available to the world outside this container
1821
EXPOSE 3000
1922

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/pdf/Placeholder.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ function Placeholder(props) {
215215
"company",
216216
"job title",
217217
"date",
218-
"email"
218+
"email",
219+
textWidget
219220
].includes(props.pos.type);
220221

221222
if (widgetTypeExist) {
@@ -594,7 +595,7 @@ function Placeholder(props) {
594595
disableDragging={
595596
props.isNeedSign
596597
? true
597-
: props.isPlaceholder && props.pos.type !== "date"
598+
: props.isPlaceholder && ![textWidget].includes(props.pos.type)
598599
? false
599600
: !isDraggingEnabled
600601
}
@@ -652,8 +653,18 @@ function Placeholder(props) {
652653
style={{
653654
left: props.xPos(props.pos, props.isSignYourself),
654655
top: props.yPos(props.pos, props.isSignYourself),
655-
width: "auto", //props.posWidth(props.pos, props.isSignYourself),
656+
width:
657+
props.pos.type === radioButtonWidget ||
658+
props.pos.type === "checkbox"
659+
? "auto"
660+
: props.posWidth(props.pos, props.isSignYourself),
661+
// "auto", //props.posWidth(props.pos, props.isSignYourself),
656662
// height: props.posHeight(props.pos, props.isSignYourself),
663+
height:
664+
props.pos.type === radioButtonWidget ||
665+
props.pos.type === "checkbox"
666+
? "auto"
667+
: props.posHeight(props.pos, props.isSignYourself),
657668
zIndex: "10"
658669
}}
659670
onTouchEnd={() => handleOnClickPlaceholder()}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
defaultWidthHeight,
55
isMobile,
66
radioButtonWidget,
7-
resizeBorderExtraWidth
7+
resizeBorderExtraWidth,
8+
textWidget
89
} from "../../constant/Utils";
910
function PlaceholderBorder(props) {
1011
const getResizeBorderExtraWidth = resizeBorderExtraWidth();
@@ -31,7 +32,10 @@ function PlaceholderBorder(props) {
3132
};
3233
return (
3334
<div
34-
onMouseEnter={!isMobile && props?.setDraggingEnabled(true)}
35+
onMouseEnter={() => !isMobile && props?.setDraggingEnabled(true)}
36+
onTouchEnd={() =>
37+
props.pos.type === textWidget && props?.setDraggingEnabled(true)
38+
}
3539
className="borderResize"
3640
style={{
3741
borderColor: themeColor,

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect, useState, forwardRef, useRef } from "react";
22
import {
33
getMonth,
44
getYear,
5+
isMobile,
56
onChangeInput,
67
radioButtonWidget,
78
range,
@@ -741,6 +742,7 @@ function PlaceholderType(props) {
741742
placeholder="Enter label"
742743
rows={1}
743744
value={textValue}
745+
onBlur={handleInputBlur}
744746
onChange={(e) => {
745747
setTextValue(e.target.value);
746748
onChangeInput(
@@ -753,7 +755,11 @@ function PlaceholderType(props) {
753755
false
754756
);
755757
}}
756-
className="labelTextArea"
758+
className={
759+
isMobile
760+
? "labelTextArea labelWidthMobile"
761+
: "labelTextArea labelWidthDesktop"
762+
}
757763
style={{ whiteSpace: "pre-wrap" }}
758764
cols="50"
759765
/>

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ function WidgetComponent({
239239
const updateWidgets = isSignYourself
240240
? filterWidgets
241241
: isTemplateFlow
242-
? textWidgetData
243-
: widget;
242+
? textWidgetData
243+
: widget;
244244

245245
return (
246246
<>
@@ -264,11 +264,7 @@ function WidgetComponent({
264264
alignItems: "center",
265265
justifyContent: "center"
266266
}}
267-
onClick={() => {
268-
// if (signersdata?.length) {
269-
handleModal();
270-
// }
271-
}}
267+
onClick={() => handleModal()}
272268
>
273269
<span
274270
style={{
@@ -346,7 +342,7 @@ function WidgetComponent({
346342
display: "flex",
347343
overflowX: "scroll",
348344
whiteSpace: "nowrap",
349-
padding: "10px"
345+
padding: "10px 5px 10px 1px"
350346
}}
351347
>
352348
<WidgetList

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getWidgetType } from "../../constant/Utils";
44
function WidgetList(props) {
55
return props.updateWidgets.map((item, ind) => {
66
return (
7-
<div key={ind} style={{ marginBottom: "10px" }}>
7+
<div key={ind} style={{ marginBottom: "5px" }}>
88
<div
99
className="widgets"
1010
onClick={() => {

0 commit comments

Comments
 (0)