mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
Merge pull request #1168 from OpenSignLabs/validation
This commit is contained in:
@@ -631,9 +631,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",
|
||||
"unauthorized-modal":"You don't have permission to perform this action, please contact {{adminName}}<{{adminEmail}}>."
|
||||
|
||||
|
||||
@@ -631,9 +631,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",
|
||||
"unauthorized-modal":"Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminName}}<{{adminEmail}}>."
|
||||
|
||||
|
||||
@@ -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 }));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 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",
|
||||
"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 à 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",
|
||||
"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}}>."
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user