Merge pull request #1156 from OpenSignLabs/raktima-patch-3

feat: display the email of the user who declined the document along with the decline reason in the document decline popup.
This commit is contained in:
prafull-opensignlabs
2024-09-03 20:47:59 +05:30
committed by GitHub
7 changed files with 86 additions and 5 deletions
@@ -627,6 +627,9 @@
"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 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.",
"reason":"Reason",
"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.",
@@ -627,6 +627,9 @@
"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 à 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.",
"reason" :"Raison",
"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.",
+1 -1
View File
@@ -1411,7 +1411,7 @@ export const multiSignEmbed = async (
};
const color = position?.options?.fontColor;
const updateColorInRgb = getWidgetsFontColor(color);
const fontSize = parseInt(position?.options?.fontSize);
const fontSize = parseInt(position?.options?.fontSize || 13);
const widgetTypeExist = [
textWidget,
textInputWidget,
+34 -3
View File
@@ -1216,7 +1216,15 @@ function PdfRequestFiles(props) {
);
const jsonSender = JSON.parse(senderUser);
setIsDecline({ isDeclined: false });
const data = { IsDeclined: true, DeclineReason: reason };
const data = {
IsDeclined: true,
DeclineReason: reason,
DeclineBy: {
__type: "Pointer",
className: "_User",
objectId: jsonSender?.objectId
}
};
setIsUiLoading(true);
await axios
@@ -1277,6 +1285,8 @@ function PdfRequestFiles(props) {
})
.catch((err) => {
console.log("error updating field is decline ", err);
setIsUiLoading(false);
alert(t("something-went-wrong-mssg"));
});
};
//function to add default signature for all requested placeholder of sign
@@ -1575,6 +1585,23 @@ function PdfRequestFiles(props) {
const name = pdfDetails?.[0]?.Name;
await fetchUrl(url, name);
};
const handleDeclineMssg = () => {
const user = pdfDetails[0]?.DeclineBy?.email;
return (
<div>
{t("decline-alert-3")}
<div className="mt-2">
{" "}
<span className="font-medium">{t("reason")}</span> :{" "}
{pdfDetails[0]?.DeclineReason}{" "}
</div>
<div className="mt-2">
{" "}
<span className="font-medium">{t("decline-by")}</span> : {user}
</div>
</div>
);
};
return (
<DndProvider backend={HTML5Backend}>
<Title title={props.templateId ? "Public Sign" : "Request Sign"} />
@@ -1664,13 +1691,17 @@ function PdfRequestFiles(props) {
{/* this modal is used to show decline alert */}
<PdfDeclineModal
show={isDecline.isDeclined}
headMsg={t("document-decline")}
headMsg={
pdfDetails[0]?.IsDeclined
? t("document-declined")
: t("document-decline")
}
bodyMssg={
isDecline.currnt === "Sure"
? t("decline-alert-1")
: isDecline.currnt === "YouDeclined"
? t("decline-alert-2")
: isDecline.currnt === "another" && t("decline-alert-3")
: isDecline.currnt === "another" && handleDeclineMssg()
}
footerMessage={isDecline.currnt === "Sure"}
declineDoc={declineDoc}
@@ -473,9 +473,21 @@ const ReportTable = (props) => {
};
//function to handle revoke/decline docment
const handleRevoke = async (item) => {
const senderUser = localStorage.getItem(
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
);
const jsonSender = JSON.parse(senderUser);
setIsRevoke({});
setActLoader({ [`${item.objectId}`]: true });
const data = { IsDeclined: true, DeclineReason: reason };
const data = {
IsDeclined: true,
DeclineReason: reason,
DeclineBy: {
__type: "Pointer",
className: "_User",
objectId: jsonSender?.objectId
}
};
await axios
.put(
`${localStorage.getItem("baseUrl")}classes/contracts_Document/${
@@ -22,6 +22,7 @@ export default async function getDocument(request) {
query.include('Signers');
query.include('AuditTrail.UserPtr');
query.include('Placeholders');
query.include('DeclineBy');
query.notEqualTo('IsArchive', true);
const res = await query.first({ useMasterKey: true });
if (res) {
@@ -0,0 +1,31 @@
/**
*
* @param {Parse} Parse
*/
exports.up = async Parse => {
// TODO: set className here
const className = 'contracts_Document';
const schema = new Parse.Schema(className);
schema.addPointer('DeclineBy', '_User');
// TODO: Set the schema here
// Example:
// schema.addString('name').addNumber('cash');
return schema.update();
};
/**
*
* @param {Parse} Parse
*/
exports.down = async Parse => {
// TODO: set className here
const className = 'contracts_Document';
const schema = new Parse.Schema(className);
schema.deleteField('DeclineBy');
// TODO: Set the schema here
// Example:
// schema.deleteField('name').deleteField('cash');
return schema.update();
};