-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Document/Media: Readonly when in recycle bin #20541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Sets Documents and Media workspaces to read-only when the item is in the Recycle Bin, and keeps them up-to-date by listening to trash/restore action events.
- Adds UmbEntityRestoredFromRecycleBinEvent and dispatches it after a successful restore.
- Media and Document workspaces now subscribe to trash/restore events and toggle a read-only guard based on isTrashed; they also reload on relevant events.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/media/media/workspace/media-workspace.context.ts | Listens for trash/restore events, observes isTrashed, toggles read-only guard, and reloads when relevant events occur. |
| src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts | Same as media workspace: event listeners, isTrashed observation, read-only guard toggle, and reload. |
| src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/entity-action/restore-from-recycle-bin/restore-from-recycle-bin.event.ts | Introduces UmbEntityRestoredFromRecycleBinEvent to signal restores. |
| src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/entity-action/restore-from-recycle-bin/restore-from-recycle-bin.action.ts | Dispatches UmbEntityRestoredFromRecycleBinEvent after restore; minor debug log present. |
| src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/entity-action/restore-from-recycle-bin/index.ts | Re-exports the new restore event. |
| src/Umbraco.Web.UI.Client/src/packages/core/recycle-bin/entity-action/index.ts | Re-exports restore event alongside existing actions/events. |
...s/core/recycle-bin/entity-action/restore-from-recycle-bin/restore-from-recycle-bin.action.ts
Show resolved
Hide resolved
...braco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts
Show resolved
Hide resolved
...braco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace.context.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great in testing - all properties and features like rollback are disabled when the document or media is in the recycle bin.
Found a couple of small things (the second likely unrelated, but I'll note it).
-
I can still click to choose a different template from the "Info" view for a document. The picker itself doesn't allow to choose anything, but probably I shouldn't be able to open the picker at all.
-
There are a couple of "TODOs" appear in the media history when it's deleted.
|
Great! I have fixed both the audit log to-dos and the content type and template pickers. Could you give it another spin? |
AndyButland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I've tested again and can confirm the two issues I raised are resolved.
This PR sets a Document/Media to read-only when it is in the Recycle Bin.
With this PR, we now listen to the trash/restore client-side events and apply a read-only rule based on the state. Currently, the item retains its existing "Draft/Publish/etc." state. This PR also prepares the workspace to display the correct state when an item is trashed or restored.
We also still have an issue with the breadcrumb. That will be addressed in another PR.
Screen.Recording.2025-10-17.at.13.01.57.mov