Skip to content

Commit c53d03e

Browse files
Mysure updates (#66)
* branding updates
1 parent cee8304 commit c53d03e

File tree

10 files changed

+84
-33
lines changed

10 files changed

+84
-33
lines changed

app/api/requests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def envelope_list():
9898
except TypeError:
9999
return jsonify(message='Invalid JSON input'), 400
100100

101+
user_documents = session.get('ds_documents', [])
102+
101103
try:
102-
envelopes = Envelope.list(envelope_args, session['ds_documents'], session)
104+
envelopes = Envelope.list(envelope_args, user_documents, session)
103105
except ApiException as exc:
104106
return process_error(exc)
105107
return jsonify({'envelopes': envelopes})

app/document.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
EnvelopeDefinition,
77
Tabs,
88
Email,
9-
InitialHere,
109
SignHere,
1110
Signer,
1211
Checkbox,
@@ -86,14 +85,6 @@ def create_claim(cls, tpl, claim, envelope_args):
8685
anchor_x_offset='20'
8786
)
8887

89-
# Create an initials tab
90-
initial_here = InitialHere(
91-
anchor_string='/initials_1/',
92-
anchor_units='pixels',
93-
anchor_y_offset='10',
94-
anchor_x_offset='20'
95-
)
96-
9788
# Create an email field
9889
email = Email(
9990
document_id='1',
@@ -115,7 +106,6 @@ def create_claim(cls, tpl, claim, envelope_args):
115106
signer.tabs = Tabs(
116107
sign_here_tabs=[sign_here],
117108
email_tabs=[email],
118-
initial_here_tabs=[initial_here],
119109
signer_attachment_tabs=[signer_attachment_tabs],
120110

121111
)

app/envelope.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def list(envelope_args, user_documents, session):
7676
access_token = session.get('access_token')
7777
account_id = session.get('account_id')
7878

79+
if not access_token or not account_id:
80+
return []
81+
7982
ds_client = DsClient.get_configured_instance(access_token)
8083
envelope_api = EnvelopesApi(ds_client)
8184
envelopes_info = envelope_api.list_status_changes(

public/locales/en/BuyNewInsurance.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
},
9494
"ApiDecription": {
9595
"SeeMore": "- See behind the scenes",
96-
"CodeFlow": "<h3>This sample features:</h3><ul><li>Update recipient information<li>Create envelope from HTML import<li>Fill tab data<li>Embedded signing (recipient view)<li>Request payment</li><li>Formula field</li></ul><p><strong>Note</strong>: This scenario uses <a target=\"_blank\" href=\"https://www.docusign.com/products/payments\">Docusign Payments</a>. To complete the transaction, you will need to set up a <a target=\"_blank\" href=\"https://support.docusign.com/en/guides/managing-payment-gateways\">payment gateway</a> on your account. </p><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, we use the <a target=\"_blank\" href=\"https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create\">Envelopes: create</a> method to send the signature request with the corresponding form information. The envelope we construct contains a <code>document</code> object, a <code>recipient</code> object of type <code>signer</code>, and <code>tabs,</code> which contain the form fields information. Since we are using embedded signing, we must also set the <code>clientUserId</code> property on the recipient.</p><p>We place the tabs on the document by specifying a <code>SignHereTab</code> element and a <code>PaymentTab</code> element as part of the <code>signer</code> element. The tab elements are positioned using <em>x/y</em> coordinates on the <code>document</code>.</p><p>The <code>PaymentTab</code> serves two purposes. It is used both to display the amount due in the document and to instruct Docusign to proceed to collect payments after the document is signed.</p><p>Lastly, we include the status \"sent\" in the request so that the envelope is sent for signing. The eSignature REST API request is sent to the following endpoint:</p><pre>POST /v2.1/accounts/{accountId}/envelopes</pre><h5>Step 2</h5><p>To enable embedded signing of the envelope inside our application, we next use the <a target=\"_blank\" href=\"https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient\">EnvelopeViews: createRecipient</a> method to generate a signing URL for the recipient. For this to work, the <code>clientUserId</code> property must be set on the recipient when the envelope is sent during step 1 above.</p><p>Once the envelope is sent, we save the envelope ID and recipient information to our session. Then, we retrieve the envelope ID and recipient info from our session and create the recipient view by generating the URL and displaying the recipient view in a full-width and full-height iframe inside our page.</p><p>To create the recipient view of the envelope, we send an API request to:</p><pre>POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient</pre>"
96+
"CodeFlow": "<p>View source files <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/document.py#L135-L326' target='blank' rel='norefferer noopener'>document.py</a> and <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/envelope.py#L10-L65' target='blank' rel='norefferer noopener'>envelope.py</a> on GitHub.</p><h3>This sample features:</h3><ul><li>Update recipient information<li>Create envelope from HTML import<li>Fill tab data<li>Embedded signing (recipient view)<li>Request payment</li><li>Formula field</li></ul><p><strong>Note</strong>: This scenario uses <a target=\"_blank\" href=\"https://www.docusign.com/products/payments\">Docusign Payments</a>. To complete the transaction, you will need to set up a <a target=\"_blank\" href=\"https://support.docusign.com/en/guides/managing-payment-gateways\">payment gateway</a> on your account. </p><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, we use the <a target=\"_blank\" href=\"https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create\">Envelopes: create</a> method to send the signature request with the corresponding form information. The envelope we construct contains a <code>document</code> object, a <code>recipient</code> object of type <code>signer</code>, and <code>tabs,</code> which contain the form fields information. Since we are using embedded signing, we must also set the <code>clientUserId</code> property on the recipient.</p><p>We place the tabs on the document by specifying a <code>SignHereTab</code> element and a <code>PaymentTab</code> element as part of the <code>signer</code> element. The tab elements are positioned using <em>x/y</em> coordinates on the <code>document</code>.</p><p>The <code>PaymentTab</code> serves two purposes. It is used both to display the amount due in the document and to instruct Docusign to proceed to collect payments after the document is signed.</p><p>Lastly, we include the status \"sent\" in the request so that the envelope is sent for signing. The eSignature REST API request is sent to the following endpoint:</p><pre>POST /v2.1/accounts/{accountId}/envelopes</pre><h5>Step 2</h5><p>To enable embedded signing of the envelope inside our application, we next use the <a target=\"_blank\" href=\"https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient\">EnvelopeViews: createRecipient</a> method to generate a signing URL for the recipient. For this to work, the <code>clientUserId</code> property must be set on the recipient when the envelope is sent during step 1 above.</p><p>Once the envelope is sent, we save the envelope ID and recipient information to our session. Then, we retrieve the envelope ID and recipient info from our session and create the recipient view by generating the URL and displaying the recipient view in a full-width and full-height iframe inside our page.</p><p>To create the recipient view of the envelope, we send an API request to:</p><pre>POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient</pre>"
9797
},
9898
"SubmitInfo": "By submitting the form, you confirm payment for this activity. The system will transfer you to the payment form after signing."
9999
}

public/locales/en/History.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
"HTMLOptionButton": "Download MySure.pdf",
99
"SummaryOptionButton": "Download Summary",
1010
"CombinedOptionButton": "Download combined PDF",
11-
"EmptyListMessage": " Create some MySure transactions and they will start showing up here."
11+
"EmptyListMessage": " Create some MySure transactions and they will start showing up here.",
12+
"ApiDecription": {
13+
"SeeMore": "- See behind the scenes",
14+
"CodeFlow": "<p>View source file <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/envelope.py#L68-L108' target='blank' rel='norefferer noopener'>envelopes.py</a> on GitHub.</p><h3>This sample features:</h3><ul><li>List envelope status changes</li><li>Download envelope documents</li></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the status page loads, we use the <a href='https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/liststatuschanges/' target='blank' rel='noopener noreferrer'>Envelopes: listStatusChanges</a> method to retrieve the statuses of envelopes in the authenticated user’s account, filtering by the current day's date with the <code>from_date</code> query parameter. Additionally, we use the <code>include</code> query parameter to retrieve recipient information for each envelope. We then cross-reference these envelopes with the envelope IDs saved in the app’s session and display only those sent by the currently authenticated user using the app.</p><p>To list envelope status changes, we send an API request to:</p><pre>POST /restapi/v2.1/accounts/{accountId}/envelopes?from_date={date}&include='recipients'</pre><h5>Step 2</h5><p>To download envelope documents, we send an API request to: <pre>GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}</pre></p>"
15+
}
1216
}

public/locales/en/RequestAutoRenewal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"ApiDecription": {
1414
"SeeMore": "- See behind the scenes",
15-
"CodeFlow": "<h3>This sample features:</h3><ul><li>Creating an elastic template<li>Embedding an elastic template on your site</li></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, the Click API is used to create a new elastic template. An elastic template is a Docusign technology that enables you to have a webpage where you can ask your users to click to agree to something. To create the elastic template, you need to provide the <code>name</code>, the <code>displaySettings</code> that control what the UI experience will look like, and a <code>document</code> that will be shown to the user when they accept.</p><p>To create the elastic template, send an API request to:</p><pre>POST /v1/accounts/{accountId}/clickwraps</pre><h5>Step 2</h5><p>The call from step 1 returns the clickwrap ID, which we need. We then add this to the HTML on our website so that it now looks like this:</p><pre><code>&lt;div id=\"ds-terms-of-service\">&lt;/div></code><code>&lt;script src=\"https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js\">&lt;/script></code><code>&lt;script></code><code>docuSignClick.Clickwrap.render({</code><code> environment: 'https://demo.docusign.net',</code><code> accountId: '&lt;your account ID>',</code><code> clickwrapId: '&lt;your clickwrap ID',</code><code> clientUserId: 'UNIQUE_USER_ID'</code><code>}, '#ds-terms-of-service');</code><code>&lt;/script></code></pre>"
15+
"CodeFlow": "<p>View source file <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/clickwrap.py' target='blank' rel='norefferer noopener'>clickwrap.py</a> on GitHub.</p><h3>This sample features:</h3><ul><li>Creating an elastic template<li>Embedding an elastic template on your site</li></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, the Click API is used to create a new elastic template. An elastic template is a Docusign technology that enables you to have a webpage where you can ask your users to click to agree to something. To create the elastic template, you need to provide the <code>name</code>, the <code>displaySettings</code> that control what the UI experience will look like, and a <code>document</code> that will be shown to the user when they accept.</p><p>To create the elastic template, send an API request to:</p><pre>POST /v1/accounts/{accountId}/clickwraps</pre><h5>Step 2</h5><p>The call from step 1 returns the clickwrap ID, which we need. We then add this to the HTML on our website so that it now looks like this:</p><pre><code>&lt;div id=\"ds-terms-of-service\">&lt;/div></code><code>&lt;script src=\"https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js\">&lt;/script></code><code>&lt;script></code><code>docuSignClick.Clickwrap.render({</code><code> environment: 'https://demo.docusign.net',</code><code> accountId: '&lt;your account ID>',</code><code> clickwrapId: '&lt;your clickwrap ID',</code><code> clientUserId: 'UNIQUE_USER_ID'</code><code>}, '#ds-terms-of-service');</code><code>&lt;/script></code></pre>"
1616
},
1717
"Renewal": {
1818
"TermsName": "Renewal Terms",

public/locales/en/SubmitClaim.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@
101101
},
102102
"ApiDecription": {
103103
"SeeMore": "- See behind the scenes",
104-
"CodeFlow": "<h3>This sample features:</h3><ul><li>Update recipient information</li><li>Create envelope from HTML Import</li><li>Fill tab data</li><li>Embedded signing (recipient view)</li<li>Optional tab</li><li>Attachment tab></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, we use the <a target=\"_blank\" href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create'>Envelopes: create</a> method to send the signature request with the corresponding form information. The envelope we construct contains various data: specifically, a <code>document</code> object, a <code>recipient</code> object with the type <code>signer</code>, and <code>tabs</code> objects, which contain form field information. Since we are using embedded signing, we must also set the <code>clientUserId</code> property on the recipient.</p><p>We place the tabs on the document by specifying a <code>SignHereTab</code> element and an <code>InitialTab</code> element as part of the <code>signer</code> element. The tab elements are positioned using <em>x/y</em> coordinates on the <code>document</code>.</p><p>Last, we include the status \"sent\" in the request so that the envelope is sent for signing.</p><p>The eSignature REST API request is sent to the following endpoint:</p><pre>POST /v2.1/accounts/{accountId}/envelopes</pre><h5>Step 2</h5><p>To enable embedded signing of the envelope inside our application, we next use the <a target=\"_blank\" href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient'>EnvelopeViews: createRecipient</a> method to generate a signing URL for the recipient. For this to work, the <code>clientUserId</code> property must be set on the recipient when the envelope is sent during step 1 above.</p><p>Once the envelope is sent, we save the envelope ID and recipient information to our session. Then, we retrieve the envelope ID and recipient info from our session and create the recipient view by generating the URL and displaying the recipient view in a full-width and full-height iframe inside our page.</p><p>To create the recipient view of the envelope, we send an API request to:</p><pre>POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient</pre>"
104+
"CodeFlow": "<p>View source files <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/document.py#L26-L132' target='blank' rel='norefferer noopener'>document.py</a> and <a href='https://github.com/docusign/sample-app-mysure-python/blob/master/app/envelope.py#L10-L65' target='blank' rel='norefferer noopener'>envelope.py</a> on GitHub.</p><h3>This sample features:</h3><ul><li>Update recipient information</li><li>Create envelope from HTML Import</li><li>Fill tab data</li><li>Embedded signing (recipient view)</li<li>Optional tab</li><li>Attachment tab></ul><h3>Code flow:</h3><h5>Step 1</h5><p>When the form is submitted, we use the <a target=\"_blank\" href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create'>Envelopes: create</a> method to send the signature request with the corresponding form information. The envelope we construct contains various data: specifically, a <code>document</code> object, a <code>recipient</code> object with the type <code>signer</code>, and <code>tabs</code> objects, which contain form field information. Since we are using embedded signing, we must also set the <code>clientUserId</code> property on the recipient.</p><p>We place the tabs on the document by specifying a <code>SignHereTab</code> element and an <code>InitialTab</code> element as part of the <code>signer</code> element. The tab elements are positioned using <em>x/y</em> coordinates on the <code>document</code>.</p><p>Last, we include the status \"sent\" in the request so that the envelope is sent for signing.</p><p>The eSignature REST API request is sent to the following endpoint:</p><pre>POST /v2.1/accounts/{accountId}/envelopes</pre><h5>Step 2</h5><p>To enable embedded signing of the envelope inside our application, we next use the <a target=\"_blank\" href='https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient'>EnvelopeViews: createRecipient</a> method to generate a signing URL for the recipient. For this to work, the <code>clientUserId</code> property must be set on the recipient when the envelope is sent during step 1 above.</p><p>Once the envelope is sent, we save the envelope ID and recipient information to our session. Then, we retrieve the envelope ID and recipient info from our session and create the recipient view by generating the URL and displaying the recipient view in a full-width and full-height iframe inside our page.</p><p>To create the recipient view of the envelope, we send an API request to:</p><pre>POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient</pre>"
105105
}
106106
}

src/assets/scss/layouts/_content.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ h5,
8989
padding-bottom: 50px;
9090

9191
&.container-fluid {
92-
max-width: 1140px;
92+
max-width: 80%;
9393
}
9494
}
9595

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from "react";
2+
import { useTranslation } from "react-i18next";
3+
import parse from "html-react-parser";
4+
5+
export const ApiDescription = () => {
6+
const { t } = useTranslation("History");
7+
const style = {
8+
// minWidth: 400
9+
};
10+
11+
return (
12+
<div className="col-lg-5" style={style}>
13+
<div id="accordion">
14+
<div className="card">
15+
<div className="card-header" id="headingOne">
16+
<h5 className="mb-0">
17+
<button
18+
className="btn btn-link"
19+
data-toggle="collapse"
20+
data-target="#collapseOne"
21+
aria-expanded="false"
22+
aria-controls="collapseOne"
23+
>
24+
{t("ApiDecription.SeeMore")}
25+
</button>
26+
</h5>
27+
</div>
28+
<div
29+
id="collapseOne"
30+
className="collapse"
31+
aria-labelledby="headingOne"
32+
data-parent="#accordion"
33+
>
34+
<div className="card-body">
35+
{parse(t("ApiDecription.CodeFlow"))}
36+
</div>
37+
</div>
38+
</div>
39+
</div>
40+
</div>
41+
);
42+
};

0 commit comments

Comments
 (0)