Skip to content

Commit

Permalink
Add CustomSettingsConstants (#15282)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Feb 15, 2024
1 parent ab8a612 commit 004e7bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace OrchardCore.CustomSettings;

public static class CustomSettingsConstants
{
public const string Stereotype = "CustomSettings";
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override async Task<IDisplayResult> EditAsync(ISite site, BuildEditorCont
var isNew = false;
var contentItem = await _customSettingsService.GetSettingsAsync(site, contentTypeDefinition, () => isNew = true);

var shape = Initialize<CustomSettingsEditViewModel>("CustomSettings", async ctx =>
var shape = Initialize<CustomSettingsEditViewModel>(CustomSettingsConstants.Stereotype, async ctx =>
{
ctx.Editor = await _contentItemDisplayManager.BuildEditorAsync(contentItem, context.Updater, isNew);
}).Location("Content:3").OnGroup(contentTypeDefinition.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task<IDictionary<string, ContentTypeDefinition>> GetContentTypeAsy
{
var contentTypes = await _contentDefinitionManager.ListTypeDefinitionsAsync();

var result = contentTypes.Where(x => x.StereotypeEquals("CustomSettings"))
var result = contentTypes.Where(x => x.StereotypeEquals(CustomSettingsConstants.Stereotype))
.ToDictionary(x => x.Name);

return result;
Expand Down

0 comments on commit 004e7bc

Please sign in to comment.