Skip to content

Add ability to delete bundles in file administration - #5307

Open
alijaber-atmire wants to merge 15 commits into
DSpace:mainfrom
atmire:w2p-138875_ability-to-delete-bundles-in-file-administration_contribute-main
Open

alijaber-atmire wants to merge 15 commits into
DSpace:mainfrom
atmire:w2p-138875_ability-to-delete-bundles-in-file-administration_contribute-main

Conversation

@alijaber-atmire

@alijaber-atmire alijaber-atmire commented Mar 24, 2026

Copy link
Copy Markdown

References

Description

Adds bundle-level delete on the item Edit bitstreams page: curators can mark a whole bundle for removal, undo before save, and submit so the UI removes bundles (and their bitstreams) through the REST API. Bundle loading and submit flow are aligned with BundleDataService and cache invalidation so the list refreshes after deletes.

Instructions for Reviewers

List of changes in this PR:

  • Item bitstreams edit: per-bundle actions to mark a bundle for removal, show a clear “will be deleted” state, disable drag/upload for that bundle, and undo removal before save.
  • Submit flow: ItemBitstreamsService.removeMarkedBundlesAndBitstreams issues bulk bundle removal (JSON Patch remove operations on /bundles/{id} via BundleDataService.removeMultiple) alongside existing bitstream deletions; success/error notifications distinguish bundles-only, bitstreams-only, or both.
  • Data layer: BundleDataService.removeMultiple sends the patch to the bundles collection endpoint; item bitstreams page uses BundleDataService.findAllByItem for bundle lists and invalidates the item’s bundles link after successful saves.

How to test / review

  1. Deploy this UI against a REST build that includes DSpace#12150.
  2. As a user with permission to edit item bitstreams, open an item → EditBitstreams (file administration).
  3. Use Remove bundle on a non-essential bundle; confirm the row shows the removal warning and upload/drag are disabled.
  4. Use Undo and confirm the bundle returns to normal.
  5. Mark one or more bundles for removal (and optionally remove individual bitstreams in other bundles), click Save; confirm success notification, bundles disappear, and removed bitstreams are gone after refresh.
  6. Regression: reorder bitstreams (drag), upload to a bundle, and delete single bitstreams still behave as before.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

Ali Jaber and others added 8 commits January 28, 2026 08:29
… fixes

Replaced remaining ItemService#getBundles usages with BundleService#findAllByItem because the first one didn't use caching
…bute-7.6' into w2p-138875_ability-to-delete-bundles-in-file-administration-ANGULAR-main
# Conflicts:
#	src/app/core/data/item-data.service.ts
#	src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html
@alexandrevryghem alexandrevryghem changed the title W2p 138875 ability to delete bundles in file administration contribute main Add ability to delete bundles in file administration Mar 24, 2026
@alexandrevryghem alexandrevryghem added new feature component: administrative tools Related to the admin menu or tools component: Item (Archived) Item display or editing labels Mar 24, 2026
@alijaber-atmire
alijaber-atmire marked this pull request as ready for review March 25, 2026 02:45
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 11.0 Release Mar 25, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

…to-delete-bundles-in-file-administration_contribute-main
@Kasinhou

Copy link
Copy Markdown
Contributor

Confirmed working locally at dataquest, works as described, with a few bug findings:

  1. After selecting several bitstreams for deletion and then clicking Remove bundle on another bundle, the previously selected bitstreams are no longer selected.
    https://github.com/user-attachments/assets/439f8aa2-473a-4062-a619-846e2f192684

  2. After uploading multiple files, scrolling to the bottom and clicking Remove bundle, the page jumps back to the top.
    https://github.com/user-attachments/assets/08d908c4-59d9-48e0-b8dc-9985ccddf353

Since this PR adds a new method to the REST API, the REST Contract should also be updated: https://github.com/DSpace/RestContract

Ali Jaber added 4 commits August 25, 2026 21:40
Preserve staged updates across bundle refreshes, prevent removal actions from submitting forms, and cover the equivalent 7.6 visual states.
Revert the main-only implementation so shared fixes can enter through the 7.6 branch history first.
Bring the shared state-preservation and non-submitting action fixes into main through the 7.6 branch history.
Reapply the table-specific danger styling, centered actions, and stable drag-handle layout that cannot be merged from the older 7.6 component structure.
@alijaber-atmire

Copy link
Copy Markdown
Author

Hello @Kasinhou , thank you for testing and reporting these issues.

Both UI regressions have been addressed:

  • Staged bitstream deletions are now preserved when removing another bundle.
  • Bundle remove/undo actions no longer submit the form or jump to the top.

I also created the requested REST Contract update: DSpace/RestContract#384.

@Kasinhou

Copy link
Copy Markdown
Contributor

Hello @alijaber-atmire, thanks for the fixes.
I retested it locally and both UI issues are resolved. Looks fine to me together with DSpace/DSpace#12150.
I reviewed the code only briefly, didn't do a detailed review.

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: Item (Archived) Item display or editing new feature

Projects

Status: 🙋 Needs Reviewers Assigned

Development

Successfully merging this pull request may close these issues.

Add ability to delete bundles in file administration

5 participants