Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
neozhu committed Jan 8, 2025
1 parent fb32ea6 commit 7bf43ca
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/CleanAspire.ClientApp/Pages/Stocks/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@
var parameters = new DialogParameters<StockDialog>
{
{x=>x.Inbound, false},
{x=>x.ProductId,item.Product?.Id },
{x=>x.model, new StockDialog.Model(){ Location = item.Location, Quantity=item.Quantity } }
{x=>x.model, new StockDialog.Model(){ Location = item.Location, Quantity=item.Quantity, ProductId=item.ProductId } }
};
await DialogServiceHelper.ShowDialogAsync<StockDialog>(L["Stock dispatching"], parameters, new DialogOptions() { MaxWidth = MaxWidth.Small },
async (state) =>
Expand Down
5 changes: 2 additions & 3 deletions src/CleanAspire.ClientApp/Pages/Stocks/StockDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<DialogContent>
<MudForm @ref="editForm">
<div class="d-flex flex-column gap-2">
<ProductAutocomplete T="ProductDto" @bind-Value="@model.Product" DefaultProductId="@ProductId" Label="@L["Product"]" Required="true" ErrorText="@L["Product is required."]" />
<ProductAutocomplete T="ProductDto" @bind-Value="@model.Product" DefaultProductId="@model.ProductId" Label="@L["Product"]" Required="true" ErrorText="@L["Product is required."]" />
<MudTextField T="string" Label="@L["Location"]" For="@(() => model.Location)" @bind-Value="model.Location" Required="true" ErrorText="@L["Location is required."]" />
<MudNumericField T="int?" Label="@L["Quantity"]" For="@(() => model.Quantity)" @bind-Value="model.Quantity" Validation="ValidateQuantity" Required="true" ErrorText="@L["Quantity must be greater than 0."]" />
</div>
Expand All @@ -19,8 +19,6 @@
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!;
[Parameter]
public string? ProductId { get; set; }
[Parameter]
public bool Inbound { get; set; }
[Parameter]
public Model model { get; set; } = new Model();
Expand Down Expand Up @@ -84,6 +82,7 @@
}
public class Model
{
public string? ProductId { get; set; }
[Required(ErrorMessage = "Product id is required.")]
public ProductDto? Product { get; set; }
[Required(ErrorMessage = "Location id is required.")]
Expand Down
9 changes: 7 additions & 2 deletions src/CleanAspire.ClientApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
using Microsoft.JSInterop;
using System.Globalization;
using CleanAspire.ClientApp.Services.Interfaces;
using Microsoft.AspNetCore.Components.Web;

var builder = WebAssemblyHostBuilder.CreateDefault(args);

//builder.RootComponents.Add<App>("#app");
//builder.RootComponents.Add<HeadOutlet>("head::after");
var renderMode = Environment.GetEnvironmentVariable("BLAZOR_RENDER_MODE");

if (renderMode?.Equals("Standalone", StringComparison.OrdinalIgnoreCase) == true)
{
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
}
// register the cookie handler
builder.Services.AddCoreServices(builder.Configuration);
builder.Services.AddHttpClients(builder.Configuration);
Expand Down
6 changes: 4 additions & 2 deletions src/CleanAspire.ClientApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5180",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Development",
"BLAZOR_RENDER_MODE": "Standalone"
}
},
"https": {
Expand All @@ -18,7 +19,8 @@
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7123;http://localhost:5180",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Development",
"BLAZOR_RENDER_MODE": "Standalone"
}
}
}
Expand Down

0 comments on commit 7bf43ca

Please sign in to comment.