Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,119 changes: 557 additions & 562 deletions apps/OpenSign/package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions apps/OpenSign/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"@formkit/auto-animate": "^0.8.2",
"@lottiefiles/dotlottie-react": "^0.9.0",
"@pdf-lib/fontkit": "^1.1.1",
"@radix-ui/themes": "^3.1.3",
"@radix-ui/themes": "^3.1.4",
"@react-pdf/renderer": "^4.0.0",
"@reduxjs/toolkit": "^2.2.7",
"axios": "^1.7.7",
"file-saver": "^2.0.5",
"i18next": "^23.15.1",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-http-backend": "^2.6.1",
"i18next-http-backend": "^2.6.2",
"jszip": "^3.10.1",
"jwt-decode": "^4.0.0",
"moment": "^2.30.1",
Expand Down Expand Up @@ -95,22 +95,22 @@
}
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/runtime-corejs2": "^7.25.6",
"@babel/core": "^7.25.7",
"@babel/preset-env": "^7.25.7",
"@babel/preset-react": "^7.25.7",
"@babel/runtime-corejs2": "^7.25.7",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"clean-webpack-plugin": "^4.0.0",
"commitizen": "^4.3.1",
"concurrently": "^9.0.1",
"css-loader": "^7.1.2",
"daisyui": "^4.12.10",
"daisyui": "^4.12.11",
"dotenv": "^16.4.5",
"dotenv-webpack": "^8.1.0",
"eslint": "^9.11.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react": "^7.37.1",
"lint-staged": "^15.2.10",
"mini-css-extract-plugin": "^2.9.1",
"postcss": "^8.4.47",
Expand Down
11 changes: 5 additions & 6 deletions apps/OpenSign/src/components/pdf/EmailComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ function EmailComponent({
const pdfName = pdfDetails[0]?.Name;
setIsLoading(true);
let sendMail;

const docId = !pdfDetails?.[0]?.IsEnableOTP
? pdfDetails?.[0]?.objectId
: "";
const docId = pdfDetails?.[0]?.objectId || "";
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
? pdfDetails?.[0]?.IsFileAdapter
: false;
let presignedUrl = pdfUrl;
try {
// const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
const axiosRes = await axios.post(
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
{ url: pdfUrl, docId: docId },
{ url: pdfUrl, docId: docId, isFileAdapter: isFileAdapter },
{
headers: {
"content-type": "Application/json",
Expand Down
4 changes: 2 additions & 2 deletions apps/OpenSign/src/components/shared/fields/SuggestionInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const SuggestionInput = (props) => {

const handleInputChange = async (e) => {
const value = e.target.value;
setInputValue(value?.toLowerCase());
setInputValue(value?.toLowerCase()?.replace(/\s/g, ""));
if (props.onChange) {
props.onChange(value);
props.onChange(value?.toLowerCase()?.replace(/\s/g, ""));
}

if (value.trim() === "") {
Expand Down
28 changes: 22 additions & 6 deletions apps/OpenSign/src/constant/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2048,11 +2048,21 @@ export const fetchUrl = async (url, pdfName) => {
console.error("Error downloading the file:", error);
}
};
export const getSignedUrl = async (pdfUrl, docId) => {
export const getSignedUrl = async (
pdfUrl,
docId,
isFileAdapter,
templateId
) => {
//use only axios here due to public template sign
const axiosRes = await axios.post(
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
{ url: pdfUrl, docId: docId || "" },
{
url: pdfUrl,
docId: docId || "",
isFileAdapter: isFileAdapter,
templateId: templateId || ""
},
{
headers: {
"content-type": "Application/json",
Expand All @@ -2069,9 +2079,12 @@ export const handleDownloadPdf = async (pdfDetails, setIsDownloading) => {
const pdfName = pdfDetails[0] && pdfDetails[0]?.Name;
const pdfUrl = pdfDetails?.[0]?.SignedUrl || pdfDetails?.[0]?.URL;
setIsDownloading && setIsDownloading("pdf");
const docId = !pdfDetails?.[0]?.IsEnableOTP ? pdfDetails?.[0]?.objectId : "";
const docId = pdfDetails?.[0]?.objectId || "";
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
? pdfDetails?.[0]?.IsFileAdapter
: false;
try {
const url = await getSignedUrl(pdfUrl, docId);
const url = await getSignedUrl(pdfUrl, docId, isFileAdapter);
await fetchUrl(url, pdfName);
setIsDownloading && setIsDownloading("");
} catch (err) {
Expand All @@ -2094,14 +2107,17 @@ export const handleToPrint = async (
) => {
event.preventDefault();
setIsDownloading("pdf");
const docId = !pdfDetails?.[0]?.IsEnableOTP ? pdfDetails?.[0]?.objectId : "";
const docId = pdfDetails?.[0]?.objectId || "";
const isFileAdapter = pdfDetails?.[0]?.IsFileAdapter
? pdfDetails?.[0]?.IsFileAdapter
: false;
try {
// const url = await Parse.Cloud.run("getsignedurl", { url: pdfUrl });
//`localStorage.getItem("baseUrl")` is also use in public-profile flow for public-sign
//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
const axiosRes = await axios.post(
`${localStorage.getItem("baseUrl")}/functions/getsignedurl`,
{ url: pdfUrl, docId: docId },
{ url: pdfUrl, docId: docId, isFileAdapter: isFileAdapter },
{
headers: {
"content-type": "Application/json",
Expand Down
Loading