Skip to content

Global Elements: Implements auditLog and contentRollback kinds for History and Rollback#22633

Merged
nielslyngsoe merged 8 commits into
v18/devfrom
v18/feature/global-elements-ui-audit-log-history
May 4, 2026
Merged

Global Elements: Implements auditLog and contentRollback kinds for History and Rollback#22633
nielslyngsoe merged 8 commits into
v18/devfrom
v18/feature/global-elements-ui-audit-log-history

Conversation

@leekelleher

@leekelleher leekelleher commented Apr 28, 2026

Copy link
Copy Markdown
Member

Description

Implements the auditLog kind for the Audit Log History workspace info app, and implements contentRollback kind for the "Rollback" button that appears on that workspace info app and opens the reusable Rollback modal.

Summary

  • Migrates the Element workspace History info app from a bespoke element to the shared auditLog workspaceInfoApp kind (matching the pattern already used by Documents, Media, and Document Blueprints).
  • Migrates Element Rollback to the shared contentRollback entityAction and auditLogAction kinds, replacing the duplicated rollback modal/action with the shared content rollback machinery.
  • Aligns UmbElementRollbackRepository with the UmbContentRollbackRepository interface.
  • Refactors UmbElementAuditLogRepository.getTagStyleAndText to use a frozen lookup map (reduces cyclomatic complexity).

Net result: ~800 fewer lines of element-specific duplication while bringing the Element workspace in line with the standard content audit-log/rollback UX.

Notes

Test plan

  • Open an Element workspace; verify the History info app renders entries with the expected tag styles and descriptions.
  • Verify the Rollback button appears in the History info app header for users with the Element Rollback permission.
  • Trigger a rollback from the History header and from the Element entity action menu; verify the rollback modal opens, versions list, and rollback completes.
  • Verify the Rollback button is hidden when the element is in the recycle bin.

Copilot AI review requested due to automatic review settings April 28, 2026 17:34
@claude

This comment was marked as low quality.

@leekelleher leekelleher changed the title Elements: Adopt shared auditLog and contentRollback kinds for History and Rollback Global Elements: Implements auditLog and contentRollback kinds for History and Rollback Apr 28, 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 migrates the Element workspace History and Rollback features to the shared auditLog workspaceInfoApp kind and shared contentRollback entity/audit-log action kinds, removing element-specific duplicated UI/action code and aligning Element behavior with other content types.

Changes:

  • Replaces the bespoke Element History info app with the shared workspaceInfoApp kind auditLog, backed by a new Element audit-log repository.
  • Replaces the bespoke Element Rollback modal/entity-action with shared contentRollback entityAction and auditLogAction kinds, and aligns the Element rollback repository to UmbContentRollbackRepository.
  • Refactors Element audit-log tag metadata selection into a frozen lookup map and exposes it via getTagStyleAndText().

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/repository/rollback.server.data-source.ts Updates rollback data-source docs (and continues to call management API endpoints for element versions).
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/repository/rollback.repository.ts Adopts UmbContentRollbackRepository and normalizes returned data to the shared rollback models.
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/modal/types.ts Removes element-specific rollback modal types (modal removed).
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/modal/rollback-modal.element.ts Removes bespoke element rollback modal implementation (replaced by shared rollback modal machinery).
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/modal/manifests.ts Removes modal manifest registration for the deleted element rollback modal.
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/modal/constants.ts Removes modal token/constants for the deleted element rollback modal.
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/manifests.ts Registers new rollback-related manifests (adds audit-log action manifests; removes modal manifests).
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/entity-action/rollback.action.ts Removes bespoke rollback entity action implementation (replaced by kind-based action).
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/entity-action/manifests.ts Switches Element rollback entity action to shared contentRollback kind with repo aliases and conditions.
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/constants.ts Stops re-exporting removed modal constants; keeps repository constants export.
src/Umbraco.Web.UI.Client/src/packages/elements/rollback/audit-log-action/manifests.ts Adds shared contentRollback audit-log action for Elements in History header actions.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/repository/manifests.ts Registers the Element audit-log repository extension.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/repository/element-audit-log.repository.ts Adds getTagStyleAndText() backed by a frozen lookup map for shared audit-log UI rendering.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/repository/constants.ts Introduces the Element audit-log repository alias constant.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/manifests.ts Includes repository manifests alongside info-app manifests for Elements audit-log.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/info-app/utils.ts Removes bespoke tag-style helper (now provided by repository via getTagStyleAndText()).
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/info-app/manifests.ts Migrates Element History info app to shared auditLog kind and wires repository alias via meta.
src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/info-app/element-history-workspace-info-app.element.ts Removes bespoke Element history info-app element (replaced by shared audit-log info app).
src/Umbraco.Web.UI.Client/src/assets/lang/en.ts Adds rollback_elementRolledBack localization string (for upcoming/shared rollback notification improvements).

leekelleher and others added 5 commits April 28, 2026 18:51
…ackoffice/element`

Surfaces the constant through the element audit-log barrel so it's available on the public package entry, matching the documents audit-log pattern.
…history

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/packages/elements/audit-log/info-app/element-history-workspace-info-app.element.ts
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) May 4, 2026 08:17
@nielslyngsoe nielslyngsoe merged commit 2434c3e into v18/dev May 4, 2026
29 checks passed
@nielslyngsoe nielslyngsoe deleted the v18/feature/global-elements-ui-audit-log-history branch May 4, 2026 12:20
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