Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 3d0aae8

Browse files
committed
webhooks.client rebranded
1 parent 94ff3fa commit 3d0aae8

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

src/Web/WebhookClient/Pages/Index.cshtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44
ViewData["Title"] = "Home page";
55
}
66

7+
<section class="esh-catalog-hero">
8+
</section>
9+
710
<div class="text-center">
8-
<h1 class="display-4">Welcome</h1>
9-
<p>eShopOnContainers - Webhook client</p>
11+
<p>&nbsp;</p>
12+
<img class="esh-app-footer-brand" src="~/images/brand.png" />
13+
<h2>eShopOnContainers - Order Management</h2>
14+
<p>
15+
This is a <bold>sample</bold> web client that uses the Webhooks API to show you all orders that reached the "paid" status. This is accomplished by creating a Webhook
16+
that will be called by eShopOnContainers core when the order reached this "paid" status. If not created you can create this webhook going to <a asp-page="RegisterWebhook">webhook registration</a>.
17+
</p>
1018
@if (!User.Identity.IsAuthenticated)
1119
{
1220
<a class="btn-primary btn" href="@Url.Action("SignIn", "Account")">Login</a>
@@ -15,8 +23,8 @@
1523
</div>
1624

1725
<div class="table">
18-
<h3>Current webhooks received</h3>
19-
<p>(Data since last time web started up)<p>
26+
<h3>Current webhooks received (orders paid)</h3>
27+
<p>(Data since last time web started up). <strong>Note: </strong>Must manually refresh this page.<p>
2028
<table class="table">
2129
@foreach (var webhook in Model.WebHooksReceived)
2230
{

src/Web/WebhookClient/Pages/RegisterWebhook.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
ViewData["Title"] = "RegisterWebhook";
55
}
66

7-
<h3>Register webhook</h3>
7+
<h3>Register a new webhook</h3>
88

9-
<p>This page registers the "OrderPaid" Webhook by sending a POST to webhooks.</p>
9+
<p>This page registers the "OrderPaid" Webhook by sending a POST to the WebHooks API. Once the Webhook is set, you will be able to see new paid orders from the <a asp-page="Index">Index</a> page.</p>
1010

1111
<form method="post">
1212
<p>Token: <input type="text" asp-for="Token" /></p>
@@ -15,5 +15,6 @@
1515

1616
@if (Model.ResponseCode != (int)System.Net.HttpStatusCode.OK)
1717
{
18-
<p>Error @Model.ResponseCode (@Model.ResponseMessage) when calling the Webhooks API (@Model.RequestUrl) with GrantUrl: @Model.GrantUrl):(</p>
18+
<p>Error @Model.ResponseCode (@Model.ResponseMessage) when calling the Webhooks API (@Model.RequestUrl) with GrantUrl: @Model.GrantUrl)</p>
19+
<p>Data sent to the webhooks API was <raw>@Model.RequestBodyJson</raw></p>
1920
}

src/Web/WebhookClient/Pages/RegisterWebhook.cshtml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Microsoft.AspNetCore.Mvc;
1111
using Microsoft.AspNetCore.Mvc.RazorPages;
1212
using Microsoft.Extensions.Options;
13+
using Newtonsoft.Json;
1314
using WebhookClient.Models;
1415

1516
namespace WebhookClient.Pages
@@ -27,7 +28,7 @@ public class RegisterWebhookModel : PageModel
2728
public string RequestUrl { get; set; }
2829
public string GrantUrl { get; set; }
2930
public string ResponseMessage { get; set; }
30-
31+
public string RequestBodyJson { get; set; }
3132

3233
public RegisterWebhookModel(IOptions<Settings> settings, IHttpClientFactory httpClientFactory)
3334
{
@@ -69,6 +70,7 @@ public async Task<IActionResult> OnPost()
6970
}
7071
else
7172
{
73+
RequestBodyJson = JsonConvert.SerializeObject(payload);
7274
ResponseCode = (int)response.StatusCode;
7375
ResponseMessage = response.ReasonPhrase;
7476
GrantUrl = granturl;

src/Web/WebhookClient/Pages/Shared/_Layout.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>@ViewData["Title"] - WebhookClient</title>
6+
<title>@ViewData["Title"] - Order Management</title>
77

88
<environment include="Development">
99
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
@@ -21,7 +21,7 @@
2121
<header>
2222
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
2323
<div class="container">
24-
<a class="navbar-brand" asp-area="" asp-page="/Index">WebhookClient</a>
24+
<a class="navbar-brand" asp-area="" asp-page="/Index">Order Management</a>
2525
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
2626
aria-expanded="false" aria-label="Toggle navigation">
2727
<span class="navbar-toggler-icon"></span>
@@ -50,7 +50,7 @@
5050

5151
<footer class="border-top footer text-muted">
5252
<div class="container">
53-
&copy; 2019 - WebhookClient - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
53+
&copy; 2019 - Order Management - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
5454
</div>
5555
</footer>
5656

src/Web/WebhookClient/wwwroot/css/site.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ body {
5454
height: 60px;
5555
line-height: 60px; /* Vertically center the text there */
5656
}
57+
58+
.esh-catalog-hero {
59+
background-image: url("../images/main_banner.png");
60+
background-size: cover;
61+
height: 260px;
62+
width: 100%;
63+
}
64+
65+
.esh-app-footer-brand {
66+
height: 50px;
67+
width: 230px;
68+
}
3.93 KB
Loading
851 KB
Loading

0 commit comments

Comments
 (0)