Skip to content

Commit df822b5

Browse files
Update to Deploy 15.0.0-rc1 and fix breaking changes
1 parent 8ed8be1 commit df822b5

12 files changed

+23
-244
lines changed

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
</PropertyGroup>
66
<!-- Global packages (private, build-time packages for all projects) -->
77
<ItemGroup>
8-
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
8+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.143" />
99
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
1010
<GlobalPackageReference Include="Umbraco.Code" Version="2.2.0" />
1111
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
1212
</ItemGroup>
1313
<!-- Umbraco packages -->
1414
<ItemGroup>
15-
<PackageVersion Include="Umbraco.Cms.Web.Common" Version="[15.0.0-rc1, 15)" />
16-
<PackageVersion Include="Umbraco.Deploy.Infrastructure" Version="[15.0.0--rc1.preview.14.gf9ce468, 15)" />
15+
<PackageVersion Include="Umbraco.Cms.Web.Common" Version="[15.0.0-rc1, 16)" />
16+
<PackageVersion Include="Umbraco.Deploy.Infrastructure" Version="[15.0.0-rc1, 16)" />
1717
</ItemGroup>
1818
</Project>

src/Umbraco.Deploy.Contrib/Migrators/DocTypeGridEditorPropertyTypeMigrator.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using System.Text.Json;
55
using System.Text.Json.Nodes;
66
using System.Text.Json.Serialization;
7+
using System.Threading;
8+
using System.Threading.Tasks;
79
using Microsoft.Extensions.Logging;
810
using Newtonsoft.Json;
911
using Umbraco.Cms.Core;
@@ -40,14 +42,14 @@ public DocTypeGridEditorPropertyTypeMigrator(ILogger<GridPropertyTypeMigrator> l
4042
=> _jsonSerializer = jsonSerializer;
4143

4244
/// <inheritdoc />
43-
protected override BlockItemData? MigrateGridControl(GridValue.GridControl gridControl, BlockGridConfiguration configuration, IContextCache contextCache)
45+
protected override async Task<BlockItemData?> MigrateGridControlAsync(GridValue.GridControl gridControl, BlockGridConfiguration configuration, IContextCache contextCache, CancellationToken cancellationToken = default)
4446
{
4547
if (TryDeserialize(gridControl.Value, out DocTypeGridEditorValue? value))
4648
{
47-
return MigrateGridControl(value, configuration, contextCache);
49+
return await MigrateGridControlAsync(value, configuration, contextCache).ConfigureAwait(false);
4850
}
4951

50-
return base.MigrateGridControl(gridControl, configuration, contextCache);
52+
return await base.MigrateGridControlAsync(gridControl, configuration, contextCache, cancellationToken).ConfigureAwait(false);
5153
}
5254

5355
/// <summary>
@@ -57,11 +59,11 @@ public DocTypeGridEditorPropertyTypeMigrator(ILogger<GridPropertyTypeMigrator> l
5759
/// <param name="configuration">The configuration.</param>
5860
/// <param name="contextCache">The context cache.</param>
5961
/// <returns>
60-
/// The block item data, or <c>null</c> if migration should be skipped.
62+
/// A task that represents the asynchronous operation. The task result contains the block item data, or <c>null</c> if migration should be skipped.
6163
/// </returns>
62-
protected virtual BlockItemData? MigrateGridControl(DocTypeGridEditorValue value, BlockGridConfiguration configuration, IContextCache contextCache)
64+
protected virtual async Task<BlockItemData?> MigrateGridControlAsync(DocTypeGridEditorValue value, BlockGridConfiguration configuration, IContextCache contextCache)
6365
{
64-
IContentType contentType = GetContentType(value.ContentTypeAlias, configuration, contextCache)
66+
IContentType contentType = await GetContentTypeAsync(value.ContentTypeAlias, configuration, contextCache).ConfigureAwait(false)
6567
?? throw new InvalidOperationException($"Migrating legacy grid failed, because content type with alias '{value.ContentTypeAlias}' could not be found (in the Block Grid configuration).");
6668

6769
return new BlockItemData()

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/CheckBoxListPropertyValueArtifactMigrator.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/DropDownListFlexiblePropertyValueArtifactMigrator.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/PrevaluePropertyTypeMigratorBase.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Threading;
4+
using System.Threading.Tasks;
35
using Umbraco.Cms.Core.Deploy;
46
using Umbraco.Cms.Core.Models;
57
using Umbraco.Cms.Core.Serialization;
@@ -8,7 +10,7 @@
810
namespace Umbraco.Deploy.Contrib.Migrators.Legacy;
911

1012
/// <summary>
11-
/// Migrates the property value containing prevalues (seperated by <see cref="Delimiter" />) from Umbraco 7 to a single value or JSON array.
13+
/// Migrates the property value containing pre-values (separated by <see cref="Delimiter" />) from Umbraco 7 to a single value or JSON array.
1214
/// </summary>
1315
public abstract class PrevaluePropertyTypeMigratorBase : PropertyTypeMigratorBase
1416
{
@@ -18,10 +20,10 @@ public abstract class PrevaluePropertyTypeMigratorBase : PropertyTypeMigratorBas
1820
private readonly IJsonSerializer _jsonSerializer;
1921

2022
/// <summary>
21-
/// Gets a value indicating whether the property type stores multiple prevalues as a JSON array or single value.
23+
/// Gets a value indicating whether the property type stores multiple pre-values as a JSON array or single value.
2224
/// </summary>
2325
/// <value>
24-
/// <c>true</c> if multiple prevalues are stored as a JSON array; otherwise, <c>false</c>.
26+
/// <c>true</c> if multiple pre-values are stored as a JSON array; otherwise, <c>false</c>.
2527
/// </value>
2628
protected abstract bool Multiple { get; }
2729

@@ -45,7 +47,10 @@ protected PrevaluePropertyTypeMigratorBase(string fromEditorAlias, string toEdit
4547
=> _jsonSerializer = jsonSerializer;
4648

4749
/// <inheritdoc />
48-
public override object? Migrate(IPropertyType propertyType, object? value, IDictionary<string, string> propertyEditorAliases, IContextCache contextCache)
50+
public override Task<object?> MigrateAsync(IPropertyType propertyType, object? value, IDictionary<string, string> propertyEditorAliases, IContextCache contextCache, CancellationToken cancellationToken = default)
51+
=> Task.FromResult(Migrate(propertyType));
52+
53+
private object? Migrate(object? value)
4954
{
5055
if (value is not string stringValue)
5156
{

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/PrevaluePropertyValueArtifactMigratorBase.cs

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/Umbraco.Deploy.Contrib/Migrators/Legacy/Content/RadioButtonListPropertyValueArtifactMigrator.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Umbraco.Deploy.Contrib/Migrators/Legacy/DataType/MediaPickerDataTypeArtifactMigrator.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Umbraco.Deploy.Contrib/Migrators/Legacy/DataType/MultiNodeTreePicker2DataTypeArtifactMigrator.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
21
using System.Collections.Generic;
3-
using Microsoft.Extensions.DependencyInjection;
42
using Umbraco.Cms.Core;
5-
using Umbraco.Cms.Core.DependencyInjection;
63
using Umbraco.Cms.Core.PropertyEditors;
74
using Umbraco.Cms.Core.Semver;
85
using Umbraco.Cms.Core.Serialization;
@@ -23,21 +20,6 @@ public class MultiNodeTreePicker2DataTypeArtifactMigrator : LegacyReplaceDataTyp
2320
private readonly IMediaTypeService _mediaTypeService;
2421
private readonly IMemberTypeService _memberTypeService;
2522

26-
/// <summary>
27-
/// Initializes a new instance of the <see cref="MultiNodeTreePicker2DataTypeArtifactMigrator" /> class.
28-
/// </summary>
29-
/// <param name="propertyEditors">The property editors.</param>
30-
/// <param name="configurationEditorJsonSerializer">The configuration editor JSON serializer.</param>
31-
[Obsolete("Please use the constructor taking all parameters. This constructor will be removed in a future version.")]
32-
public MultiNodeTreePicker2DataTypeArtifactMigrator(PropertyEditorCollection propertyEditors, IConfigurationEditorJsonSerializer configurationEditorJsonSerializer)
33-
: this(
34-
propertyEditors,
35-
configurationEditorJsonSerializer,
36-
StaticServiceProvider.Instance.GetRequiredService<IContentTypeService>(),
37-
StaticServiceProvider.Instance.GetRequiredService<IMediaTypeService>(),
38-
StaticServiceProvider.Instance.GetRequiredService<IMemberTypeService>())
39-
{ }
40-
4123
/// <summary>
4224
/// Initializes a new instance of the <see cref="MultiNodeTreePicker2DataTypeArtifactMigrator" /> class.
4325
/// </summary>

src/Umbraco.Deploy.Contrib/Migrators/Legacy/DataType/MultiNodeTreePickerDataTypeArtifactMigrator.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)