-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Member types: Implement containers #20706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I've extended this now to add the client-side support, and also aligned further with media types such that we have features to move, duplicate, export and import. Seemed like it might be a bit dangerous to have a management API that supports features that the UI doesn't, in case some uses this - e.g. via the MCP Server - to create things they can't then use. And this way we can hopefully roll forward rather than roll back. I've moved the target branch to |
# Conflicts: # src/Umbraco.Web.UI.Client/package-lock.json # src/Umbraco.Web.UI.Client/package.json # version.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds folder support to the member type tree in Umbraco CMS, bringing it in line with functionality already available for document types and media types. The changes enable hierarchical organization of member types through folders.
Key changes include:
- Added folder entity type (
UMB_MEMBER_TYPE_FOLDER_ENTITY_TYPE) and container support for member types - Implemented folder creation, update, delete, move, duplicate, import, and export operations
- Added tree endpoints for ancestors, children, and siblings with folder filtering
- Updated the member type tree to support both folders and member types as tree items
Reviewed Changes
Copilot reviewed 106 out of 106 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/Umbraco.Web.UI.Client/src/packages/members/member-type/entity.ts |
Added new folder entity type constant |
src/Umbraco.Web.UI.Client/src/packages/members/member-type/tree/types.ts |
Updated tree item model to support folder entity types |
src/Umbraco.Web.UI.Client/src/packages/members/member-type/tree/server-data-source/* |
Created new server data source implementation with full tree support |
src/Umbraco.Web.UI.Client/src/packages/members/member-type/tree/folder/* |
Added complete folder workspace, repository, and manifest implementation |
src/Umbraco.Web.UI.Client/src/packages/members/member-type/entity-actions/* |
Added move, duplicate, import/export actions for member types |
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberTypeContainerRepository.cs |
Replaced no-op implementation with actual entity container repository |
src/Umbraco.Core/Services/ContentTypeEditing/MemberTypeEditingService.cs |
Updated to support container (parent folder) during creation |
src/Umbraco.Cms.Api.Management/Controllers/MemberType/* |
Added API controllers for move, import, export, and tree operations |
.../packages/members/member-type/tree/server-data-source/member-type-tree.server.data-source.ts
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
Outdated
Show resolved
Hide resolved
Totally understandable, although I'd then suggest merging ac20b43 and b9a5fd5, so at least the service works and Deploy can add support for it by targeting CMS 17.0.0. Maybe some base classes of the controllers can already be updated as well, so those don't end up as breaking changes. As long as the tree API endpoints don't return the containers/folders yet, the UI will simply not show them yet and nothing in the CMS will seem 'broken'. |
|
Added in #20715 @ronaldbarendse. I found I couldn't make the controller base class changes and be compatible with the current front-end. |
|
Thanks Andy! Including those changes in the next 17 RC should allow us to implement deploying member type containers/folders in Deploy and introduce the remaining UI work in a future minor 💪🏻 I had a quick look at changes to the existing base classes and the following changes shouldn't be breaking:
The remaining changes should be made backwards compatible using default implementations or adding additional overloads. We might want to already add the optional
|
|
Thanks @ronaldbarendse - I've added those last two to #20715 |
ronaldbarendse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also reviewed the code and couldn't find any obvious issues, but did experience the following when testing in the backoffice:
- Moving an item from a folder back to the root works, but besides the green 'Moved' notification, also shows a red 'Menu loading failed. Showing the first items again.' error and doesn't update the tree.
- Performing a manual 'Reload children' on the tree root will show '...' at the bottom, which only shows the actual items after clicking/expanding it.
- Something similar happens when creating a new folder (but at the top, since folders are shown first).
Other than this, all actions (create, rename, move, delete, duplicate, export and import) do work as expected.
|
Thanks for the testing @ronaldbarendse. I saw issues similar to these, but I think they are outside of this PR: |
|
The frontend changes look good. We need to be aware that there is a fair bit of code duplication, especially around the import/export of content types. It would be good to make that reusable at some point. But let's get this merged first, as there's already more than enough happening. 😃 @nikolajlauridsen, feel free to merge after you've had a look. |
# Conflicts: # src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/RootMemberTypeTreeController.cs # src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/SiblingMemberTypeTreeController.cs
PR #16914 got merged and targeted for v17, but only contains a partial implementation of PR #14833 that targeted v13 (but was closed).
This fixes the error when creating a new member type folder using the Management API (thrown from
EntityContainer), updates the no-opIMemberTypeContainerRepositoryimplementation to inherit from the shared base container repository (so something actually gets persisted) and updates/adds the required member type container API endpoints.All the
/umbraco/management/api/v1/member-type/folderendpoints now work and the/umbraco/management/api/v1/tree/member-typeone returns the folders as well. However, the backoffice UI still needs to be updated to support the folders (hence I'm currently creating this as a draft PR):