Skip to content

Commit 85bc2fb

Browse files
Merge pull request #1902 from OpenSignLabs/updates-16958097538
fix: save sign, initials not working
2 parents 086d8ee + e857724 commit 85bc2fb

File tree

5 files changed

+23
-26
lines changed

5 files changed

+23
-26
lines changed

apps/OpenSign/src/components/pdf/WidgetsValueModal.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ function WidgetsValueModal(props) {
551551
// below code is used to save or update default signature, initials, stamp
552552
try {
553553
const signCls = new Parse.Object("contracts_Signature");
554-
if (props?.saveSignCheckbox?.signId) {
555-
signCls.id = props.saveSignCheckbox.signId;
554+
if (saveSignCheckbox?.signId) {
555+
signCls.id = saveSignCheckbox.signId;
556556
}
557557
if (currWidgetsDetails?.type === "initials") {
558558
signCls.set("Initials", imageUrl);

apps/OpenSign/src/constant/Utils.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3729,4 +3729,3 @@ export function convertJpegToPng(base64Image, filename) {
37293729
});
37303730
}
37313731
}
3732-

apps/OpenSign/src/pages/PdfRequestFiles.jsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ function PdfRequestFiles(
7575
const { t } = useTranslation();
7676
const dispatch = useDispatch();
7777
const isShowModal = useSelector((state) => state.widget.isShowModal);
78-
const saveSignCheckbox = useSelector(
79-
(state) => state.widget.saveSignCheckbox
80-
);
8178
const defaultSignImg = useSelector((state) => state.widget.defaultSignImg);
8279
const myInitial = useSelector((state) => state.widget.myInitial);
8380
const appName =
@@ -484,20 +481,14 @@ function PdfRequestFiles(
484481
} else {
485482
setRequestSignTour(false);
486483
}
487-
dispatch(
488-
setSaveSignCheckbox({
489-
...saveSignCheckbox,
490-
isVisible: true
491-
})
492-
);
484+
493485
//function to get default signatur of current user from `contracts_Signature` class
494486
const defaultSignRes = await getDefaultSignature(
495487
jsonSender?.objectId
496488
);
497489
if (defaultSignRes?.status === "success") {
498490
dispatch(
499491
setSaveSignCheckbox({
500-
...saveSignCheckbox,
501492
isVisible: true,
502493
signId: defaultSignRes?.res?.id
503494
})
@@ -506,6 +497,8 @@ function PdfRequestFiles(
506497
const initials = defaultSignRes?.res?.defaultInitial || "";
507498
dispatch(setDefaultSignImg(sign));
508499
dispatch(setMyInitial(initials));
500+
} else {
501+
dispatch(setSaveSignCheckbox({ isVisible: true }));
509502
}
510503
} else if (res?.length === 0) {
511504
const res = await contactBook(currUserId);
@@ -642,7 +635,7 @@ function PdfRequestFiles(
642635
(data) => data.signerObjId === signerObjectId
643636
);
644637
if (checkUser && checkUser.length > 0) {
645-
const status = handleCheckResponse(checkUser,setminRequiredCount)
638+
const status = handleCheckResponse(checkUser, setminRequiredCount);
646639
if (status?.showAlert) {
647640
setUnSignedWidgetId(status?.widgetKey);
648641
setPageNumber(status?.tourPageNumber);
@@ -1377,7 +1370,7 @@ function PdfRequestFiles(
13771370
setIsUiLoading(false);
13781371
alert(t("expiry-date-error"));
13791372
}
1380-
};
1373+
};
13811374
// `handleRedirectCancel` is used to cancel redirecting to redirectUrl
13821375
const handleRedirectCancel = () => {
13831376
setIsredirectCanceled(true);

apps/OpenSign/src/pages/SignyourselfPdf.jsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ function SignYourSelf() {
7777
const { docId } = useParams();
7878
const dispatch = useDispatch();
7979
const isShowModal = useSelector((state) => state.widget.isShowModal);
80-
const saveSignCheckbox = useSelector(
81-
(state) => state.widget.saveSignCheckbox
82-
);
8380
const appName =
8481
"OpenSign™";
8582
const divRef = useRef(null);
@@ -268,13 +265,14 @@ function SignYourSelf() {
268265
if (defaultSignRes?.status === "success") {
269266
dispatch(
270267
setSaveSignCheckbox({
271-
...saveSignCheckbox,
272268
isVisible: true,
273269
signId: defaultSignRes?.res?.id
274270
})
275271
);
276272
dispatch(setDefaultSignImg(defaultSignRes?.res?.defaultSignature));
277273
dispatch(setMyInitial(defaultSignRes?.res?.defaultInitial));
274+
} else {
275+
dispatch(setSaveSignCheckbox({ isVisible: true }));
278276
}
279277
const contractUsersRes = await contractUsers();
280278
if (contractUsersRes === "Error: Something went wrong!") {
@@ -283,8 +281,6 @@ function SignYourSelf() {
283281
} else if (contractUsersRes[0] && contractUsersRes.length > 0) {
284282
setContractName("_Users");
285283
setSignerUserId(contractUsersRes[0].objectId);
286-
dispatch(setSaveSignCheckbox({ ...saveSignCheckbox, isVisible: true }));
287-
288284
const tourstatuss =
289285
contractUsersRes[0].TourStatus && contractUsersRes[0].TourStatus;
290286
if (tourstatuss && tourstatuss.length > 0 && !isCompleted) {
@@ -1046,12 +1042,18 @@ function SignYourSelf() {
10461042

10471043
const setCellCount = (key, newCount) => {
10481044
setXyPosition((prev) => {
1049-
const getPageNumer = prev.filter((data) => data.pageNumber === pageNumber);
1045+
const getPageNumer = prev.filter(
1046+
(data) => data.pageNumber === pageNumber
1047+
);
10501048
if (getPageNumer.length > 0) {
10511049
const updatePos = getPageNumer[0].pos.map((p) =>
1052-
p.key === key ? { ...p, options: { ...p.options, cellCount: newCount } } : p
1050+
p.key === key
1051+
? { ...p, options: { ...p.options, cellCount: newCount } }
1052+
: p
1053+
);
1054+
return prev.map((obj, ind) =>
1055+
ind === index ? { ...obj, pos: updatePos } : obj
10531056
);
1054-
return prev.map((obj, ind) => (ind === index ? { ...obj, pos: updatePos } : obj));
10551057
}
10561058
return prev;
10571059
});
@@ -1082,7 +1084,8 @@ function SignYourSelf() {
10821084
cellCount: count,
10831085
defaultValue: (defaultdata?.defaultValue || "").slice(0, count),
10841086
fontSize: newFontSize || position.options?.fontSize || 12,
1085-
fontColor: newFontColor || position.options?.fontColor || "black"
1087+
fontColor:
1088+
newFontColor || position.options?.fontColor || "black"
10861089
}
10871090
};
10881091
} else {

apps/OpenSign/src/pages/UserProfile.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ function UserProfile() {
286286
style={{ width: `${percentage}%` }}
287287
></div>
288288
</div>
289-
<span className="text-base-contentk text-sm">{percentage}%</span>
289+
<span className="text-base-contentk text-sm">
290+
{percentage}%
291+
</span>
290292
</div>
291293
)}
292294
<div className="text-base font-semibold pt-4">

0 commit comments

Comments
 (0)