mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
resolve minor ui issues
This commit is contained in:
+200
-2
@@ -29,11 +29,13 @@
|
||||
"react-dnd-touch-backend": "^16.0.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-draggable": "^4.4.6",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-pdf": "^7.4.0",
|
||||
"react-rnd": "^10.4.1",
|
||||
"react-router-dom": "^6.16.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-scrollbars-custom": "^4.1.1",
|
||||
"react-select": "^5.8.0",
|
||||
"react-signature-canvas": "^1.0.6",
|
||||
"reactour": "^1.19.1",
|
||||
"select-dom": "^9.0.0",
|
||||
@@ -2310,6 +2312,65 @@
|
||||
"postcss-selector-parser": "^6.0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/babel-plugin": {
|
||||
"version": "11.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz",
|
||||
"integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.16.7",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@emotion/hash": "^0.9.1",
|
||||
"@emotion/memoize": "^0.8.1",
|
||||
"@emotion/serialize": "^1.1.2",
|
||||
"babel-plugin-macros": "^3.1.0",
|
||||
"convert-source-map": "^1.5.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"find-root": "^1.1.0",
|
||||
"source-map": "^0.5.7",
|
||||
"stylis": "4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/babel-plugin/node_modules/convert-source-map": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
|
||||
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
|
||||
},
|
||||
"node_modules/@emotion/babel-plugin/node_modules/escape-string-regexp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
||||
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/babel-plugin/node_modules/source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/cache": {
|
||||
"version": "11.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz",
|
||||
"integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==",
|
||||
"dependencies": {
|
||||
"@emotion/memoize": "^0.8.1",
|
||||
"@emotion/sheet": "^1.2.2",
|
||||
"@emotion/utils": "^1.2.1",
|
||||
"@emotion/weak-memoize": "^0.3.1",
|
||||
"stylis": "4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/hash": {
|
||||
"version": "0.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz",
|
||||
"integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ=="
|
||||
},
|
||||
"node_modules/@emotion/is-prop-valid": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz",
|
||||
@@ -2322,8 +2383,52 @@
|
||||
"node_modules/@emotion/memoize": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz",
|
||||
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==",
|
||||
"peer": true
|
||||
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
|
||||
},
|
||||
"node_modules/@emotion/react": {
|
||||
"version": "11.11.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz",
|
||||
"integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@emotion/babel-plugin": "^11.11.0",
|
||||
"@emotion/cache": "^11.11.0",
|
||||
"@emotion/serialize": "^1.1.2",
|
||||
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
||||
"@emotion/utils": "^1.2.1",
|
||||
"@emotion/weak-memoize": "^0.3.1",
|
||||
"hoist-non-react-statics": "^3.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/serialize": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz",
|
||||
"integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==",
|
||||
"dependencies": {
|
||||
"@emotion/hash": "^0.9.1",
|
||||
"@emotion/memoize": "^0.8.1",
|
||||
"@emotion/unitless": "^0.8.1",
|
||||
"@emotion/utils": "^1.2.1",
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/serialize/node_modules/@emotion/unitless": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz",
|
||||
"integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ=="
|
||||
},
|
||||
"node_modules/@emotion/sheet": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz",
|
||||
"integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA=="
|
||||
},
|
||||
"node_modules/@emotion/stylis": {
|
||||
"version": "0.8.5",
|
||||
@@ -2337,6 +2442,24 @@
|
||||
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@emotion/use-insertion-effect-with-fallbacks": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz",
|
||||
"integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/utils": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz",
|
||||
"integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg=="
|
||||
},
|
||||
"node_modules/@emotion/weak-memoize": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz",
|
||||
"integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww=="
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
@@ -10608,6 +10731,11 @@
|
||||
"url": "https://github.com/avajs/find-cache-dir?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/find-root": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
|
||||
"integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
||||
@@ -14810,6 +14938,11 @@
|
||||
"node": ">= 4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/memoize-one": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
|
||||
"integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||
@@ -17748,6 +17881,25 @@
|
||||
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
|
||||
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg=="
|
||||
},
|
||||
"node_modules/react-fast-compare": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
|
||||
"integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="
|
||||
},
|
||||
"node_modules/react-helmet": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz",
|
||||
"integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==",
|
||||
"dependencies": {
|
||||
"object-assign": "^4.1.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-fast-compare": "^3.1.1",
|
||||
"react-side-effect": "^2.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-is": {
|
||||
"version": "17.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||
@@ -18003,6 +18155,34 @@
|
||||
"react": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-select": {
|
||||
"version": "5.8.0",
|
||||
"resolved": "https://registry.npmjs.org/react-select/-/react-select-5.8.0.tgz",
|
||||
"integrity": "sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.0",
|
||||
"@emotion/cache": "^11.4.0",
|
||||
"@emotion/react": "^11.8.1",
|
||||
"@floating-ui/dom": "^1.0.1",
|
||||
"@types/react-transition-group": "^4.4.0",
|
||||
"memoize-one": "^6.0.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"react-transition-group": "^4.3.0",
|
||||
"use-isomorphic-layout-effect": "^1.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-side-effect": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz",
|
||||
"integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-signature-canvas": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/react-signature-canvas/-/react-signature-canvas-1.0.6.tgz",
|
||||
@@ -19527,6 +19707,11 @@
|
||||
"postcss": "^8.2.15"
|
||||
}
|
||||
},
|
||||
"node_modules/stylis": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz",
|
||||
"integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw=="
|
||||
},
|
||||
"node_modules/sucrase": {
|
||||
"version": "3.34.0",
|
||||
"resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz",
|
||||
@@ -20443,6 +20628,19 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/use-isomorphic-layout-effect": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz",
|
||||
"integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/use-sidecar": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz",
|
||||
|
||||
@@ -25,11 +25,13 @@
|
||||
"react-dnd-touch-backend": "^16.0.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-draggable": "^4.4.6",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-pdf": "^7.4.0",
|
||||
"react-rnd": "^10.4.1",
|
||||
"react-router-dom": "^6.16.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-scrollbars-custom": "^4.1.1",
|
||||
"react-select": "^5.8.0",
|
||||
"react-signature-canvas": "^1.0.6",
|
||||
"reactour": "^1.19.1",
|
||||
"select-dom": "^9.0.0",
|
||||
|
||||
@@ -27,9 +27,9 @@ import {
|
||||
} from "../utils/Utils";
|
||||
import RenderPdf from "./component/renderPdf";
|
||||
import ModalComponent from "./component/modalComponent";
|
||||
import SelectSigners from "./component/SelectSigners";
|
||||
import AddUser from "./component/AddUser";
|
||||
import "../css/AddUser.css";
|
||||
import Title from "./component/Title";
|
||||
import LinkUserModal from "./component/LinkUserModal";
|
||||
const TemplatePlaceholder = () => {
|
||||
const navigate = useNavigate();
|
||||
const { templateId } = useParams();
|
||||
@@ -151,6 +151,7 @@ const TemplatePlaceholder = () => {
|
||||
const [isModalRole, setIsModalRole] = useState(false);
|
||||
const [roleName, setRoleName] = useState("");
|
||||
const [isAddUser, setIsAddUser] = useState({});
|
||||
const [isCreateDoc, setIsCreateDoc] = useState(false);
|
||||
|
||||
const senderUser =
|
||||
localStorage.getItem(
|
||||
@@ -206,12 +207,10 @@ const TemplatePlaceholder = () => {
|
||||
}
|
||||
}
|
||||
);
|
||||
// console.log("templateDeatils.data ", templateDeatils.data);
|
||||
const documentData =
|
||||
templateDeatils.data && templateDeatils.data
|
||||
? [templateDeatils.data]
|
||||
: [];
|
||||
// console.log("documentData ", documentData)
|
||||
if (documentData && documentData.length > 0) {
|
||||
setPdfDetails(documentData);
|
||||
setIsSigners(true);
|
||||
@@ -224,7 +223,7 @@ const TemplatePlaceholder = () => {
|
||||
documentData[0].Placeholders.length > 0
|
||||
) {
|
||||
setSignerPos(documentData[0].Placeholders);
|
||||
let signers = [...signersdata];
|
||||
let signers = [...documentData[0].Signers];
|
||||
let updatedSigners = documentData[0].Placeholders.map((x) => {
|
||||
let matchingSigner = signers.find(
|
||||
(y) => x.signerObjId && x.signerObjId === y.objectId
|
||||
@@ -263,12 +262,11 @@ const TemplatePlaceholder = () => {
|
||||
documentData[0].Placeholders.length > 0
|
||||
) {
|
||||
let updatedSigners = documentData[0].Placeholders.map((x) => {
|
||||
return {
|
||||
Role: x.Role,
|
||||
Id: x.Id,
|
||||
blockColor: x.blockColor
|
||||
};
|
||||
|
||||
return {
|
||||
Role: x.Role,
|
||||
Id: x.Id,
|
||||
blockColor: x.blockColor
|
||||
};
|
||||
});
|
||||
setSignerPos(documentData[0].Placeholders);
|
||||
setUniqueId(updatedSigners[0].Id);
|
||||
@@ -339,10 +337,8 @@ const TemplatePlaceholder = () => {
|
||||
getSignerPos(item, monitor);
|
||||
}
|
||||
};
|
||||
console.log("signerdata ", signersdata)
|
||||
|
||||
const getSignerPos = (item, monitor) => {
|
||||
console.log("item ", item);
|
||||
const posZIndex = zIndex + 1;
|
||||
setZIndex(posZIndex);
|
||||
const newWidth = containerWH.width;
|
||||
@@ -714,8 +710,6 @@ const TemplatePlaceholder = () => {
|
||||
};
|
||||
setIsLoading(loadObj);
|
||||
setIsSendAlert(false);
|
||||
console.log("signerPos ", signerPos);
|
||||
|
||||
let signers = [];
|
||||
if (signersdata?.length > 0) {
|
||||
signersdata.forEach((x) => {
|
||||
@@ -838,14 +832,17 @@ const TemplatePlaceholder = () => {
|
||||
});
|
||||
};
|
||||
const handleCreateDocModal = async () => {
|
||||
setIsCreateDocModal(false);
|
||||
setIsCreateDoc(true);
|
||||
const hostUrl = getHostUrl();
|
||||
// handle create document
|
||||
console.log("template ", pdfDetails);
|
||||
const res = await createDocument(pdfDetails, signerPos, signersdata);
|
||||
if (res.status === "success") {
|
||||
navigate(`${hostUrl}placeHolderSign/${res.id}`);
|
||||
setIsCreateDoc(false);
|
||||
} else {
|
||||
setHandleError("Error: Something went wrong!");
|
||||
setIsCreateDoc(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -855,7 +852,6 @@ const TemplatePlaceholder = () => {
|
||||
};
|
||||
const handleAddRole = (e) => {
|
||||
e.preventDefault();
|
||||
console.log("signerArr", signersdata.length);
|
||||
const count = signersdata.length > 0 ? signersdata.length + 1 : 1;
|
||||
const Id = randomId();
|
||||
const obj = {
|
||||
@@ -912,6 +908,7 @@ const TemplatePlaceholder = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Title title={"Template"} />
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
{isLoading.isLoad ? (
|
||||
<Loader isLoading={isLoading} />
|
||||
@@ -960,7 +957,7 @@ const TemplatePlaceholder = () => {
|
||||
|
||||
{/* signature modal */}
|
||||
<Modal.Body>
|
||||
<p>Please Add field for all recipients.</p>
|
||||
<p>Please add field for all recipients.</p>
|
||||
</Modal.Body>
|
||||
|
||||
<Modal.Footer>
|
||||
@@ -1015,6 +1012,7 @@ const TemplatePlaceholder = () => {
|
||||
)}
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
{isCreateDoc && <Loader isLoading={isLoading} />}
|
||||
<ModalComponent
|
||||
isShow={isShowEmail}
|
||||
type={"signersAlert"}
|
||||
@@ -1022,6 +1020,7 @@ const TemplatePlaceholder = () => {
|
||||
/>
|
||||
{/* pdf header which contain funish back button */}
|
||||
<Header
|
||||
completeBtnTitle={"Save"}
|
||||
isPlaceholder={true}
|
||||
pageNumber={pageNumber}
|
||||
allPages={allPages}
|
||||
@@ -1098,6 +1097,7 @@ const TemplatePlaceholder = () => {
|
||||
isMailSend={isMailSend}
|
||||
setSelectedEmail={setSelectedEmail}
|
||||
selectedEmail={selectedEmail}
|
||||
handleAddSigner={handleAddSigner}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
@@ -1160,13 +1160,21 @@ const TemplatePlaceholder = () => {
|
||||
}
|
||||
className="addUserInput"
|
||||
/>
|
||||
<p
|
||||
style={{
|
||||
color: "grey",
|
||||
fontSize: 11,
|
||||
margin: "2px 0 10px 5px"
|
||||
}}
|
||||
>
|
||||
e.g: Account, Hr, Director, Manager, New joinee etc...
|
||||
</p>
|
||||
<div>
|
||||
<div
|
||||
style={{
|
||||
height: "1px",
|
||||
backgroundColor: "#9f9f9f",
|
||||
width: "100%",
|
||||
marginTop: "15px",
|
||||
marginBottom: "15px"
|
||||
}}
|
||||
></div>
|
||||
@@ -1195,37 +1203,12 @@ const TemplatePlaceholder = () => {
|
||||
</Modal>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<Modal show={isAddUser[uniqueId]}>
|
||||
<Modal.Header
|
||||
className={"bg-info"}
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<span style={{ color: "white" }}>Add/choose user</span>
|
||||
<span
|
||||
style={{ color: "white", cursor: "pointer" }}
|
||||
onClick={() => closePopup()}
|
||||
>
|
||||
X
|
||||
</span>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
{isAddUser && isAddUser[uniqueId] && (
|
||||
<>
|
||||
<SelectSigners
|
||||
details={handleAddUser}
|
||||
closePopup={closePopup}
|
||||
/>
|
||||
<AddUser details={handleAddUser} closePopup={closePopup} />
|
||||
</>
|
||||
)}
|
||||
</Modal.Body>
|
||||
</Modal>
|
||||
</div>
|
||||
<LinkUserModal
|
||||
handleAddUser={handleAddUser}
|
||||
isAddUser={isAddUser}
|
||||
uniqueId={uniqueId}
|
||||
closePopup={closePopup}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,8 +28,8 @@ import {
|
||||
import RenderPdf from "./component/renderPdf";
|
||||
import ModalComponent from "./component/modalComponent";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import AddUser from "./component/AddUser";
|
||||
import SelectSigners from "./component/SelectSigners";
|
||||
import LinkUserModal from "./component/LinkUserModal";
|
||||
import Title from "./component/Title";
|
||||
|
||||
function PlaceHolderSign() {
|
||||
const navigate = useNavigate();
|
||||
@@ -69,7 +69,6 @@ function PlaceHolderSign() {
|
||||
const [isShowEmail, setIsShowEmail] = useState(false);
|
||||
const [selectedEmail, setSelectedEmail] = useState(false);
|
||||
const [isResize, setIsResize] = useState(false);
|
||||
const [isAlreadyPlace, setIsAlreadyPlace] = useState(false);
|
||||
const [zIndex, setZIndex] = useState(1);
|
||||
const [pdfLoadFail, setPdfLoadFail] = useState({
|
||||
status: false,
|
||||
@@ -78,6 +77,7 @@ function PlaceHolderSign() {
|
||||
const [uniqueId, setUniqueId] = useState("");
|
||||
const [roleName, setRoleName] = useState("");
|
||||
const [isAddUser, setIsAddUser] = useState({});
|
||||
const [signerExistModal, setSignerExistModal] = useState(false);
|
||||
const color = [
|
||||
"#93a3db",
|
||||
"#e6c3db",
|
||||
@@ -215,7 +215,7 @@ function PlaceHolderSign() {
|
||||
documentData[0].Placeholders.length > 0
|
||||
) {
|
||||
setSignerPos(documentData[0].Placeholders);
|
||||
let signers = [...signersdata];
|
||||
let signers = [...documentData[0].Signers];
|
||||
let updatedSigners = documentData[0].Placeholders.map((x) => {
|
||||
let matchingSigner = signers.find(
|
||||
(y) => x.signerObjId && x.signerObjId === y.objectId
|
||||
@@ -254,12 +254,11 @@ function PlaceHolderSign() {
|
||||
documentData[0].Placeholders.length > 0
|
||||
) {
|
||||
let updatedSigners = documentData[0].Placeholders.map((x) => {
|
||||
return {
|
||||
Role: x.Role,
|
||||
Id: x.Id,
|
||||
blockColor: x.blockColor
|
||||
};
|
||||
|
||||
return {
|
||||
Role: x.Role,
|
||||
Id: x.Id,
|
||||
blockColor: x.blockColor
|
||||
};
|
||||
});
|
||||
setSignerPos(documentData[0].Placeholders);
|
||||
setSignersData(updatedSigners);
|
||||
@@ -693,11 +692,16 @@ function PlaceHolderSign() {
|
||||
|
||||
const alertSendEmail = async () => {
|
||||
if (signerPos.length === signersdata.length) {
|
||||
const alert = {
|
||||
mssg: "confirm",
|
||||
alert: true
|
||||
};
|
||||
setIsSendAlert(alert);
|
||||
const IsSignerNotExist = signerPos?.some((x) => !x.signerObjId);
|
||||
if (IsSignerNotExist) {
|
||||
setSignerExistModal(true);
|
||||
} else {
|
||||
const alert = {
|
||||
mssg: "confirm",
|
||||
alert: true
|
||||
};
|
||||
setIsSendAlert(alert);
|
||||
}
|
||||
} else {
|
||||
const alert = {
|
||||
mssg: "sure",
|
||||
@@ -938,13 +942,9 @@ function PlaceHolderSign() {
|
||||
const closePopup = () => {
|
||||
setIsAddUser({});
|
||||
};
|
||||
|
||||
// console.log("isAddUser", isAddUser);
|
||||
// console.log("signerdata", signersdata);
|
||||
// console.log("signerPos", signerPos);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Title title={"placeholder"} />
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
{isLoading.isLoad ? (
|
||||
<Loader isLoading={isLoading} />
|
||||
@@ -1006,7 +1006,7 @@ function PlaceHolderSign() {
|
||||
{/* signature modal */}
|
||||
<Modal.Body>
|
||||
{isSendAlert.mssg === "sure" ? (
|
||||
<p>Please Add field for all recipients.</p>
|
||||
<p>Please add field for all recipients.</p>
|
||||
) : (
|
||||
isSendAlert.mssg === "confirm" && (
|
||||
<p>
|
||||
@@ -1233,35 +1233,34 @@ function PlaceHolderSign() {
|
||||
)}
|
||||
</DndProvider>
|
||||
<div>
|
||||
<Modal show={isAddUser[uniqueId]}>
|
||||
<Modal.Header
|
||||
className={"bg-info"}
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<span style={{ color: "white" }}>Add/choose user</span>
|
||||
<span
|
||||
style={{ color: "white", cursor: "pointer" }}
|
||||
onClick={() => closePopup()}
|
||||
>
|
||||
X
|
||||
</span>
|
||||
<Modal show={signerExistModal}>
|
||||
<Modal.Header className="bg-danger">
|
||||
<span style={{ color: "white" }}>Users required</span>
|
||||
</Modal.Header>
|
||||
|
||||
{/* signature modal */}
|
||||
<Modal.Body>
|
||||
{isAddUser && isAddUser[uniqueId] && (
|
||||
<>
|
||||
<SelectSigners
|
||||
details={handleAddUser}
|
||||
closePopup={closePopup}
|
||||
/>
|
||||
<AddUser details={handleAddUser} closePopup={closePopup} />
|
||||
</>
|
||||
)}
|
||||
<p>Please attach users to all fields</p>
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
<button
|
||||
onClick={() => setSignerExistModal(false)}
|
||||
style={{
|
||||
color: "black"
|
||||
}}
|
||||
type="button"
|
||||
className="finishBtn"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
<LinkUserModal
|
||||
handleAddUser={handleAddUser}
|
||||
isAddUser={isAddUser}
|
||||
uniqueId={uniqueId}
|
||||
closePopup={closePopup}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1060,7 +1060,6 @@ export const createDocument = async (template, placeholders, signerData) => {
|
||||
}
|
||||
);
|
||||
if (res) {
|
||||
console.log("res", res);
|
||||
return { status: "success", id: res.data.objectId };
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user