Fix for Provide a way to add / remove collections from communities - #4668
Fix for Provide a way to add / remove collections from communities#4668im-shivamb wants to merge 15 commits into
Conversation
|
@im-shivamb : The tests in this PR are failing because of a minor lint error in |
|
Hi @im-shivamb, |
|
@tdonohue, |
|
Hi @im-shivamb, |
|
@im-shivamb : Apologies that we have not gotten a reviewer on this PR yet. However, we are just beginning a more detailed review process for 10.0 for all new feature PRs. If you can rebase this on latest |
|
Unfortunately, this Feature PR missed our DSpace 10.0 "Feature PR Merge Deadline". As DSpace 10.0 is now under a "Feature Freeze", this ticket will be moved to our 11.0 release board in the hopes of completing this feature in the next release. If there are any questions, let us know. |
References
Description
A user tried to delete a group of permissions on the authorizations tab of a collection. They pressed the "Delete this collection" button instead of the "Delete selected" button and clicked through without realizing their error. There is no further confirmation to delete a collection of hundreds of items besides those two buttons (from the authorizations page, from the collection/community page it's three buttons).
Instructions for Reviewers
In the Edit Collection → Status Tab, users see collection details along with “Move this Collection” and “Delete this Collection” actions. Clicking Move this Collection opens a new page to select the target community. After selecting and saving, the collection is successfully moved to the selected community (if permissions allow).
List of changes in this PR
• Update edit-collection-page-routes.ts, edit-collection-page-routing-path.ts to add collection_edit move and delete path
• Added collection-move.component.html to provides the structure and UI for the “Move this Collection” page.
• Added collection-move.component.spec.ts to verifies the correct rendering and behavior of the collection-move component.
• Added collection-move.component.ts to provides the structure and UI for the “Move this Collection” page. It displays an authorized community selector, and a “Save” button to confirm the move.
• Added collection-operation.component.html to defines the UI for listing operations available on a collection, specifically Move and Delete.
• Added collection-operation.component.spec.ts to validate that the correct operations (Move/Delete) are displayed, that buttons route properly, and that visibility conditions are respected based on collection state or authorization.
• Added collection-operation.component.ts to manages the logic behind the operations panel for collections. It decides which operations (e.g., Move, Delete) should be displayed, binds them to UI routes, and ensures integration with authorization features
• Added collectionOperation.model.ts to represent collection-level operations in a structured way. It defines properties such as operation type, label, route, and permissions, making the UI components cleaner and more reusable
• Added collection-status.component.html template defines the new Status tab of the Edit Collection page. It shows key collection details (Name, Handle, ID, Page URL) and integrates the operations panel for Move and Delete.
• Added collection-status.component.spec.ts test file for collection-status component ensures that collection details are rendered correctly and that Move/Delete actions are displayed as expected.
• Added collection-status.component.ts to implements the logic behind the new Status tab for collections. It fetches and displays collection metadata (like handle, URL, ID), integrates the collection-operation component, and ensures that data refreshes correctly.
• Added themed-collection-status.component.ts, themed extension of the collection-status component, designed to allow customizations in DSpace’s themed UI.
• Update collection-data.services.ts to support the new collection move functionality. This service now includes methods to call the backend PUT /api/core/collections/{uuid}/owningCommunity endpoint. It handles request construction, error handling, and integrates with Angular’s observable pattern so components can trigger moves and react to the API’s response appropriately.
• Added new method getAuthorizedCommunity in community-data.service.ts to get all communities for the user is authorized to.
• Update edit-comcol-page.component.html to add condition to limit the visibility of delete button on edit-community page only.
• Added authorized-community-selector.component.ts wrapper to show the autocomplete results in community edit section instead of using common DSpace Object selector.
• Added authorized-community-selector.component.spec.ts against the new dso selector wrapper added to test the listing of all authorized communities and collections in edit and create section.
• Update en.json5 to add new translation keys for UI text related to collection operations.
• Added collection-status.component.html
• Added collection-status.component.ts to extends the base collection-status.component and provides an override point for theming.
• Update edit-collection.cy.ts to test for the status tab should be visible and remove the delete tab page visibility test.
Steps to Test and Reproduce the Behavior