Browse Source

feat: update MudBlazor bundling and enhance email settings UI components

pull/25235/head
maliming 5 months ago
parent
commit
c3b461aa7c
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor/AbpAspNetCoreComponentsServerThemingMudBlazorModule.cs
  2. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor/Bundling/BlazorServerMudBlazorStandardBundles.cs
  3. 2
      framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudDateTimeExtensionProperty.razor.cs
  4. 2
      framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudDateTimeOffsetExtensionProperty.razor.cs
  5. 5
      framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudSelectExtensionProperty.razor.cs
  6. 9
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme/Themes/Basic/NavMenu.razor.cs
  7. 9
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme/Themes/Basic/NavToolbar.razor
  8. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.MudBlazor/Components/FeatureManagementModal.razor
  9. 10
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor

4
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor/AbpAspNetCoreComponentsServerThemingMudBlazorModule.cs

@ -20,14 +20,14 @@ public class AbpAspNetCoreComponentsServerThemingMudBlazorModule : AbpModule
{ {
options options
.StyleBundles .StyleBundles
.Add(BlazorStandardBundles.Styles.Global, bundle => .Add(BlazorServerMudBlazorStandardBundles.Styles.Global, bundle =>
{ {
bundle.AddContributors(typeof(BlazorServerMudBlazorStyleContributor)); bundle.AddContributors(typeof(BlazorServerMudBlazorStyleContributor));
}); });
options options
.ScriptBundles .ScriptBundles
.Add(BlazorStandardBundles.Scripts.Global, bundle => .Add(BlazorServerMudBlazorStandardBundles.Scripts.Global, bundle =>
{ {
bundle.AddContributors(typeof(BlazorServerMudBlazorScriptContributor)); bundle.AddContributors(typeof(BlazorServerMudBlazorScriptContributor));
}); });

2
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor/Bundling/BlazorStandardBundles.cs → framework/src/Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor/Bundling/BlazorServerMudBlazorStandardBundles.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor.Bundling; namespace Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor.Bundling;
public class BlazorStandardBundles public class BlazorServerMudBlazorStandardBundles
{ {
public static class Styles public static class Styles
{ {

2
framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudDateTimeExtensionProperty.razor.cs

@ -50,7 +50,7 @@ public partial class MudDateTimeExtensionProperty<TEntity, TResourceType>
return dataFormatString.Replace("{0:", "").Replace("}", ""); return dataFormatString.Replace("{0:", "").Replace("}", "");
} }
return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd"; return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
} }
protected string GetTimeLabel() protected string GetTimeLabel()

2
framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudDateTimeOffsetExtensionProperty.razor.cs

@ -83,7 +83,7 @@ public partial class MudDateTimeOffsetExtensionProperty<TEntity, TResourceType>
return dataFormatString.Replace("{0:", "").Replace("}", ""); return dataFormatString.Replace("{0:", "").Replace("}", "");
} }
return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd"; return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
} }
protected string GetTimeLabel() protected string GetTimeLabel()

5
framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudSelectExtensionProperty.razor.cs

@ -52,10 +52,7 @@ public partial class MudSelectExtensionProperty<TEntity, TResourceType>
var isNullableType = Nullable.GetUnderlyingType(PropertyInfo.Type!) != null; var isNullableType = Nullable.GetUnderlyingType(PropertyInfo.Type!) != null;
if (!isNullableType) if (!isNullableType)
{ {
var enumType = isNullableType SelectedValue = (int)PropertyInfo.Type.GetEnumValues().GetValue(0)!;
? Nullable.GetUnderlyingType(PropertyInfo.Type)!
: PropertyInfo.Type;
SelectedValue = (int)enumType.GetEnumValues().GetValue(0)!;
} }
} }
} }

9
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme/Themes/Basic/NavMenu.razor.cs

@ -22,10 +22,13 @@ public partial class NavMenu : IDisposable
ApplicationConfigurationChangedService.Changed += ApplicationConfigurationChanged; ApplicationConfigurationChangedService.Changed += ApplicationConfigurationChanged;
} }
private async void ApplicationConfigurationChanged() private void ApplicationConfigurationChanged()
{ {
Menu = await MenuManager.GetMainMenuAsync(); _ = InvokeAsync(async () =>
await InvokeAsync(StateHasChanged); {
Menu = await MenuManager.GetMainMenuAsync();
StateHasChanged();
});
} }
public void Dispose() public void Dispose()

9
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme/Themes/Basic/NavToolbar.razor

@ -44,10 +44,13 @@
} }
} }
private async void ApplicationConfigurationChanged() private void ApplicationConfigurationChanged()
{ {
await GetToolbarItemRendersAsync(); _ = InvokeAsync(async () =>
await InvokeAsync(StateHasChanged); {
await GetToolbarItemRendersAsync();
StateHasChanged();
});
} }
public void Dispose() public void Dispose()

2
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.MudBlazor/Components/FeatureManagementModal.razor

@ -5,7 +5,7 @@
@using Volo.Abp.FeatureManagement.Localization @using Volo.Abp.FeatureManagement.Localization
@inherits AbpFeatureManagementComponentBase @inherits AbpFeatureManagementComponentBase
<MudDialog @bind-Visible="@_isVisible" Options="@(new DialogOptions { MaxWidth = MaxWidth.Large, FullWidth = true, CloseOnEscapeKey = true })"> <MudDialog @bind-Visible="@_isVisible" Options="@(new DialogOptions { BackdropClick = false, MaxWidth = MaxWidth.Large, FullWidth = true, CloseOnEscapeKey = true })">
<TitleContent> <TitleContent>
<MudText Typo="Typo.h6">@L["Features"]@ProviderKeyDisplayName</MudText> <MudText Typo="Typo.h6">@L["Features"]@ProviderKeyDisplayName</MudText>
</TitleContent> </TitleContent>

10
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor

@ -5,7 +5,7 @@
@if (EmailSettings != null) @if (EmailSettings != null)
{ {
<MudForm @ref="@_emailFormRef" Model="@EmailSettings"> <MudForm @ref="@_emailFormRef" Model="@EmailSettings">
<MudGrid> <MudGrid Spacing="2">
<MudItem xs="12"> <MudItem xs="12">
<MudTextField Margin="Margin.Dense" @bind-Value="@EmailSettings.DefaultFromDisplayName" <MudTextField Margin="Margin.Dense" @bind-Value="@EmailSettings.DefaultFromDisplayName"
Label="@L["DefaultFromDisplayName"]" Label="@L["DefaultFromDisplayName"]"
@ -27,11 +27,11 @@
Label="@L["SmtpPort"]" /> Label="@L["SmtpPort"]" />
</MudItem> </MudItem>
<MudItem xs="12"> <MudItem xs="12">
<MudCheckBox Color="Color.Primary" UncheckedColor="Color.Default" T="bool" @bind-Value="@EmailSettings.SmtpEnableSsl" <MudCheckBox Dense="true" Color="Color.Primary" UncheckedColor="Color.Default" T="bool" @bind-Value="@EmailSettings.SmtpEnableSsl"
Label="@L["SmtpEnableSsl"]" /> Label="@L["SmtpEnableSsl"]" />
</MudItem> </MudItem>
<MudItem xs="12"> <MudItem xs="12">
<MudCheckBox Color="Color.Primary" UncheckedColor="Color.Default" T="bool" @bind-Value="@EmailSettings.SmtpUseDefaultCredentials" <MudCheckBox Dense="true" Color="Color.Primary" UncheckedColor="Color.Default" T="bool" @bind-Value="@EmailSettings.SmtpUseDefaultCredentials"
Label="@L["SmtpUseDefaultCredentials"]" /> Label="@L["SmtpUseDefaultCredentials"]" />
</MudItem> </MudItem>
@if (!EmailSettings.SmtpUseDefaultCredentials) @if (!EmailSettings.SmtpUseDefaultCredentials)
@ -58,7 +58,7 @@
@if (HasSendTestEmailPermission) @if (HasSendTestEmailPermission)
{ {
<MudButton Color="Color.Primary" <MudButton Color="Color.Primary"
Variant="Variant.Outlined"
OnClick="@OpenSendTestEmailDialogAsync" OnClick="@OpenSendTestEmailDialogAsync"
Class="me-2"> Class="me-2">
@L["SendTestEmail"] @L["SendTestEmail"]
@ -73,7 +73,7 @@
@if (HasSendTestEmailPermission) @if (HasSendTestEmailPermission)
{ {
<MudDialog @bind-Visible="@_sendTestEmailDialogVisible" Options="@(new DialogOptions { MaxWidth = MaxWidth.Medium, FullWidth = true, CloseOnEscapeKey = true })"> <MudDialog @bind-Visible="@_sendTestEmailDialogVisible" Options="@(new DialogOptions { BackdropClick = false, MaxWidth = MaxWidth.Medium, FullWidth = true, CloseOnEscapeKey = true })">
<TitleContent> <TitleContent>
<MudText Typo="Typo.h6">@L["SendTestEmail"]</MudText> <MudText Typo="Typo.h6">@L["SendTestEmail"]</MudText>
</TitleContent> </TitleContent>

Loading…
Cancel
Save