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:
RaktimaNXG
2024-09-03 19:48:21 +05:30
parent cb5bcd72e4
commit 9675e051bd
6 changed files with 76 additions and 6 deletions
@@ -623,5 +623,10 @@
"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 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."
"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"
}
@@ -624,5 +624,8 @@
"generate-test-token": "Générer jeton de test",
"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."
"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é"
}
+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,
+33 -3
View File
@@ -1213,7 +1213,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
@@ -1572,6 +1580,24 @@ 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>
);
};
console.log("signerpos", signerPos);
return (
<DndProvider backend={HTML5Backend}>
<Title title={props.templateId ? "Public Sign" : "Request Sign"} />
@@ -1659,13 +1685,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}
@@ -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();
};