Merge pull request #9215 from abpframework/auto-merge/rel-4-3/424

Merge branch dev with rel-4.3
pull/9218/head
Berkan Sasmaz 4 years ago committed by GitHub
commit 245fe81e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Features;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.UI.Navigation;
@ -19,6 +20,12 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>();
if (!await featureChecker.IsEnabledAsync(SettingManagementFeatures.Enable))
{
return;
}
var settingManagementPageOptions = context.ServiceProvider.GetRequiredService<IOptions<SettingManagementComponentOptions>>().Value;
var settingPageCreationContext = new SettingComponentCreationContext(context.ServiceProvider);
if (!settingManagementPageOptions.Contributors.Any() ||
@ -33,7 +40,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
/* This may happen if MVC UI is being used in the same application.
* In this case, we are removing the MVC setting management UI. */
context.Menu.GetAdministration().TryRemoveMenuItem(SettingManagementMenus.GroupName);
context.Menu
.GetAdministration()
.AddItem(
@ -60,4 +67,4 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
return false;
}
}
}
}

@ -1,6 +1,6 @@
@page "/setting-management"
@using Microsoft.AspNetCore.Authorization
@attribute [Authorize(SettingManagementPermissions.Emailing)]
@using Volo.Abp.Features
@attribute [RequiresFeature(SettingManagementFeatures.Enable)]
@* ************************* PAGE HEADER ************************* *@
<PageHeader Title="@L["Settings"]" BreadcrumbItems="@BreadcrumbItems">
@ -39,4 +39,4 @@
</Content>
</Tabs>
</CardBody>
</Card>
</Card>

@ -26,6 +26,8 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Features\Volo.Abp.Features.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Validation\Volo.Abp.Validation.csproj" />
</ItemGroup>
</Project>

@ -1,11 +1,15 @@
using Volo.Abp.Modularity;
using Volo.Abp.Features;
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.Validation;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.SettingManagement
{
[DependsOn(typeof(AbpLocalizationModule))]
[DependsOn(typeof(AbpLocalizationModule),
typeof(AbpValidationModule),
typeof(AbpFeaturesModule))]
public class AbpSettingManagementDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

@ -14,6 +14,9 @@
"SmtpEnableSsl": "Enable ssl",
"SmtpUseDefaultCredentials": "Use default credentials",
"DefaultFromAddress": "Default from address",
"DefaultFromDisplayName": "Default from display name"
"DefaultFromDisplayName": "Default from display name",
"Feature:SettingManagementGroup": "Setting Management",
"Feature:SettingManagementEnable": "Enable setting management",
"Feature:SettingManagementEnableDescription": "Enable setting management system in the application."
}
}

@ -14,6 +14,9 @@
"SmtpEnableSsl": "Ssl'i aktif et",
"SmtpUseDefaultCredentials": "Varsayılan yetkilendirmeleri kullan",
"DefaultFromAddress": "Varsayılan gönderici görünen isim",
"DefaultFromDisplayName": "Varsayılan gönderici email adresi"
"DefaultFromDisplayName": "Varsayılan gönderici email adresi",
"Feature:SettingManagementGroup": "Ayar yönetimi",
"Feature:SettingManagementEnable": "Ayar yönetimini etkinleştir",
"Feature:SettingManagementEnableDescription": "Uygulamada ayar yönetim sistemini etkinleştirin."
}
}

@ -14,6 +14,9 @@
"SmtpEnableSsl": "启用ssl",
"SmtpUseDefaultCredentials": "使用默认证书",
"DefaultFromAddress": "默认发件人",
"DefaultFromDisplayName": "默认显示名称"
"DefaultFromDisplayName": "默认显示名称",
"Feature:SettingManagementGroup": "设置管理",
"Feature:SettingManagementEnable": "启用设置管理",
"Feature:SettingManagementEnableDescription": "在应用程序中启用设置管理系统."
}
}

@ -14,6 +14,9 @@
"SmtpEnableSsl": "啟用 SSL",
"SmtpUseDefaultCredentials": "使用預設Credentials",
"DefaultFromAddress": "預設發信信箱",
"DefaultFromDisplayName": "預設信件顯示名稱"
"DefaultFromDisplayName": "預設信件顯示名稱",
"Feature:SettingManagementGroup": "設定管理",
"Feature:SettingManagementEnable": "啟用設定管理",
"Feature:SettingManagementEnableDescription": "在應用程序中啟用設定管理系統."
}
}
}

@ -0,0 +1,27 @@
using Volo.Abp.Features;
using Volo.Abp.Localization;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.Validation.StringValues;
namespace Volo.Abp.SettingManagement
{
public class SettingManagementFeatureDefinitionProvider: FeatureDefinitionProvider
{
public override void Define(IFeatureDefinitionContext context)
{
var group = context.AddGroup(SettingManagementFeatures.GroupName,
L("Feature:SettingManagementGroup"));
group.AddFeature(SettingManagementFeatures.Enable,
"true",
L("Feature:SettingManagementEnable"),
L("Feature:SettingManagementEnableDescription"),
new ToggleStringValueType());
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<AbpSettingManagementResource>(name);
}
}
}

@ -0,0 +1,9 @@
namespace Volo.Abp.SettingManagement
{
public class SettingManagementFeatures
{
public const string GroupName = "TextManagement";
public const string Enable = GroupName + ".Enable";
}
}

@ -43,11 +43,6 @@ namespace Volo.Abp.SettingManagement.Web
options.FileSets.AddEmbedded<AbpSettingManagementWebModule>();
});
Configure<RazorPagesOptions>(options =>
{
options.Conventions.AuthorizePage("/SettingManagement/Index", SettingManagementPermissions.Emailing);
});
Configure<AbpBundlingOptions>(options =>
{
options.ScriptBundles

@ -1,9 +1,8 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Features;
using Volo.Abp.SettingManagement.Web.Pages.SettingManagement;
using Volo.Abp.UI.Navigation;
using Volo.Abp.SettingManagement.Localization;
@ -26,6 +25,12 @@ namespace Volo.Abp.SettingManagement.Web.Navigation
return;
}
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>();
if (!await featureChecker.IsEnabledAsync(SettingManagementFeatures.Enable))
{
return;
}
var settingManagementPageOptions = context.ServiceProvider.GetRequiredService<IOptions<SettingManagementPageOptions>>().Value;
var settingPageCreationContext = new SettingPageCreationContext(context.ServiceProvider);
if (!settingManagementPageOptions.Contributors.Any() ||

@ -4,9 +4,11 @@ using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.EventBus.Local;
using Volo.Abp.Features;
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement
{
[RequiresFeature(SettingManagementFeatures.Enable)]
public class IndexModel : AbpPageModel
{
public SettingPageCreationContext SettingPageCreationContext { get; private set; }

Loading…
Cancel
Save