Merge branch 'staging' of https://github.com/OpenSignLabs/OpenSign into raktima-patch-2

This commit is contained in:
RaktimaNXG
2024-09-06 15:23:31 +05:30
13 changed files with 56 additions and 59 deletions
@@ -633,9 +633,9 @@
"decline-by":"Declined/revoked by",
"document-declined": "Document declined",
"Add-Webhook":"Add Webhook",
"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.",
"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 youre using Yarn, you can replace npm install with yarn add opensign-react.",
@@ -633,9 +633,9 @@
"decline-by" :"Refusé/révoqué par",
"document-declined":"document refusé",
"Add-Webhook":"Ajouter Webhook",
"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.",
"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.",
+3 -1
View File
@@ -77,7 +77,9 @@ const BulkSendUi = (props) => {
const addoncredits = resCredits?.addoncredits || 0;
const totalcredits = allowedcredits + addoncredits;
if (totalcredits > 0) {
setIsBulkAvailable(true);
if (subscription?.plan !== "freeplan") {
setIsBulkAvailable(true);
}
}
setAmount((obj) => ({ ...obj, totalcredits: totalcredits }));
}
+17 -8
View File
@@ -13,6 +13,8 @@ import {
import { isEnableSubscription, isStaging } from "../constant/const";
import { validplan } from "../json/plansArr";
import { useTranslation } from "react-i18next";
import ModalUi from "../primitives/ModalUi";
import QuotaCard from "../primitives/QuotaCard";
const Header = ({ showSidebar }) => {
const { t, i18n } = useTranslation();
@@ -27,6 +29,7 @@ const Header = ({ showSidebar }) => {
localStorage.getItem("appLogo") || " "
);
const [emailUsed, setEmailUsed] = useState(0);
const [isModal, setIsModal] = useState(false);
const toggleDropdown = () => {
setIsOpen(!isOpen);
@@ -111,6 +114,9 @@ const Header = ({ showSidebar }) => {
const handleNavigation = () => {
navigate("/subscription");
};
const handleMailUsed = () => {
setIsModal(!isModal);
};
return (
<div>
{isEnableSubscription && (
@@ -203,14 +209,6 @@ const Header = ({ showSidebar }) => {
tabIndex={0}
className="mt-3 z-[1] p-2 shadow op-menu op-menu-sm op-dropdown-content text-base-content bg-base-100 rounded-box w-52"
>
{isEnableSubscription && isTeam?.plan === "freeplan" && (
<li className="cursor-pointer">
<span>
<i className="fa-light fa-envelope"></i> Email used:{" "}
{emailUsed}/20
</span>
</li>
)}
<li onClick={() => openInNewTab("https://docs.opensignlabs.com")}>
<span>
<i className="fa-light fa-book"></i> {t("docs")}
@@ -241,6 +239,14 @@ const Header = ({ showSidebar }) => {
<i className="fa-light fa-id-card"></i> Console
</span>
</li>
{isEnableSubscription && isTeam?.plan === "freeplan" && (
<li className="cursor-pointer" onClick={handleMailUsed}>
<span>
<i className="fa-light fa-envelope"></i>
{emailUsed}/20 sent this month
</span>
</li>
)}
<li onClick={closeDropdown}>
<span>
<i className="fa-light fa-arrow-right-from-bracket"></i>{" "}
@@ -251,6 +257,9 @@ const Header = ({ showSidebar }) => {
</div>
</div>
</div>
<ModalUi isOpen={isModal}>
<QuotaCard isPaidInfo={true} handlClose={handleMailUsed} />
</ModalUi>
</div>
);
};
@@ -15,8 +15,7 @@ function EmailComponent({
sender,
setIsAlert,
extUserId,
activeMailAdapter,
planCode
activeMailAdapter
}) {
const { t } = useTranslation();
const [emailList, setEmailList] = useState([]);
@@ -51,7 +50,6 @@ function EmailComponent({
recipient: emailList[i],
subject: `${sender.name} has signed the doc - ${pdfName}`,
from: sender.email,
plan: planCode,
html:
"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body> <div style='background-color:#f5f5f5;padding:20px'> <div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'> <div><img src=" +
imgPng +
@@ -85,12 +83,6 @@ function EmailComponent({
setEmailList([]);
}, 1500);
setIsLoading(false);
} else if (sendMail?.data?.result?.status === "quota-reached") {
setIsLoading(false);
setIsEmail(false);
setIsAlert({ isShow: true, alertMessage: "quotareached" });
setEmailValue("");
setEmailList([]);
} else {
setIsLoading(false);
setIsEmail(false);
+5 -22
View File
@@ -57,7 +57,6 @@ import PdfZoom from "../components/pdf/PdfZoom";
import Loader from "../primitives/Loader";
import { useTranslation } from "react-i18next";
import RotateAlert from "../components/RotateAlert";
import QuotaCard from "../primitives/QuotaCard";
//For signYourself inProgress section signer can add sign and complete doc sign.
function SignYourSelf() {
const { t } = useTranslation();
@@ -1241,29 +1240,14 @@ function SignYourSelf() {
<div className="w-full md:w-[95%]">
<ModalUi
isOpen={isAlert.isShow}
title={
isAlert.alertMessage === "quotareached"
? false
: isAlert?.header || t("alert")
}
title={isAlert?.header || t("alert")}
handleClose={() =>
isAlert.alertMessage === "quotareached"
? false
: setIsAlert({ isShow: false, alertMessage: "" })
setIsAlert({ isShow: false, alertMessage: "" })
}
>
{isAlert.alertMessage === "quotareached" ? (
<QuotaCard
isSignyourself={true}
handlClose={() =>
setIsAlert({ isShow: false, alertMessage: "" })
}
/>
) : (
<div className="p-[20px] h-full">
<p>{isAlert.alertMessage}</p>
</div>
)}
<div className="p-[20px] h-full">
<p>{isAlert.alertMessage}</p>
</div>
</ModalUi>
{/* this modal is used show this document is already sign */}
@@ -1343,7 +1327,6 @@ function SignYourSelf() {
setIsAlert={setIsAlert}
extUserId={extUserId}
activeMailAdapter={activeMailAdapter}
planCode={isSubscribe?.plan}
/>
{/* pdf header which contain funish back button */}
<Header
+4 -3
View File
@@ -2,10 +2,10 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
const QuotaCard = ({ isSignyourself, handlClose }) => {
const QuotaCard = ({ isPaidInfo, handlClose }) => {
const { t } = useTranslation();
const navigate = useNavigate();
return isSignyourself ? (
return isPaidInfo ? (
<>
<div
className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-primary-content absolute right-2 top-2 z-40"
@@ -18,7 +18,8 @@ const QuotaCard = ({ isSignyourself, handlClose }) => {
<h2 className="op-card-title">
{t("upgrade-to") + " Paid " + t("plan")}
</h2>
<p>{t("quotamailselfsign")}</p>
<p>{t("quotamailinfo")}</p>
<p>{t("quotamailTip")}</p>
<div className="op-card-actions justify-end">
<button
onClick={() => navigate("/subscription")}
@@ -628,9 +628,9 @@
"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 youve 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",
"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.",
"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}}>."
@@ -628,9 +628,9 @@
"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 à lun 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",
"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.",
"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",
"unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>."
@@ -81,6 +81,7 @@ export default async function createDocumentWithTemplate(request, response) {
objectId: extUser.get('TenantId').id,
});
subscription.include('ExtUserPtr');
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
const resSub = await subscription.first({ useMasterKey: true });
if (resSub) {
const _resSub = JSON.parse(JSON.stringify(resSub));
@@ -404,7 +405,9 @@ export default async function createDocumentWithTemplate(request, response) {
.json({ error: 'Quota reached, Please buy credits and try again later.' });
}
} else {
return response.status(400).json({ error: 'Please buy subscriptions.' });
return response.status(400).json({
error: 'Please purchase or renew your subscription.',
});
}
} else {
return response.status(405).json({ error: 'Invalid API Token!' });
@@ -95,6 +95,7 @@ export default async function createDocumentwithCoordinate(request, response) {
objectId: extUser.get('TenantId').id,
});
subscription.include('ExtUserPtr');
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
const resSub = await subscription.first({ useMasterKey: true });
if (resSub) {
const _resSub = JSON.parse(JSON.stringify(resSub));
@@ -422,7 +423,9 @@ export default async function createDocumentwithCoordinate(request, response) {
.json({ error: 'Quota reached, Please buy credits and try again later.' });
}
} else {
return response.status(400).json({ error: 'Please buy subscriptions.' });
return response.status(400).json({
error: 'Please purchase or renew your subscription.',
});
}
} else {
return response.status(405).json({ error: 'Invalid API Token!' });
@@ -211,6 +211,7 @@ export default async function createBatchDocs(request) {
objectId: _resExt.TenantId.objectId,
});
subscription.include('ExtUserPtr');
subscription.greaterThanOrEqualTo('Next_billing_date', new Date());
const resSub = await subscription.first({ useMasterKey: true });
if (resSub) {
const _resSub = JSON.parse(JSON.stringify(resSub));
@@ -240,7 +241,10 @@ export default async function createBatchDocs(request) {
);
}
} else {
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Please buy subscriptions.');
throw new Parse.Error(
Parse.Error.INVALID_QUERY,
'Please purchase or renew your subscription.'
);
}
} else {
const response = await axios.post('batch', { requests: requests[0] }, parseConfig);
@@ -225,7 +225,7 @@ async function sendmailv3(req) {
const nonCustomMail = await sendMailProvider(req, Plan, true);
return nonCustomMail;
} else {
if (MonthlyFreeEmails >= 20) {
if (MonthlyFreeEmails >= 15) {
return { status: 'quota-reached' };
} else {
const nonCustomMail = await sendMailProvider(req, Plan);