mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-10 03:37:40 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f2433fbea | ||
|
|
b671dbac19 | ||
|
|
79cdbc9c8c | ||
|
|
e585b7c943 | ||
|
|
5336e2cb7c | ||
|
|
72401291f8 | ||
|
|
7b34314b9e | ||
|
|
b6f1cceeca | ||
|
|
c422cdac06 | ||
|
|
ab08d2615d | ||
|
|
2b0c7488d9 |
@@ -61,17 +61,14 @@
|
|||||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-template-win": "vite build --config vite.public-template.config.js",
|
"build": "npm run version && NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
|
||||||
"build-template": "NODE_OPTIONS=\"--max-old-space-size=8192\" vite build --config vite.public-template.config.js",
|
|
||||||
"build": "npm run version && react-scripts build",
|
|
||||||
"build-template-watch": "NODE_OPTIONS=\"--max-old-space-size=8192\" vite build --config vite.public-template.config.js --watch",
|
|
||||||
"start-dev": "vite",
|
"start-dev": "vite",
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"start": "serve -s build",
|
"start": "serve -s build",
|
||||||
"version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt",
|
"version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt",
|
||||||
"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\"",
|
"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\"",
|
||||||
"build-win": "npm run version-win && react-scripts build",
|
"build-win": "npm run version-win && vite build",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"release": "standard-version",
|
"release": "standard-version",
|
||||||
|
|||||||
@@ -276,6 +276,20 @@ function Header(props) {
|
|||||||
className="bg-white shadow-md rounded-md px-3 py-2"
|
className="bg-white shadow-md rounded-md px-3 py-2"
|
||||||
sideOffset={5}
|
sideOffset={5}
|
||||||
>
|
>
|
||||||
|
{props?.setIsEditTemplate && (
|
||||||
|
<DropdownMenu.Item
|
||||||
|
className="DropdownMenuItem"
|
||||||
|
onClick={() => props?.setIsEditTemplate(true)}
|
||||||
|
>
|
||||||
|
<div className="flex flex-row">
|
||||||
|
<i
|
||||||
|
className="fa-light fa-gear mr-[3px]"
|
||||||
|
aria-hidden="true"
|
||||||
|
></i>
|
||||||
|
<span className="font-[500]">{t("Edit")}</span>
|
||||||
|
</div>
|
||||||
|
</DropdownMenu.Item>
|
||||||
|
)}
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
className="DropdownMenuItem"
|
className="DropdownMenuItem"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
|
|||||||
@@ -3081,9 +3081,9 @@ export const updateDateWidgetsRes = (documentData, signerId, journey) => {
|
|||||||
if (item?.signerObjId === signerId) {
|
if (item?.signerObjId === signerId) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
placeHolder: item.placeHolder.map((ph) => ({
|
placeHolder: item?.placeHolder?.map((ph) => ({
|
||||||
...ph,
|
...ph,
|
||||||
pos: ph.pos.map((widget) => {
|
pos: ph?.pos?.map((widget) => {
|
||||||
// only for date widgets *and* missing response
|
// only for date widgets *and* missing response
|
||||||
if (widget.type === "date" && !widget.options.response) {
|
if (widget.type === "date" && !widget.options.response) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ function PdfRequestFiles(
|
|||||||
docId,
|
docId,
|
||||||
isNextUser,
|
isNextUser,
|
||||||
isSuccessPage = false,
|
isSuccessPage = false,
|
||||||
publiccontactId
|
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
let isUpdatedSubscribe;
|
let isUpdatedSubscribe;
|
||||||
@@ -274,7 +273,9 @@ function PdfRequestFiles(
|
|||||||
const jsonSender = JSON.parse(senderUser);
|
const jsonSender = JSON.parse(senderUser);
|
||||||
const contactId = jsonSender?.objectId
|
const contactId = jsonSender?.objectId
|
||||||
? ""
|
? ""
|
||||||
: contactBookId || publiccontactId || signerObjectId || "";
|
: contactBookId ||
|
||||||
|
signerObjectId ||
|
||||||
|
"";
|
||||||
const tenantSignTypes = await fetchTenantDetails(contactId);
|
const tenantSignTypes = await fetchTenantDetails(contactId);
|
||||||
// `currUserId` will be contactId or extUserId
|
// `currUserId` will be contactId or extUserId
|
||||||
let currUserId;
|
let currUserId;
|
||||||
@@ -322,7 +323,9 @@ function PdfRequestFiles(
|
|||||||
|
|
||||||
currUserId = getCurrentSigner?.objectId
|
currUserId = getCurrentSigner?.objectId
|
||||||
? getCurrentSigner.objectId
|
? getCurrentSigner.objectId
|
||||||
: contactBookId || publiccontactId || signerObjectId || ""; //signerObjectId is contactBookId refer from public template flow
|
: contactBookId ||
|
||||||
|
signerObjectId ||
|
||||||
|
""; //signerObjectId is contactBookId refer from public template flow
|
||||||
if (currUserId) {
|
if (currUserId) {
|
||||||
setSignerObjectId(currUserId);
|
setSignerObjectId(currUserId);
|
||||||
}
|
}
|
||||||
@@ -581,9 +584,12 @@ function PdfRequestFiles(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
//function for embed signature or image url in pdf
|
//function for embed signature or image url in pdf
|
||||||
async function embedWidgetsData(publiccontactId, publicDocId) {
|
async function embedWidgetsData(
|
||||||
let contactId = publiccontactId || signerObjectId;
|
) {
|
||||||
let docId = publicDocId || documentId;
|
let contactId =
|
||||||
|
signerObjectId;
|
||||||
|
let docId =
|
||||||
|
documentId;
|
||||||
const addExtraDays = pdfDetails[0]?.TimeToCompleteDays
|
const addExtraDays = pdfDetails[0]?.TimeToCompleteDays
|
||||||
? pdfDetails[0].TimeToCompleteDays
|
? pdfDetails[0].TimeToCompleteDays
|
||||||
: 15;
|
: 15;
|
||||||
@@ -1023,30 +1029,7 @@ function PdfRequestFiles(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSignPdf = async () => {
|
const handleSignPdf = async () => {
|
||||||
if (props.templateId) {
|
|
||||||
const params = {
|
|
||||||
...contact,
|
|
||||||
templateid: pdfDetails[0]?.objectId,
|
|
||||||
role: pdfDetails[0]?.PublicRole[0]
|
|
||||||
};
|
|
||||||
const linkRes = await axios.post(
|
|
||||||
`${localStorage.getItem(
|
|
||||||
"baseUrl"
|
|
||||||
)}/functions/publicuserlinkcontacttodoc`,
|
|
||||||
params,
|
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-Parse-Application-Id": localStorage.getItem("parseAppId")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const contactId = linkRes.data.result?.contactId;
|
|
||||||
const docId = linkRes.data?.result?.docId;
|
|
||||||
await embedWidgetsData(contactId, docId);
|
|
||||||
} else {
|
|
||||||
await embedWidgetsData();
|
await embedWidgetsData();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
//function for save x and y position and show signature tab on that position
|
//function for save x and y position and show signature tab on that position
|
||||||
const handleTabDrag = (key) => {
|
const handleTabDrag = (key) => {
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
import { defineConfig } from "vite";
|
|
||||||
import react from "@vitejs/plugin-react";
|
|
||||||
import path from "path";
|
|
||||||
import rollupNodePolyFill from "rollup-plugin-node-polyfills";
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [react()],
|
|
||||||
define: {
|
|
||||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
||||||
process: JSON.stringify({
|
|
||||||
env: {
|
|
||||||
NODE_ENV: "production"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
build: {
|
|
||||||
lib: {
|
|
||||||
entry: path.resolve(__dirname, "src/ee/script/PublicTemplate.jsx"),
|
|
||||||
name: "PublicTemplate",
|
|
||||||
fileName: () => `public-template.bundle.js`,
|
|
||||||
formats: ["iife"]
|
|
||||||
},
|
|
||||||
outDir: "public/static/js",
|
|
||||||
emptyOutDir: false,
|
|
||||||
assetsInlineLimit: 0,
|
|
||||||
copyPublicDir: false,
|
|
||||||
rollupOptions: {
|
|
||||||
plugins: [rollupNodePolyFill()],
|
|
||||||
output: {
|
|
||||||
// 👇 Controls how asset files (like CSS) are named
|
|
||||||
assetFileNames: (assetInfo) => {
|
|
||||||
if (assetInfo.name && assetInfo.name.endsWith(".css")) {
|
|
||||||
return "public-template.bundle.css"; // Custom CSS filename
|
|
||||||
}
|
|
||||||
return "[name].[ext]";
|
|
||||||
},
|
|
||||||
globals: {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user