Lots of progress

This commit is contained in:
2024-04-05 23:22:45 -05:00
parent 23ec66dd88
commit 96b48fb46a
16 changed files with 191 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
using Oap.OapApplication;
using Oap.OapExplanation;
using OrchardCore.Autoroute.Models;
using OrchardCore.ContentFields.Fields;
using OrchardCore.ContentFields.Settings;
@@ -114,5 +115,41 @@ public class Migrations : DataMigration
return 2;
}
public async Task<int> UpdateFrom2Async()
{
await m_contentDefinitionManager
.AlterPartDefinitionAsync(nameof(OapExplanationPart), part => part
.Attachable());
await m_contentDefinitionManager
.AlterTypeDefinitionAsync(ContentTypes.OapExplanation, type => type
.WithPart<OapExplanationPart>()
.Stereotype("Widget"));
return 3;
}
public async Task<int> UpdateFrom3Async()
{
await m_contentDefinitionManager
.AlterPartDefinitionAsync(nameof(OapExplanationPart), part => part
.WithField(nameof(OapExplanationPart.Text), field => field
.OfType(nameof(HtmlField))
.WithDisplayName(nameof(OapExplanationPart.Text))
.WithDescription("A detailed explanation of a field.")));
return 4;
}
public async Task<int> UpdateFrom4Async()
{
await m_contentDefinitionManager
.AlterPartDefinitionAsync(nameof(OapExplanationPart), part => part
.WithField(nameof(OapExplanationPart.Text), field => field
.WithSettings(new ContentPartFieldSettings { Editor = "Wysiwyg" })));
return 5;
}
private readonly IContentDefinitionManager m_contentDefinitionManager;
}