Skip to content

Content Rollback: Add notification message meta property#22631

Merged
leekelleher merged 5 commits into
mainfrom
v17/improvement/content-rollback-notification
Apr 29, 2026
Merged

Content Rollback: Add notification message meta property#22631
leekelleher merged 5 commits into
mainfrom
v17/improvement/content-rollback-notification

Conversation

@leekelleher

@leekelleher leekelleher commented Apr 28, 2026

Copy link
Copy Markdown
Member

Description

The Content Rollback entity action kind (introduced in #21939) hard-coded its success notification to use the document-specific localization key rollback_documentRolledBack. This prevents other content types (e.g. Global Elements in v18) from supplying their own message.

Summary

  • Adds an optional rollbackNotificationMessage meta property to the contentRollback entity action kind. Manifests can supply a localization key (or literal string) to use for the success notification.
  • The Document rollback manifests (entity action and audit log action) opt in with #rollback_documentRolledBack, preserving the existing message.
  • When a manifest does not set the property, the action falls back to a new generic #rollback_contentRolledBack ("Content has been rolled back") localization key.
  • Replaces the unreachable "Notification context not found" throw with an optional-chained call.

Test plan

  • Roll back a document — verify the existing "Document has been rolled back" notification still appears.
  • Cancel the rollback modal — verify no notification is shown.

so that the Rollback modal can return the entity-type,
to display the correct notification message.
Copilot AI review requested due to automatic review settings April 28, 2026 15:32
@claude

This comment was marked as resolved.

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 updates the content rollback flow so the rollback modal returns entity metadata (unique, entityType) and the rollback entity action can show an entity-specific localized success notification (with a generic fallback), while also making the notification context access non-throwing.

Changes:

  • Extend UmbContentRollbackModalValue to include unique/entityType (via UmbEntityModel) and submit those values from the modal.
  • Update the rollback entity action to localize the success notification based on the returned entityType, and make notification context usage optional.
  • Minor formatting cleanup in the entity-action manifest types.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/content/content/rollback/modal/types.ts Makes the rollback modal’s return value include unique + entityType by extending UmbEntityModel.
src/Umbraco.Web.UI.Client/src/packages/content/content/rollback/modal/content-rollback-modal.element.ts Submits { unique, entityType } on successful rollback instead of an empty object.
src/Umbraco.Web.UI.Client/src/packages/content/content/rollback/entity-action/types.ts Formatting-only change to the rollback entity action manifest interface.
src/Umbraco.Web.UI.Client/src/packages/content/content/rollback/entity-action/content-rollback.action.ts Uses returned entityType to build an entity-specific localization key and peeks a success notification via optional context.

@claude claude Bot added the category/ux User experience label Apr 28, 2026
@leekelleher leekelleher changed the title Content Rollback: Use entity-specific notification message Content Rollback: Add notification message meta property Apr 29, 2026

@AndyButland AndyButland 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.

Works as expected @leekelleher, and looks good. I've tested out the rollback from both the entity action and the audit log itself. Just a couple of inline comments to consider, then, unless you feel you need a more expert FE review, looks good to merge.

@leekelleher leekelleher merged commit e37a291 into main Apr 29, 2026
36 checks passed
@leekelleher leekelleher deleted the v17/improvement/content-rollback-notification branch April 29, 2026 11:36
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.

3 participants