You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added new ConfigurationPresentationFactory, that is responsible for creating the configuration models
Added new IReservedNamesService that will return all the reserved names for a given model (Member, Media, Content)
Added 3 new property settings, so that users (or package devs) can define their own reserved names.
How to test
Using the 3 configuration endpoint, assert that you get the correct list of reserved names
Try configuring the property settings & add some reserved names yourself, assert these also get returned via the endpoints
You can use this code to configure the property settings:
public class TestComposer : IComposer
{
public void Compose(IUmbracoBuilder builder) =>
builder.Services.Configure<ContentPropertySettings>(
x =>
{
x.AddReservedFieldName("myReservedFieldName");
x.AddReservedFieldName("anotherOne");
});
}
I just stumbled across the ReservedFieldNamesService.cs and found it a bit weird that it's placed as part of the Umbraco.PublishedCache.NuCache as it doesn't seem to be needed in a caching context. I can see the only dependency that isn't available outside Umbraco.PublishedCache.NuCache in the file is PublishedMember so maybe an interface should be created instead so the service doesn't have a hard link to the internal cache implementation.
@nikcio There is a reason that we have left the implementation in the NuCache project, this is because the PublishedMember is internal and is at the moment, and is only available in this project 😢
At some point, we could probably move it, by making PublishedMember public or refactoring it in some way, but that was too big of a scope creep at this point 🙈
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes
IReservedNamesServicethat will return all the reserved names for a given model (Member, Media, Content)How to test