Management API: Refactor element tree controllers to use start node filter service#22598
Draft
Management API: Refactor element tree controllers to use start node filter service#22598
Conversation
Move user start node filtering logic from UserStartNodeFolderTreeControllerBase and ElementTreeControllerBase into a dedicated ElementStartNodeTreeFilterService, matching the pattern established for document and media trees in PR #22486. Add a virtual TreeObjectTypes property to UserStartNodeTreeFilterService so element trees can query both Element and ElementContainer object types.
|
Hi there @lauraneto, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
UserStartNodeFolderTreeControllerBaseto delegate start node filtering toIUserStartNodeTreeFilterService, matching the pattern established for document and media trees in Management API: Reduce user start node tree filtering code duplication #22486IElementStartNodeTreeFilterServiceandElementStartNodeTreeFilterServiceto handle element-specific start node resolution (bothElementandElementContainerobject types)TreeObjectTypesproperty toUserStartNodeTreeFilterServiceso subclasses can supply multiple object types without changing the base class contractRoot,Children,Ancestors,Siblings) to use the new service via DIThis is the v18 counterpart to #22486 (v17), covering the element tree controllers that were introduced in v18. The original v18 PR was #22016 (closed).
Testing
Open the backoffice and navigate to the element tree. Verify that root, children, ancestors, and sibling tree operations behave the same as before for both admin users (root access, no filtering) and restricted users (with element start nodes configured). Confirm that folder nodes and element nodes both appear correctly in the tree.