Skip to content

V14: Add reserved fields to config endpoints#15919

Merged
Zeegaan merged 6 commits intov14/devfrom
v14/feature/add-reserved-fields-to-config-endpoints
Mar 22, 2024
Merged

V14: Add reserved fields to config endpoints#15919
Zeegaan merged 6 commits intov14/devfrom
v14/feature/add-reserved-fields-to-config-endpoints

Conversation

@Zeegaan
Copy link
Copy Markdown
Member

@Zeegaan Zeegaan commented Mar 20, 2024

Notes

  • Added configuration endpoint for members
  • 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");
            });
}

Copy link
Copy Markdown
Contributor

@elit0451 elit0451 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💪

@Zeegaan Zeegaan merged commit dd68a6d into v14/dev Mar 22, 2024
@Zeegaan Zeegaan deleted the v14/feature/add-reserved-fields-to-config-endpoints branch March 22, 2024 11:11
@Zeegaan Zeegaan added the project/bellissima AKA "the new backoffice" label Mar 22, 2024
@nikcio
Copy link
Copy Markdown
Contributor

nikcio commented Apr 28, 2024

Hey @Zeegaan

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.

Just a thought 😄

@Zeegaan
Copy link
Copy Markdown
Member Author

Zeegaan commented Apr 29, 2024

@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 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

project/bellissima AKA "the new backoffice" release/14.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants