Skip to content

Comments

Add collection import UI to admin dashboard (PP-364)#195

Open
jonathangreen wants to merge 3 commits intomainfrom
feature/collection-import-ui
Open

Add collection import UI to admin dashboard (PP-364)#195
jonathangreen wants to merge 3 commits intomainfrom
feature/collection-import-ui

Conversation

@jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Feb 20, 2026

Description

  • Add CollectionImportButton component that renders a collapsible "Import" panel with a "Queue Import" button and "Force full re-import" checkbox for protocols that support import
  • Add supports_import field to ProtocolData interface, used to conditionally show the import controls
  • Add importCollection action that POSTs to /admin/collection/<id>/import
  • Add renderAdditionalContent() hook to ServiceEditForm so subclasses can inject additional panels
  • Wire CollectionEditForm to render the import button via renderAdditionalContent()
  • Display success/error feedback with Bootstrap alert styling (alert-success / alert-danger)
  • Reset component state (checkbox, feedback) when switching between collections

Motivation and Context

Companion to ThePalaceProject/circulation#3069. The backend now exposes supports_import in protocol details and provides a POST /admin/collection/<id>/import endpoint. This PR adds the admin UI to consume that API.

Screenshot 2026-02-20 at 2 01 37 PM

How Has This Been Tested?

  • Added comprehensive tests for CollectionImportButton covering: rendering conditions, checkbox toggle, import with/without force, success/error feedback styling, state reset on collection switch, disabled state, and loading state
  • Updated existing Collections tests to pass the new importCollection prop

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Add a CollectionImportButton component that renders a "Queue Import"
button with a "Force full re-import" checkbox on the collection edit
screen for protocols that support import. Wire it into the Collections
page via context and connect it to the new backend import endpoint.
Wrap the import controls in a collapsible Panel, add alert-success and
alert-danger feedback styling, and use renderAdditionalContent hook on
ServiceEditForm to inject the import button cleanly.
@jonathangreen jonathangreen added enhancement New feature or request and removed enhancement New feature or request labels Feb 20, 2026
@jonathangreen jonathangreen requested a review from a team February 20, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant