Browse Source

feat: update MudBlazor bundling and enhance email settings UI components

pull/25235/head
maliming 4 weeks 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
.StyleBundles
.Add(BlazorStandardBundles.Styles.Global, bundle =>
.Add(BlazorServerMudBlazorStandardBundles.Styles.Global, bundle =>
{
bundle.AddContributors(typeof(BlazorServerMudBlazorStyleContributor));
});
options
.ScriptBundles
.Add(BlazorStandardBundles.Scripts.Global, bundle =>
.Add(BlazorServerMudBlazorStandardBundles.Scripts.Global, bundle =>
{
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;
public class BlazorStandardBundles
public class BlazorServerMudBlazorStandardBundles
{
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 PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd";
return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
}
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 PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd";
return PropertyInfo.IsDate() ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
}
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;
if (!isNullableType)
{
var enumType = isNullableType
? Nullable.GetUnderlyingType(PropertyInfo.Type)!
: PropertyInfo.Type;
SelectedValue = (int)enumType.GetEnumValues().GetValue(0)!;
SelectedValue = (int)PropertyInfo.Type.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;
}
private async void ApplicationConfigurationChanged()
private void ApplicationConfigurationChanged()
{
Menu = await MenuManager.GetMainMenuAsync();
await InvokeAsync(StateHasChanged);
_ = InvokeAsync(async () =>
{
Menu = await MenuManager.GetMainMenuAsync();
StateHasChanged();
});
}
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();
await InvokeAsync(StateHasChanged);
_ = InvokeAsync(async () =>
{
await GetToolbarItemRendersAsync();
StateHasChanged();
});
}
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
@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>
<MudText Typo="Typo.h6">@L["Features"]@ProviderKeyDisplayName</MudText>
</TitleContent>

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

@ -5,7 +5,7 @@
@if (EmailSettings != null)
{
<MudForm @ref="@_emailFormRef" Model="@EmailSettings">
<MudGrid>
<MudGrid Spacing="2">
<MudItem xs="12">
<MudTextField Margin="Margin.Dense" @bind-Value="@EmailSettings.DefaultFromDisplayName"
Label="@L["DefaultFromDisplayName"]"
@ -27,11 +27,11 @@
Label="@L["SmtpPort"]" />
</MudItem>
<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"]" />
</MudItem>
<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"]" />
</MudItem>
@if (!EmailSettings.SmtpUseDefaultCredentials)
@ -58,7 +58,7 @@
@if (HasSendTestEmailPermission)
{
<MudButton Color="Color.Primary"
Variant="Variant.Outlined"
OnClick="@OpenSendTestEmailDialogAsync"
Class="me-2">
@L["SendTestEmail"]
@ -73,7 +73,7 @@
@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>
<MudText Typo="Typo.h6">@L["SendTestEmail"]</MudText>
</TitleContent>

Loading…
Cancel
Save