-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathGridToBlockListMigrator.cs
30 lines (25 loc) · 1.4 KB
/
GridToBlockListMigrator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Umbraco.Cms.Core.Composing;
using uSync.Migrations.Core.Context;
using uSync.Migrations.Core.Migrators;
using uSync.Migrations.Core.Migrators.Models;
namespace MyMigrations;
[SyncMigrator(Umbraco.Cms.Core.Constants.PropertyEditors.Aliases.Grid)]
[HideFromTypeFinder] // hide from type if you don't want to automatically load this one (you have to replace in a composer)
// [SyncDefaultMigrator] // set it to default if you do load it and always want it to be the one you use. (can be overriden by preferred)
internal class GridToBlockListMigrator : SyncPropertyMigratorBase
{
/// <summary>
/// the migrated editor alias.
/// </summary>
/// <remarks>
/// e.g if you are converting Umbraco.Grid to Umbraco.BlockGrid
/// </remarks>
public override string GetEditorAlias(SyncMigrationDataTypeProperty propertyModel, SyncMigrationContext context)
=> Umbraco.Cms.Core.Constants.PropertyEditors.Aliases.BlockList;
// TODO: Convert the grid config to block list grid.
public override object? GetConfigValues(SyncMigrationDataTypeProperty dataTypeModel, SyncMigrationContext context)
=> base.GetConfigValues(dataTypeModel, context);
// TODO: Convert grid content to blocklist grid content
public override string? GetContentValue(SyncMigrationContentProperty contentProperty, SyncMigrationContext context)
=> base.GetContentValue(contentProperty, context);
}