Skip to content

Commit 21457a0

Browse files
committed
Upgrade to MudBlazor 9 and update related APIs
- Bump MudBlazor to v9.0.0 and update DataGrid usage accordingly - Update ActualLab.Fusion, QuestPDF, Serilog, and NUnit packages - Refactor ServerReload methods to accept CancellationToken - Update MainLayout for new dark mode API - Adjust MudBlazor service/snackbar config for v9 - Update MudChart and DataGrid edit APIs in Dashboard and PicklistSets - Miscellaneous code cleanups for compatibility with new library versions
1 parent 516f75a commit 21457a0

18 files changed

Lines changed: 35 additions & 38 deletions

File tree

src/Application/Application.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.7.1" />
2525
<PackageReference Include="Hangfire.Core" Version="1.8.23" />
2626
<PackageReference Include="ZiggyCreatures.FusionCache" Version="2.5.0" />
27-
<PackageReference Include="ActualLab.Fusion" Version="12.1.14" />
28-
<PackageReference Include="ActualLab.Fusion.Blazor" Version="12.1.14" />
29-
<PackageReference Include="ActualLab.Generators" Version="12.1.14">
27+
<PackageReference Include="ActualLab.Fusion" Version="12.1.61" />
28+
<PackageReference Include="ActualLab.Fusion.Blazor" Version="12.1.61" />
29+
<PackageReference Include="ActualLab.Generators" Version="12.1.61">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>

src/Infrastructure/Infrastructure.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="10.0.3" />
1414
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.3" />
1515
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="10.0.3" />
16-
<PackageReference Include="QuestPDF" Version="2025.12.4" />
16+
<PackageReference Include="QuestPDF" Version="2026.2.1" />
1717
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
18-
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.3-dev-00155" />
18+
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.3" />
1919
<PackageReference Include="Serilog.Sinks.Postgresql.Alternative" Version="4.2.0" />
2020
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
2121
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />

src/Server.UI/Components/Shared/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
private async Task ApplyUserPreferences()
3939
{
40-
_defaultDarkMode = await _mudThemeProvider.GetSystemPreference();
40+
_defaultDarkMode = await _mudThemeProvider.GetSystemDarkModeAsync();
4141
await LayoutService.ApplyUserPreferences(_defaultDarkMode);
4242
}
4343

src/Server.UI/DependencyInjection.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ public static IServiceCollection AddServerUI(this IServiceCollection services, I
4141
services.AddScoped<IdentityRedirectManager>();
4242
services.AddMudServices(config =>
4343
{
44-
MudGlobal.InputDefaults.ShrinkLabel = true;
45-
//MudGlobal.InputDefaults.Variant = Variant.Outlined;
46-
//MudGlobal.ButtonDefaults.Variant = Variant.Outlined;
44+
4745
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomCenter;
4846
config.SnackbarConfiguration.NewestOnTop = false;
4947
config.SnackbarConfiguration.ShowCloseIcon = true;

src/Server.UI/Pages/Contacts/Contacts.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
_canImport = (await AuthService.AuthorizeAsync(state.User, Permissions.Contacts.Import)).Succeeded;
190190
_canExport = (await AuthService.AuthorizeAsync(state.User, Permissions.Contacts.Export)).Succeeded;
191191
}
192-
private async Task<GridData<ContactDto>> ServerReload(GridState<ContactDto> state)
192+
private async Task<GridData<ContactDto>> ServerReload(GridState<ContactDto> state, CancellationToken cancellationToken)
193193
{
194194
try
195195
{
@@ -234,7 +234,7 @@
234234
{ x=>x.model,command },
235235
};
236236
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true };
237-
var dialog = DialogService.Show<ContactFormDialog>(title, parameters, options);
237+
var dialog =await DialogService.ShowAsync<ContactFormDialog>(title, parameters, options);
238238
var state = await dialog.Result;
239239

240240
if (state != null && !state.Canceled)

src/Server.UI/Pages/Dashboard/Dashboard.razor

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838

3939
<!-- Center: Donut Chart -->
4040
<MudItem xs="12" md="4" Class="d-flex justify-center align-center">
41-
<MudChart ChartType="ChartType.Donut" Width="140px" Height="140px"
42-
InputData="@ChartData" InputLabels="@ChartLabels" LegendPosition="Position.Right" />
41+
<MudChart T="double" ChartType="ChartType.Donut" Width="140px" Height="140px"
42+
ChartLabels="@ChartLabels" ChartSeries="@([ChartData])"
43+
LegendPosition="Position.Right" />
4344
</MudItem>
4445

4546
<!-- Right: Detailed Breakdown -->
@@ -79,7 +80,7 @@
7980
</MudAvatar>
8081
</div>
8182

82-
83+
8384

8485
<div class="d-flex align-center gap-2 mt-2">
8586
<MudChip T="string" Color="Color.Success" Size="Size.Small" Variant="Variant.Text" Icon="@Icons.Material.Filled.ArrowUpward">+14.2%</MudChip>
@@ -101,7 +102,7 @@
101102
</MudAvatar>
102103
</div>
103104

104-
105+
105106

106107
<div class="d-flex align-center gap-2 mt-2">
107108
<MudChip T="string" Color="Color.Warning" Size="Size.Small" Variant="Variant.Text" Icon="@Icons.Material.Filled.TrendingUp">+5.4%</MudChip>
@@ -123,7 +124,7 @@
123124
</MudAvatar>
124125
</div>
125126

126-
127+
127128

128129
<div class="d-flex align-center gap-2 mt-2">
129130
<MudChip T="string" Color="Color.Default" Size="Size.Small" Variant="Variant.Text">Stable</MudChip>
@@ -206,7 +207,7 @@
206207
<MudTd DataLabel="Position">@context.Position</MudTd>
207208
<MudTd DataLabel="Molar" Style="text-align:right; font-family: monospace;">@context.Molar</MudTd>
208209
</RowTemplate>
209-
210+
210211
</MudTable>
211212
</MudItem>
212213

@@ -222,9 +223,9 @@
222223
public double[] ChartData = { 68, 21, 11 };
223224
public string[] ChartLabels = { "Paid", "Awaiting", "Overdue" };
224225

226+
225227

226-
227-
228+
228229

229230

230231
// --- TABLE DATA ---

src/Server.UI/Pages/Documents/Documents.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<PageTitle>@Title</PageTitle>
2121

22-
<MudDataGrid ServerData="@(new Func<GridState<DocumentDto>, Task<GridData<DocumentDto>>>(ServerReload))"
22+
<MudDataGrid ServerData="@(ServerReload)"
2323
FixedHeader="true"
2424
FixedFooter="false"
2525
Virtualize="false"
@@ -265,7 +265,7 @@
265265
Client.JobStartedEvent -= _client_JobStarted;
266266
}
267267

268-
private async Task<GridData<DocumentDto>> ServerReload(GridState<DocumentDto> state)
268+
private async Task<GridData<DocumentDto>> ServerReload(GridState<DocumentDto> state, CancellationToken cancellationToken)
269269
{
270270
try
271271
{

src/Server.UI/Pages/Identity/Roles/Roles.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
(_selectedTenantId == " " || (_selectedTenantId != " " && x.TenantId == _selectedTenantId));
211211
}
212212

213-
private async Task<GridData<ApplicationRoleDto>> ServerReload(GridState<ApplicationRoleDto> state)
213+
private async Task<GridData<ApplicationRoleDto>> ServerReload(GridState<ApplicationRoleDto> state, CancellationToken cancellationToken)
214214
{
215215
try
216216
{

src/Server.UI/Pages/Identity/Users/Users.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
(_searchRole == null || (_searchRole != null && x.UserRoles.Any(x => x.Role.Name == _searchRole))) &&
331331
(_selectedTenantId == " " || (_selectedTenantId != " " && x.TenantId == _selectedTenantId));
332332
}
333-
private async Task<GridData<ApplicationUserDto>> ServerReload(GridState<ApplicationUserDto> state)
333+
private async Task<GridData<ApplicationUserDto>> ServerReload(GridState<ApplicationUserDto> state, CancellationToken cancellationToken)
334334
{
335335
try
336336
{

src/Server.UI/Pages/PicklistSets/PicklistSets.razor

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<Columns>
103103
<PropertyColumn Property="x => x.Name" Title="@L[SelectedItem.GetMemberDescription(x => x.Name)]">
104104
<EditTemplate>
105-
<MudEnumSelect @bind-Value="@context.Item.Name" TEnum="Picklist" OnClose="@(()=>PicklistChanged(context.Item))" Required="true">
105+
<MudEnumSelect @bind-Value="@context.Item.Name" TEnum="Picklist" Required="true">
106106
</MudEnumSelect>
107107
</EditTemplate>
108108
</PropertyColumn>
@@ -162,7 +162,7 @@
162162
_canExport = (await AuthService.AuthorizeAsync(state.User, Permissions.PicklistSets.Export)).Succeeded;
163163
}
164164

165-
private async Task<GridData<PicklistSetDto>> ServerReload(GridState<PicklistSetDto> state)
165+
private async Task<GridData<PicklistSetDto>> ServerReload(GridState<PicklistSetDto> state, CancellationToken cancellationToken)
166166
{
167167
try
168168
{
@@ -205,12 +205,9 @@
205205
_searchString = string.Empty;
206206
await _table.ReloadServerData();
207207
}
208-
private void PicklistChanged(PicklistSetDto item)
209-
{
210-
_table.CommittedItemChanges.InvokeAsync(item);
211-
}
208+
212209

213-
private void CommittedItemChanges(PicklistSetDto item)
210+
private Task<DataGridEditFormAction> CommittedItemChanges(PicklistSetDto item)
214211
{
215212
InvokeAsync(async () =>
216213
{
@@ -223,6 +220,7 @@
223220

224221
StateHasChanged();
225222
});
223+
return Task.FromResult(DataGridEditFormAction.Close);
226224
}
227225

228226
private async Task DeleteItem(PicklistSetDto item)

0 commit comments

Comments
 (0)