Skip to content

Commit 73f02b8

Browse files
Merge branch 'master' into feature/add-and-configure-linter
2 parents fd4b4d1 + 021e524 commit 73f02b8

File tree

6 files changed

+2727
-1643
lines changed

6 files changed

+2727
-1643
lines changed

demo_documents/order_form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h4>Ordered by {signerName}</h4>
2929
<tr>
3030
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Harmonica</td>
3131
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
32-
<span style="color:white;">/l1q/</span>
32+
<span style="color:black;">/l1q/</span>
3333
</td>
3434
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$5</td>
3535
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
@@ -39,7 +39,7 @@ <h4>Ordered by {signerName}</h4>
3939
<tr>
4040
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Xylophone</td>
4141
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
42-
<span style="color:white;">/l2q/</span>
42+
<span style="color:black;">/l2q/</span>
4343
</td>
4444
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$150</td>
4545
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">

lib/eSignature/examples/embeddedSigningCFR.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const sendEnvelopeForEmbeddedSigning = async (args) => {
1818
// args.accessToken
1919
// args.accountId
2020

21+
//ds-snippet-start:eSign41Step2
2122
let dsApiClient = new docusign.ApiClient();
2223
dsApiClient.setBasePath(args.basePath);
2324
dsApiClient.addDefaultHeader('Authorization', 'Bearer ' + args.accessToken);
@@ -36,7 +37,7 @@ const sendEnvelopeForEmbeddedSigning = async (args) => {
3637
workflowId = workflow.workflowId;
3738
}
3839
});
39-
// Step 3 end
40+
//ds-snippet-end:eSign41Step2
4041

4142
if (workflowId === null) {
4243
throw new Error('IDENTITY_WORKFLOW_INVALID_ID');
@@ -47,25 +48,30 @@ const sendEnvelopeForEmbeddedSigning = async (args) => {
4748
let envelopesApi = new docusign.EnvelopesApi(dsApiClient);
4849
let results = null;
4950

50-
// Step 1. Make the envelope request body
51+
// Make the envelope request body
52+
//ds-snippet-start:eSign41Step4
5153
let envelope = makeEnvelope(args.envelopeArgs);
5254

53-
// Step 2. call Envelopes::create API method
55+
// call Envelopes::create API method
5456
// Exceptions will be caught by the calling function
5557
results = await envelopesApi.createEnvelope(args.accountId, {
5658
envelopeDefinition: envelope,
5759
});
5860

5961
let envelopeId = results.envelopeId;
62+
//ds-snippet-end:eSign41Step4
6063
console.log(`Envelope was created. EnvelopeId ${envelopeId}`);
6164

62-
// Step 3. create the recipient view, the embedded signing
65+
// create the recipient view, the embedded signing
66+
//ds-snippet-start:eSign41Step6
6367
let viewRequest = makeRecipientViewRequest(args.envelopeArgs);
68+
6469
// Call the CreateRecipientView API
6570
// Exceptions will be caught by the calling function
6671
results = await envelopesApi.createRecipientView(args.accountId, envelopeId, {
6772
recipientViewRequest: viewRequest,
6873
});
74+
//ds-snippet-end:eSign41Step6
6975

7076
return { envelopeId: envelopeId, redirectUrl: results.url };
7177
};
@@ -77,6 +83,7 @@ const sendEnvelopeForEmbeddedSigning = async (args) => {
7783
* @returns {Envelope} An envelope definition
7884
* @private
7985
*/
86+
//ds-snippet-start:eSign41Step3
8087
function makeEnvelope(args) {
8188
// Data for this method
8289
// args.signerEmail
@@ -149,7 +156,9 @@ function makeEnvelope(args) {
149156

150157
return env;
151158
}
159+
//ds-snippet-end:eSign41Step3
152160

161+
//ds-snippet-start:eSign41Step5
153162
function makeRecipientViewRequest(args) {
154163
// Data for this method
155164
// args.dsReturnUrl
@@ -192,5 +201,6 @@ function makeRecipientViewRequest(args) {
192201

193202
return viewRequest;
194203
}
204+
//ds-snippet-end:eSig41Step5
195205

196206
module.exports = { sendEnvelopeForEmbeddedSigning };

lib/eSignature/examples/responsiveSigning.js

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,70 @@ function makeEnvelope(args) {
9595
recipientId: '2',
9696
});
9797

98+
// add formula tabs
99+
const price1 = 5;
100+
const formulaTab1 = docusign.FormulaTab.constructFromObject({
101+
font: 'helvetica',
102+
fontSize: 'size11',
103+
fontColor: 'black',
104+
anchorString: '/l1e/',
105+
anchorYOffset: '-8',
106+
anchorUnits: 'pixels',
107+
anchorXOffset: '105',
108+
tabLabel: 'l1e',
109+
formula: `[l1q] * ${price1}`,
110+
roundDecimalPlaces: '0',
111+
required: 'true',
112+
locked: 'true',
113+
disableAutoSize: 'false',
114+
});
115+
116+
const price2 = 150;
117+
const formulaTab2 = docusign.FormulaTab.constructFromObject({
118+
font: 'helvetica',
119+
fontSize: 'size11',
120+
fontColor: 'black',
121+
anchorString: '/l2e/',
122+
anchorYOffset: '-8',
123+
anchorUnits: 'pixels',
124+
anchorXOffset: '105',
125+
tabLabel: 'l2e',
126+
formula: `[l2q] * ${price2}`,
127+
roundDecimalPlaces: '0',
128+
required: 'true',
129+
locked: 'true',
130+
disableAutoSize: 'false',
131+
});
132+
133+
const formulaTab3 = docusign.FormulaTab.constructFromObject({
134+
font: 'helvetica',
135+
fontSize: 'size11',
136+
fontColor: 'black',
137+
anchorString: '/l3t/',
138+
anchorYOffset: '-8',
139+
anchorUnits: 'pixels',
140+
anchorXOffset: '105',
141+
tabLabel: 'l3t',
142+
formula: '[l1e] + [l2e]',
143+
roundDecimalPlaces: '0',
144+
required: 'true',
145+
locked: 'true',
146+
disableAutoSize: 'false',
147+
bold: 'true',
148+
});
149+
150+
const signerTabs = docusign.Tabs.constructFromObject({
151+
formulaTabs: [formulaTab1, formulaTab2, formulaTab3]
152+
});
153+
signer.tabs = signerTabs;
154+
98155
// Add the recipients to the envelope object
99156
let recipients = docusign.Recipients.constructFromObject({
100157
signers: [signer],
101158
carbonCopies: [cc],
102159
});
103160

104161
// add the document
105-
106162
let htmlDefinition = new docusign.DocumentHtmlDefinition();
107163
htmlDefinition.source = getHTMLDocument(args);
108164

@@ -145,9 +201,9 @@ function getHTMLDocument(args) {
145201
.replace('{signerEmail}', args.signerEmail)
146202
.replace('{ccName}', args.ccName)
147203
.replace('{ccEmail}', args.ccEmail)
148-
.replace('/sn1/', '<ds-signature data-ds-role="Signer"/>')
149-
.replace('/l1q/', '<input data-ds-type="number"/>')
150-
.replace('/l2q/', '<input data-ds-type="number"/>');
204+
.replace('/sn1/', '<ds-signature data-ds-role=\"Signer\"/>')
205+
.replace('/l1q/', '<input data-ds-type=\"number\" name=\"l1q\"/>')
206+
.replace('/l2q/', '<input data-ds-type=\"number\" name=\"l2q\"/>');
151207
}
152208

153209
function makeRecipientViewRequest(args) {

0 commit comments

Comments
 (0)