Skip to content

Elements: Hide element actions from the document notifications dialog (closes #23053)#23059

Merged
AndyButland merged 1 commit into
release/18.0from
v18/bugfix/23053-hide-element-notification-options
Jun 4, 2026
Merged

Elements: Hide element actions from the document notifications dialog (closes #23053)#23059
AndyButland merged 1 commit into
release/18.0from
v18/bugfix/23053-hide-element-notification-options

Conversation

@AndyButland

@AndyButland AndyButland commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

The new element actions (ActionElement*/ActionElementContainer*) were registered with ShowInNotifier => true, and DocumentNotificationPresentationFactory returns every action with that flag set. As a result the document Notifications dialog listed element options that:

  • Don't belong on documents,
  • Displayed as raw, untranslated aliases (elementpublish, elementcontainercreate, …), and
  • Could never do anything — UserNotificationsHandler only handles Content* notifications, so element subscriptions would never produce an email.

This PR sets ShowInNotifier => false on the 11 affected element actions. All of them keep CanBePermissionAssigned => true, so the ActionCollectionBuilder invariant holds and Library-section element permissions are unaffected.

Also adds DocumentNotificationPresentationFactoryTests, a contract test using custom IAction implementations verifying the factory includes only actions with ShowInNotifier set (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 and actions_element* localization keys added.

Testing

Open up the Notifications dialog and verify that the elements related actions are no longer shown.

Copilot AI review requested due to automatic review settings June 3, 2026 15:16
@claude

claude Bot commented Jun 3, 2026

Copy link
Copy Markdown

Claude finished @AndyButland's task in 2m 33s —— View job


PR Review

Target: origin/release/18.0 · Based on commit: 9ebe0a075d18e1c27e8746b101c7429fb3b8e30f
· Skipped: 0 noise files out of 12 total

Sets ShowInNotifier = false on all 11 element action classes so they are excluded from the document Notifications dialog, and adds a contract unit test verifying the factory filters by that flag.

  • Other changes: Users subscribed to element actions (if any subscriptions exist in the database) would previously have seen those options in the Notifications dialog. After this fix they no longer appear.

Suggestions

  • tests/.../DocumentNotificationPresentationFactoryTests.cs:39: Test method name does not follow the Can_/Cannot_ PascalCase underscore-separated convention (coding-preferences). Consider Can_Create_Notification_Models_Excluding_Non_Notifiable_Actions. (inline comment posted)

Approved with Suggestions for improvement

Clean, targeted fix. The IAction invariant (CanBePermissionAssigned stays true on all 11 actions) is preserved, the factory filtering logic is correct, and the test validates the contract without coupling to real action instances — good design. The test method name is the only thing worth tidying up before merge.

@claude claude Bot added area/backend category/ux User experience labels Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 ShowInNotifier to false for 11 element/element-container actions so they are excluded from document notification options.
  • Added DocumentNotificationPresentationFactoryTests to verify the factory filters actions by ShowInNotifier.

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).

@AndyButland AndyButland merged commit 27909ed into release/18.0 Jun 4, 2026
31 checks passed
@AndyButland AndyButland deleted the v18/bugfix/23053-hide-element-notification-options branch June 4, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

18: Content Notifications options not translated and possibly misplaced

3 participants