From 83df969751566c90b260f70b36f31de3d94a1e4c Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Thu, 5 Sep 2024 12:56:38 +0530 Subject: [PATCH 01/10] feat: introduce embedding feature after make template public --- apps/OpenSign/package-lock.json | 270 ++++++++++++++++++ apps/OpenSign/package.json | 1 + apps/OpenSign/src/components/pdf/EmbedTab.js | 116 ++++++++ .../src/primitives/GetReportDisplay.js | 2 + 4 files changed, 389 insertions(+) create mode 100644 apps/OpenSign/src/components/pdf/EmbedTab.js diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json index 16c09673d..c6f0a2105 100644 --- a/apps/OpenSign/package-lock.json +++ b/apps/OpenSign/package-lock.json @@ -49,6 +49,7 @@ "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", "react-signature-canvas": "^1.0.6", + "react-syntax-highlighter": "^15.5.0", "react-tooltip": "^5.28.0", "react-web-share": "^2.0.2", "reactour": "^1.19.4", @@ -5993,6 +5994,15 @@ "@types/node": "*" } }, + "node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2" + } + }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", @@ -6196,6 +6206,12 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, "node_modules/@types/use-sync-external-store": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", @@ -8127,6 +8143,36 @@ "node": ">=10" } }, + "node_modules/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -8597,6 +8643,16 @@ "node": ">= 0.8" } }, + "node_modules/comma-separated-tokens": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", + "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", @@ -11213,6 +11269,19 @@ "reusify": "^1.0.4" } }, + "node_modules/fault": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz", + "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==", + "license": "MIT", + "dependencies": { + "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/faye-websocket": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", @@ -11782,6 +11851,14 @@ "node": ">= 6" } }, + "node_modules/format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", + "engines": { + "node": ">=0.4.x" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -12297,6 +12374,33 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-parse-selector": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz", + "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", + "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==", + "license": "MIT", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^1.0.0", + "hast-util-parse-selector": "^2.0.0", + "property-information": "^5.0.0", + "space-separated-tokens": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -12305,6 +12409,15 @@ "he": "bin/he" } }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "license": "BSD-3-Clause", + "engines": { + "node": "*" + } + }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -13019,6 +13132,30 @@ "node": ">= 10" } }, + "node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -13158,6 +13295,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -13236,6 +13383,16 @@ "node": ">=0.10.0" } }, + "node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", @@ -16813,6 +16970,20 @@ "tslib": "^2.0.3" } }, + "node_modules/lowlight": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz", + "integrity": "sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==", + "license": "MIT", + "dependencies": { + "fault": "^1.0.0", + "highlight.js": "~10.7.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -17806,6 +17977,24 @@ "crypto-js": "4.2.0" } }, + "node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "license": "MIT", + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -19655,6 +19844,15 @@ "resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz", "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==" }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -19712,6 +19910,19 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/property-information": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz", + "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -21457,6 +21668,22 @@ } } }, + "node_modules/react-syntax-highlighter": { + "version": "15.5.0", + "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz", + "integrity": "sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "highlight.js": "^10.4.1", + "lowlight": "^1.17.0", + "prismjs": "^1.27.0", + "refractor": "^3.6.0" + }, + "peerDependencies": { + "react": ">= 0.14.0" + } + }, "node_modules/react-tooltip": { "version": "5.28.0", "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.28.0.tgz", @@ -21631,6 +21858,30 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/refractor": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz", + "integrity": "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==", + "license": "MIT", + "dependencies": { + "hastscript": "^6.0.0", + "parse-entities": "^2.0.0", + "prismjs": "~1.27.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/refractor/node_modules/prismjs": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", + "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -22839,6 +23090,16 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "deprecated": "Please use @jridgewell/sourcemap-codec instead" }, + "node_modules/space-separated-tokens": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz", + "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", @@ -25601,6 +25862,15 @@ "node": ">=0.4.0" } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json index 79712fa1e..0d393c61d 100644 --- a/apps/OpenSign/package.json +++ b/apps/OpenSign/package.json @@ -44,6 +44,7 @@ "react-scrollbars-custom": "^4.1.1", "react-select": "^5.8.0", "react-signature-canvas": "^1.0.6", + "react-syntax-highlighter": "^15.5.0", "react-tooltip": "^5.28.0", "react-web-share": "^2.0.2", "reactour": "^1.19.4", diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js new file mode 100644 index 000000000..b0d40beb7 --- /dev/null +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -0,0 +1,116 @@ +import React, { useState } from "react"; +import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; +import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/prism"; +import { copytoData } from "../../constant/Utils"; + +function EmbedTab(props) { + const tabName = [ + { title: "React/Next", icon: "fa-brands fa-react", color: "#61dafb" }, + { title: "Angular", icon: "fa-brands fa-angular", color: "#ff5733" } + ]; + const [activeTab, setActiveTab] = useState(0); + // State to track if the code has been copied + const [isCopied, setIsCopied] = useState(false); + const codeData = [ + { + id: 0, + title: "Installation command", + codeString: ` +npm install opensign-react` + }, + { + id: 1, + title: "Usage", + codeString: ` +import React from "react"; +import Opensign from "opensign-react"; + +export function App() { + return ( +
+ console.log("success")} + onLoadError={(error) => console.log(error)} + templateId= {"${props.templateId}"} + /> +
+ ); +} + + +` + } + ]; + + const handleCopy = (code, ind) => { + copytoData(code); + setIsCopied({ ...isCopied, [ind]: true }); + setTimeout(() => setIsCopied(false), 3000); + }; + + return ( +
+
+
+ {tabName.map((tabData, ind) => ( +
setActiveTab(ind)} + key={ind} + role="tab" + className={`${ + activeTab === ind ? "op-tab-active" : "" + } op-tab flex items-center`} + > + + {tabData.title} +
+ ))} +
+
+
+ {activeTab === 0 ? ( +
+ {codeData.map((data, ind) => { + return ( +
+

{data.title}

+
+
handleCopy(data.codeString, ind)} + className="absolute top-[20px] right-[20px] cursor-pointer" + > + {" "} + + {isCopied[ind] ? "COPIED" : "COPY"} + +
+ + {data.codeString} + +
+
+ ); + })} +
+ ) : ( + activeTab === 1 && ( +
+

Feature comming soon

+
+ ) + )} +
+
+ ); +} + +export default EmbedTab; diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 0fd2773f7..cb707a98d 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -30,6 +30,7 @@ import SubscribeCard from "./SubscribeCard"; import { validplan } from "../json/plansArr"; import { serverUrl_fn } from "../constant/appinfo"; import { useTranslation } from "react-i18next"; +import EmbedTab from "../components/pdf/EmbedTab"; const ReportTable = (props) => { const { t } = useTranslation(); @@ -1421,6 +1422,7 @@ const ReportTable = (props) => { + ) : (
From de5b8160a22783493a95fb7266d8efe730ab1aa4 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Thu, 5 Sep 2024 16:40:15 +0530 Subject: [PATCH 02/10] fix: add embedding functionality for all template & add CopyTemplateId button in template report list options --- .../public/locales/en/translation.json | 18 ++- .../public/locales/fr/translation.json | 20 ++- apps/OpenSign/src/components/pdf/EmbedTab.js | 42 ++++- apps/OpenSign/src/json/ReportJson.js | 7 + apps/OpenSign/src/json/dashboardJson.js | 2 +- apps/OpenSign/src/pages/PlaceHolderSign.js | 2 +- apps/OpenSign/src/pages/UserProfile.js | 2 +- apps/OpenSign/src/primitives/Alert.js | 4 +- .../src/primitives/GetReportDisplay.js | 147 ++++++------------ 9 files changed, 129 insertions(+), 115 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index f6df36dd7..18dd4c6d3 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -131,7 +131,8 @@ "Share": "Share", "View": "View", "option": "Option", - "Embed": "Embed" + "Embed": "Embed", + "CopyTemplateId":"CopyTemplateId" }, "report-heading": { "Sr.No": "Sr.No", @@ -263,7 +264,8 @@ "make-template-private-alert": "Are you sure you want to make this template private? This will remove it from your public profile.", "public-role": "Public role", "public-url": "Public URL", - "public-url-copy-mssg": " Here’s your public URL: Copy it or share it with the signer, and you will be able to see all your publicly set templates.", + "public-url-copy": "Here’s your public URL: ", + "public-url-copy-mssg":"Copy it or share it with the signer, and you will be able to see all your publicly set templates.", "add-public-url-alert": "Please add your public URL, and you will be able to make a public template.", "share-with-alert": "You cannot share a template if any roles already have contacts assigned. Please remove all contact assignments from the roles before sharing the template.", "share-with": "Share with", @@ -634,6 +636,16 @@ "quotamailselfsign": "You've reached your limit of 20 emails for this month. Upgrade now to continue sending emails directly.", "quotamail": "You've reached your limit of 20 signature request emails for this month. Upgrade now to continue sending emails directly.", "quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links below.", - "quotamailhead":"Quota Reached" + "quotamailhead":"Quota Reached", + "public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:", + "public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add opensign-react.", + "public-template-mssg-3" :"Need more details or examples?", + "public-template-mssg-4": "Visit the", + "public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.", + "public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.", + "copy-code":"COPY", + "copied-code":"COPIED", + "Installation":"Installation", + "Usage" :"Usage" } diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index e52882f39..ed3969643 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -150,7 +150,8 @@ "Share": "Partager", "View": "Voir", "option": "Option", - "Embed": "Intégrer" + "Embed": "Intégrer", + "CopyTemplateId": "Copier l'ID du modèle" }, "report-help": { "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", @@ -262,7 +263,8 @@ "make-template-private-alert": "Êtes-vous sûr de vouloir rendre ce modèle privé ? Cela le supprimera de votre profil public.", "public-role": "Rôle public", "public-url": "URL publique", - "public-url-copy-mssg": "Voici votre URL publique : copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.", + "public-url-copy": "Voici votre URL publique : ", + "public-url-copy-mssg": "copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.", "add-public-url-alert": "Veuillez ajouter votre URL publique et vous pourra rendre public modèle.", "share-with-alert": "Vous ne pouvez pas partager un modèle si des contacts sont déjà attribués à des rôles. Veuillez supprimer toutes les attributions de contacts des rôles avant de partager le modèle.", "share-with": "Partager avec", @@ -634,6 +636,16 @@ "quotamailselfsign": "Vous avez atteint votre limite de 20 e-mails pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", "quotamail": "Vous avez atteint votre limite de 20 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", "quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature ci-dessous.", - "quotamailhead":"Quota atteint" - + "quotamailhead":"Quota atteint", + "public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :", + "public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.", + "public-template-mssg-3" :"Besoin de plus de détails ou d'exemples ?", + "public-template-mssg-4": "Visitez le", + "public-template-mssg-5": "npm pour les dernières mises à jour, une documentation détaillée et l'historique des versions.", + "public-template-mssg-6":"Vous devez définir ce modèle comme public avant de pouvoir utiliser cet extrait de code.", + "copy-code":"COPIE", + "copied-code":"COPIÉ", + "Installation":"Installation", + "Usage" :"Usage" + } diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js index b0d40beb7..60caaab12 100644 --- a/apps/OpenSign/src/components/pdf/EmbedTab.js +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -2,10 +2,12 @@ import React, { useState } from "react"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { tomorrow } from "react-syntax-highlighter/dist/esm/styles/prism"; import { copytoData } from "../../constant/Utils"; +import { useTranslation } from "react-i18next"; function EmbedTab(props) { + const { t } = useTranslation(); const tabName = [ - { title: "React/Next", icon: "fa-brands fa-react", color: "#61dafb" }, + { title: "React/Next.js", icon: "fa-brands fa-react", color: "#61dafb" }, { title: "Angular", icon: "fa-brands fa-angular", color: "#ff5733" } ]; const [activeTab, setActiveTab] = useState(0); @@ -14,7 +16,7 @@ function EmbedTab(props) { const codeData = [ { id: 0, - title: "Installation command", + title: "Installation", codeString: ` npm install opensign-react` }, @@ -76,15 +78,22 @@ export function App() { {codeData.map((data, ind) => { return (
-

{data.title}

+

+ {t(`${data.title}`)} +

+ {ind === 0 && ( +

+ {t("public-template-mssg-1")} +

+ )}
handleCopy(data.codeString, ind)} className="absolute top-[20px] right-[20px] cursor-pointer" > - {" "} + - {isCopied[ind] ? "COPIED" : "COPY"} + {isCopied[ind] ? t("copied-code") : t("copy-code")}
+ {ind === 0 && ( +

+ {t("public-template-mssg-2")} +

+ )}
); })} + +

+ {t("public-template-mssg-3")} +

+

+ {" "} + {t("public-template-mssg-4")} + + {" "} + OpenSign React package{" "} + + {t("public-template-mssg-5")} +

) : ( activeTab === 1 && ( diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.js index 8100f5477..49b17d078 100644 --- a/apps/OpenSign/src/json/ReportJson.js +++ b/apps/OpenSign/src/json/ReportJson.js @@ -361,6 +361,13 @@ export default function reportJson(id) { btnIcon: "fa-light fa-code", action: "Embed" }, + { + btnId: "2434", + btnLabel: "CopyTemplateId", + hoverLabel: "CopyTemplateId", + btnIcon: "fa-light fa-copy", + action: "CopyTemplateId" + }, { btnId: "1834", btnLabel: "Delete", diff --git a/apps/OpenSign/src/json/dashboardJson.js b/apps/OpenSign/src/json/dashboardJson.js index dd1245954..8e9d1037b 100644 --- a/apps/OpenSign/src/json/dashboardJson.js +++ b/apps/OpenSign/src/json/dashboardJson.js @@ -36,7 +36,7 @@ const dashboardJson = [ queryType: "", class: "contracts_Document", query: - 'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1', + 'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"SignedUrl":{"#*ne":null},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1', key: "count", Redirect_type: "Report", Redirect_id: "1MwEuxLEkF", diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 617bcc64f..12c13a991 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -1047,7 +1047,7 @@ function PlaceHolderSign() { type="button" className="flex flex-row items-center op-link op-link-primary" > - + {t("copy-link")} diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 98b0012e1..f22ecfc5c 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -595,7 +595,7 @@ function UserProfile() { className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm" onClick={() => copytoclipboard()} > - {" "} + diff --git a/apps/OpenSign/src/primitives/Alert.js b/apps/OpenSign/src/primitives/Alert.js index b0a6e00e7..1d84d9b07 100644 --- a/apps/OpenSign/src/primitives/Alert.js +++ b/apps/OpenSign/src/primitives/Alert.js @@ -25,8 +25,8 @@ const Alert = ({ children, type, className }) => { : "z-[1000] fixed top-20 left-1/2 transform -translate-x-1/2 text-sm" } `} > -
- {children} +
+ {children}
) diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index cb707a98d..d066f5d0e 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -71,6 +71,7 @@ const ReportTable = (props) => { const [isViewShare, setIsViewShare] = useState({}); const [isSubscribe, setIsSubscribe] = useState(true); const [reason, setReason] = useState(""); + const [isEmbed, setIsEmbed] = useState(false); const Extand_Class = localStorage.getItem("Extand_Class"); const extClass = Extand_Class && JSON.parse(Extand_Class); const startIndex = (currentPage - 1) * props.docPerPage; @@ -365,6 +366,8 @@ const ReportTable = (props) => { setIsShareWith({ [item.objectId]: true }); } else if (act.action === "Embed") { handleEmbedFunction(item); + } else if (act.action === "CopyTemplateId") { + copyTemplateId(item.objectId); } }; // Get current list @@ -1067,12 +1070,14 @@ const ReportTable = (props) => { } }; const handleEmbedFunction = async (item) => { + setIsEmbed(true); setIsPublicProfile({ - [item.objectId]: props.isPublic[item.objectId] + [item.objectId]: true }); let extendUser = JSON.parse(localStorage.getItem("Extand_Class")); setIsPublicUserName(extendUser[0]?.UserName || ""); }; + return (
{Object.keys(actLoader)?.length > 0 && ( @@ -1343,22 +1348,27 @@ const ReportTable = (props) => { setIsPublicProfile({})} + handleClose={() => { + setIsPublicProfile({}); + setIsEmbed(false); + }} >
- {publicUserName ? ( + {isEmbed && !item?.IsPublic ? ( + <> +

{t("public-template-mssg-6")}

+ + + ) : publicUserName ? (
-

{t("public-url-copy-mssg")}

-
+ {t("public-url-copy")} +
- - {t("public-url")} : - copytoProfileLink() } - className="ml-[2px] underline underline-offset-2 cursor-pointer" + className="ml-[2px] underline underline-offset-2 cursor-pointer text-blue-800" > {publicUrl()} @@ -1383,7 +1393,7 @@ const ReportTable = (props) => { copytoProfileLink() } > - {" "} + {copied["publicprofile"] ? t("copied") @@ -1392,36 +1402,9 @@ const ReportTable = (props) => {
-
-
- - {t("templateid")} : - - - copyTemplateId(item.objectId) - } - className="underline ml-[2px] underline-offset-2 w-[150px] md:w-[350px] whitespace-nowrap overflow-hidden text-ellipsis cursor-pointer" - > - {item.objectId} - -
-
- -
-
+

+ {t("public-url-copy-mssg")} +

) : ( @@ -1482,65 +1465,33 @@ const ReportTable = (props) => { {isOption[item.objectId] && act.action === "option" && (
    - {act.subaction?.map((subact) => - props.isPublic[ - item.objectId - ] ? ( -
  • - handleActionBtn( - subact, - item - ) - } - title={t( - `btnLabel.${subact.btnLabel}` - )} - > - - - {subact.btnLabel && ( - - {t( - `btnLabel.${subact.btnLabel}` - )} - - )} - -
  • - ) : ( - subact.action !== "Embed" && ( -
  • - handleActionBtn( - subact, - item - ) - } - title={t( - `btnLabel.${subact.btnLabel}` - )} - > - - - {subact.btnLabel && ( - - {t( - `btnLabel.${subact.btnLabel}` - )} - + {act.subaction?.map((subact) => ( +
  • + handleActionBtn( + subact, + item + ) + } + title={t( + `btnLabel.${subact.btnLabel}` + )} + > + + + {subact.btnLabel && ( + + {t( + `btnLabel.${subact.btnLabel}` )} -
  • - ) - ) - )} + )} + + + ))}
)}
@@ -1861,7 +1812,7 @@ const ReportTable = (props) => { className="op-btn op-btn-primary op-btn-outline op-btn-xs md:op-btn-sm" onClick={() => copytoclipboard(share)} > - {" "} + {copied[share.email] ? t("copied") : t("copy")} From e80bcfc5869abd30ae85b4440ddae3efe8925ff4 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Thu, 5 Sep 2024 18:41:09 +0530 Subject: [PATCH 03/10] refactor code --- apps/OpenSign/public/locales/en/translation.json | 2 +- apps/OpenSign/public/locales/fr/translation.json | 2 +- apps/OpenSign/src/json/ReportJson.js | 4 ++-- apps/OpenSign/src/json/dashboardJson.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 18dd4c6d3..f860543e0 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -132,7 +132,7 @@ "View": "View", "option": "Option", "Embed": "Embed", - "CopyTemplateId":"CopyTemplateId" + "Copy TemplateId":"Copy TemplateId" }, "report-heading": { "Sr.No": "Sr.No", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index ed3969643..3644e5d04 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -151,7 +151,7 @@ "View": "Voir", "option": "Option", "Embed": "Intégrer", - "CopyTemplateId": "Copier l'ID du modèle" + "Copy TemplateId": "Copier l'ID du modèle" }, "report-help": { "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.js index 49b17d078..ba08c87ad 100644 --- a/apps/OpenSign/src/json/ReportJson.js +++ b/apps/OpenSign/src/json/ReportJson.js @@ -363,8 +363,8 @@ export default function reportJson(id) { }, { btnId: "2434", - btnLabel: "CopyTemplateId", - hoverLabel: "CopyTemplateId", + btnLabel: "Copy TemplateId", + hoverLabel: "Copy TemplateId", btnIcon: "fa-light fa-copy", action: "CopyTemplateId" }, diff --git a/apps/OpenSign/src/json/dashboardJson.js b/apps/OpenSign/src/json/dashboardJson.js index 8e9d1037b..dd1245954 100644 --- a/apps/OpenSign/src/json/dashboardJson.js +++ b/apps/OpenSign/src/json/dashboardJson.js @@ -36,7 +36,7 @@ const dashboardJson = [ queryType: "", class: "contracts_Document", query: - 'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"SignedUrl":{"#*ne":null},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1', + 'where={"Type":{"#*ne":"Folder"},"Signers":{"#*exists":true,"#*ne":[]},"Placeholders":{"#*ne":null},"IsCompleted":{"#*ne":true},"IsDeclined":{"#*ne":true},"IsArchive":{"#*ne":true},"CreatedBy":{"__type":"Pointer","className":"_User","objectId":"#UserId.objectId#"},"ExpiryDate":{"#*gt":{"__type":"#Date#","iso":"#today#"}}}&count=1', key: "count", Redirect_type: "Report", Redirect_id: "1MwEuxLEkF", From 3fc41f4255eb83d981c56de508296837509d8123 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 9 Sep 2024 09:59:33 +0530 Subject: [PATCH 04/10] feat : implement credit deduction in the public signature process --- .../public/locales/en/translation.json | 5 +- .../public/locales/fr/translation.json | 5 +- apps/OpenSign/src/constant/Utils.js | 9 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 111 +++++--- .../src/script/locales/en/translation.json | 33 +-- .../src/script/locales/fr/translation.json | 5 +- .../PublicUserLinkContactToDoc.js | 248 +++++++++++------- 7 files changed, 257 insertions(+), 159 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 51507ea96..4b0b4122b 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -647,6 +647,7 @@ "copied-code":"COPIED", "Installation":"Installation", "Usage" :"Usage", - "unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>." - + "unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>.", + "insufficient-credits":"Insufficient Signing Credits", + "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details." } diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index f9ff9669b..178d9ddea 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -647,6 +647,7 @@ "copied-code":"COPIÉ", "Installation":"Installation", "Usage" :"Usage", - "unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>." - + "unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>.", + "insufficient-credits":"Crédits de signature insuffisants", + "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails." } diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index 4ec3c35d0..2f98f17b9 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -33,14 +33,15 @@ export const openInNewTab = (url, target) => { export async function fetchSubscription( extUserId, contactObjId, - isGuestSign = false + isGuestSign = false, + isPublic = false ) { try { const Extand_Class = localStorage.getItem("Extand_Class"); const extClass = Extand_Class && JSON.parse(Extand_Class); // console.log("extClass ", extClass); let extUser; - if (extClass && extClass.length > 0) { + if (extClass && extClass.length > 0 && !isPublic) { extUser = extClass[0].objectId; } else { extUser = extUserId; @@ -54,8 +55,10 @@ export async function fetchSubscription( }; const params = isGuestSign ? { contactId: contactObjId } - : { extUserId: extUser }; + : { extUserId: extUser, ispublic: isPublic }; + console.log("params", params); const tenatRes = await axios.post(url, params, { headers: headers }); + console.log("tenantRes", tenatRes); let plan, status, billingDate, adminId; if (isGuestSign) { plan = tenatRes.data?.result?.result?.plan; diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 3f9d41a25..7d4aed259 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -243,7 +243,13 @@ function PdfRequestFiles(props) { }; async function checkIsSubscribed(extUserId, contactId) { const isGuestSign = isGuestSignFlow || false; - const res = await fetchSubscription(extUserId, contactId, isGuestSign); + const isPublic = props.templateId ? true : false; + const res = await fetchSubscription( + extUserId, + contactId, + isGuestSign, + isPublic + ); const plan = res.plan; const billingDate = res?.billingDate; const status = res?.status; @@ -296,14 +302,16 @@ function PdfRequestFiles(props) { ? [templateDeatils.data.result] : []; if (documentData && documentData[0]?.error) { - props?.setTemplateStatus({ - status: "Invalid" - }); + props?.setTemplateStatus && + props?.setTemplateStatus({ + status: "Invalid" + }); } else if (documentData && documentData.length > 0) { if (documentData[0]?.IsPublic) { - props?.setTemplateStatus({ - status: "Success" - }); + props?.setTemplateStatus && + props?.setTemplateStatus({ + status: "Success" + }); const url = documentData[0] && (documentData[0]?.SignedUrl || documentData[0]?.URL); @@ -347,14 +355,16 @@ function PdfRequestFiles(props) { isLoad: false }); } else { - props?.setTemplateStatus({ - status: "Private" - }); + props?.setTemplateStatus && + props?.setTemplateStatus({ + status: "Private" + }); } } else { - props?.setTemplateStatus({ - status: "Invalid" - }); + props?.setTemplateStatus && + props?.setTemplateStatus({ + status: "Invalid" + }); } } catch (err) { console.log("err in get template details ", err); @@ -1286,7 +1296,11 @@ function PdfRequestFiles(props) { .catch((err) => { console.log("error updating field is decline ", err); setIsUiLoading(false); - alert(t("something-went-wrong-mssg")); + setIsAlert({ + title: "Error", + isShow: true, + alertMessage: t("something-went-wrong-mssg") + }); }); }; //function to add default signature for all requested placeholder of sign @@ -1467,11 +1481,32 @@ function PdfRequestFiles(props) { await SendOtp(); } else { console.log("error in public-sign to create user details"); - alert(t("something-went-wrong-mssg")); + setIsAlert({ + title: "Error", + isShow: true, + alertMessage: t("something-went-wrong-mssg") + }); } } catch (e) { console.log("e", e); - // setIsLoader(false); + if ( + e?.response?.data?.error === "Insufficient Credit" || + e?.response?.data?.error === "Plan expired" + ) { + handleCloseOtp(); + setIsAlert({ + title: t("insufficient-credits"), + isShow: true, + alertMessage: t("insufficient-credits-mssg") + }); + } else { + handleCloseOtp(); + setIsAlert({ + title: "Error", + isShow: true, + alertMessage: t("something-went-wrong-mssg") + }); + } } }; @@ -1503,7 +1538,11 @@ function PdfRequestFiles(props) { } } catch (error) { console.log("error in verify otp in public-sign", error); - alert(t("something-went-wrong-mssg")); + setIsAlert({ + title: "Error", + isShow: true, + alertMessage: t("something-went-wrong-mssg") + }); } }; @@ -1602,6 +1641,7 @@ function PdfRequestFiles(props) {
); }; + console.log("templateId", props.templateId); return ( @@ -1656,27 +1696,6 @@ function PdfRequestFiles(props) { {!requestSignTour && signerObjectId && requestSignTourFunction()} - <ModalUi - isOpen={isAlert.isShow} - title={t("alert-message")} - handleClose={() => - setIsAlert({ isShow: false, alertMessage: "" }) - } - > - <div className="h-full p-[20px]"> - <p>{isAlert.alertMessage}</p> - <button - onClick={() => - setIsAlert({ isShow: false, alertMessage: "" }) - } - type="button" - className="op-btn op-btn-primary mt-3 px-4" - > - {t("ok")} - </button> - </div> - </ModalUi> - <Tour showNumber={false} showNavigation={false} @@ -2184,6 +2203,22 @@ function PdfRequestFiles(props) { </button> </div> </ModalUi> + <ModalUi + isOpen={isAlert.isShow} + title={isAlert?.title || t("alert-message")} + handleClose={() => setIsAlert({ isShow: false, alertMessage: "" })} + > + <div className="h-full p-[20px]"> + <p>{isAlert.alertMessage}</p> + <button + onClick={() => setIsAlert({ isShow: false, alertMessage: "" })} + type="button" + className="op-btn op-btn-primary mt-3 px-4" + > + {t("close")} + </button> + </div> + </ModalUi> </> )} </DndProvider> diff --git a/apps/OpenSign/src/script/locales/en/translation.json b/apps/OpenSign/src/script/locales/en/translation.json index f2a1fdf1c..6b116ed3d 100644 --- a/apps/OpenSign/src/script/locales/en/translation.json +++ b/apps/OpenSign/src/script/locales/en/translation.json @@ -41,7 +41,7 @@ "upgrade-now": "Upgrade now", "upgrade-to": "Upgrade to", "plan": "Plan", - "subscribe-card-teamplan":"Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!", + "subscribe-card-teamplan": "Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!", "subscribe-card-plan": "Unlock premium features starting at just {{premiumPrice}}/month. Enjoy enhanced performance and only {{addonPrice}} per additional credit after your included premium credits.", "user-name-limit-char": "To have a username less than 8 character please subscribe", "tour-content": "Don't show this again", @@ -614,24 +614,25 @@ "select-date-format": "Select a date format", "quantityofcredits": "Quantity of premium credits", "remainingcredits": "Premium credits available:", - "remainingcreditshelp":"Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.", + "remainingcreditshelp": "Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.", "additional-credits": "Please purchase premium credits", "quotaerrquicksend": "Quota Reached, You don't have enough credits.", "buycredits": "Buy Premium Credits", - "rotate-right":"Rotate right", - "rotate-left":"Rotate left", - "rotate-alert-mssg":"All widgets on this page will be lost. Are you sure you want to proceed?", - "templateid":"Template-Id", - "bulksendsubcriptionalert":"Please upgrade to Professional or Team plan to use bulk send.", - "generate-test-token":"Generate Test Token", - "regenerate-test-token":"Regenerate Test Token", - "help-test-token":"This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.", - "help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.", - "Add-Webhook":"Add Webhook", + "rotate-right": "Rotate right", + "rotate-left": "Rotate left", + "rotate-alert-mssg": "All widgets on this page will be lost. Are you sure you want to proceed?", + "templateid": "Template-Id", + "bulksendsubcriptionalert": "Please upgrade to Professional or Team plan to use bulk send.", + "generate-test-token": "Generate Test Token", + "regenerate-test-token": "Regenerate Test Token", + "help-test-token": "This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once you’ve completed your testing, you can upgrade to one of our paid plans to generate a production token.", + "help-api-token": "This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.", + "Add-Webhook": "Add Webhook", "quotamailinfo": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.", "quotamail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.", - "quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links.", - "quotamailhead":"Quota Reached", - "unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>." - + "quotamailTip": "Tip: You can still sign unlimited documents by manually sharing the signing request links.", + "quotamailhead": "Quota Reached", + "unauthorized-modal": "You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>.", + "insufficient-credits": "Insufficient Signing Credits", + "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details." } diff --git a/apps/OpenSign/src/script/locales/fr/translation.json b/apps/OpenSign/src/script/locales/fr/translation.json index 7e401e781..d1ee4e8c0 100644 --- a/apps/OpenSign/src/script/locales/fr/translation.json +++ b/apps/OpenSign/src/script/locales/fr/translation.json @@ -632,6 +632,7 @@ "quotamail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", "quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature.", "quotamailhead":"Quota atteint", - "unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>." - + "unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>.", + "insufficient-credits":"Crédits de signature insuffisants", + "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails." } diff --git a/apps/OpenSignServer/cloud/parsefunction/PublicUserLinkContactToDoc.js b/apps/OpenSignServer/cloud/parsefunction/PublicUserLinkContactToDoc.js index 5c2e16532..ba2cf0820 100644 --- a/apps/OpenSignServer/cloud/parsefunction/PublicUserLinkContactToDoc.js +++ b/apps/OpenSignServer/cloud/parsefunction/PublicUserLinkContactToDoc.js @@ -221,6 +221,25 @@ const sendMailToAllSigners = async docId => { } }; +const deductcount = async _resSub => { + try { + const subscriptionCls = new Parse.Object('contracts_Subscriptions'); + subscriptionCls.id = _resSub.objectId; + const allowedCredits = _resSub?.AllowedCredits || 0; + const addonCredits = _resSub?.AddonCredits || 0; + if (allowedCredits > 0) { + const updateAllowedcredits = allowedCredits - 1 || 0; + subscriptionCls.set('AllowedCredits', updateAllowedcredits); + } else { + const updateAddonCredits = addonCredits > 0 ? addonCredits - 1 : 0; + subscriptionCls.set('AddonCredits', updateAddonCredits); + } + await subscriptionCls.save(null, { useMasterKey: true }); + } catch (err) { + console.log('Err in deductcount in PublicUserLinkContacttoDoc cloud function', err); + } +}; + // `PublicUserLinkContactToDoc` cloud function is used to create contact, add this contact in contracts_Guest role and // create new document from template and save contact pointer in placeholder, signers and ACL of Document export default async function PublicUserLinkContactToDoc(req) { @@ -240,126 +259,163 @@ export default async function PublicUserLinkContactToDoc(req) { throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Template not found.'); } const _tempRes = JSON.parse(JSON.stringify(tempRes)); - const Placeholders = _tempRes?.Placeholders || []; - let index; - if (role) { - index = Placeholders?.findIndex(x => x.Role && x.Role === role); - } else { - throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, ''); - } - if (index !== -1) { - // Execute the query to check if a contact already exists in the 'contracts_Contactbook' class - const contactCls = new Parse.Query('contracts_Contactbook'); - contactCls.equalTo('Email', email); - contactCls.equalTo('CreatedBy', _tempRes.CreatedBy); - contactCls.notEqualTo('IsDeleted', true); - const existContact = await contactCls.first({ useMasterKey: true }); - if (existContact) { - const template_json = JSON.parse(JSON.stringify(tempRes)); - //update contact in placeholder, signers and update ACl in provide document - const docRes = await createDocumentFromTemplate(template_json, existContact, index); - if (docRes) { - //condition will execute only if sendInOrder will be false for send email to all signers at a time. - if (!template_json?.SendinOrder) { - await sendMailToAllSigners(docRes.id); - } - return { contactId: existContact.id, docId: docRes.id }; + const subscription = new Parse.Query('contracts_Subscriptions'); + subscription.equalTo('TenantId', { + __type: 'Pointer', + className: 'partners_Tenant', + objectId: _tempRes?.ExtUserPtr?.TenantId?.objectId, + }); + subscription.include('ExtUserPtr'); + const date = new Date(); + subscription.greaterThanOrEqualTo('Next_billing_date', date); + const resSub = await subscription.first({ useMasterKey: true }); + if (resSub) { + const _resSub = JSON.parse(JSON.stringify(resSub)); + const allowedCredits = _resSub?.AllowedCredits || 0; + const addonCredits = _resSub?.AddonCredits || 0; + const totalcredits = allowedCredits + addonCredits; + if (totalcredits > 0) { + const Placeholders = _tempRes?.Placeholders || []; + let index; + if (role) { + index = Placeholders?.findIndex(x => x.Role && x.Role === role); + } else { + throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, ''); } - } else { - // Execute the query to check if a user already exists in the 'contracts_Users' class - const extUserQuery = new Parse.Query('contracts_Users'); - extUserQuery.equalTo('Email', email); - const extUser = await extUserQuery.first({ useMasterKey: true }); - if (extUser) { - const _extUser = JSON.parse(JSON.stringify(extUser)); - const contact = { - UserId: _extUser.UserId, - Name: _extUser.Name, - Email: email, - Phone: _extUser?.Phone ? _extUser.Phone : '', - CreatedBy: _tempRes.CreatedBy, - TenantId: _tempRes.ExtUserPtr.TenantId, - }; - const template_json = JSON.parse(JSON.stringify(tempRes)); - // if user present on platform create contact on the basis of extended user details - const contactRes = await saveRoleContact(contact); - const docRes = await createDocumentFromTemplate(template_json, contactRes, index); - if (docRes) { - //condition will execute only if sendInOrder will be false for send email to all signers at a time. - if (!template_json?.SendinOrder) { - await sendMailToAllSigners(docRes.id); + if (index !== -1) { + // Execute the query to check if a contact already exists in the 'contracts_Contactbook' class + const contactCls = new Parse.Query('contracts_Contactbook'); + contactCls.equalTo('Email', email); + contactCls.equalTo('CreatedBy', _tempRes.CreatedBy); + contactCls.notEqualTo('IsDeleted', true); + const existContact = await contactCls.first({ useMasterKey: true }); + if (existContact) { + const template_json = JSON.parse(JSON.stringify(tempRes)); + //update contact in placeholder, signers and update ACl in provide document + const docRes = await createDocumentFromTemplate(template_json, existContact, index); + if (docRes) { + await deductcount(_resSub); + //condition will execute only if sendInOrder will be false for send email to all signers at a time. + if (!template_json?.SendinOrder) { + await sendMailToAllSigners(docRes.id); + } + return { contactId: existContact.id, docId: docRes.id }; } - return { contactId: contactRes.id, docId: docRes.id }; - } - } else if (name) { - try { - // Execute the query to check if a user already exists in the '_User' class - const userQuery = new Parse.Query(Parse.User); - userQuery.equalTo('email', email); - const userRes = await userQuery.first({ useMasterKey: true }); - if (userRes) { + } else { + // Execute the query to check if a user already exists in the 'contracts_Users' class + const extUserQuery = new Parse.Query('contracts_Users'); + extUserQuery.equalTo('Email', email); + const extUser = await extUserQuery.first({ useMasterKey: true }); + if (extUser) { + const _extUser = JSON.parse(JSON.stringify(extUser)); const contact = { - UserId: { __type: 'Pointer', className: '_User', objectId: userRes.id }, - Name: name, + UserId: _extUser.UserId, + Name: _extUser.Name, Email: email, - Phone: phone, + Phone: _extUser?.Phone ? _extUser.Phone : '', CreatedBy: _tempRes.CreatedBy, TenantId: _tempRes.ExtUserPtr.TenantId, }; const template_json = JSON.parse(JSON.stringify(tempRes)); - // Create new contract on the basis provided contact details by user and userId from _User class + // if user present on platform create contact on the basis of extended user details const contactRes = await saveRoleContact(contact); - //update contact in placeholder, signers and update ACl in provide document const docRes = await createDocumentFromTemplate(template_json, contactRes, index); if (docRes) { + await deductcount(_resSub); //condition will execute only if sendInOrder will be false for send email to all signers at a time. if (!template_json?.SendinOrder) { await sendMailToAllSigners(docRes.id); } return { contactId: contactRes.id, docId: docRes.id }; } + } else if (name) { + try { + // Execute the query to check if a user already exists in the '_User' class + const userQuery = new Parse.Query(Parse.User); + userQuery.equalTo('email', email); + const userRes = await userQuery.first({ useMasterKey: true }); + if (userRes) { + const contact = { + UserId: { __type: 'Pointer', className: '_User', objectId: userRes.id }, + Name: name, + Email: email, + Phone: phone, + CreatedBy: _tempRes.CreatedBy, + TenantId: _tempRes.ExtUserPtr.TenantId, + }; + const template_json = JSON.parse(JSON.stringify(tempRes)); + // Create new contract on the basis provided contact details by user and userId from _User class + const contactRes = await saveRoleContact(contact); + //update contact in placeholder, signers and update ACl in provide document + const docRes = await createDocumentFromTemplate( + template_json, + contactRes, + index + ); + if (docRes) { + await deductcount(_resSub); + //condition will execute only if sendInOrder will be false for send email to all signers at a time. + if (!template_json?.SendinOrder) { + await sendMailToAllSigners(docRes.id); + } + return { contactId: contactRes.id, docId: docRes.id }; + } + } else { + // create new user in _User class on the basis of details provide by user + const _users = Parse.Object.extend('User'); + const _user = new _users(); + _user.set('name', name); + _user.set('username', email); + _user.set('email', email); + _user.set('password', email); + if (phone) { + _user.set('phone', phone); + } + const newUserRes = await _user.save(); + const contact = { + UserId: { __type: 'Pointer', className: '_User', objectId: newUserRes.id }, + Name: name, + Email: email, + Phone: phone, + CreatedBy: _tempRes.CreatedBy, + TenantId: _tempRes.ExtUserPtr.TenantId, + }; + const template_json = JSON.parse(JSON.stringify(tempRes)); + // Create new contract on the basis provided contact details by user and userId from _User class + const contactRes = await saveRoleContact(contact); + //update contact in placeholder, signers and update ACl in provide document + const docRes = await createDocumentFromTemplate( + template_json, + contactRes, + index + ); + if (docRes) { + await deductcount(_resSub); + //condition will execute only if sendInOrder will be false for send email to all signers at a time. + if (!template_json?.SendinOrder) { + await sendMailToAllSigners(docRes.id); + } + return { contactId: contactRes.id, docId: docRes.id }; + } + } + } catch (err) { + console.log('Err', err); + } } else { - // create new user in _User class on the basis of details provide by user - const _users = Parse.Object.extend('User'); - const _user = new _users(); - _user.set('name', name); - _user.set('username', email); - _user.set('email', email); - _user.set('password', email); - if (phone) { - _user.set('phone', phone); - } - const newUserRes = await _user.save(); - const contact = { - UserId: { __type: 'Pointer', className: '_User', objectId: newUserRes.id }, - Name: name, - Email: email, - Phone: phone, - CreatedBy: _tempRes.CreatedBy, - TenantId: _tempRes.ExtUserPtr.TenantId, - }; - const template_json = JSON.parse(JSON.stringify(tempRes)); - // Create new contract on the basis provided contact details by user and userId from _User class - const contactRes = await saveRoleContact(contact); - //update contact in placeholder, signers and update ACl in provide document - const docRes = await createDocumentFromTemplate(template_json, contactRes, index); - if (docRes) { - //condition will execute only if sendInOrder will be false for send email to all signers at a time. - if (!template_json?.SendinOrder) { - await sendMailToAllSigners(docRes.id); - } - return { contactId: contactRes.id, docId: docRes.id }; - } + throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'User not found.'); } - } catch (err) { - console.log('Err', err); } } else { - throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'User not found.'); + throw new Parse.Error( + Parse.Error.OBJECT_NOT_FOUND, + 'Please provide required parameters!' + ); } + } else { + throw new Parse.Error(Parse.Error.REQUEST_LIMIT_EXCEEDED, 'Insufficient Credit'); } } else { - throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Please provide required parameters!'); + throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Plan expired'); } } else { throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Template not found.'); From 6551b2537a1039d842b1104d70b0647bbb172f2c Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 18 Sep 2024 16:48:20 +0530 Subject: [PATCH 05/10] feat: implement angular npm package use case in public template --- apps/OpenSign/src/components/pdf/EmbedTab.js | 139 ++++++++++++++++++- 1 file changed, 134 insertions(+), 5 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js index 60caaab12..f0525df1a 100644 --- a/apps/OpenSign/src/components/pdf/EmbedTab.js +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -8,12 +8,13 @@ function EmbedTab(props) { const { t } = useTranslation(); const tabName = [ { title: "React/Next.js", icon: "fa-brands fa-react", color: "#61dafb" }, + { title: "JavaScript", icon: "fa-brands fa-js", color: "#ffd43b" }, { title: "Angular", icon: "fa-brands fa-angular", color: "#ff5733" } ]; const [activeTab, setActiveTab] = useState(0); // State to track if the code has been copied const [isCopied, setIsCopied] = useState(false); - const codeData = [ + const reactCode = [ { id: 0, title: "Installation", @@ -44,6 +45,51 @@ export function App() { } ]; + const angularCode = [ + { + id: 0, + title: "Installation", + codeString: ` +npm install opensign-angular` + }, + { + id: 1, + title: "Usage", + codeString: ` +import { Component } from '@angular/core'; +import {OpensignComponent} from "opensign-angular" + +@Component({ + selector:'app-root', + standalone: true, + imports: [OpensignComponent], + template: '<opensign templateId={"${props.templateId}"} + (onLoad)="handleLoad()" + (onLoadError)="handleError($event)" + ></opensign>', +}) +export class AppComponent{ + handleLoad() { + console.log("success"); + } + handleError(error: string) { + console.log(error); + } + +} + + +` + } + ]; + const jsCodeString = ` +<script + src= "https://app.opensignlabs.com/static/js/public-template.bundle.js" + id="opensign-script" + templateId=${props.templateId} + ></script> + `; + const handleCopy = (code, ind) => { copytoData(code); setIsCopied({ ...isCopied, [ind]: true }); @@ -75,7 +121,7 @@ export function App() { <div> {activeTab === 0 ? ( <div className="mt-4"> - {codeData.map((data, ind) => { + {reactCode.map((data, ind) => { return ( <div key={ind}> <p className="font-medium text-[18px]"> @@ -133,10 +179,93 @@ export function App() { {t("public-template-mssg-5")} </p> </div> + ) : activeTab === 1 ? ( + <div className="mt-4"> + <div> + {/* <p className="font-medium text-[18px]">{t(`${data.title}`)}</p> */} + + <div className="relative p-1"> + <div + onClick={() => handleCopy(jsCodeString, 0)} + className="absolute top-[20px] right-[20px] cursor-pointer" + > + <i className="fa-light fa-copy text-white mr-[2px]" /> + <span className=" text-white"> + {isCopied[0] ? t("copied-code") : t("copy-code")} + </span> + </div> + <SyntaxHighlighter + customStyle={{ + borderRadius: "15px" + }} + language="javascript" + style={tomorrow} + > + {jsCodeString} + </SyntaxHighlighter> + </div> + </div> + </div> ) : ( - activeTab === 1 && ( - <div className="mt-3"> - <p>Feature comming soon</p> + activeTab === 2 && ( + <div className="mt-4"> + {angularCode.map((data, ind) => { + return ( + <div key={ind}> + <p className="font-medium text-[18px]"> + {t(`${data.title}`)} + </p> + {ind === 0 && ( + <p className="text-[13px] mt-2"> + {t("public-template-mssg-1")} + </p> + )} + <div className="relative p-1"> + <div + onClick={() => handleCopy(data.codeString, ind)} + className="absolute top-[20px] right-[20px] cursor-pointer" + > + <i className="fa-light fa-copy text-white mr-[2px]" /> + <span className=" text-white"> + {isCopied[ind] ? t("copied-code") : t("copy-code")} + </span> + </div> + <SyntaxHighlighter + customStyle={{ + borderRadius: "15px" + }} + language="javascript" + style={tomorrow} + > + {data.codeString} + </SyntaxHighlighter> + </div> + {ind === 0 && ( + <p className="text-[13px] mb-3"> + {t("public-template-mssg-2")} + </p> + )} + </div> + ); + })} + + <p className="font-medium text-[15px]"> + {t("public-template-mssg-3")} + </p> + <p className="my-[6px]"> + {" "} + {t("public-template-mssg-4")} + <a + href="https://www.npmjs.com/package/opensignme-angular" + target="_blank" + rel="noreferrer" + className="cursor-pointer text-blue-700 " + > + {" "} + OpenSign Angular package{" "} + </a> + {t("public-template-mssg-5")} + </p> </div> ) )} From 1268f65516d69a1ea47222ff6c02131292a0aa1b Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 18 Sep 2024 16:58:04 +0530 Subject: [PATCH 06/10] fix: update angular text --- .../public/locales/en/translation.json | 5 +-- .../public/locales/fr/translation.json | 5 +-- apps/OpenSign/src/components/pdf/EmbedTab.js | 31 +++++++------------ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 4b0b4122b..2dc97e305 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -642,12 +642,13 @@ "public-template-mssg-3" :"Need more details or examples?", "public-template-mssg-4": "Visit the", "public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.", - "public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.", + "public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.", "copy-code":"COPY", "copied-code":"COPIED", "Installation":"Installation", "Usage" :"Usage", "unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>.", "insufficient-credits":"Insufficient Signing Credits", - "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details." + "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.", + "angular-npm-mssg-1": "To integrate OpenSign into your Angular project, simply run the following command:" } diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 178d9ddea..d1b7d72e8 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -649,5 +649,6 @@ "Usage" :"Usage", "unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>.", "insufficient-credits":"Crédits de signature insuffisants", - "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails." -} + "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails.", + "angular-npm-mssg-1" :"Pour intégrer OpenSign dans votre projet Angular, exécutez simplement la commande suivante :" + } diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js index f0525df1a..20e901b28 100644 --- a/apps/OpenSign/src/components/pdf/EmbedTab.js +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -127,11 +127,9 @@ export class AppComponent{ <p className="font-medium text-[18px]"> {t(`${data.title}`)} </p> - {ind === 0 && ( - <p className="text-[13px] mt-2"> - {t("public-template-mssg-1")} - </p> - )} + <p className="text-[13px] mt-2"> + {t("public-template-mssg-1")} + </p> <div className="relative p-1"> <div onClick={() => handleCopy(data.codeString, ind)} @@ -152,11 +150,9 @@ export class AppComponent{ {data.codeString} </SyntaxHighlighter> </div> - {ind === 0 && ( - <p className="text-[13px] mb-3"> - {t("public-template-mssg-2")} - </p> - )} + <p className="text-[13px] mb-3"> + {t("public-template-mssg-2")} + </p> </div> ); })} @@ -215,11 +211,11 @@ export class AppComponent{ <p className="font-medium text-[18px]"> {t(`${data.title}`)} </p> - {ind === 0 && ( - <p className="text-[13px] mt-2"> - {t("public-template-mssg-1")} - </p> - )} + + <p className="text-[13px] mt-2"> + {t("angular-npm-mssg-1")} + </p> + <div className="relative p-1"> <div onClick={() => handleCopy(data.codeString, ind)} @@ -240,11 +236,6 @@ export class AppComponent{ {data.codeString} </SyntaxHighlighter> </div> - {ind === 0 && ( - <p className="text-[13px] mb-3"> - {t("public-template-mssg-2")} - </p> - )} </div> ); })} From 9852c87be7f0783d8150b89eb1b611d4c271215a Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Wed, 18 Sep 2024 18:19:08 +0530 Subject: [PATCH 07/10] fix: design in mobile view --- apps/OpenSign/src/components/pdf/EmbedTab.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js index 20e901b28..655ccaf9b 100644 --- a/apps/OpenSign/src/components/pdf/EmbedTab.js +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -113,7 +113,9 @@ export class AppComponent{ className={`${tabData.icon}`} style={{ color: tabData.color }} ></i> - <span className="ml-1">{tabData.title}</span> + <span className="ml-1 text-[10px] font-medium md:font-normal md:text-[15px]"> + {tabData.title} + </span> </div> ))} </div> @@ -150,9 +152,6 @@ export class AppComponent{ {data.codeString} </SyntaxHighlighter> </div> - <p className="text-[13px] mb-3"> - {t("public-template-mssg-2")} - </p> </div> ); })} From 0f1ef0406e00d51ee0e3486e7d6b114df1d12b0a Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 19 Sep 2024 17:19:45 +0530 Subject: [PATCH 08/10] refactor code --- apps/OpenSign/src/components/pdf/EmbedTab.js | 2 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 21 ++++++++++----- apps/OpenSign/src/script/PublicTemplate.js | 27 +++++++++++++------- 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/EmbedTab.js b/apps/OpenSign/src/components/pdf/EmbedTab.js index 655ccaf9b..8891d0dcc 100644 --- a/apps/OpenSign/src/components/pdf/EmbedTab.js +++ b/apps/OpenSign/src/components/pdf/EmbedTab.js @@ -246,7 +246,7 @@ export class AppComponent{ {" "} {t("public-template-mssg-4")} <a - href="https://www.npmjs.com/package/opensignme-angular" + href="https://www.npmjs.com/package/opensign-angular" target="_blank" rel="noreferrer" className="cursor-pointer text-blue-700 " diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 7d4aed259..e2d5ef00a 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -297,15 +297,15 @@ function PdfRequestFiles(props) { } } ); - const documentData = - templateDeatils.data && templateDeatils.data.result - ? [templateDeatils.data.result] - : []; + const documentData = templateDeatils?.data?.result + ? [templateDeatils?.data?.result] + : []; if (documentData && documentData[0]?.error) { props?.setTemplateStatus && props?.setTemplateStatus({ status: "Invalid" }); + throw new Error("error: Invalid TemplateId"); } else if (documentData && documentData.length > 0) { if (documentData[0]?.IsPublic) { props?.setTemplateStatus && @@ -359,20 +359,30 @@ function PdfRequestFiles(props) { props?.setTemplateStatus({ status: "Private" }); + setIsLoading(false); + setHandleError(t("something-went-wrong-mssg")); + console.error("error: TemplateId is not public"); + return; } } else { props?.setTemplateStatus && props?.setTemplateStatus({ status: "Invalid" }); + setIsLoading(false); + setHandleError(t("something-went-wrong-mssg")); + console.error("error: Invalid TemplateId"); + return; } } catch (err) { - console.log("err in get template details ", err); + setIsLoading(false); if (err?.response?.data?.code === 101) { setHandleError(t("error-template")); } else { setHandleError(t("something-went-wrong-mssg")); } + console.error("error: Invalid TemplateId"); + return; } }; //function for get document details for perticular signer with signer'object id @@ -1641,7 +1651,6 @@ function PdfRequestFiles(props) { </div> ); }; - console.log("templateId", props.templateId); return ( <DndProvider backend={HTML5Backend}> <Title title={props.templateId ? "Public Sign" : "Request Sign"} /> diff --git a/apps/OpenSign/src/script/PublicTemplate.js b/apps/OpenSign/src/script/PublicTemplate.js index 741c66f7c..c684b00b0 100644 --- a/apps/OpenSign/src/script/PublicTemplate.js +++ b/apps/OpenSign/src/script/PublicTemplate.js @@ -11,28 +11,37 @@ import { isPublicStaging } from "../constant/const"; pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.mjs`; // Wrapper component to manage props -const PublicScriptFileWrapper = ({ initialProps }) => { - const [props, setProps] = useState(initialProps); +const PublicScriptFileWrapper = () => { + const [props, setProps] = useState(""); - // Make the setProps function globally accessible useEffect(() => { + // Assigns the function 'setProps' to the global 'window' object as 'updatePublicTemplateProps'. + // This allows 'setProps' to be accessed and called globally across different scripts or components, + // enabling dynamic updates to the public template's properties. window.updatePublicTemplateProps = setProps; - + const publicScript = document.getElementById("opensign-script"); + // condition for using plan js load opensign-script then get templateId + if (publicScript) { + // Get the custom templateId attribute + const templateId = publicScript.getAttribute("templateId"); + if (templateId) { + setProps({ templateId: templateId }); + } else { + const error = "error: TemplateId is missing"; + throw new Error(error); + } + } return () => { window.updatePublicTemplateProps = undefined; }; }, []); - return <PdfRequestFiles {...props} />; }; const appId = isPublicStaging ? "opensign" : "legadranaxn"; -//"opensign" - const serverUrl = isPublicStaging ? "https://staging-app.opensignlabs.com/api/app" : "https://app.opensignlabs.com/api/app"; -// "https://staging-app.opensignlabs.com/api/app" localStorage.setItem("baseUrl", `${serverUrl}/`); localStorage.setItem("parseAppId", appId); @@ -58,7 +67,7 @@ const root = ReactDOM.createRoot(document.getElementById("script-component")); root.render( <div data-theme="opensigncss"> <Provider store={store}> - <PublicScriptFileWrapper initialProps={{ text: "templateId" }} /> + <PublicScriptFileWrapper /> </Provider> </div> ); From 88919f26343f4bcf34c8137d42af2e047086948f Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 19 Sep 2024 17:47:50 +0530 Subject: [PATCH 09/10] refactor code --- .../public/locales/en/translation.json | 5 --- .../public/locales/fr/translation.json | 5 --- .../src/script/locales/en/translation.json | 34 ++++++++++--------- .../src/script/locales/fr/translation.json | 26 +++++++++----- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 014879f9a..33feaf25b 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -633,11 +633,6 @@ "reason":"Reason", "decline-by":"Declined/revoked by", "document-declined": "Document declined", - "Add-Webhook":"Add Webhook", - "quotamailinfo": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.", - "quotamail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.", - "quotamailTip":"Tip: You can still sign unlimited documents by manually sharing the signing request links.", - "quotamailhead":"Quota Reached", "public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:", "public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add opensign-react.", "public-template-mssg-3" :"Need more details or examples?", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index b558364a5..88d0ac2c2 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -632,11 +632,6 @@ "reason" :"Raison", "decline-by" :"Refusé/révoqué par", "document-declined":"document refusé", - "Add-Webhook":"Ajouter Webhook", - "quotamailinfo": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.", - "quotamail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", - "quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature.", - "quotamailhead":"Quota atteint", "public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :", "public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.", "public-template-mssg-3" :"Besoin de plus de détails ou d'exemples ?", diff --git a/apps/OpenSign/src/script/locales/en/translation.json b/apps/OpenSign/src/script/locales/en/translation.json index 34a45b1ed..33feaf25b 100644 --- a/apps/OpenSign/src/script/locales/en/translation.json +++ b/apps/OpenSign/src/script/locales/en/translation.json @@ -41,7 +41,7 @@ "upgrade-now": "Upgrade now", "upgrade-to": "Upgrade to", "plan": "Plan", - "subscribe-card-teamplan": "Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!", + "subscribe-card-teamplan":"Unlock the full power of collaboration! Create unlimited organizations, teams, and hierarchies. Share templates seamlessly across teams and assign custom user roles. Elevate your workflow today!", "subscribe-card-plan": "Unlock premium features starting at just {{premiumPrice}}/month. Enjoy enhanced performance and only {{addonPrice}} per additional credit after your included premium credits.", "user-name-limit-char": "To have a username less than 8 character please subscribe", "tour-content": "Don't show this again", @@ -131,7 +131,8 @@ "Share": "Share", "View": "View", "option": "Option", - "Embed": "Embed" + "Embed": "Embed", + "Copy TemplateId":"Copy TemplateId" }, "report-heading": { "Sr.No": "Sr.No", @@ -263,7 +264,8 @@ "make-template-private-alert": "Are you sure you want to make this template private? This will remove it from your public profile.", "public-role": "Public role", "public-url": "Public URL", - "public-url-copy-mssg": " Here’s your public URL: Copy it or share it with the signer, and you will be able to see all your publicly set templates.", + "public-url-copy": "Here’s your public URL: ", + "public-url-copy-mssg":"Copy it or share it with the signer, and you will be able to see all your publicly set templates.", "add-public-url-alert": "Please add your public URL, and you will be able to make a public template.", "share-with-alert": "You cannot share a template if any roles already have contacts assigned. Please remove all contact assignments from the roles before sharing the template.", "share-with": "Share with", @@ -613,19 +615,6 @@ "user-name-exist": "user name already exist", "format": "format", "select-date-format": "Select a date format", - "quantityofcredits": "Quantity of premium credits", - "remainingcredits": "Premium credits available:", - "remainingcreditshelp": "Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.", - "quotaerrquicksend": "Quota Reached, You don't have enough credits.", - "buycredits": "Buy Premium Credits", - "bulksendsubcriptionalert": "Please upgrade to Professional or Team plan to use bulk send.", - "Add-Webhook": "Add Webhook", - "quotamailinfo": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.", - "quotamail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.", - "quotamailTip": "Tip: You can still sign unlimited documents by manually sharing the signing request links.", - "quotamailhead": "Quota Reached", - "insufficient-credits": "Insufficient Signing Credits", - "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.", "quantity-of-credits": "Quantity of premium credits", "remaining-credits": "Premium credits available:", "remaining-credits-help":"Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.", @@ -644,6 +633,19 @@ "reason":"Reason", "decline-by":"Declined/revoked by", "document-declined": "Document declined", + "public-template-mssg-1":"To integrate OpenSign into your React or Next.js project, simply run the following command:", + "public-template-mssg-2" :"Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add opensign-react.", + "public-template-mssg-3" :"Need more details or examples?", + "public-template-mssg-4": "Visit the", + "public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.", + "public-template-mssg-6" :"You need to set this template as public before you can utilize this code snippet.", + "copy-code":"COPY", + "copied-code":"COPIED", + "Installation":"Installation", + "Usage" :"Usage", + "insufficient-credits":"Insufficient Signing Credits", + "insufficient-credits-mssg":"The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.", + "angular-npm-mssg-1": "To integrate OpenSign into your Angular project, simply run the following command:", "quota-mail-info-head":"Monthly request signatures email limit", "quota-mail-info": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.", "quota-mail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.", diff --git a/apps/OpenSign/src/script/locales/fr/translation.json b/apps/OpenSign/src/script/locales/fr/translation.json index cfdf452fb..88d0ac2c2 100644 --- a/apps/OpenSign/src/script/locales/fr/translation.json +++ b/apps/OpenSign/src/script/locales/fr/translation.json @@ -150,7 +150,8 @@ "Share": "Partager", "View": "Voir", "option": "Option", - "Embed": "Intégrer" + "Embed": "Intégrer", + "Copy TemplateId": "Copier l'ID du modèle" }, "report-help": { "Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.", @@ -262,7 +263,8 @@ "make-template-private-alert": "Êtes-vous sûr de vouloir rendre ce modèle privé ? Cela le supprimera de votre profil public.", "public-role": "Rôle public", "public-url": "URL publique", - "public-url-copy-mssg": "Voici votre URL publique : copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.", + "public-url-copy": "Voici votre URL publique : ", + "public-url-copy-mssg": "copiez-la ou partagez-le avec le signataire et vous pouvoir voir tous vos paramètres publics modèles.", "add-public-url-alert": "Veuillez ajouter votre URL publique et vous pourra rendre public modèle.", "share-with-alert": "Vous ne pouvez pas partager un modèle si des contacts sont déjà attribués à des rôles. Veuillez supprimer toutes les attributions de contacts des rôles avant de partager le modèle.", "share-with": "Partager avec", @@ -627,16 +629,22 @@ "regenerate-test-token":"Régénérer le jeton de test", "help-test-token":"Ce jeton peut être utilisé pour tester les API au niveau du point de terminaison https://sandbox.opensignlabs.com/api/v1, vous permettant ainsi d'effectuer un nombre illimité de signatures de documents. Veuillez noter que l'API sandbox signera vos documents avec des certificats auto-signés, qui peuvent ne pas être reconnus comme valides par Adobe. Une fois vos tests terminés, vous pouvez passer à l’un de nos forfaits payants pour générer un jeton de production.", "help-api-token":"Ce jeton peut être utilisé pour accéder aux API de production au point de terminaison {{origin}}/api/v1. Il ne peut être généré que sur l'un de nos forfaits payants.", - "Add-Webhook":"Ajouter Webhook", - "quotamailinfo": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.", - "quotamail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", - "quotamailTip":"Astuce : Vous pouvez toujours signer un nombre illimité de documents en partageant manuellement les liens de demande de signature.", - "quotamailhead":"Quota atteint", - "insufficient-credits":"Crédits de signature insuffisants", - "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails.", "reason" :"Raison", "decline-by" :"Refusé/révoqué par", "document-declined":"document refusé", + "public-template-mssg-1" :"Pour intégrer OpenSign dans votre projet React ou Next.js, exécutez simplement la commande suivante :", + "public-template-mssg-2" :"Assurez-vous que npm ou Yarn est configuré dans votre projet. Si vous utilisez Yarn, vous pouvez remplacer npm install par Yarn Add opensign-react.", + "public-template-mssg-3" :"Besoin de plus de détails ou d'exemples ?", + "public-template-mssg-4": "Visitez le", + "public-template-mssg-5": "npm pour les dernières mises à jour, une documentation détaillée et l'historique des versions.", + "public-template-mssg-6":"Vous devez définir ce modèle comme public avant de pouvoir utiliser cet extrait de code.", + "copy-code":"COPIE", + "copied-code":"COPIÉ", + "Installation":"Installation", + "Usage" :"Usage", + "insufficient-credits":"Crédits de signature insuffisants", + "insufficient-credits-mssg" :"Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails.", + "angular-npm-mssg-1" :"Pour intégrer OpenSign dans votre projet Angular, exécutez simplement la commande suivante :", "quota-mail-info-head":"Limite mensuelle d'e-mails de signatures de demandes", "quota-mail-info": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.", "quota-mail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.", From c4426895731f3b5929bdd8d09e4aa8612dae2eb7 Mon Sep 17 00:00:00 2001 From: RaktimaNXG <raktima.c@nxglabs.com> Date: Thu, 19 Sep 2024 18:38:32 +0530 Subject: [PATCH 10/10] fix: remove console --- apps/OpenSign/src/constant/Utils.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index 37c4fd919..312544391 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -56,9 +56,7 @@ export async function fetchSubscription( const params = isGuestSign ? { contactId: contactObjId } : { extUserId: extUser, ispublic: isPublic }; - console.log("params", params); const tenatRes = await axios.post(url, params, { headers: headers }); - console.log("tenantRes", tenatRes); let plan, status, billingDate, adminId; if (isGuestSign) { plan = tenatRes.data?.result?.result?.plan;