forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Async in IShapeTableProvider (OrchardCMS#14864)
- Loading branch information
1 parent
00befda
commit 9ffa9a5
Showing
34 changed files
with
349 additions
and
300 deletions.
There are no files selected for viewing
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
8 changes: 1 addition & 7 deletions
8
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/YoutubeFieldSetting.Edit.cshtml
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
7 changes: 5 additions & 2 deletions
7
src/OrchardCore.Modules/OrchardCore.Demo/Shapes/DemoShapeProvider.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
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
38 changes: 20 additions & 18 deletions
38
src/OrchardCore.Modules/OrchardCore.Html/Media/MediaShapes.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,28 +1,30 @@ | ||
using System.Threading.Tasks; | ||
using OrchardCore.DisplayManagement.Descriptors; | ||
using OrchardCore.Modules; | ||
|
||
namespace OrchardCore.Html.Media | ||
namespace OrchardCore.Html.Media; | ||
|
||
[RequireFeatures("OrchardCore.Media")] | ||
public class MediaShapes : ShapeTableProvider | ||
{ | ||
[RequireFeatures("OrchardCore.Media")] | ||
public class MediaShapes : IShapeTableProvider | ||
public override ValueTask DiscoverAsync(ShapeTableBuilder builder) | ||
{ | ||
public void Discover(ShapeTableBuilder builder) | ||
{ | ||
builder.Describe("HtmlBodyPart_Edit") | ||
.OnDisplaying(displaying => | ||
builder.Describe("HtmlBodyPart_Edit") | ||
.OnDisplaying(displaying => | ||
{ | ||
var editor = displaying.Shape; | ||
if (editor.Metadata.Type == "HtmlBodyPart_Edit__Wysiwyg") | ||
{ | ||
var editor = displaying.Shape; | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__HtmlBodyPart"); | ||
} | ||
if (editor.Metadata.Type == "HtmlBodyPart_Edit__Wysiwyg") | ||
{ | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__HtmlBodyPart"); | ||
} | ||
if (editor.Metadata.Type == "HtmlBodyPart_Edit__Trumbowyg") | ||
{ | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__HtmlBodyPart"); | ||
} | ||
}); | ||
|
||
if (editor.Metadata.Type == "HtmlBodyPart_Edit__Trumbowyg") | ||
{ | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__HtmlBodyPart"); | ||
} | ||
}); | ||
} | ||
return ValueTask.CompletedTask; | ||
} | ||
} |
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
46 changes: 24 additions & 22 deletions
46
src/OrchardCore.Modules/OrchardCore.Markdown/Media/MediaShapes.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,34 +1,36 @@ | ||
using System.Threading.Tasks; | ||
using OrchardCore.DisplayManagement.Descriptors; | ||
using OrchardCore.Modules; | ||
|
||
namespace OrchardCore.Markdown.Media | ||
namespace OrchardCore.Markdown.Media; | ||
|
||
[RequireFeatures("OrchardCore.Media")] | ||
public class MediaShapes : ShapeTableProvider | ||
{ | ||
[RequireFeatures("OrchardCore.Media")] | ||
public class MediaShapes : IShapeTableProvider | ||
public override ValueTask DiscoverAsync(ShapeTableBuilder builder) | ||
{ | ||
public void Discover(ShapeTableBuilder builder) | ||
{ | ||
builder.Describe("MarkdownBodyPart_Edit") | ||
.OnDisplaying(displaying => | ||
builder.Describe("MarkdownBodyPart_Edit") | ||
.OnDisplaying(displaying => | ||
{ | ||
var editor = displaying.Shape; | ||
if (editor.Metadata.Type == "MarkdownBodyPart_Edit__Wysiwyg") | ||
{ | ||
var editor = displaying.Shape; | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__MarkdownBodyPart"); | ||
} | ||
}); | ||
|
||
if (editor.Metadata.Type == "MarkdownBodyPart_Edit__Wysiwyg") | ||
{ | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__MarkdownBodyPart"); | ||
} | ||
}); | ||
builder.Describe("MarkdownField_Edit") | ||
.OnDisplaying(displaying => | ||
{ | ||
var editor = displaying.Shape; | ||
builder.Describe("MarkdownField_Edit") | ||
.OnDisplaying(displaying => | ||
if (editor.Metadata.Type == "MarkdownField_Edit__Wysiwyg") | ||
{ | ||
var editor = displaying.Shape; | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__MarkdownBodyPart"); | ||
} | ||
}); | ||
|
||
if (editor.Metadata.Type == "MarkdownField_Edit__Wysiwyg") | ||
{ | ||
editor.Metadata.Wrappers.Add("Media_Wrapper__MarkdownBodyPart"); | ||
} | ||
}); | ||
} | ||
return ValueTask.CompletedTask; | ||
} | ||
} |
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.