Elements: Hide element actions from the document notifications dialog (closes #23053)#23059
Conversation
|
Claude finished @AndyButland's task in 2m 33s —— View job PR ReviewTarget: Sets
Suggestions
Approved with Suggestions for improvementClean, targeted fix. The |
There was a problem hiding this comment.
Pull request overview
This PR prevents “Element” actions from appearing in the Document Notifications dialog by setting ShowInNotifier => false on the v18 element-related IAction implementations, aligning the UI with what the notification system actually supports for documents. It also adds a unit test that asserts the DocumentNotificationPresentationFactory only includes actions flagged to show in the notifier.
Changes:
- Set
ShowInNotifiertofalsefor 11 element/element-container actions so they are excluded from document notification options. - Added
DocumentNotificationPresentationFactoryTeststo verify the factory filters actions byShowInNotifier.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/Factories/DocumentNotificationPresentationFactoryTests.cs | Adds a contract-style unit test ensuring only actions with ShowInNotifier are included. |
| src/Umbraco.Core/Actions/ActionElementUpdate.cs | Hides element update action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementRollback.cs | Hides element rollback action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementPublish.cs | Hides element publish action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementNew.cs | Hides element create action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementMove.cs | Hides element move action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementDelete.cs | Hides element delete action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementCopy.cs | Hides element copy action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementContainerUpdate.cs | Hides element container update action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementContainerNew.cs | Hides element container create action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementContainerMove.cs | Hides element container move action from document notifications (ShowInNotifier=false). |
| src/Umbraco.Core/Actions/ActionElementContainerDelete.cs | Hides element container delete action from document notifications (ShowInNotifier=false). |
Description
The new element actions (
ActionElement*/ActionElementContainer*) were registered withShowInNotifier => true, andDocumentNotificationPresentationFactoryreturns every action with that flag set. As a result the document Notifications dialog listed element options that:elementpublish,elementcontainercreate, …), andUserNotificationsHandleronly handlesContent*notifications, so element subscriptions would never produce an email.This PR sets
ShowInNotifier => falseon the 11 affected element actions. All of them keepCanBePermissionAssigned => true, so theActionCollectionBuilderinvariant holds and Library-section element permissions are unaffected.Also adds
DocumentNotificationPresentationFactoryTests, a contract test using customIActionimplementations verifying the factory includes only actions withShowInNotifierset (so it won't false-fail if element actions legitimately opt back in later).Fixes #23053
Out of scope
A real element notifications feature (Notifications dialog in the Library section, element notification endpoints, and
Element*notification email handling). Maybe we want that in the future? If so, when that's built, the flags can be flipped back andactions_element*localization keys added.Testing
Open up the Notifications dialog and verify that the elements related actions are no longer shown.