Skip to content

Commit

Permalink
Various updates to C# UI for some code examples, also updates version…
Browse files Browse the repository at this point in the history
… of the Maestro SDK
  • Loading branch information
InbarGazit committed Jun 21, 2024
1 parent 0370f9f commit 3afcf66
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 38 deletions.
2 changes: 1 addition & 1 deletion launcher-csharp/Admin/Controllers/CreateCLMESignUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected override void InitializeInternal()

//ds-snippet-start:Admin2Step3
var productPermissionProfileApi = new ProductPermissionProfilesApi(apiClient);
var productPermissionProfiles = productPermissionProfileApi.GetProductPermissionProfiles(organizationId, Guid.Parse(accountId));
var productPermissionProfiles = productPermissionProfileApi.GetProductPermissionProfiles(organizationId.Value, Guid.Parse(accountId));
this.ViewBag.CLMPermissionProfiles = productPermissionProfiles.ProductPermissionProfiles.Find(x => x.ProductName == "CLM").PermissionProfiles;
this.ViewBag.ESignPermissionProfiles = productPermissionProfiles.ProductPermissionProfiles.Find(x => x.ProductName == "ESign").PermissionProfiles;
clmProductId = productPermissionProfiles.ProductPermissionProfiles.Find(x => x.ProductName == "CLM").ProductId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace DocuSign.CodeExamples.Admin.Controllers
using Newtonsoft.Json;

[Area("Admin")]
[Route("Aeg011")]
[Route("aeg011")]
public class DeleteUserDataFromAccount : EgController
{
public DeleteUserDataFromAccount(DsConfiguration config, LauncherTexts launcherTexts, IRequestItemsService requestItemsService)
Expand All @@ -27,7 +27,7 @@ public DeleteUserDataFromAccount(DsConfiguration config, LauncherTexts launcherT
this.ViewBag.title = this.CodeExampleText.ExampleName;
}

public override string EgName => "Aeg011";
public override string EgName => "aeg011";

[MustAuthenticate]
[SetViewBag]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace DocuSign.CodeExamples.Admin.Controllers
using Newtonsoft.Json;

[Area("Admin")]
[Route("Aeg010")]
[Route("aeg010")]
public class DeleteUserDataFromOrganization : EgController
{
public DeleteUserDataFromOrganization(DsConfiguration config, LauncherTexts launcherTexts, IRequestItemsService requestItemsService)
Expand All @@ -27,7 +27,7 @@ public DeleteUserDataFromOrganization(DsConfiguration config, LauncherTexts laun
this.ViewBag.title = this.CodeExampleText.ExampleName;
}

public override string EgName => "Aeg010";
public override string EgName => "aeg010";

[MustAuthenticate]
[SetViewBag]
Expand Down
3 changes: 2 additions & 1 deletion launcher-csharp/Maestro/Controllers/TriggerWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public ActionResult SubmitForm(WorkflowTriggerModel model)
docuSignManageClient,
accountId,
new Uri(workflow.TriggerUrl),
model);
model,
this.RequestItemsService.WorkflowId);

this.RequestItemsService.InstanceId = result.InstanceId;

Expand Down
9 changes: 7 additions & 2 deletions launcher-csharp/Maestro/Examples/TriggerWorkflowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ public static string PublishWorkFlow(DocuSignClient docuSignClient, string accou
}
}

public static TriggerWorkflowViaPostResponse TriggerWorkflow(DocuSignClient docuSignClient, string accountId, Uri triggerUrl, WorkflowTriggerModel model)
public static TriggerWorkflowViaPostResponse TriggerWorkflow(
DocuSignClient docuSignClient,
string accountId,
Uri triggerUrl,
WorkflowTriggerModel model,
string workflowId)
{
//ds-snippet-start:Maestro1Step4
var maestroApi = new WorkflowTriggerApi(docuSignClient);
Expand All @@ -76,7 +81,7 @@ public static TriggerWorkflowViaPostResponse TriggerWorkflow(DocuSignClient docu
};
//ds-snippet-end:Maestro1Step4
//ds-snippet-start:Maestro1Step5
return maestroApi.TriggerWorkflow(accountId, payload, options);
return maestroApi.TriggerWorkflow(accountId, workflowId, payload, options);
//ds-snippet-end:Maestro1Step5
}
}
Expand Down
6 changes: 3 additions & 3 deletions launcher-csharp/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
Boolean.TryParse(ViewData["showDoc"].ToString(), out showDoc);//ViewBag.ShowDoc;
Layout = "_HomeLayout";
}
<div class="jumbotron">
<div class="jumbotron" style="background-color: #210058!important">
<table>
<tbody>
<tr>
<td>
<h1 class="display-4">C# Launcher</h1>
<h1 class="display-4" style="background-color: #210058!important">C# Launcher</h1>
<p class="Xlead">
@Html.Raw(ViewBag.SupportingTexts.HomePageText)
</p>
</td>
<td>
<img src="/images/banner-code.PNG" />
<img src="/images/header.PNG" />
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion launcher-csharp/appsettings.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"AppUrl": "https://localhost:44333",
"RoomsApiEndpoint": "https://demo.rooms.docusign.com",
"AdminApiEndpoint": "https://api-d.docusign.net/management",
"MaestroApiEndpoint": "https://demo.services.docusign.net/",
"MaestroApiEndpoint": "https://apps-d.docusign.com/api/maestro",
"WebFormsBasePath": "https://apps-d.docusign.com/api/webforms/v1.1",
"CodeExamplesManifest": "https://raw.githubusercontent.com/docusign/code-examples-csharp/master/manifest/CodeExamplesManifest.json",
"SignerEmail": "{SIGNER_EMAIL}",
Expand Down
9 changes: 9 additions & 0 deletions launcher-csharp/eSignature/Controllers/RecipientAuthIDV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public RecipientAuthIdv(DsConfiguration config, LauncherTexts launcherTexts, IRe
[SetViewBag]
public IActionResult Create(string signerEmail, string signerName, string ccEmail, string ccName)
{
if (signerEmail == this.Config.SignerEmail)
{
this.ViewBag.errorCode = "400";
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;

return this.View("Error");
}

try
{
// Check the token with minimal buffer time.
Expand Down
9 changes: 9 additions & 0 deletions launcher-csharp/eSignature/Controllers/RecipientAuthKBA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ public RecipientAuthKba(DsConfiguration config, LauncherTexts launcherTexts, IRe
[SetViewBag]
public IActionResult Create(string signerEmail, string signerName)
{
if (signerEmail == this.Config.SignerEmail)
{
this.ViewBag.errorCode = "400";
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;

return this.View("Error");
}

// Check the token with minimal buffer time.
bool tokenOk = this.CheckToken(3);
if (!tokenOk)
Expand Down
9 changes: 9 additions & 0 deletions launcher-csharp/eSignature/Controllers/RecipientAuthPhone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public RecipientAuthPhone(DsConfiguration config, LauncherTexts launcherTexts, I
[SetViewBag]
public IActionResult Create(string signerEmail, string signerName, string signerCountryCode, string signerPhoneNumber)
{
if (signerEmail == this.Config.SignerEmail)
{
this.ViewBag.errorCode = "400";
this.ViewBag.errorMessage = this.LauncherTexts.ManifestStructure.SupportingTexts.IdenticalEmailsNotAllowedErrorMessage;
this.ViewBag.SupportingTexts = this.LauncherTexts.ManifestStructure.SupportingTexts;

return this.View("Error");
}

try
{
// Check the token with minimal buffer time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class SupportingTexts
[JsonProperty("ContactSupportToEnableFeature")]
public string ContactSupportToEnableFeature { get; set; }

[JsonProperty("IdenticalEmailsNotAllowedErrorMessage")]
public string IdenticalEmailsNotAllowedErrorMessage { get; set; }

[JsonProperty("LoginPage")]
public LoginPage LoginPage { get; set; }

Expand Down
4 changes: 1 addition & 3 deletions launcher-csharp/eSignature/Views/Eg020SmsAuth/eg020.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
name="signerEmail"
aria-describedby="emailHelp"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[emailInputNumber].InputPlaceholder"
required
value="@ViewBag.Locals.DsConfig.SignerEmail">
required>

<small id="emailHelp" class="form-text text-muted">
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
Expand All @@ -68,7 +67,6 @@
id="signerName"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[nameInputNumber].InputPlaceholder"
name="signerName"
value="@ViewBag.Locals.DsConfig.SignerName"
required>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
</p>

<form class="eg" action="" method="post" data-busy="form">
<p>@Html.Raw(ViewBag.CodeExampleText.Notes)</p>

<div class="form-group">
<label for="signerEmail">
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputName)
Expand All @@ -34,8 +32,7 @@
name="signerEmail"
aria-describedby="emailHelp"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
required
value="@ViewBag.Locals.DsConfig.SignerEmail">
required>

<small id="emailHelp" class="form-text text-muted">
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
Expand All @@ -51,7 +48,6 @@
id="signerName"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
name="signerName"
value="@ViewBag.Locals.DsConfig.SignerName"
required />
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
</p>

<form class="eg" action="" method="post" data-busy="form">
<p>@Html.Raw(ViewBag.CodeExampleText.Notes)</p>

<div class="form-group">
<label for="signerEmail">
@Html.Raw(ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputName)
Expand All @@ -34,8 +32,7 @@
name="signerEmail"
aria-describedby="emailHelp"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
required
value="@ViewBag.Locals.DsConfig.SignerEmail">
required>
<small id="emailHelp" class="form-text text-muted">
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
</small>
Expand All @@ -50,7 +47,6 @@
id="signerName"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
name="signerName"
value="@ViewBag.Locals.DsConfig.SignerName"
required />
</div>
<input type="hidden" name="_csrf" value="<%- csrfToken %>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
name="signerEmail"
aria-describedby="emailHelp"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerEmailInputNumber].InputPlaceholder"
required
value="@ViewBag.Locals.DsConfig.SignerEmail">
required>

<small id="emailHelp" class="form-text text-muted">
@Html.Raw(ViewBag.SupportingTexts.HelpingTexts.EmailWontBeShared)
Expand All @@ -81,7 +80,6 @@
id="signerName"
placeholder="@ViewBag.CodeExampleText.Forms[formNumber].Inputs[signerNameInputNumber].InputPlaceholder"
name="signerName"
value="@ViewBag.Locals.DsConfig.SignerName"
required />
</div>
<input type="hidden" name="_csrf" value="<%- csrfToken %>">
Expand Down
2 changes: 1 addition & 1 deletion launcher-csharp/launcher-csharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="DocuSign.Click" Version="2.0.0-rc1" />
<PackageReference Include="DocuSign.eSign.dll" Version="7.0.0-rc2" />
<PackageReference Include="DocuSign.Monitor" Version="2.0.0-rc1" />
<PackageReference Include="DocuSign.Maestro" Version="1.0.0-rc1" />
<PackageReference Include="DocuSign.Maestro" Version="1.0.0-rc4" />
<PackageReference Include="DocuSign.Rooms" Version="2.0.0-rc1" />
<PackageReference Include="DocuSign.WebForms" Version="2.0.0-rc1" />
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
Expand Down
Binary file removed launcher-csharp/wwwroot/images/banner-code.PNG
Binary file not shown.
Binary file added launcher-csharp/wwwroot/images/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions manifest/CodeExamplesManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"WelcomeText":"Welcome {0} (Account: {1})",
"CFRError":"This example is not compatible with your CFR Part 11 account. Please return to the homepage to run one of the examples that is compatible or authenticate with a different account.",
"ContactSupportToEnableFeature": "Please contact <a href=\"https://support.docusign.com/\">support</a> to enable {0} in your account",
"IdenticalEmailsNotAllowedErrorMessage": "For recipient authentication you must specify a different recipient from the account owner (sender) in order to ensure recipient authentication is performed",
"LoginPage":{
"LoginHeader":"<h1 class='display-4'>Please Authenticate with Docusign</h1><label for='auth_type'>Please choose your authentication type</label>",
"LoginButton":"Authenticate with Docusign",
Expand Down Expand Up @@ -187,7 +188,8 @@
},
{
"InputName": "RSUs"
} ]
}
]
}
],
"ResultsPageText":"The envelope has been created and sent!<br />Envelope ID {0}."
Expand Down Expand Up @@ -1520,7 +1522,7 @@
"CFREnabled":"AllAccounts",
"ExampleName":"Send an envelope with ID Verification Authentication",
"ExampleDescription":"Submit an envelope that requires verification of a government issued identity.",
"Notes":"<p><b>Note:<b/> The access code for this example is the Signer Name.</p>",
"Notes":"<b>Note:</b> The access code for this example is the Signer Name.",
"LinksToAPIMethod":[
{
"Path":"https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/",
Expand Down Expand Up @@ -1554,7 +1556,7 @@
"CFREnabled":"AllAccounts",
"ExampleName":"Send an envelope with Recipient Knowledged Based Authentication",
"ExampleDescription":"Submit an envelope with multiple choice, public records based questions to provide multi-factor authentication.",
"Notes":"<p><b>Note:<b/> The access code for this example is the Signer Name.</p>",
"Notes":"<b>Note:</b> The access code for this example is the Signer Name.",
"LinksToAPIMethod":[
{
"Path":"https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/",
Expand Down Expand Up @@ -1886,7 +1888,7 @@
}
],
"ResultsPageText":"This value should match the value of your x-docusign-signature header: <br/>HMAC signature {0}",
"SkipForLanguages":"bash;powershell;java;php"
"SkipForLanguages":"bash;powershell"
}
]
}
Expand Down Expand Up @@ -2711,8 +2713,7 @@
]
}
],
"ResultsPageText":"Results from DataDeletion:redactIndividualMembershipData method:",
"SkipForLanguages":"java"
"ResultsPageText":"Results from DataDeletion:redactIndividualMembershipData method:"
},
{
"ExampleNumber":11,
Expand All @@ -2734,8 +2735,7 @@
]
}
],
"ResultsPageText":"Results from DataDeletion:redactIndividualUserData method:",
"SkipForLanguages":"java"
"ResultsPageText":"Results from DataDeletion:redactIndividualUserData method:"
},
{
"ExampleNumber":12,
Expand Down Expand Up @@ -2783,4 +2783,4 @@
]
}
]
}
}

0 comments on commit 3afcf66

Please sign in to comment.