Merge pull request #15314 from abpframework/auto-merge/rel-7-0/1634

Merge branch dev with rel-7.0
pull/15319/head^2
maliming 2 years ago committed by GitHub
commit 82d7bda841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -182,8 +182,13 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency
var versionAttribute = package.Attributes["Version"]; var versionAttribute = package.Attributes["Version"];
var currentVersion = versionAttribute.Value; var currentVersion = versionAttribute.Value;
var currentSemanticVersion = SemanticVersion.Parse(currentVersion); var isVersionParsed = SemanticVersion.TryParse(currentVersion, out var currentSemanticVersion);
if (!isVersionParsed)
{
Logger.LogWarning("Could not parse package \"{0}\" version v{1}. Skipped.", packageId, currentVersion);
continue;
}
var isLeptonXPackage = packageId.Contains("LeptonX"); var isLeptonXPackage = packageId.Contains("LeptonX");
Logger.LogDebug("Checking package: \"{0}\" - Current version: {1}", packageId, currentSemanticVersion); Logger.LogDebug("Checking package: \"{0}\" - Current version: {1}", packageId, currentSemanticVersion);
@ -194,7 +199,7 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency
{ {
continue; continue;
} }
if (await SpecifiedVersionExists(specifiedVersion, packageId)) if (await SpecifiedVersionExists(specifiedVersion, packageId))
{ {
var specifiedSemanticVersion = SemanticVersion.Parse(specifiedVersion); var specifiedSemanticVersion = SemanticVersion.Parse(specifiedVersion);
@ -235,12 +240,12 @@ public class VoloNugetPackagesVersionUpdater : ITransientDependency
SemanticVersion latestVersion; SemanticVersion latestVersion;
if (currentSemanticVersion.IsPrerelease && !switchToStable) if (currentSemanticVersion.IsPrerelease && !switchToStable)
{ {
latestVersion = latestNugetReleaseCandidateVersion == null || isLeptonXPackage ? latestVersion = latestNugetReleaseCandidateVersion == null || isLeptonXPackage ?
await _nuGetService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: true) : latestNugetReleaseCandidateVersion; await _nuGetService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: true) : latestNugetReleaseCandidateVersion;
} }
else else
{ {
latestVersion = latestNugetVersion == null || isLeptonXPackage ? latestVersion = latestNugetVersion == null || isLeptonXPackage ?
await _nuGetService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: includeReleaseCandidates) : latestNugetVersion; await _nuGetService.GetLatestVersionOrNullAsync(packageId, includeReleaseCandidates: includeReleaseCandidates) : latestNugetVersion;
} }

@ -11,7 +11,7 @@ public abstract class FeatureCheckerBase : IFeatureChecker, ITransientDependency
public virtual async Task<bool> IsEnabledAsync(string name) public virtual async Task<bool> IsEnabledAsync(string name)
{ {
var value = await GetOrNullAsync(name); var value = await GetOrNullAsync(name);
if (value == null) if (value.IsNullOrEmpty())
{ {
return false; return false;
} }

@ -100,11 +100,11 @@ public class FeatureDefinition : ICanCreateChildFeature
bool isVisibleToClients = true, bool isVisibleToClients = true,
bool isAvailableToHost = true) bool isAvailableToHost = true)
{ {
Name = name; Name = Check.NotNullOrWhiteSpace(name, nameof(name));
DefaultValue = defaultValue; DefaultValue = defaultValue;
DisplayName = displayName ?? new FixedLocalizableString(name); DisplayName = displayName ?? new FixedLocalizableString(name);
Description = description; Description = description;
ValueType = valueType; ValueType = valueType ?? new ToggleStringValueType();
IsVisibleToClients = isVisibleToClients; IsVisibleToClients = isVisibleToClients;
IsAvailableToHost = isAvailableToHost; IsAvailableToHost = isAvailableToHost;

@ -70,7 +70,7 @@ public class FeatureDefinitionRecord : BasicAggregateRoot<Guid>, IHasExtraProper
DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), FeatureDefinitionRecordConsts.MaxDisplayNameLength); DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), FeatureDefinitionRecordConsts.MaxDisplayNameLength);
Description = Check.Length(description, nameof(description), FeatureDefinitionRecordConsts.MaxDescriptionLength); Description = Check.Length(description, nameof(description), FeatureDefinitionRecordConsts.MaxDescriptionLength);
DefaultValue = Check.NotNullOrWhiteSpace(defaultValue, nameof(defaultValue), FeatureDefinitionRecordConsts.MaxDefaultValueLength); DefaultValue = Check.Length(defaultValue, nameof(defaultValue), FeatureDefinitionRecordConsts.MaxDefaultValueLength);
IsVisibleToClients = isVisibleToClients; IsVisibleToClients = isVisibleToClients;
IsAvailableToHost = isAvailableToHost; IsAvailableToHost = isAvailableToHost;

@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Storage;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Sqlite; using Volo.Abp.EntityFrameworkCore.Sqlite;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace Volo.Abp.FeatureManagement.EntityFrameworkCore; namespace Volo.Abp.FeatureManagement.EntityFrameworkCore;
@ -26,6 +27,11 @@ public class AbpFeatureManagementEntityFrameworkCoreTestModule : AbpModule
abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection);
}); });
}); });
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
} }
private static SqliteConnection CreateDatabaseAndGetConnection() private static SqliteConnection CreateDatabaseAndGetConnection()

Loading…
Cancel
Save