Skip to content

Commit f08758f

Browse files
authored
Merge pull request #491 from OpenSignLabs/staging
2 parents d3b1a37 + 08476ba commit f08758f

28 files changed

+1241
-618
lines changed

apps/OpenSign/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/OpenSign/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"react-scrollbars-custom": "^4.1.1",
3939
"react-select": "^5.8.0",
4040
"react-signature-canvas": "^1.0.6",
41+
"react-tooltip": "^5.26.3",
4142
"reactour": "^1.19.2",
4243
"redux": "^4.2.1",
4344
"redux-thunk": "^2.4.2",
@@ -48,7 +49,7 @@
4849
},
4950
"scripts": {
5051
"start": "serve -s build",
51-
"start-dev" :"react-scripts start",
52+
"start-dev": "react-scripts start",
5253
"version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt",
5354
"version-win": "powershell -Command \"Invoke-RestMethod -Uri 'https://api.github.com/repos/opensignlabs/opensign/releases/latest' | Select-Object -ExpandProperty tag_name | Out-File -FilePath ./public/version.txt\"",
5455
"build": "npm run version && react-scripts build",

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

Lines changed: 73 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useEffect, useState } from "react";
22
import { themeColor } from "../../constant/const";
33
import ModalUi from "../../primitives/ModalUi";
4+
import { radioButtonWidget } from "../../constant/Utils";
45
function DropdownWidgetOption(props) {
56
const [dropdownOptionList, setDropdownOptionList] = useState([
67
"option-1",
@@ -10,6 +11,7 @@ function DropdownWidgetOption(props) {
1011
const [maxCount, setMaxCount] = useState(0);
1112
const [dropdownName, setDropdownName] = useState(props.type);
1213
const [isReadOnly, setIsReadOnly] = useState(false);
14+
const [isHideLabel, setIsHideLabel] = useState(false);
1315
const [status, setStatus] = useState("required");
1416
const [defaultValue, setDefaultValue] = useState("");
1517
const statusArr = ["required", "optional"];
@@ -19,6 +21,7 @@ function DropdownWidgetOption(props) {
1921
setDropdownOptionList(["option-1", "option-2"]);
2022
setDropdownName(props.type);
2123
setIsReadOnly(false);
24+
setIsHideLabel(false);
2225
setMinCount(0);
2326
setMaxCount(0);
2427
setDefaultCheckbox([]);
@@ -39,6 +42,7 @@ function DropdownWidgetOption(props) {
3942
props.currWidgetsDetails?.options?.validation?.maxRequiredCount
4043
);
4144
setIsReadOnly(props.currWidgetsDetails?.options?.isReadOnly);
45+
setIsHideLabel(props.currWidgetsDetails?.options?.isHideLabel);
4246
setStatus(props.currWidgetsDetails?.options?.status || "required");
4347
setDefaultValue(props.currWidgetsDetails?.options?.defaultValue || "");
4448
setDefaultCheckbox(props.currWidgetsDetails?.options?.defaultValue || []);
@@ -106,13 +110,15 @@ function DropdownWidgetOption(props) {
106110
null,
107111
null,
108112
status,
109-
defaultData
113+
defaultData,
114+
isHideLabel
110115
);
111116
// props.setShowDropdown(false);
112117
setDropdownOptionList(["option-1", "option-2"]);
113118
setDropdownName(props.type);
114119
// props.setCurrWidgetsDetails({});
115120
setIsReadOnly(false);
121+
setIsHideLabel(false);
116122
setMinCount(0);
117123
setMaxCount(0);
118124
setDefaultCheckbox([]);
@@ -143,7 +149,7 @@ function DropdownWidgetOption(props) {
143149
// styleClass={"dropdownModal"}
144150
isOpen={props.showDropdown}
145151
title={props.title}
146-
closeOff={true}
152+
showClose={false}
147153
>
148154
<div style={{ height: "100%", padding: 20 }}>
149155
<form
@@ -153,20 +159,6 @@ function DropdownWidgetOption(props) {
153159
}}
154160
>
155161
<div className="dropdownContainer">
156-
{["checkbox", "radio"].includes(props.type) &&
157-
!props.isSignYourself && (
158-
<div>
159-
<input
160-
type="checkbox"
161-
checked={isReadOnly}
162-
onChange={(e) => {
163-
setIsReadOnly(e.target.checked);
164-
}}
165-
/>
166-
167-
<label style={{ marginLeft: "10px" }}>Is read only</label>
168-
</div>
169-
)}
170162
<label style={{ fontSize: "13px", fontWeight: "600" }}>
171163
Name<span style={{ color: "red", fontSize: 13 }}> *</span>
172164
</label>
@@ -178,36 +170,6 @@ function DropdownWidgetOption(props) {
178170
className="drodown-input"
179171
/>
180172

181-
{props.type === "checkbox" && !props.isSignYourself && (
182-
<>
183-
<label style={{ fontSize: "13px", fontWeight: "600" }}>
184-
Minimun check
185-
</label>
186-
<input
187-
required
188-
defaultValue={0}
189-
value={minCount}
190-
onChange={(e) => {
191-
const count = handleSetMinMax(e);
192-
setMinCount(count);
193-
}}
194-
className="drodown-input"
195-
/>
196-
<label style={{ fontSize: "13px", fontWeight: "600" }}>
197-
Maximum check
198-
</label>
199-
<input
200-
required
201-
defaultValue={0}
202-
value={maxCount}
203-
onChange={(e) => {
204-
const count = handleSetMinMax(e);
205-
setMaxCount(count);
206-
}}
207-
className="drodown-input"
208-
/>
209-
</>
210-
)}
211173
<label
212174
style={{ fontSize: "13px", fontWeight: "600", marginTop: "5px" }}
213175
>
@@ -274,7 +236,6 @@ function DropdownWidgetOption(props) {
274236
></i>
275237
</div>
276238
))}
277-
278239
<i
279240
onClick={handleAddInput}
280241
style={{
@@ -285,8 +246,38 @@ function DropdownWidgetOption(props) {
285246
}}
286247
className="fa-solid fa-square-plus"
287248
></i>
249+
{props.type === "checkbox" && !props.isSignYourself && (
250+
<>
251+
<label style={{ fontSize: "13px", fontWeight: "600" }}>
252+
Minimun check
253+
</label>
254+
<input
255+
required
256+
defaultValue={0}
257+
value={minCount}
258+
onChange={(e) => {
259+
const count = handleSetMinMax(e);
260+
setMinCount(count);
261+
}}
262+
className="drodown-input"
263+
/>
264+
<label style={{ fontSize: "13px", fontWeight: "600" }}>
265+
Maximum check
266+
</label>
267+
<input
268+
required
269+
defaultValue={0}
270+
value={maxCount}
271+
onChange={(e) => {
272+
const count = handleSetMinMax(e);
273+
setMaxCount(count);
274+
}}
275+
className="drodown-input"
276+
/>
277+
</>
278+
)}
288279
</div>
289-
{["dropdown", "radio"].includes(props.type) && (
280+
{["dropdown", radioButtonWidget].includes(props.type) && (
290281
<>
291282
<label
292283
style={{
@@ -321,7 +312,7 @@ function DropdownWidgetOption(props) {
321312
</select>
322313
</>
323314
)}
324-
{props.type !== "checkbox" && props.type !== "radio" && (
315+
{props.type !== "checkbox" && props.type !== radioButtonWidget && (
325316
<>
326317
<div
327318
style={{
@@ -358,8 +349,40 @@ function DropdownWidgetOption(props) {
358349
</div>
359350
</>
360351
)}
361-
</div>
352+
{["checkbox", radioButtonWidget].includes(props.type) && (
353+
<div className="flex flex-row gap-5 mt-2 items-center text-center">
354+
{!props.isSignYourself && (
355+
<div>
356+
<input
357+
id="isreadonly"
358+
type="checkbox"
359+
checked={isReadOnly}
360+
onChange={(e) => {
361+
setIsReadOnly(e.target.checked);
362+
}}
363+
/>
364+
<label className="ml-1" htmlFor="isreadonly">
365+
Is read only
366+
</label>
367+
</div>
368+
)}
369+
<div>
370+
<input
371+
id="ishidelabel"
372+
type="checkbox"
373+
checked={isHideLabel}
374+
onChange={(e) => {
375+
setIsHideLabel(e.target.checked);
376+
}}
377+
/>
362378

379+
<label className="ml-1" htmlFor="ishidelabel">
380+
Hide label
381+
</label>
382+
</div>
383+
</div>
384+
)}
385+
</div>
363386
<div
364387
style={{
365388
height: "1px",

0 commit comments

Comments
 (0)