Skip to content

Commit fbda523

Browse files
Merge pull request #1089 from OpenSignLabs/validation
build(deps): update dependencies
2 parents b235287 + bd4d333 commit fbda523

File tree

8 files changed

+711
-586
lines changed

8 files changed

+711
-586
lines changed

apps/OpenSign/package-lock.json

Lines changed: 600 additions & 509 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/OpenSign/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"private": true,
55
"dependencies": {
66
"@formkit/auto-animate": "^0.8.2",
7-
"@lottiefiles/dotlottie-react": "^0.8.7",
7+
"@lottiefiles/dotlottie-react": "^0.8.9",
88
"@pdf-lib/fontkit": "^1.1.1",
99
"@radix-ui/themes": "^3.1.3",
1010
"@react-pdf/renderer": "^3.4.4",
1111
"@reduxjs/toolkit": "^2.2.7",
1212
"axios": "^1.7.4",
1313
"file-saver": "^2.0.5",
14-
"i18next": "^23.12.2",
14+
"i18next": "^23.14.0",
1515
"i18next-browser-languagedetector": "^8.0.0",
16-
"i18next-http-backend": "^2.5.2",
16+
"i18next-http-backend": "^2.6.1",
1717
"jwt-decode": "^4.0.0",
1818
"moment": "^2.30.1",
1919
"nth-check": "^2.1.1",
@@ -36,10 +36,10 @@
3636
"react-i18next": "^15.0.1",
3737
"react-konva": "^18.2.10",
3838
"react-pdf": "^9.1.0",
39-
"react-quill-new": "^3.2.2",
39+
"react-quill-new": "^3.3.0",
4040
"react-redux": "^9.1.2",
4141
"react-rnd": "^10.4.11",
42-
"react-router-dom": "^6.26.0",
42+
"react-router-dom": "^6.26.1",
4343
"react-scripts": "5.0.1",
4444
"react-scrollbars-custom": "^4.1.1",
4545
"react-select": "^5.8.0",
@@ -94,9 +94,9 @@
9494
},
9595
"devDependencies": {
9696
"@babel/core": "^7.25.2",
97-
"@babel/preset-env": "^7.25.3",
97+
"@babel/preset-env": "^7.25.4",
9898
"@babel/preset-react": "^7.24.7",
99-
"@babel/runtime-corejs2": "^7.25.0",
99+
"@babel/runtime-corejs2": "^7.25.4",
100100
"autoprefixer": "^10.4.20",
101101
"babel-loader": "^9.1.3",
102102
"clean-webpack-plugin": "^4.0.0",
@@ -110,7 +110,7 @@
110110
"eslint-plugin-prettier": "^5.2.1",
111111
"eslint-plugin-react": "^7.34.3",
112112
"lint-staged": "^15.2.8",
113-
"mini-css-extract-plugin": "^2.9.0",
113+
"mini-css-extract-plugin": "^2.9.1",
114114
"postcss": "^8.4.41",
115115
"prettier": "^3.3.3",
116116
"pretty-quick": "^4.0.0",

apps/OpenSign/public/locales/en/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,6 @@
616616
"buycredits": "Buy credits",
617617
"rotate-right":"Rotate right",
618618
"rotate-left":"Rotate left",
619-
"rotate-alert-mssg":"All widgets on this page will be lost. Are you sure you want to proceed?"
619+
"rotate-alert-mssg":"All widgets on this page will be lost. Are you sure you want to proceed?",
620+
"bulksendsubcriptionalert":"Please upgrade to Professional or Team plan to use quicksend."
620621
}

apps/OpenSign/public/locales/fr/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,6 @@
616616
"buycredits": "Acheter des crédits",
617617
"rotate-right" :"Faire pivoter à droite",
618618
"rotate-left" :"Faire pivoter à gauche",
619-
"rotate-alert-mssg" :"Tous les widgets de cette page seront perdus. Êtes-vous sûr de vouloir continuer ?"
619+
"rotate-alert-mssg" :"Tous les widgets de cette page seront perdus. Êtes-vous sûr de vouloir continuer ?",
620+
"bulksendsubcriptionalert":"Veuillez passer au forfait Professionnel ou Équipe pour utiliser Quicksend."
620621
}

apps/OpenSign/src/components/BulkSendUi.js

Lines changed: 66 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ import { useTranslation } from "react-i18next";
66
import Parse from "parse";
77
import ModalUi from "../primitives/ModalUi";
88
import { isEnableSubscription } from "../constant/const";
9+
import { fetchSubscription } from "../constant/Utils";
10+
import { useNavigate } from "react-router-dom";
911
const BulkSendUi = (props) => {
1012
const { t } = useTranslation();
13+
const navigate = useNavigate();
1114
const [forms, setForms] = useState([]);
1215
const [formId, setFormId] = useState(2);
1316
const formRef = useRef(null);
@@ -25,6 +28,7 @@ const BulkSendUi = (props) => {
2528
});
2629
const [isQuotaReached, setIsQuotaReached] = useState(false);
2730
const [isLoader, setIsLoader] = useState(false);
31+
const [isFreePlan, setIsFreePlan] = useState(false);
2832
const allowedSigners = 50;
2933
useEffect(() => {
3034
signatureExist();
@@ -36,6 +40,10 @@ const BulkSendUi = (props) => {
3640
if (isEnableSubscription) {
3741
setIsLoader(true);
3842
try {
43+
const subscription = await fetchSubscription();
44+
if (subscription?.plan === "freeplan") {
45+
setIsFreePlan(true);
46+
}
3947
const allowedquicksend = await Parse.Cloud.run("allowedquicksend");
4048
if (allowedquicksend > 0) {
4149
setIsBulkAvailable(true);
@@ -273,6 +281,9 @@ const BulkSendUi = (props) => {
273281
const handleCloseQuotaReached = () => {
274282
setIsQuotaReached(false);
275283
};
284+
const handleNavigation = () => {
285+
navigate("/subscription");
286+
};
276287
return (
277288
<>
278289
{isLoader ? (
@@ -385,46 +396,62 @@ const BulkSendUi = (props) => {
385396
)}
386397
</>
387398
) : (
388-
<form onSubmit={handleAddOnQuickSubmit} className="p-3">
389-
<p className="flex justify-center text-center mx-2 mb-3 text-base op-text-accent font-medium">
390-
{t("additional-quicksend")}
391-
</p>
392-
<div className="mb-3 flex justify-between">
393-
<label
394-
htmlFor="quantity"
395-
className="block text-xs text-gray-700 font-semibold"
396-
>
397-
{t("quantityofquicksend")}
398-
<span className="text-[red] text-[13px]">*</span>
399-
</label>
400-
<select
401-
value={amount.quantity}
402-
onChange={(e) => handlePricePerQuick(e)}
403-
name="quantity"
404-
className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-1/4 text-xs"
405-
required
406-
>
407-
{quantityList.length > 0 &&
408-
quantityList.map((x) => (
409-
<option key={x} value={x}>
410-
{x}
411-
</option>
412-
))}
413-
</select>
414-
</div>
415-
<div className="mb-3 flex justify-between">
416-
<label className="block text-xs text-gray-700 font-semibold">
417-
{t("Price")} (1 * {amount.priceperbulksend})
418-
</label>
419-
<div className="w-1/4 flex justify-center items-center text-sm">
420-
USD {amount.price}
399+
<>
400+
{isFreePlan ? (
401+
<div className="w-full h-[130px] flex flex-col justify-center items-center text-center p-4">
402+
<p className="text-base font-medium mb-2.5">
403+
{t("bulksendsubcriptionalert")}
404+
</p>
405+
<button
406+
onClick={() => handleNavigation()}
407+
className="op-btn op-btn-primary"
408+
>
409+
{t("upgrade-now")}
410+
</button>
421411
</div>
422-
</div>
423-
<hr className="text-base-content mb-3" />
424-
<button className="op-btn op-btn-primary w-full mt-2">
425-
{t("Proceed")}
426-
</button>
427-
</form>
412+
) : (
413+
<form onSubmit={handleAddOnQuickSubmit} className="p-3">
414+
<p className="flex justify-center text-center mx-2 mb-3 text-base op-text-accent font-medium">
415+
{t("additional-quicksend")}
416+
</p>
417+
<div className="mb-3 flex justify-between">
418+
<label
419+
htmlFor="quantity"
420+
className="block text-xs text-gray-700 font-semibold"
421+
>
422+
{t("quantityofquicksend")}
423+
<span className="text-[red] text-[13px]">*</span>
424+
</label>
425+
<select
426+
value={amount.quantity}
427+
onChange={(e) => handlePricePerQuick(e)}
428+
name="quantity"
429+
className="op-select op-select-bordered op-select-sm focus:outline-none hover:border-base-content w-1/4 text-xs"
430+
required
431+
>
432+
{quantityList.length > 0 &&
433+
quantityList.map((x) => (
434+
<option key={x} value={x}>
435+
{x}
436+
</option>
437+
))}
438+
</select>
439+
</div>
440+
<div className="mb-3 flex justify-between">
441+
<label className="block text-xs text-gray-700 font-semibold">
442+
{t("Price")} (1 * {amount.priceperbulksend})
443+
</label>
444+
<div className="w-1/4 flex justify-center items-center text-sm">
445+
USD {amount.price}
446+
</div>
447+
</div>
448+
<hr className="text-base-content mb-3" />
449+
<button className="op-btn op-btn-primary w-full mt-2">
450+
{t("Proceed")}
451+
</button>
452+
</form>
453+
)}
454+
</>
428455
)}
429456
</>
430457
)}

apps/OpenSign/src/pages/GenerateToken.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import Tooltip from "../primitives/Tooltip";
99
import Loader from "../primitives/Loader";
1010
import SubscribeCard from "../primitives/SubscribeCard";
1111
import Tour from "reactour";
12-
import { validplan } from "../json/plansArr";
1312
import { useTranslation } from "react-i18next";
1413
import Parse from "parse";
1514

@@ -65,7 +64,7 @@ function GenerateToken() {
6564
};
6665
const handleSubmit = async (e) => {
6766
e.preventDefault();
68-
if (!validplan[isSubscribe.plan] && isEnableSubscription) {
67+
if (isSubscribe?.plan === "freeplan" && isEnableSubscription) {
6968
setIsTour(true);
7069
} else {
7170
setIsLoader(true);
@@ -103,11 +102,15 @@ function GenerateToken() {
103102
setTimeout(() => setIsAlert({ type: "success", msg: "" }), 1500); // Reset copied state after 1.5 seconds
104103
};
105104
const handleModal = () => {
106-
setIsModal((obj) => ({ ...obj, generateapi: !obj.generateapi }));
105+
if (isSubscribe?.plan === "freeplan" && isEnableSubscription) {
106+
setIsTour(true);
107+
} else {
108+
setIsModal((obj) => ({ ...obj, generateapi: !obj.generateapi }));
109+
}
107110
};
108111

109112
const handleBuyAPIsModal = () => {
110-
if (!validplan[isSubscribe.plan] && isEnableSubscription) {
113+
if (isSubscribe?.plan === "freeplan" && isEnableSubscription) {
111114
setIsTour(true);
112115
} else {
113116
setIsModal((obj) => ({ ...obj, buyapis: !obj.buyapis }));
@@ -176,16 +179,18 @@ function GenerateToken() {
176179
<span
177180
id="token"
178181
className={`${
179-
validplan[isSubscribe.plan]
180-
? ""
181-
: "bg-white/20 pointer-events-none select-none"
182+
isSubscribe?.plan === "freeplan"
183+
? "bg-white/20 pointer-events-none select-none"
184+
: ""
182185
} md:text-end py-2 md:py-0`}
183186
>
184187
<span
185188
className="cursor-pointer"
186189
onClick={() => copytoclipboard(apiToken)}
187190
>
188-
{apiToken ? apiToken : "_____"}
191+
{isSubscribe?.plan !== "freeplan" && apiToken
192+
? apiToken
193+
: "_____"}
189194
</span>
190195
<button
191196
className="op-btn op-btn-accent op-btn-outline op-btn-sm ml-2 cursor-pointer"
@@ -303,9 +308,9 @@ function GenerateToken() {
303308
</form>
304309
</ModalUi>
305310
</div>
306-
{!validplan[isSubscribe.plan] && isEnableSubscription && (
311+
{isSubscribe?.plan === "freeplan" && isEnableSubscription && (
307312
<div data-tut="apisubscribe">
308-
<SubscribeCard plan_code={isSubscribe.plan} />
313+
<SubscribeCard plan_code={isSubscribe?.plan} />
309314
</div>
310315
)}
311316
</>

apps/OpenSignServer/package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/OpenSignServer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@signpdf/placeholder-pdf-lib": "^3.2.4",
2525
"@signpdf/signer-p12": "^3.2.4",
2626
"@signpdf/signpdf": "^3.2.4",
27-
"aws-sdk": "^2.1674.0",
27+
"aws-sdk": "^2.1681.0",
2828
"axios": "^1.7.4",
2929
"cors": "^2.8.5",
3030
"dotenv": "^16.4.5",
@@ -52,7 +52,7 @@
5252
"@babel/eslint-parser": "^7.25.1",
5353
"eslint": "^9.9.0",
5454
"jasmine": "^5.2.0",
55-
"mongodb-runner": "^5.6.4",
55+
"mongodb-runner": "^5.6.5",
5656
"nodemon": "^3.1.4",
5757
"nyc": "^17.0.0",
5858
"prettier": "^3.3.3"

0 commit comments

Comments
 (0)