Skip to content

Commit 5ca5f15

Browse files
Minor fixes.
1 parent bc5f1b1 commit 5ca5f15

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

cli/Squidex.CLI/Squidex.CLI.Tests/FolderTreeTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
using FakeItEasy;
99
using Squidex.CLI.Commands.Implementation;
10+
using Squidex.CLI.Commands.Implementation.Sync;
1011
using Squidex.ClientLibrary.Management;
1112
using Xunit;
1213

cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="FakeItEasy" Version="7.2.0" />
9-
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
8+
<PackageReference Include="FakeItEasy" Version="7.3.0" />
9+
<PackageReference Include="Meziantou.Analyzer" Version="1.0.695">
1010
<PrivateAssets>all</PrivateAssets>
1111
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1212
</PackageReference>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
1414
<PackageReference Include="CommandDotNet.FluentValidation" Version="5.0.1" />
1515
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
1616
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/Sync/FolderNode.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

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

1110
namespace Squidex.CLI.Commands.Implementation.Sync

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/Sync/Schemas/SchemasSynchronizer.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,10 @@ await log.DoSafeAsync($"Schema {model.Name} creating", async () =>
122122
await model.Schema.MapReferencesAsync(schemaMap);
123123
await model.Schema.MapFoldersAsync(sync.Folders, false);
124124

125-
var version = schemasByName[model.Name].Version;
126-
127-
if (!options.Delete)
128-
{
129-
model.Schema.NoFieldRecreation = true;
130-
}
125+
model.Schema.NoFieldDeletion |= !options.Delete;
126+
model.Schema.NoFieldRecreation |= !options.Recreate;
131127

132-
if (!options.Recreate)
133-
{
134-
model.Schema.NoFieldRecreation = true;
135-
}
128+
var version = schemasByName[model.Name].Version;
136129

137130
await log.DoVersionedAsync($"Schema {model.Name} updating", version, async () =>
138131
{

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/Utils/PropertyAccessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void Set(object source, object? value)
5757

5858
private readonly IPropertyAccessor internalAccessor;
5959

60-
public PropertyAccessor(Type targetType, PropertyInfo propertyInfo)
60+
public PropertyAccessor(PropertyInfo propertyInfo)
6161
{
6262
var type = typeof(PropertyWrapper<,>).MakeGenericType(propertyInfo.DeclaringType!, propertyInfo.PropertyType);
6363

cli/Squidex.CLI/Squidex.CLI/Commands/Implementation/Utils/SimpleMapper.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ static ClassMapper()
161161
if (sourceType == targetType)
162162
{
163163
Mappers.Add(new PropertyMapper(
164-
new PropertyAccessor(sourceClassType, sourceProperty),
165-
new PropertyAccessor(targetClassType, targetProperty)));
164+
new PropertyAccessor(sourceProperty),
165+
new PropertyAccessor(targetProperty)));
166166
}
167167
else if (targetType == typeof(string))
168168
{
169169
Mappers.Add(new StringConversionPropertyMapper(
170-
new PropertyAccessor(sourceClassType, sourceProperty),
171-
new PropertyAccessor(targetClassType, targetProperty)));
170+
new PropertyAccessor(sourceProperty),
171+
new PropertyAccessor(targetProperty)));
172172
}
173173
else
174174
{
@@ -177,15 +177,15 @@ static ClassMapper()
177177
if (converter.CanConvertFrom(sourceType))
178178
{
179179
Mappers.Add(new TypeConverterPropertyMapper(
180-
new PropertyAccessor(sourceClassType, sourceProperty),
181-
new PropertyAccessor(targetClassType, targetProperty),
180+
new PropertyAccessor(sourceProperty),
181+
new PropertyAccessor(targetProperty),
182182
converter));
183183
}
184184
else if (sourceType.Implements<IConvertible>() || targetType.Implements<IConvertible>())
185185
{
186186
Mappers.Add(new ConversionPropertyMapper(
187-
new PropertyAccessor(sourceClassType, sourceProperty),
188-
new PropertyAccessor(targetClassType, targetProperty),
187+
new PropertyAccessor(sourceProperty),
188+
new PropertyAccessor(targetProperty),
189189
targetType));
190190
}
191191
}

cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Copyright>MIT</Copyright>
77
<Description>Command Line Interface for Squidex Headless CMS</Description>
88
<ImplicitUsings>enable</ImplicitUsings>
9+
<LangVersion>latest</LangVersion>
910
<Nullable>enable</Nullable>
1011
<OutputType>Exe</OutputType>
1112
<PackageIcon>logo-squared.png</PackageIcon>
@@ -16,24 +17,24 @@
1617
<TargetFramework>net6.0</TargetFramework>
1718
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
1819
<ToolCommandName>sq</ToolCommandName>
19-
<Version>8.1</Version>
20+
<Version>8.2</Version>
2021
</PropertyGroup>
2122
<ItemGroup>
2223
<None Remove="Commands\Implementation\OpenLibrary\Structure\schemas\author.json" />
2324
</ItemGroup>
2425
<ItemGroup>
25-
<PackageReference Include="CommandDotNet" Version="6.0.1" />
26+
<PackageReference Include="CommandDotNet" Version="6.0.5" />
2627
<PackageReference Include="CommandDotNet.FluentValidation" Version="5.0.1" />
2728
<PackageReference Include="ConsoleTables" Version="2.4.2" />
2829
<PackageReference Include="CommandDotNet.IoC.MicrosoftDependencyInjection" Version="4.0.1" />
2930
<PackageReference Include="CoreTweet" Version="1.0.0.483" />
3031
<PackageReference Include="CsvHelper" Version="27.2.1" />
3132
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
32-
<PackageReference Include="Meziantou.Analyzer" Version="1.0.680">
33+
<PackageReference Include="Meziantou.Analyzer" Version="1.0.695">
3334
<PrivateAssets>all</PrivateAssets>
3435
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3536
</PackageReference>
36-
<PackageReference Include="NJsonSchema" Version="10.6.4" />
37+
<PackageReference Include="NJsonSchema" Version="10.6.10" />
3738
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
3839
<PackageReference Include="Slugify.Core" Version="3.0.0" />
3940
<PackageReference Include="Squidex.Text" Version="1.7.0" />

0 commit comments

Comments
 (0)