Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Feb 26, 2022
1 parent bc5f1b1 commit 5ca5f15
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
1 change: 1 addition & 0 deletions cli/Squidex.CLI/Squidex.CLI.Tests/FolderTreeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using FakeItEasy;
using Squidex.CLI.Commands.Implementation;
using Squidex.CLI.Commands.Implementation.Sync;
using Squidex.ClientLibrary.Management;
using Xunit;

Expand Down
6 changes: 3 additions & 3 deletions cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.2.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="FakeItEasy" Version="7.3.0" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.695">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="CommandDotNet.FluentValidation" Version="5.0.1" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license.
// ==========================================================================


#pragma warning disable SA1313 // Parameter names should begin with lower-case letter

namespace Squidex.CLI.Commands.Implementation.Sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,10 @@ await log.DoSafeAsync($"Schema {model.Name} creating", async () =>
await model.Schema.MapReferencesAsync(schemaMap);
await model.Schema.MapFoldersAsync(sync.Folders, false);

var version = schemasByName[model.Name].Version;

if (!options.Delete)
{
model.Schema.NoFieldRecreation = true;
}
model.Schema.NoFieldDeletion |= !options.Delete;
model.Schema.NoFieldRecreation |= !options.Recreate;

if (!options.Recreate)
{
model.Schema.NoFieldRecreation = true;
}
var version = schemasByName[model.Name].Version;

await log.DoVersionedAsync($"Schema {model.Name} updating", version, async () =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void Set(object source, object? value)

private readonly IPropertyAccessor internalAccessor;

public PropertyAccessor(Type targetType, PropertyInfo propertyInfo)
public PropertyAccessor(PropertyInfo propertyInfo)
{
var type = typeof(PropertyWrapper<,>).MakeGenericType(propertyInfo.DeclaringType!, propertyInfo.PropertyType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ static ClassMapper()
if (sourceType == targetType)
{
Mappers.Add(new PropertyMapper(
new PropertyAccessor(sourceClassType, sourceProperty),
new PropertyAccessor(targetClassType, targetProperty)));
new PropertyAccessor(sourceProperty),
new PropertyAccessor(targetProperty)));
}
else if (targetType == typeof(string))
{
Mappers.Add(new StringConversionPropertyMapper(
new PropertyAccessor(sourceClassType, sourceProperty),
new PropertyAccessor(targetClassType, targetProperty)));
new PropertyAccessor(sourceProperty),
new PropertyAccessor(targetProperty)));
}
else
{
Expand All @@ -177,15 +177,15 @@ static ClassMapper()
if (converter.CanConvertFrom(sourceType))
{
Mappers.Add(new TypeConverterPropertyMapper(
new PropertyAccessor(sourceClassType, sourceProperty),
new PropertyAccessor(targetClassType, targetProperty),
new PropertyAccessor(sourceProperty),
new PropertyAccessor(targetProperty),
converter));
}
else if (sourceType.Implements<IConvertible>() || targetType.Implements<IConvertible>())
{
Mappers.Add(new ConversionPropertyMapper(
new PropertyAccessor(sourceClassType, sourceProperty),
new PropertyAccessor(targetClassType, targetProperty),
new PropertyAccessor(sourceProperty),
new PropertyAccessor(targetProperty),
targetType));
}
}
Expand Down
9 changes: 5 additions & 4 deletions cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Copyright>MIT</Copyright>
<Description>Command Line Interface for Squidex Headless CMS</Description>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<PackageIcon>logo-squared.png</PackageIcon>
Expand All @@ -16,24 +17,24 @@
<TargetFramework>net6.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ToolCommandName>sq</ToolCommandName>
<Version>8.1</Version>
<Version>8.2</Version>
</PropertyGroup>
<ItemGroup>
<None Remove="Commands\Implementation\OpenLibrary\Structure\schemas\author.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandDotNet" Version="6.0.1" />
<PackageReference Include="CommandDotNet" Version="6.0.5" />
<PackageReference Include="CommandDotNet.FluentValidation" Version="5.0.1" />
<PackageReference Include="ConsoleTables" Version="2.4.2" />
<PackageReference Include="CommandDotNet.IoC.MicrosoftDependencyInjection" Version="4.0.1" />
<PackageReference Include="CoreTweet" Version="1.0.0.483" />
<PackageReference Include="CsvHelper" Version="27.2.1" />
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
<PackageReference Include="Meziantou.Analyzer" Version="1.0.695">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NJsonSchema" Version="10.6.4" />
<PackageReference Include="NJsonSchema" Version="10.6.10" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Slugify.Core" Version="3.0.0" />
<PackageReference Include="Squidex.Text" Version="1.7.0" />
Expand Down

0 comments on commit 5ca5f15

Please sign in to comment.