diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index e4b3d032a4c..d6518a0af3a 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -212,6 +212,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EntityFrameworkCore.PostgreSql", "src\Volo.Abp.EntityFrameworkCore.PostgreSql\Volo.Abp.EntityFrameworkCore.PostgreSql.csproj", "{882E82F1-1A57-4BB9-B126-4CBF700C8F0C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Localization.Abstractions", "src\Volo.Abp.Localization.Abstractions\Volo.Abp.Localization.Abstractions.csproj", "{20513A4E-FAC7-4106-8976-5D79A3BDFED1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -598,6 +600,10 @@ Global {882E82F1-1A57-4BB9-B126-4CBF700C8F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {882E82F1-1A57-4BB9-B126-4CBF700C8F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {882E82F1-1A57-4BB9-B126-4CBF700C8F0C}.Release|Any CPU.Build.0 = Release|Any CPU + {20513A4E-FAC7-4106-8976-5D79A3BDFED1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20513A4E-FAC7-4106-8976-5D79A3BDFED1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20513A4E-FAC7-4106-8976-5D79A3BDFED1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20513A4E-FAC7-4106-8976-5D79A3BDFED1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -700,6 +706,7 @@ Global {D3E07597-BB3D-4249-B873-607E2C128C0E} = {447C8A77-E5F0-4538-8687-7383196D04EA} {77A621CF-9562-411B-A707-C7C02CC3B8FA} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {882E82F1-1A57-4BB9-B126-4CBF700C8F0C} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {20513A4E-FAC7-4106-8976-5D79A3BDFED1} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs index 5b48e6101ba..d7913f0d2d5 100644 --- a/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs +++ b/framework/src/Volo.Abp.Authorization/Volo/Abp/Authorization/Permissions/PermissionDefinition.cs @@ -28,6 +28,9 @@ public ILocalizableString DisplayName public IReadOnlyList Children => _children.ToImmutableList(); private readonly List _children; + /// + /// Can be used to get/set custom properties for this permission definition. + /// public Dictionary Properties { get; } /// diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj b/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj new file mode 100644 index 00000000000..b4df348774d --- /dev/null +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo.Abp.Localization.Abstractions.csproj @@ -0,0 +1,20 @@ + + + + + + netstandard2.0 + Volo.Abp.Localization.Abstractions + Volo.Abp.Localization.Abstractions + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + diff --git a/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/AbpLocalizationAbstractionsModule.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/AbpLocalizationAbstractionsModule.cs new file mode 100644 index 00000000000..0008b7d1bc0 --- /dev/null +++ b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/AbpLocalizationAbstractionsModule.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace Volo.Abp.Localization +{ + public class AbpLocalizationAbstractionsModule : AbpModule + { + + } +} diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/FixedLocalizableString.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/FixedLocalizableString.cs similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/FixedLocalizableString.cs rename to framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/FixedLocalizableString.cs diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizableString.cs b/framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs similarity index 100% rename from framework/src/Volo.Abp.Localization/Volo/Abp/Localization/ILocalizableString.cs rename to framework/src/Volo.Abp.Localization.Abstractions/Volo/Abp/Localization/ILocalizableString.cs diff --git a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj index 0acdb086277..a512bfc580b 100644 --- a/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj +++ b/framework/src/Volo.Abp.Localization/Volo.Abp.Localization.csproj @@ -22,6 +22,7 @@ + diff --git a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs index c94d881030a..3fcd90ac6d1 100644 --- a/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs +++ b/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/AbpLocalizationModule.cs @@ -1,5 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Localization.Resources.AbpValidation; +using Volo.Abp.Localization.Resources.AbpValidation; using Volo.Abp.Modularity; using Volo.Abp.Settings; using Volo.Abp.VirtualFileSystem; @@ -8,7 +7,8 @@ namespace Volo.Abp.Localization { [DependsOn( typeof(AbpVirtualFileSystemModule), - typeof(AbpSettingsModule) + typeof(AbpSettingsModule), + typeof(AbpLocalizationAbstractionsModule) )] public class AbpLocalizationModule : AbpModule { diff --git a/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj b/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj index 5d5da4549f4..6ba4d46c1f6 100644 --- a/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj +++ b/framework/src/Volo.Abp.Settings/Volo.Abp.Settings.csproj @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs index ae6d61b0c82..8900e8e0a35 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/AbpSettingsModule.cs @@ -1,7 +1,11 @@ -using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; namespace Volo.Abp.Settings { + [DependsOn( + typeof(AbpLocalizationAbstractionsModule) + )] public class AbpSettingsModule : AbpModule { diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingDefinition.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingDefinition.cs index d65d143362f..58726492c69 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingDefinition.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingDefinition.cs @@ -1,15 +1,32 @@ -namespace Volo.Abp.Settings +using System.Collections.Generic; +using JetBrains.Annotations; +using Volo.Abp.Localization; + +namespace Volo.Abp.Settings { public class SettingDefinition { /// /// Unique name of the setting. /// + [NotNull] public string Name { get; } + [NotNull] + public ILocalizableString DisplayName + { + get => _displayName; + set => _displayName = Check.NotNull(value, nameof(value)); + } + private ILocalizableString _displayName; + + [CanBeNull] + public ILocalizableString Description { get; set; } + /// /// Default value of the setting. /// + [CanBeNull] public string DefaultValue { get; set; } /// @@ -26,24 +43,27 @@ public class SettingDefinition public bool IsInherited { get; set; } /// - /// Can be used to store a custom object related to this setting. + /// Can be used to get/set custom properties for this setting definition. /// - public object CustomData { get; set; } //TODO: Convert to dictionary! - - //TODO: Add Properties dictionary for custom stuff (and remove CustomData) + [NotNull] + public Dictionary Properties { get; } public SettingDefinition( string name, string defaultValue = null, + ILocalizableString displayName = null, + ILocalizableString description = null, bool isVisibleToClients = false, - bool isInherited = true, - object customData = null) + bool isInherited = true) { Name = name; DefaultValue = defaultValue; IsVisibleToClients = isVisibleToClients; + DisplayName = displayName ?? new FixedLocalizableString(name); + Description = description; IsInherited = isInherited; - CustomData = customData; + + Properties = new Dictionary(); } } } \ No newline at end of file