Skip to content

Commit 05ab781

Browse files
authored
Merge pull request #926 from neozhu/mudblazor_v9
Upgrade MudBlazor to v9
2 parents 516f75a + c8f1b7b commit 05ab781

File tree

24 files changed

+146
-121
lines changed

24 files changed

+146
-121
lines changed

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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@
7676
{
7777
<MudMenuItem>
7878
<MudFileUpload T="IBrowserFile" FilesChanged="OnImportData" Accept=".xlsx">
79-
<ActivatorContent>
79+
<CustomContent>
8080
<MudButton Class="pa-0 ma-0" Style="font-weight:400;text-transform:none;"
8181
Variant="Variant.Text"
8282
Disabled="@_uploading">
8383
@ConstantString.Import
8484
</MudButton>
85-
</ActivatorContent>
85+
</CustomContent>
86+
<SelectedTemplate />
8687
</MudFileUpload>
8788
</MudMenuItem>
8889
}
@@ -189,7 +190,7 @@
189190
_canImport = (await AuthService.AuthorizeAsync(state.User, Permissions.Contacts.Import)).Succeeded;
190191
_canExport = (await AuthService.AuthorizeAsync(state.User, Permissions.Contacts.Export)).Succeeded;
191192
}
192-
private async Task<GridData<ContactDto>> ServerReload(GridState<ContactDto> state)
193+
private async Task<GridData<ContactDto>> ServerReload(GridState<ContactDto> state, CancellationToken cancellationToken)
193194
{
194195
try
195196
{
@@ -234,7 +235,7 @@
234235
{ x=>x.model,command },
235236
};
236237
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.Medium, FullWidth = true };
237-
var dialog = DialogService.Show<ContactFormDialog>(title, parameters, options);
238+
var dialog =await DialogService.ShowAsync<ContactFormDialog>(title, parameters, options);
238239
var state = await dialog.Result;
239240

240241
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/Components/UploadFilesFormDialog.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040

4141
<MudButton Variant="Variant.Filled" Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Clear" Disabled="@(!_uploadedFiles.Any())" OnClick="Clear">@ConstantString.Clear</MudButton>
4242
<MudFileUpload @ref="@_fileUpload" T="IReadOnlyList<IBrowserFile>" Accept=".jpg, .jpeg, .png, .webp" FilesChanged="LoadFiles">
43-
<ActivatorContent>
43+
<CustomContent>
4444
<MudLoadingButton Loading="@_uploading" Variant="Variant.Filled"
4545
StartIcon="@Icons.Material.Filled.AttachFile"
4646
>
4747
@L["Choose files"]
4848
</MudLoadingButton>
49-
</ActivatorContent>
49+
</CustomContent>
50+
<SelectedTemplate />
5051
</MudFileUpload>
5152

5253
<MudLoadingButton Loading="@_processing" Disabled="@(!_uploadedFiles.Any())" Variant="Variant.Filled" OnClick="Submit">@ConstantString.Submit</MudLoadingButton>

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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@
7878
{
7979
<MudMenuItem>
8080
<MudFileUpload T="IBrowserFile" FilesChanged="OnImportData" Accept=".xlsx">
81-
<ActivatorContent>
81+
<CustomContent>
8282
<MudButton Class="pa-0 ma-0" Style="font-weight:400;text-transform:none;"
8383
Variant="Variant.Text"
8484
Disabled="@_uploading">
8585
@ConstantString.Import
8686
</MudButton>
87-
</ActivatorContent>
87+
</CustomContent>
88+
<SelectedTemplate />
8889
</MudFileUpload>
8990
</MudMenuItem>
9091
}
@@ -210,7 +211,7 @@
210211
(_selectedTenantId == " " || (_selectedTenantId != " " && x.TenantId == _selectedTenantId));
211212
}
212213

213-
private async Task<GridData<ApplicationRoleDto>> ServerReload(GridState<ApplicationRoleDto> state)
214+
private async Task<GridData<ApplicationRoleDto>> ServerReload(GridState<ApplicationRoleDto> state, CancellationToken cancellationToken)
214215
{
215216
try
216217
{

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
}
3636
<MudTooltip Text="@L["Click upload a image"]">
3737
<MudFileUpload T="IBrowserFile" Accept=".jpg, .jpeg, .png, .webp" FilesChanged="UploadPhoto" Style="margin-top:-10px;margin-left:-15px">
38-
<ActivatorContent>
38+
<CustomContent>
3939
<MudIconButton Icon="@Icons.Material.Filled.PhotoCamera">
4040
</MudIconButton>
41-
</ActivatorContent>
41+
</CustomContent>
42+
<SelectedTemplate/>
4243
</MudFileUpload>
4344
</MudTooltip>
4445

@@ -48,6 +49,8 @@
4849
<MultiTenantAutocomplete For="@(() => Model.Tenant)"
4950
T="TenantDto"
5051
Label="@L[Model.GetMemberDescription(x=>x.Tenant)]"
52+
53+
5154
Required="true"
5255
ValueChanged="@(x=>TenantChanged(x))"
5356
Value="@Model.Tenant">

0 commit comments

Comments
 (0)