Skip to content

Global Elements - take one#21431

Merged
kjac merged 101 commits intov18/devfrom
v17/feature/global-elements
Feb 3, 2026
Merged

Global Elements - take one#21431
kjac merged 101 commits intov18/devfrom
v17/feature/global-elements

Conversation

@kjac
Copy link
Contributor

@kjac kjac commented Jan 16, 2026

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This is the first part of the Global Elements feature. It is not feature complete, but the foundation is in place, and we believe it makes the most sense to carry on development in smaller feature branches off v18/dev.

kjac and others added 30 commits July 25, 2025 14:19
# Conflicts:
#	src/Umbraco.Core/Persistence/Constants-Locks.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/EntityRepository.cs
# Conflicts:
#	src/Umbraco.Core/Persistence/Repositories/IDocumentRepository.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.PublishedCache.HybridCache/Factories/PublishedContentFactory.cs
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Mapping/Content/ContentMapDefinition.cs
#	src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentVariantResponseModel.cs
#	src/Umbraco.Core/Persistence/Repositories/IDocumentRepository.cs
#	src/Umbraco.Core/Services/IContentService.cs
# Conflicts:
#	src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentVariantResponseModel.cs
#	src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
#	src/Umbraco.Core/Services/ContentPublishingService.cs
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

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

I've given this a fairly thorough once-over, within reason for what's a big PR and one with work still to do once merged, and plenty of lead time before release. It looks very good and thorough, and almost everything I can see might be missing is marked with a TODO and hence known.

There are some missing things that I'll detail here, but so long as these are considered and tracked I don't see any reason why they shouldn't come in smaller, subsequent PRs.


Potentially missing management API controllers which should be considered (from comparing with the implementation for documents):

  • Documents have a GetAuditLogDocumentController but we don't have the equivalent for elements.
  • Documents have a SearchDocumentItemController but we don't have the equivalent for elements.
  • Documents have a SortDocumentController - I guess we don't need this for elements, but should the folders support it? Maybe not necessary as the numbers should be much lower.
  • Document have controllers in the Umbraco.Cms.Api.Management.Controllers.Document.References namespace, but we don't have equivalents for elements.
    • As well as the details of references on the "Info" workspace view, these are also needed to support the configuration DisableDeleteWhenReferenced and DisableUnpublishWhenReferenced.

One clarifying question - what's the plan for "element types" here? I.e. document, media and member have document, media and member types. Are elements going to be made from document types with "is element" selected still?

If so, I see validation on create/update element is still to do, but this should check the provided type is an element.


Scheduled publishing of elements doesn't look to be hooked up yet. This is triggered from ScheduledPublishingJob calling _contentService.PerformScheduledPublish(), but there's no equivalent for elements implemented yet.

Similarly ContentVersionCleanupJob only calls IContentVersionService.PerformContentVersionCleanup(). The equivalent on IElementVersionService isn't called.

Webhooks aren't implemented - i.e. there's no equivalent of ContentSavedWebhookEvent used for documents.

kjac and others added 3 commits January 21, 2026 12:13
…-elements

# Conflicts:
#	src/Umbraco.Infrastructure/Persistence/Dtos/DocumentDto.cs
#	src/Umbraco.Infrastructure/Persistence/Dtos/DocumentVersionDto.cs
Grant the admin user group access to the element root node and all
element permissions when upgrading from a previous version. This
ensures parity with fresh installations where the admin group receives
these permissions by default.
@kjac
Copy link
Contributor Author

kjac commented Jan 21, 2026

Thanks, @AndyButland

I'll dig into the concrete suggestions later.

As for your remarks:

Potentially missing management API controllers which should be considered (from comparing with the implementation for documents)

Excellent points. The current backlog contains tasks to resolve them 👍

One clarifying question - what's the plan for "element types" here?

We will continue to use the current setup with a boolean flag on document types, even if it would be more ideal to have dedicated element types like we have media types. Introducing dedicated element types (and handling all the subsequent migration) is a potential future project with a LOT of implications that need hashing out first.

Scheduled publishing of elements doesn't look to be hooked up yet. This is triggered from ScheduledPublishingJob calling _contentService.PerformScheduledPublish(), but there's no equivalent for elements implemented yet.
Similarly ContentVersionCleanupJob only calls IContentVersionService.PerformContentVersionCleanup(). The equivalent on IElementVersionService isn't called.
Webhooks aren't implemented - i.e. there's no equivalent of ContentSavedWebhookEvent used for documents.

Good catch. Some of this is already in the backlog, some is not. I will create tasks.

lauraneto and others added 8 commits January 22, 2026 11:49
…ission tests

Update WriterUserGroupAssertionModel to expect Forbidden for operations
that Writers don't have permission for, matching Document controller
behavior and the actual permissions assigned to the Writer group.

Changed from OK/Created to Forbidden:
- CopyElementControllerTests
- DeleteElementControllerTests
- MoveElementControllerTests
- MoveToRecycleBinElementControllerTests
- PublishElementControllerTests
- UnpublishElementControllerTests
- Folder/DeleteElementFolderControllerTests
- Folder/MoveElementFolderControllerTests
- Folder/MoveToRecycleBinElementFolderControllerTests
- RecycleBin/DeleteElementRecycleBinControllerTests
- RecycleBin/DeleteElementFolderRecycleBinControllerTests
- RecycleBin/EmptyElementRecycleBinControllerTests
…ition

The ForColumns parameter incorrectly specified PublishedColumnName twice
instead of IdColumnName and PublishedColumnName, causing SQL Server to
reject index creation with "duplicate column names" error on new installs.
…ve elements (#21483)

* Add missing element mapper and allow deleting element types with active elements

* Update src/Umbraco.Core/Services/ContentTypeService.cs

Co-authored-by: Laura Neto <[email protected]>

* Update src/Umbraco.Core/Services/ContentTypeService.cs

Co-authored-by: Laura Neto <[email protected]>

---------

Co-authored-by: Laura Neto <[email protected]>
lauraneto and others added 6 commits January 23, 2026 18:52
…on authorization policies (#21501)

Add Elements access to data type, document type, and relation authorization policies
# Conflicts:
#	src/Umbraco.Core/Persistence/Constants-Locks.cs
#	src/Umbraco.Core/Persistence/Repositories/IDocumentRepository.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
* chore: generate new openapi types

* Added package/module for "Library"

* Added default dashboard for Library section

* [WIP] Adds "Elements" package module

Basics of the tree/menu.

* Adds entity-actions for Create and Reload

* Adds entity-action for Move To

* Adds collection workspace view

for root and folders

* Adds entity-action for Duplicate To

* "Reload Children" should only be for root & folders

* Reworked Library sidebar app

Replaced with Elements sidebar app
Removed the Library menu

* chore: generate new openapi types

* Added Item repository

* Added Reference repository

* Added Element Recycle Bin

Tree, menu, entity-actions, workspace (collection view)

* Adds "umb-element-tree-item" to identify the `isTrashed` state

* Re-added Library sidebar app

Removed Library dashboard (we'll figure it out later)

* Recycle Bin type tweaks

* [WIP] Element "Create" modal

* Reverted Element "Create" modal, to use create-options + picker

* chore: generate new openapi types

* Added Element Detail Repository

* [WIP] Element Workspace + Context

* Elements: Add workspace views for edit and info

Add edit and info workspace views to the Element workspace:
- Edit view using shared 'contentEditor' kind pattern
- Info view displaying state tag, dates, element type, and ID
- Menu structure context for tree navigation
- Split-view component for variant editing

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Elements: Add save action and trash state handling

- Add Save workspace action using UmbSubmitWorkspaceAction
- Add isTrashed property to UmbElementDetailModel
- Implement trash state change handling with read-only guard
- Add recycle bin event listeners for trash/restore actions

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Adds Workspace actions for Save, Publish, Scheduled Publish

* Adds Element Configuration repository

* Adds mock handle + data for Elements

* Adds Publish and Unpublish entity actions for Elements

Implements context menu actions for publishing and unpublishing elements
directly from the tree. Uses existing modals and publishing repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* package-lock.json update

* Adds bulk entity actions for Publish, Unpublish, Move and Trash

* Localization keys + code tweaks

* Adds reusable `emptyRecycleBin` `collectionAction` kind

* Adds `emptyRecycleBin` for Element Recycle Bin collection

* Element Recycle Bin refactoring

Working towards folder support

* Relations: exported entity-action types

* Restructured "Element Folder" code

* Restructured "Trash" entity-bulk-action code

* Adds `trashFolder` `entityAction` kind

* Adds "Trash" entity-action for Element Folders

* Tidy-up / restructuring

* [WIP] Element Picker property-editor UI

making use of an Elements property-data-source,
with Entity Picker.

* Renamed `UmbElementPropertyDatasetContext` to `UmbElementWorkspacePropertyDatasetContext`

to de-duplicate a class name clash with the underlying base class.

* Added "entity-data-picker" importmap

Exposing the "umb-input-entity-data" component

* Reworking the "Element Picker" property-editor UI

to reuse the Entity Picker internal input component

* Implemented "Element Item Data Resolver" helper

* chore: generate new openapi types

* Fixed up the mocks and types

with new Element start nodes and `noAccess` fields.

* Added UI for "Elements Start Nodes"

* Added "entity-data-picker" export to the Vite config

* Fixed Element Folder picker for "start nodes"

* Adds UI for Element's User Permissions

* Adds Element User Permission condition

Implemented the user permissions for entity actions, etc.

* Adds UI for Element's Granular Permissions

* Adds element-folder item repository

* Element Recycle Bin: implemented `isTrashed`

* Fixed mock folder data manager

* Adds move entity-action for element-folder

Implements the Move action for element folders using the
ElementService.putElementFolderByIdMove API endpoint.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Fix typos and element tag name mismatches in elements package

- Fix typo 'now' -> 'no' in user-permissions/types.ts
- Fix HTMLElementTagNameMap tag name to match @CustomElement decorator
- Fix typo 'TDOD' -> 'TODO' in element-detail.server.data-source.ts
- Fix missing 'u' prefix in element-picker tag name declaration

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* Ignore local Claude settings in UI Client

* Updated workspace assign access,

to disable root access when start nodes are selected.

* Elements: Display trashed state in Element workspace info panel (#21542)

The state tag in the Element workspace info view was missing a case
for the TRASHED state, causing trashed Elements to incorrectly display
"Not created" instead of "Trashed".

* Elements: Fix folder link in recycle bin list view (#21543)

The trashed element name column always used the element workspace path
pattern, causing folders clicked in the recycle bin list view to show
"Not found". Now checks isFolder and uses the correct workspace path
pattern for folders vs elements.

* Elements: Add missing delete permission conditions to recycle bin actions (#21547)

The Empty Recycle Bin collection action and the folder delete entity
action were missing user permission conditions, making them visible
to users without delete permission.

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
Co-authored-by: Laura Neto <[email protected]>
@kjac kjac marked this pull request as ready for review February 2, 2026 13:16
@kjac kjac merged commit 46b96f3 into v18/dev Feb 3, 2026
24 of 26 checks passed
@kjac kjac deleted the v17/feature/global-elements branch February 3, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants