Skip to content

Commit 4e83734

Browse files
authored
Merge pull request #859 from OpenSignLabs/resolve_stage
fix: zindex of tooltip, decrease size of loader, remove description from signyourself and requestsign form
2 parents 6fa4c47 + 6eeaea1 commit 4e83734

File tree

7 files changed

+61
-137
lines changed

7 files changed

+61
-137
lines changed

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

Lines changed: 31 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useEffect, useState, forwardRef, useRef } from "react";
22
import {
33
getMonth,
44
getYear,
5-
isMobile,
65
onChangeHeightOfTextArea,
76
onChangeInput,
87
radioButtonWidget,
@@ -14,7 +13,10 @@ import DatePicker from "react-datepicker";
1413
import "react-datepicker/dist/react-datepicker.css";
1514
import "../../styles/signature.css";
1615
import RegexParser from "regex-parser";
17-
16+
const textWidgetCls =
17+
"w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] rounded-[2px] border-[1px] border-[#007bff] overflow-hidden resize-none outline-none text-base-content bg-base-100 whitespace-pre-wrap";
18+
const selectWidgetCls =
19+
"w-full h-full absolute left-0 top-0 border-[1px] border-[#007bff] rounded-[2px] focus:outline-none bg-base-100 text-base-content";
1820
function PlaceholderType(props) {
1921
const type = props?.pos?.type;
2022
const [selectOption, setSelectOption] = useState("");
@@ -137,13 +139,13 @@ function PlaceholderType(props) {
137139

138140
const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
139141
<div
140-
className="inputPlaceholder"
141-
style={{ overflow: "hidden", fontSize: calculateFontSize() }}
142+
className={`${selectWidgetCls} overflow-hidden`}
143+
style={{ fontSize: calculateFontSize() }}
142144
onClick={onClick}
143145
ref={ref}
144146
>
145147
{value}
146-
<i className="fa-regular fa-calendar" style={{ marginLeft: "5px" }}></i>
148+
<i className="fa-regular fa-calendar ml-[5px]"></i>
147149
</div>
148150
));
149151
ExampleCustomInput.displayName = "ExampleCustomInput";
@@ -304,17 +306,13 @@ function PlaceholderType(props) {
304306
case "signature":
305307
return props.pos.SignUrl ? (
306308
<img
307-
alt="signimg"
309+
alt="signature"
308310
draggable="false"
309311
src={props.pos.SignUrl}
310-
style={{
311-
width: "99%",
312-
height: "100%",
313-
objectFit: "contain"
314-
}}
312+
className="w-[99%] h-full object-contain"
315313
/>
316314
) : (
317-
<div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
315+
<div className="text-[11px] text-black justify-center">
318316
{props?.handleUserName &&
319317
props?.handleUserName(
320318
props?.data?.Id,
@@ -326,17 +324,13 @@ function PlaceholderType(props) {
326324
case "stamp":
327325
return props.pos.SignUrl ? (
328326
<img
329-
alt="signimg"
327+
alt="stamp"
330328
draggable="false"
331329
src={props.pos.SignUrl}
332-
style={{
333-
width: "99%",
334-
height: "100%",
335-
objectFit: "contain"
336-
}}
330+
className="w-[99%] h-full object-contain"
337331
/>
338332
) : (
339-
<div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
333+
<div className="text-[11px] text-black justify-center">
340334
{props?.handleUserName &&
341335
props?.handleUserName(
342336
props?.data?.Id,
@@ -417,12 +411,7 @@ function PlaceholderType(props) {
417411
false
418412
);
419413
}}
420-
className={
421-
isMobile
422-
? "labelTextArea labelWidthMobile"
423-
: "labelTextArea labelWidthDesktop"
424-
}
425-
style={{ whiteSpace: "pre-wrap", color: "initial" }}
414+
className={textWidgetCls}
426415
cols="50"
427416
/>
428417
) : (
@@ -438,9 +427,8 @@ function PlaceholderType(props) {
438427
case "dropdown":
439428
return props.data?.signerObjId === props.signerObjId ? (
440429
<select
441-
className="inputPlaceholder"
430+
className={`${selectWidgetCls} text-[12px]`}
442431
id="myDropdown"
443-
style={{ fontSize: "12px", color: "initial" }}
444432
value={selectOption}
445433
onChange={(e) => {
446434
setSelectOption(e.target.value);
@@ -470,7 +458,7 @@ function PlaceholderType(props) {
470458
</select>
471459
) : (
472460
<div
473-
className="inputPlaceholder"
461+
className={selectWidgetCls}
474462
style={{ fontSize: calculateFontSize() }}
475463
>
476464
{props.pos?.options?.name ? props.pos.options.name : type}
@@ -479,17 +467,13 @@ function PlaceholderType(props) {
479467
case "initials":
480468
return props.pos.SignUrl ? (
481469
<img
482-
alt="signimg"
470+
alt="initials"
483471
draggable="false"
484472
src={props.pos.SignUrl}
485-
style={{
486-
width: "99%",
487-
height: "100%",
488-
objectFit: "contain"
489-
}}
473+
className="w-[99%] h-full object-contain"
490474
/>
491475
) : (
492-
<div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
476+
<div className="text-[11px] text-black justify-center">
493477
{props?.handleUserName &&
494478
props?.handleUserName(
495479
props?.data?.Id,
@@ -520,12 +504,7 @@ function PlaceholderType(props) {
520504
isDefault
521505
);
522506
}}
523-
className={
524-
isMobile
525-
? "labelTextArea labelWidthMobile"
526-
: "labelTextArea labelWidthDesktop"
527-
}
528-
style={{ whiteSpace: "pre-wrap", color: "initial" }}
507+
className={textWidgetCls}
529508
cols="50"
530509
/>
531510
) : (
@@ -559,12 +538,7 @@ function PlaceholderType(props) {
559538
false
560539
);
561540
}}
562-
className={
563-
isMobile
564-
? "labelTextArea labelWidthMobile"
565-
: "labelTextArea labelWidthDesktop"
566-
}
567-
style={{ whiteSpace: "pre-wrap", color: "initial" }}
541+
className={textWidgetCls}
568542
cols="50"
569543
/>
570544
) : (
@@ -598,12 +572,7 @@ function PlaceholderType(props) {
598572
false
599573
);
600574
}}
601-
className={
602-
isMobile
603-
? "labelTextArea labelWidthMobile"
604-
: "labelTextArea labelWidthDesktop"
605-
}
606-
style={{ whiteSpace: "pre-wrap", color: "initial" }}
575+
className={textWidgetCls}
607576
cols="50"
608577
/>
609578
) : (
@@ -655,8 +624,7 @@ function PlaceholderType(props) {
655624
}
656625
onBlur={handleInputBlur}
657626
closeOnScroll={true}
658-
className="inputPlaceholder"
659-
style={{ outlineColor: "#007bff" }}
627+
className={`${selectWidgetCls} outline-[#007bff]`}
660628
selected={
661629
props?.startDate
662630
? props?.startDate
@@ -679,17 +647,13 @@ function PlaceholderType(props) {
679647
case "image":
680648
return props.pos.SignUrl ? (
681649
<img
682-
alt="signimg"
650+
alt="image"
683651
draggable="false"
684652
src={props.pos.SignUrl}
685-
style={{
686-
width: "99%",
687-
height: "100%",
688-
objectFit: "contain"
689-
}}
653+
className="w-[99%] h-full object-contain"
690654
/>
691655
) : (
692-
<div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
656+
<div className="text-[11px] text-black justify-center">
693657
{props?.handleUserName &&
694658
props?.handleUserName(
695659
props?.data?.Id,
@@ -720,12 +684,7 @@ function PlaceholderType(props) {
720684
false
721685
);
722686
}}
723-
className={
724-
isMobile
725-
? "labelTextArea labelWidthMobile"
726-
: "labelTextArea labelWidthDesktop"
727-
}
728-
style={{ whiteSpace: "pre-wrap", color: "initial" }}
687+
className={textWidgetCls}
729688
cols="50"
730689
/>
731690
) : (
@@ -791,31 +750,18 @@ function PlaceholderType(props) {
791750
false
792751
);
793752
}}
794-
className={
795-
isMobile
796-
? "labelTextArea labelWidthMobile"
797-
: "labelTextArea labelWidthDesktop"
798-
}
799-
style={{
800-
whiteSpace: "pre-wrap",
801-
overflow: "hidden",
802-
color: "initial"
803-
}}
753+
className={textWidgetCls}
804754
cols="50"
805755
/>
806756
);
807757
default:
808758
return props.pos.SignUrl ? (
809-
<div style={{ pointerEvents: "none" }}>
759+
<div className="pointer-events-none">
810760
<img
811-
alt="signimg"
761+
alt="image"
812762
draggable="false"
813763
src={props.pos.SignUrl}
814-
style={{
815-
width: "99%",
816-
height: "100%",
817-
objectFit: "contain"
818-
}}
764+
className="w-[99%] h-full object-contain"
819765
/>
820766
</div>
821767
) : (

apps/OpenSign/src/pages/Form.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -701,15 +701,17 @@ const Forms = (props) => {
701701
required
702702
/>
703703
</div>
704-
<div className="text-xs mt-2">
705-
<label className="block">Description</label>
706-
<input
707-
name="Description"
708-
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
709-
value={formData.Description}
710-
onChange={(e) => handleStrInput(e)}
711-
/>
712-
</div>
704+
{props.title === "New Template" && (
705+
<div className="text-xs mt-2">
706+
<label className="block">Description</label>
707+
<input
708+
name="Description"
709+
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
710+
value={formData.Description}
711+
onChange={(e) => handleStrInput(e)}
712+
/>
713+
</div>
714+
)}
713715
{props.signers && (
714716
<SignersInput
715717
onChange={handleSigners}

apps/OpenSign/src/pages/Managesign.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const ManageSign = () => {
293293
{image ? (
294294
<div className="signatureCanvas relative border-[2px] border-[#888]">
295295
<img
296-
alt="preview image"
296+
alt="signature"
297297
src={image}
298298
className="w-full h-full object-contain"
299299
/>
@@ -401,7 +401,7 @@ const ManageSign = () => {
401401
className="intialSignature"
402402
>
403403
<img
404-
alt="preview image"
404+
alt="inititals"
405405
src={Initials}
406406
style={{
407407
width: "100%",
@@ -424,17 +424,10 @@ const ManageSign = () => {
424424
dotSize={1}
425425
/>
426426
)}
427-
<div
428-
style={{
429-
display: "flex",
430-
flexDirection: "row",
431-
justifyContent: "space-between"
432-
}}
433-
className="penContainerInitial"
434-
>
427+
<div className="flex flex-row justify-between w-[183px]">
435428
<div>
436429
{!isInitials && (
437-
<div style={{ display: "flex", flexDirection: "row" }}>
430+
<div className="flex flex-row">
438431
{allColor.map((data, key) => {
439432
return (
440433
<i

apps/OpenSign/src/primitives/GetReportDisplay.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ const ReportTable = (props) => {
965965
</div>
966966
<div
967967
className={`${
968-
isDashboard ? "h-[317px]" : "h-full"
968+
isDashboard && props.List?.length > 0 ? "h-[317px]" : "h-full"
969969
} overflow-x-auto w-full`}
970970
>
971971
<table className="op-table border-collapse w-full">
@@ -1604,7 +1604,11 @@ const ReportTable = (props) => {
16041604
)}
16051605
</div>
16061606
{props.List?.length <= 0 && (
1607-
<div className="flex flex-col items-center justify-center w-full bg-base-100 text-base-content rounded-xl py-4">
1607+
<div
1608+
className={`${
1609+
isDashboard ? "h-[330px]" : ""
1610+
} flex flex-col items-center justify-center w-ful bg-base-100 text-base-content rounded-xl py-4`}
1611+
>
16081612
<div className="w-[60px] h-[60px] overflow-hidden">
16091613
<img
16101614
className="w-full h-full object-contain"

apps/OpenSign/src/primitives/Loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22

33
const Loader = () => {
44
return (
5-
<div className="op-loading op-loading-infinity w-[5rem] text-accent"></div>
5+
<div className="op-loading op-loading-infinity w-[4rem] text-accent"></div>
66
);
77
};
88

apps/OpenSign/src/primitives/Tooltip.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ const Tooltip = ({ id, message, url, iconColor }) =>
66
<button onClick={() => openInNewTab(url)} className={"text-center"}>
77
<sup>
88
<i
9-
className="fa-solid fa-question rounded-full"
9+
className="fa-solid fa-question rounded-full border-[1.5px] py-[1.5px] px-[4px] text-[13px]"
1010
style={{
1111
borderColor: iconColor ? iconColor : "#33bbff",
12-
color: iconColor ? iconColor : "#33bbff",
13-
fontSize: 13,
14-
borderWidth: 1.5,
15-
padding: "1.5px 4px"
12+
color: iconColor ? iconColor : "#33bbff"
1613
}}
1714
></i>
1815
</sup>
@@ -26,18 +23,18 @@ const Tooltip = ({ id, message, url, iconColor }) =>
2623
>
2724
<sup>
2825
<i
29-
className="fa-solid fa-question rounded-full"
26+
className="fa-solid fa-question rounded-full border-[1.5px] py-[1.5px] px-[4px] text-[13px]"
3027
style={{
3128
borderColor: iconColor ? iconColor : "#33bbff",
32-
color: iconColor ? iconColor : "#33bbff",
33-
fontSize: 13,
34-
borderWidth: 1.5,
35-
padding: "1.5px 4px"
29+
color: iconColor ? iconColor : "#33bbff"
3630
}}
3731
></i>
3832
</sup>
3933
</a>
40-
<ReactTooltip id={id ? id : "my-tooltip"} className="max-w-[200px]" />
34+
<ReactTooltip
35+
id={id ? id : "my-tooltip"}
36+
className="max-w-[200px] z-[200]"
37+
/>
4138
</>
4239
);
4340

0 commit comments

Comments
 (0)