-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into issue/OFFI-119
- Loading branch information
Showing
70 changed files
with
613 additions
and
446 deletions.
There are no files selected for viewing
75 changes: 42 additions & 33 deletions
75
Lombiq.HelpfulExtensions.Tests.UI/Constants/GeneratedMigrationCodes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,48 @@ | ||
using System; | ||
using Shouldly; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Lombiq.HelpfulExtensions.Tests.UI.Constants; | ||
|
||
internal static class GeneratedMigrationCodes | ||
{ | ||
// Environment.NewLine is used for this to work regardless of the mismatch of line ending style between the code | ||
// file, the platform where it was compiled, and where it was executed. | ||
public static string Page = | ||
string.Join( | ||
Environment.NewLine, | ||
"_contentDefinitionManager.AlterTypeDefinition(\"Page\", type => type", | ||
" .DisplayedAs(\"Page\")", | ||
" .Creatable()", | ||
" .Listable()", | ||
" .Draftable()", | ||
" .Versionable()", | ||
" .Securable()", | ||
" .WithPart(\"TitlePart\", part => part", | ||
" .WithPosition(\"0\")", | ||
" )", | ||
" .WithPart(\"AutoroutePart\", part => part", | ||
" .WithPosition(\"1\")", | ||
" .WithSettings(new AutoroutePartSettings", | ||
" {", | ||
" AllowCustomPath = true,", | ||
" ShowHomepageOption = true,", | ||
" Pattern = \"{{ Model.ContentItem | display_text | slugify }}\",", | ||
" })", | ||
" )", | ||
" .WithPart(\"FlowPart\", part => part", | ||
" .WithPosition(\"2\")", | ||
" )", | ||
" .WithPart(\"Page\", part => part", | ||
" .WithPosition(\"3\")", | ||
" )", | ||
");", | ||
string.Empty); | ||
[SuppressMessage( | ||
"Usage", | ||
"MA0136:Raw String contains an implicit end of line character", | ||
Justification = "It's wrapped to prevent issues related to that.")] | ||
private const string Page = | ||
""" | ||
_contentDefinitionManager.AlterTypeDefinition("Page", type => type | ||
.DisplayedAs("Page") | ||
.Creatable() | ||
.Listable() | ||
.Draftable() | ||
.Versionable() | ||
.Securable() | ||
.WithPart("TitlePart", part => part | ||
.WithPosition("0") | ||
) | ||
.WithPart("AutoroutePart", part => part | ||
.WithPosition("1") | ||
.WithSettings(new AutoroutePartSettings | ||
{ | ||
AllowCustomPath = true, | ||
Pattern = {{ Model.ContentItem | display_text | slugify }}, | ||
ShowHomepageOption = true, | ||
AllowUpdatePath = false, | ||
AllowDisabled = false, | ||
AllowRouteContainedItems = false, | ||
ManageContainedItemRoutes = false, | ||
AllowAbsolutePath = false, | ||
}) | ||
) | ||
.WithPart("FlowPart", part => part | ||
.WithPosition("2") | ||
) | ||
.WithPart("Page", part => part | ||
.WithPosition("3") | ||
) | ||
); | ||
"""; | ||
|
||
public static void ShouldBePage(string actual) => actual.ShouldBeByLine(Page); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Code Generation Helpful Extensions | ||
|
||
## Content definition code generation | ||
|
||
Generates migration code from content definitions. You can use this to create (or edit) a content type on the admin and then move its creation to a migration class. Generated migration code is displayed under the content types' editors, just enable the feature. Check out [this demo video](https://www.youtube.com/watch?v=KOlsLaIzgm8) to see this in action. | ||
|
||
![Content definition code generation textbox on the admin, showing generated migration code for the Page content type.](../../../Docs/Attachments/ContentTypeCodeGeneration.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.