Skip to content

Fix for Provide a way to add / remove collections from communities - #4668

Open
im-shivamb wants to merge 15 commits into
DSpace:mainfrom
im-shivamb:fix-9824
Open

Fix for Provide a way to add / remove collections from communities#4668
im-shivamb wants to merge 15 commits into
DSpace:mainfrom
im-shivamb:fix-9824

Conversation

@im-shivamb

@im-shivamb im-shivamb commented Sep 4, 2025

Copy link
Copy Markdown

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

  1. Navigate to the Edit Collection page of any collection.
  2. On the Status tab, Verify that collection details (Name, Handle, URL, ID) are displayed.
  3. At the bottom, click Move this Collection.
  4. Select a new community from the authorized community selector
  5. Click Save and confirm that the collection moves to the new community.
  6. Confirm that the collection no longer appears under its old community.

@tdonohue

tdonohue commented Sep 4, 2025

Copy link
Copy Markdown
Member

@im-shivamb : The tests in this PR are failing because of a minor lint error in collection-edit.cy.ts. Here's the reported error:

Linting "dspace-angular"...

/home/runner/work/dspace-angular/dspace-angular/cypress/e2e/collection-edit.cy.ts
Lint errors found in the listed files.

Error:   132:4  error  Newline required at end of file but not found  eol-last

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

@github-actions

Copy link
Copy Markdown

Hi @im-shivamb,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@PitbaranK

Copy link
Copy Markdown

@tdonohue,
We have corrected the linting and conflicts. Please align reviewer for the same.

@github-actions

Copy link
Copy Markdown

Hi @im-shivamb,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue

Copy link
Copy Markdown
Member

@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 main (to resolve the merge conflicts) that would allow us to consider this for 10.0. Thanks!

@tdonohue

tdonohue commented Apr 2, 2026

Copy link
Copy Markdown
Member

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.

@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 11.0 Release Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: administrative tools Related to the admin menu or tools component: Collection Collection display or editing new feature

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

Confirmation field before deleting a community/collection Provide a way to add / remove collections from communities

3 participants