Clean & rename feature management module

pull/870/head
Halil ibrahim Kalkan 6 years ago
parent 4f5b688864
commit 1dcb2620e3

@ -1,5 +1,4 @@
using Volo.Abp.Application;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.FeatureManagement.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -8,28 +7,23 @@ using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementDomainSharedModule),
typeof(AbpFeatureManagementDomainSharedModule),
typeof(AbpDddApplicationModule)
)]
public class FeatureManagementApplicationContractsModule : AbpModule
public class AbpFeatureManagementApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<PermissionOptions>(options =>
{
options.DefinitionProviders.Add<FeatureManagementPermissionDefinitionProvider>();
});
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<FeatureManagementApplicationContractsModule>();
options.FileSets.AddEmbedded<AbpFeatureManagementApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<FeatureManagementResource>()
.AddVirtualJson("/Abp/FeatureManagement/Localization/ApplicationContracts");
.Get<AbpFeatureManagementResource>()
.AddVirtualJson("/Volo/Abp/FeatureManagement/Localization/ApplicationContracts");
});
}
}

@ -1,19 +0,0 @@
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.FeatureManagement.Localization;
using Volo.Abp.Localization;
namespace Volo.Abp.FeatureManagement
{
public class FeatureManagementPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
//var moduleGroup = context.AddGroup(FeatureManagementPermissions.GroupName, L("Permission:FeatureManagement"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<FeatureManagementResource>(name);
}
}
}

@ -1,15 +0,0 @@
namespace Volo.Abp.FeatureManagement
{
public class FeatureManagementPermissions
{
public const string GroupName = "FeatureManagement";
public static string[] GetAll()
{
return new[]
{
GroupName
};
}
}
}

@ -5,11 +5,11 @@ using Volo.Abp.Settings;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementDomainModule),
typeof(FeatureManagementApplicationContractsModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpAutoMapperModule)
)]
public class FeatureManagementApplicationModule : AbpModule
public class AbpFeatureManagementApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

@ -2,7 +2,7 @@
{
public static class FeatureManagementSettings
{
public const string GroupName = "FeatureManagement";
public const string GroupName = "AbpFeatureManagement";
/* Add constants for setting names. Example:
* public const string MySettingName = GroupName + ".MySettingName";

@ -7,13 +7,13 @@ namespace Volo.Abp.FeatureManagement
[DependsOn(
typeof(AbpLocalizationModule)
)]
public class FeatureManagementDomainSharedModule : AbpModule
public class AbpFeatureManagementDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources.Add<FeatureManagementResource>("en");
options.Resources.Add<AbpFeatureManagementResource>("en");
});
}
}

@ -2,6 +2,6 @@
{
public static class FeatureManagementDomainErrorCodes
{
//Add your business exception error codes here...
}
}

@ -2,8 +2,8 @@
namespace Volo.Abp.FeatureManagement.Localization
{
[LocalizationResourceName("FeatureManagement")]
public class FeatureManagementResource
[LocalizationResourceName("AbpFeatureManagement")]
public class AbpFeatureManagementResource
{
}

@ -7,25 +7,27 @@ using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementDomainSharedModule)
typeof(AbpFeatureManagementDomainSharedModule)
)]
public class FeatureManagementDomainModule : AbpModule
public class AbpFeatureManagementDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<FeatureManagementDomainModule>();
options.FileSets.AddEmbedded<AbpFeatureManagementDomainModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources.Get<FeatureManagementResource>().AddVirtualJson("/Abp/FeatureManagement/Localization/Domain");
options.Resources
.Get<AbpFeatureManagementResource>()
.AddVirtualJson("/Volo/Abp/FeatureManagement/Localization/Domain");
});
Configure<ExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("FeatureManagement", typeof(FeatureManagementResource));
options.MapCodeNamespace("AbpFeatureManagement", typeof(AbpFeatureManagementResource));
});
}
}

@ -2,7 +2,7 @@
{
public static class FeatureManagementConsts
{
public const string DefaultDbTablePrefix = "FeatureManagement";
public const string DefaultDbTablePrefix = "Abp";
public const string DefaultDbSchema = null;
}

@ -5,10 +5,10 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
[DependsOn(
typeof(FeatureManagementDomainModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpEntityFrameworkCoreModule)
)]
public class FeatureManagementEntityFrameworkCoreModule : AbpModule
public class AbpFeatureManagementEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

@ -4,17 +4,13 @@ using Volo.Abp.EntityFrameworkCore;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
[ConnectionStringName("FeatureManagement")]
[ConnectionStringName("AbpFeatureManagement")]
public class FeatureManagementDbContext : AbpDbContext<FeatureManagementDbContext>, IFeatureManagementDbContext
{
public static string TablePrefix { get; set; } = FeatureManagementConsts.DefaultDbTablePrefix;
public static string Schema { get; set; } = FeatureManagementConsts.DefaultDbSchema;
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
public FeatureManagementDbContext(DbContextOptions<FeatureManagementDbContext> options)
: base(options)
{

@ -3,7 +3,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
[ConnectionStringName("FeatureManagement")]
[ConnectionStringName("AbpFeatureManagement")]
public interface IFeatureManagementDbContext : IEfCoreDbContext
{
/* Add DbSet for each Aggregate Root here. Example:

@ -5,16 +5,16 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementApplicationContractsModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpHttpClientModule))]
public class FeatureManagementHttpApiClientModule : AbpModule
public class AbpFeatureManagementHttpApiClientModule : AbpModule
{
public const string RemoteServiceName = "FeatureManagement";
public const string RemoteServiceName = "AbpFeatureManagement";
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddHttpClientProxies(
typeof(FeatureManagementApplicationContractsModule).Assembly,
typeof(AbpFeatureManagementApplicationContractsModule).Assembly,
RemoteServiceName
);
}

@ -4,9 +4,9 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementApplicationContractsModule),
typeof(AbpFeatureManagementApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule))]
public class FeatureManagementHttpApiModule : AbpModule
public class AbpFeatureManagementHttpApiModule : AbpModule
{
}

@ -5,10 +5,10 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
[DependsOn(
typeof(FeatureManagementDomainModule),
typeof(AbpFeatureManagementDomainModule),
typeof(AbpMongoDbModule)
)]
public class FeatureManagementMongoDbModule : AbpModule
public class AbpFeatureManagementMongoDbModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

@ -3,15 +3,11 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
[ConnectionStringName("FeatureManagement")]
[ConnectionStringName("AbpFeatureManagement")]
public class FeatureManagementMongoDbContext : AbpMongoDbContext, IFeatureManagementMongoDbContext
{
public static string CollectionPrefix { get; set; } = FeatureManagementConsts.DefaultDbTablePrefix;
/* Add mongo collections here. Example:
* public IMongoCollection<Question> Questions => Collection<Question>();
*/
protected override void CreateModel(IMongoModelBuilder modelBuilder)
{
base.CreateModel(modelBuilder);

@ -9,6 +9,7 @@ namespace Volo.Abp.FeatureManagement.MongoDB
[NotNull] string tablePrefix = FeatureManagementConsts.DefaultDbTablePrefix)
: base(tablePrefix)
{
}
}
}

@ -3,11 +3,9 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.FeatureManagement.MongoDB
{
[ConnectionStringName("FeatureManagement")]
[ConnectionStringName("AbpFeatureManagement")]
public interface IFeatureManagementMongoDbContext : IAbpMongoDbContext
{
/* Define mongo collections here. Example:
* IMongoCollection<Question> Questions { get; }
*/
}
}

@ -8,40 +8,36 @@ using Volo.Abp.FeatureManagement.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(typeof(FeatureManagementHttpApiModule))]
[DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))]
[DependsOn(typeof(AbpAutoMapperModule))]
public class FeatureManagementWebModule : AbpModule
[DependsOn(
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpAspNetCoreMvcUiThemeSharedModule),
typeof(AbpAutoMapperModule)
)]
public class AbpFeatureManagementWebModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(FeatureManagementResource), typeof(FeatureManagementWebModule).Assembly);
options.AddAssemblyResource(typeof(AbpFeatureManagementResource), typeof(AbpFeatureManagementWebModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<NavigationOptions>(options =>
{
options.MenuContributors.Add(new FeatureManagementMenuContributor());
});
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<FeatureManagementWebModule>("Abp.FeatureManagement");
options.FileSets.AddEmbedded<AbpFeatureManagementWebModule>("Volo.Abp.FeatureManagement");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<FeatureManagementResource>()
.Get<AbpFeatureManagementResource>()
.AddBaseTypes(
typeof(AbpValidationResource),
typeof(AbpUiResource)

@ -1,23 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace Volo.Abp.FeatureManagement
{
public class FeatureManagementMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenu(context);
}
}
private Task ConfigureMainMenu(MenuConfigurationContext context)
{
//Add main menu items.
return Task.CompletedTask;
}
}
}

@ -0,0 +1,13 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementDomainTestModule)
)]
public class AbpFeatureManagementApplicationTestModule : AbpModule
{
}
}

@ -1,13 +0,0 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementApplicationModule),
typeof(FeatureManagementDomainTestModule)
)]
public class FeatureManagementApplicationTestModule : AbpModule
{
}
}

@ -4,9 +4,9 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement
{
[DependsOn(
typeof(FeatureManagementEntityFrameworkCoreTestModule)
typeof(AbpFeatureManagementEntityFrameworkCoreTestModule)
)]
public class FeatureManagementDomainTestModule : AbpModule
public class AbpFeatureManagementDomainTestModule : AbpModule
{
}

@ -2,7 +2,7 @@
namespace Volo.Abp.FeatureManagement
{
public abstract class FeatureManagementDomainTestBase : FeatureManagementTestBase<FeatureManagementDomainTestModule>
public abstract class FeatureManagementDomainTestBase : FeatureManagementTestBase<AbpFeatureManagementDomainTestModule>
{
}

@ -9,10 +9,10 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
[DependsOn(
typeof(FeatureManagementTestBaseModule),
typeof(FeatureManagementEntityFrameworkCoreModule)
typeof(AbpFeatureManagementTestBaseModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule)
)]
public class FeatureManagementEntityFrameworkCoreTestModule : AbpModule
public class AbpFeatureManagementEntityFrameworkCoreTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

@ -2,7 +2,7 @@
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore
{
public class MyEntityRepository_Tests : MyEntityRepository_Tests<FeatureManagementEntityFrameworkCoreTestModule>
public class MyEntityRepository_Tests : MyEntityRepository_Tests<AbpFeatureManagementEntityFrameworkCoreTestModule>
{
}

@ -1,5 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Mongo2Go;
using Mongo2Go;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.FeatureManagement.MongoDB;
@ -8,10 +7,10 @@ using Volo.Abp.Modularity;
namespace Abp.FeatureManagement.MongoDB
{
[DependsOn(
typeof(FeatureManagementTestBaseModule),
typeof(FeatureManagementMongoDbModule)
typeof(AbpFeatureManagementTestBaseModule),
typeof(AbpFeatureManagementMongoDbModule)
)]
public class FeatureManagementMongoDbTestModule : AbpModule
public class AbpFeatureManagementMongoDbTestModule : AbpModule
{
private MongoDbRunner _mongoDbRunner;

@ -1,6 +1,6 @@
namespace Abp.FeatureManagement.MongoDB
{
public class MyEntityRepository_Tests : MyEntityRepository_Tests<FeatureManagementMongoDbTestModule>
public class MyEntityRepository_Tests : MyEntityRepository_Tests<AbpFeatureManagementMongoDbTestModule>
{
}

@ -11,9 +11,9 @@ namespace Abp.FeatureManagement
typeof(AbpAutofacModule),
typeof(AbpTestBaseModule),
typeof(AbpAuthorizationModule),
typeof(FeatureManagementDomainModule)
typeof(AbpFeatureManagementDomainModule)
)]
public class FeatureManagementTestBaseModule : AbpModule
public class AbpFeatureManagementTestBaseModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

@ -4,5 +4,6 @@ namespace Abp.FeatureManagement
{
public class FeatureManagementTestData : ISingletonDependency
{
}
}

@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Guids;
using Volo.Abp.MultiTenancy;
@ -24,8 +23,7 @@ namespace Volo.Abp.PermissionManagement
GuidGenerator = guidGenerator;
CurrentTenant = currentTenant;
}
public virtual async Task<PermissionValueProviderGrantInfo> CheckAsync(string name, string providerName, string providerKey)
{
if (providerName != Name)

Loading…
Cancel
Save