Skip to content

Commit 1f5ab87

Browse files
Merge pull request #1293 from OpenSignLabs/validation
2 parents 356ab4e + 00fcd17 commit 1f5ab87

26 files changed

+1869
-1464
lines changed

apps/OpenSign/package-lock.json

Lines changed: 557 additions & 562 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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
"@formkit/auto-animate": "^0.8.2",
77
"@lottiefiles/dotlottie-react": "^0.9.0",
88
"@pdf-lib/fontkit": "^1.1.1",
9-
"@radix-ui/themes": "^3.1.3",
9+
"@radix-ui/themes": "^3.1.4",
1010
"@react-pdf/renderer": "^4.0.0",
1111
"@reduxjs/toolkit": "^2.2.7",
1212
"axios": "^1.7.7",
1313
"file-saver": "^2.0.5",
1414
"i18next": "^23.15.1",
1515
"i18next-browser-languagedetector": "^8.0.0",
16-
"i18next-http-backend": "^2.6.1",
16+
"i18next-http-backend": "^2.6.2",
1717
"jszip": "^3.10.1",
1818
"jwt-decode": "^4.0.0",
1919
"moment": "^2.30.1",
@@ -95,22 +95,22 @@
9595
}
9696
},
9797
"devDependencies": {
98-
"@babel/core": "^7.25.2",
99-
"@babel/preset-env": "^7.25.4",
100-
"@babel/preset-react": "^7.24.7",
101-
"@babel/runtime-corejs2": "^7.25.6",
98+
"@babel/core": "^7.25.7",
99+
"@babel/preset-env": "^7.25.7",
100+
"@babel/preset-react": "^7.25.7",
101+
"@babel/runtime-corejs2": "^7.25.7",
102102
"autoprefixer": "^10.4.20",
103103
"babel-loader": "^9.2.1",
104104
"clean-webpack-plugin": "^4.0.0",
105105
"commitizen": "^4.3.1",
106106
"concurrently": "^9.0.1",
107107
"css-loader": "^7.1.2",
108-
"daisyui": "^4.12.10",
108+
"daisyui": "^4.12.11",
109109
"dotenv": "^16.4.5",
110110
"dotenv-webpack": "^8.1.0",
111111
"eslint": "^9.11.1",
112112
"eslint-plugin-prettier": "^5.2.1",
113-
"eslint-plugin-react": "^7.37.0",
113+
"eslint-plugin-react": "^7.37.1",
114114
"lint-staged": "^15.2.10",
115115
"mini-css-extract-plugin": "^2.9.1",
116116
"postcss": "^8.4.47",

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ function EmailComponent({
3030
const pdfName = pdfDetails[0]?.Name;
3131
setIsLoading(true);
3232
let sendMail;
33-
34-
const docId = !pdfDetails?.[0]?.IsEnableOTP
35-
? pdfDetails?.[0]?.objectId
36-
: "";
33+
const docId = pdfDetails?.[0]?.objectId || "";
34+
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
35+
? pdfDetails?.[0]?.IsFileAdapter
36+
: false;
3737
let presignedUrl = pdfUrl;
3838
try {
39-
// const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
4039
const axiosRes = await axios.post(
4140
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
42-
{ url: pdfUrl, docId: docId },
41+
{ url: pdfUrl, docId: docId, isFileAdapter: isFileAdapter },
4342
{
4443
headers: {
4544
"content-type": "Application/json",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ const SuggestionInput = (props) => {
4141

4242
const handleInputChange = async (e) => {
4343
const value = e.target.value;
44-
setInputValue(value?.toLowerCase());
44+
setInputValue(value?.toLowerCase()?.replace(/\s/g, ""));
4545
if (props.onChange) {
46-
props.onChange(value);
46+
props.onChange(value?.toLowerCase()?.replace(/\s/g, ""));
4747
}
4848

4949
if (value.trim() === "") {

apps/OpenSign/src/constant/Utils.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,11 +2048,21 @@ export const fetchUrl = async (url, pdfName) => {
20482048
console.error("Error downloading the file:", error);
20492049
}
20502050
};
2051-
export const getSignedUrl = async (pdfUrl, docId) => {
2051+
export const getSignedUrl = async (
2052+
pdfUrl,
2053+
docId,
2054+
isFileAdapter,
2055+
templateId
2056+
) => {
20522057
//use only axios here due to public template sign
20532058
const axiosRes = await axios.post(
20542059
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
2055-
{ url: pdfUrl, docId: docId || "" },
2060+
{
2061+
url: pdfUrl,
2062+
docId: docId || "",
2063+
isFileAdapter: isFileAdapter,
2064+
templateId: templateId || ""
2065+
},
20562066
{
20572067
headers: {
20582068
"content-type": "Application/json",
@@ -2069,9 +2079,12 @@ export const handleDownloadPdf = async (pdfDetails, setIsDownloading) => {
20692079
const pdfName = pdfDetails[0] && pdfDetails[0]?.Name;
20702080
const pdfUrl = pdfDetails?.[0]?.SignedUrl || pdfDetails?.[0]?.URL;
20712081
setIsDownloading && setIsDownloading("pdf");
2072-
const docId = !pdfDetails?.[0]?.IsEnableOTP ? pdfDetails?.[0]?.objectId : "";
2082+
const docId = pdfDetails?.[0]?.objectId || "";
2083+
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
2084+
? pdfDetails?.[0]?.IsFileAdapter
2085+
: false;
20732086
try {
2074-
const url = await getSignedUrl(pdfUrl, docId);
2087+
const url = await getSignedUrl(pdfUrl, docId, isFileAdapter);
20752088
await fetchUrl(url, pdfName);
20762089
setIsDownloading && setIsDownloading("");
20772090
} catch (err) {
@@ -2094,14 +2107,17 @@ export const handleToPrint = async (
20942107
) => {
20952108
event.preventDefault();
20962109
setIsDownloading("pdf");
2097-
const docId = !pdfDetails?.[0]?.IsEnableOTP ? pdfDetails?.[0]?.objectId : "";
2110+
const docId = pdfDetails?.[0]?.objectId || "";
2111+
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
2112+
? pdfDetails?.[0]?.IsFileAdapter
2113+
: false;
20982114
try {
20992115
// const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
21002116
//`localStorage.getItem("baseUrl")` is also use in public-profile flow for public-sign
21012117
//if we give this `appInfo.baseUrl` as a base url then in public-profile it will create base url of it's window.location.origin ex- opensign.me which is not base url
21022118
const axiosRes = await axios.post(
21032119
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
2104-
{ url: pdfUrl, docId: docId },
2120+
{ url: pdfUrl, docId: docId, isFileAdapter: isFileAdapter },
21052121
{
21062122
headers: {
21072123
"content-type": "Application/json",

0 commit comments

Comments
 (0)