Skip to content

Commit 5c3c99f

Browse files
committed
example done
1 parent ffba8cb commit 5c3c99f

File tree

4 files changed

+30
-49
lines changed

4 files changed

+30
-49
lines changed

lib/click/controllers/eg006EmbedClickwrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
if (results) {
7575
// Save for use by other examples that need an clickwrapId
7676
const example = getExampleByNumber(res.locals.manifest, exampleNumber);
77-
res.render("pages/example_done", {
77+
res.render("pages/example_click6_done", {
7878
title: example.ExampleName,
7979
message: example.ResultsPageText,
8080
agreementUrl: JSON.parse(JSON.stringify(results)).agreementUrl

lib/click/examples/embedClickwrap.js

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,6 @@
2020
*/
2121
const embedClickwrap = async (args) => {
2222
// Step 3. Construct the request Body
23-
// Create display settings model
24-
// const displaySettings = docusignClick.DisplaySettings.constructFromObject({
25-
// consentButtonText: "I Agree",
26-
// displayName: "Terms of Service",
27-
// downloadable: true,
28-
// format: "modal",
29-
// hasAccept: true,
30-
// mustRead: true,
31-
// requireAccept: true,
32-
// documentDisplay: "document",
33-
// // fullName: args.fullName,
34-
// // email: args.email,
35-
// // company: args.company,
36-
// // title: args.title,
37-
// // date: args.date,
38-
// });
39-
40-
// Create document model
41-
// Read and encode file. Put encoded value to Document entity.
42-
// The reads could raise an exception if the file is not available!
43-
// const documentPdfExample = fs.readFileSync(args.docFile);
44-
// const encodedExampleDocument =
45-
// Buffer.from(documentPdfExample).toString("base64");
46-
// const document = docusignClick.Document.constructFromObject({
47-
// documentBase64: encodedExampleDocument,
48-
// documentName: "Terms of Service",
49-
// fileExtension: "pdf",
50-
// // fullName: args.fullName,
51-
// // email: args.email,
52-
// // company: args.company,
53-
// // title: args.title,
54-
// // date: args.date,
55-
// order: 0,
56-
57-
// });
58-
59-
// Create clickwrapRequest model
60-
// const clickwrapRequest = docusignClick.ClickwrapRequest.constructFromObject({
61-
// displaySettings,
62-
// documents: [document],
63-
// name: args.clickwrapName,
64-
// requireReacceptance: true,
65-
// });
66-
6723
const documentArgs = {
6824
fullName: args.documentArgs.fullName,
6925
email: args.documentArgs.email,
@@ -83,7 +39,6 @@
8339
title: documentArgs.jobTitle,
8440
date: documentArgs.date,
8541
},
86-
// requireReacceptance: true,
8742
});
8843

8944

@@ -98,7 +53,7 @@
9853
args.accountId, args.clickwrapId, {
9954
userAgreementRequest: userAgreement
10055
});
101-
console.log(`See the embedded clickwrap in the dialog box.`);
56+
console.log(`See the embedded clickwrap on this page:`);
10257
return result;
10358
};
10459

views/pages/click-examples/eg006EmbedClickwrap.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
</div>
4545
4646
<div class="form-group">
47-
<label for="jobTitle"><%= example.Forms[0].Inputs[4].InputName %></label>
48-
<input type="text" class="form-control" id="jobTitle" name="jobTitle"
47+
<label for="title"><%= example.Forms[0].Inputs[4].InputName %></label>
48+
<input type="text" class="form-control" id="title" name="title"
4949
placeholder="<%= example.Forms[0].Inputs[3].InputPlaceholder %>" required/>
5050
</div>
5151
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<%- include("../partials/genericHead") %>
2+
3+
<h2><%= title %></h2>
4+
<p><%- message %></p>
5+
6+
<p>Agreement URL received back from the API call: <%- agreementUrl %></p>
7+
8+
<p id="agreementStatus">
9+
<%- locals.manifest.SupportingTexts.HelpingTexts.NOTAGREED %>
10+
</p>
11+
12+
<div id="ds-terms-of-service"></div>
13+
<script src="https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js"></script>
14+
<script>docuSignClick.Clickwrap.render({
15+
agreementUrl: agreementUrl,
16+
onAgreed: function() {
17+
// Triggered if the user has just agreed
18+
document.getElementById("agreementStatus").innerHTML = "<%- locals.manifest.SupportingTexts.HelpingTexts.AGREED %>";
19+
}
20+
}, "#ds-terms-of-service");
21+
</script>
22+
23+
24+
<p><a href="/">Continue</a></p>
25+
26+
<%- include("../partials/genericFoot") %>

0 commit comments

Comments
 (0)