Sharpening up everything!
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Oap.OapApplication;
|
||||
using Oap.OapExplanation;
|
||||
using OrchardCore.Autoroute.Models;
|
||||
using OrchardCore.ContentFields.Fields;
|
||||
using OrchardCore.ContentFields.Settings;
|
||||
@@ -7,6 +6,7 @@ using OrchardCore.ContentManagement.Metadata;
|
||||
using OrchardCore.ContentManagement.Metadata.Settings;
|
||||
using OrchardCore.Data.Migration;
|
||||
using OrchardCore.Flows.Models;
|
||||
using OrchardCore.Forms.Models;
|
||||
using OrchardCore.Html.Models;
|
||||
using OrchardCore.Html.Settings;
|
||||
using OrchardCore.Lists.Models;
|
||||
@@ -115,40 +115,128 @@ public class Migrations : DataMigration
|
||||
return 2;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom2Async()
|
||||
public 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;
|
||||
return Task.FromResult(3);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom3Async()
|
||||
public 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;
|
||||
return Task.FromResult(4);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom4Async()
|
||||
public Task<int> UpdateFrom4Async()
|
||||
{
|
||||
return Task.FromResult(5);
|
||||
}
|
||||
|
||||
public Task<int> UpdateFrom5Async()
|
||||
{
|
||||
return Task.FromResult(6);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom6Async()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterPartDefinitionAsync(nameof(OapExplanationPart), part => part
|
||||
.WithField(nameof(OapExplanationPart.Text), field => field
|
||||
.WithSettings(new ContentPartFieldSettings { Editor = "Wysiwyg" })));
|
||||
.AlterTypeDefinitionAsync(ContentTypes.OapApplicationForm, type => type
|
||||
.WithPart(nameof(TitlePart)));
|
||||
|
||||
return 5;
|
||||
return 7;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom7Async()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Input", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("1")
|
||||
.WithDisplayName("Details to help the user correctly fill out this form field.")
|
||||
.WithEditor("Wysiwyg")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("TextArea", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("1")
|
||||
.WithDisplayName("Details to help the user correctly fill out this form field.")
|
||||
.WithEditor("Wysiwyg")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Select", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("1")
|
||||
.WithDisplayName("Details to help the user correctly fill out this form field.")
|
||||
.WithEditor("Wysiwyg")
|
||||
));
|
||||
|
||||
return 8;
|
||||
}
|
||||
|
||||
public async Task<int> UpdateFrom8Async()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Input", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("4")
|
||||
)
|
||||
.WithPart("InputPart", part => part
|
||||
.WithPosition("5")
|
||||
)
|
||||
.WithPart("FormElementValidationPart", part => part
|
||||
.WithPosition("6")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("TextArea", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("4")
|
||||
)
|
||||
.WithPart("TextAreaPart", part => part
|
||||
.WithPosition("5")
|
||||
)
|
||||
.WithPart("FormElementValidationPart", part => part
|
||||
.WithPosition("6")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Select", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithPosition("4")
|
||||
)
|
||||
.WithPart("SelectPart", part => part
|
||||
.WithPosition("5")
|
||||
)
|
||||
.WithPart("FormElementValidationPart", part => part
|
||||
.WithPosition("6")
|
||||
));
|
||||
|
||||
return 9;
|
||||
}
|
||||
public async Task<int> UpdateFrom9Async()
|
||||
{
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Input", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithDisplayName("Explanation")
|
||||
.WithDescription("Details to help the user correctly fill out this form field.")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("TextArea", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithDisplayName("Explanation")
|
||||
.WithDescription("Details to help the user correctly fill out this form field.")
|
||||
));
|
||||
|
||||
await m_contentDefinitionManager
|
||||
.AlterTypeDefinitionAsync("Select", type => type
|
||||
.WithPart("Explanation", "HtmlBodyPart", part => part
|
||||
.WithDisplayName("Explanation")
|
||||
.WithDescription("Details to help the user correctly fill out this form field.")
|
||||
));
|
||||
|
||||
return 10;
|
||||
}
|
||||
|
||||
private readonly IContentDefinitionManager m_contentDefinitionManager;
|
||||
|
||||
Reference in New Issue
Block a user