Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab 4 fixes #26

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions labs/4-Add-Shopping-Basket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ In previous labs, we have created a web site that shoppers can use to browser a
1. In the `Program.cs` file, update the line that maps the `GreeterService` gRPC service so that it maps the `BasketService` instead:

```csharp
builder.MapGrpcService<BasketService>();
app.MapGrpcService<BasketService>();
```

1. Delete the `Services/GreeterSrevice.cs` file that was included with the template, including the `Services` directory.
Expand Down Expand Up @@ -293,7 +293,10 @@ In previous labs, we have created a web site that shoppers can use to browser a

private static CustomerBasket MapToCustomerBasket(string userId, UpdateBasketRequest customerBasketRequest)
{
var response = new CustomerBasket(userId);
var response = new CustomerBasket
{
BuyerId = userId
};

foreach (var item in customerBasketRequest.Items)
{
Expand Down Expand Up @@ -379,7 +382,7 @@ In previous labs, we have created a web site that shoppers can use to browser a

1. Navigate to the definition of the `AddDefaultAuthentication` method and take a moment to read through the code. This code looks similar in places to the authentication configuration code in the `WebApp` project added in lab 3, but is slightly simpler as it doesn't need to configure the application to instigate login flows via OpenID Connect. It just needs to validate tokens issued by the IdP.

Note that the `ConfigureDefaaultJwtBearer` method expects the application configuration to have a section named **Identity** from which it retrieves a required value named **Audience**. This code will throw a runtime extepsion if it doesn't exist, so let's add that now.
Note that the `ConfigureDefaultJwtBearer` method expects the application configuration to have a section named **Identity** from which it retrieves a required value named **Audience**. This code will throw a runtime extepsion if it doesn't exist, so let's add that now.

1. Open the `appsettings.json` file and add a new section named **Identity** with a property named **Audience** set to a value of `"basket"`:

Expand Down Expand Up @@ -418,7 +421,7 @@ In previous labs, we have created a web site that shoppers can use to browser a
}

[DoesNotReturn]
rivate static void ThrowBasketDoesNotExist(string userId)
private static void ThrowBasketDoesNotExist(string userId)
=> throw new RpcException(new Status(StatusCode.NotFound, $"Basket with buyer ID {userId} does not exist"));
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
6 changes: 6 additions & 0 deletions src/WebApp/Components/Pages/Cart/CartPage.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
gap: 0.5rem;
}

.cart-items .cart-item .catalog-item-quantity form button:hover {
cursor: pointer;
background: #000;
color: #FFF;
}

.cart-items .cart-item .catalog-item-quantity input {
max-width: 3rem;
padding: 1rem 0.75rem;
Expand Down
Loading