Skip to content

[PP-3820] Add patron blocking rules editor to the Library Settings UI…#201

Draft
dbernstein wants to merge 2 commits intomainfrom
feature/PP-3820-add-patron-blocks
Draft

[PP-3820] Add patron blocking rules editor to the Library Settings UI…#201
dbernstein wants to merge 2 commits intomainfrom
feature/PP-3820-add-patron-blocks

Conversation

@dbernstein
Copy link
Contributor

@dbernstein dbernstein commented Feb 27, 2026

… for SIP2 patron auth providers

Description

Implements an editable list of "Patron Blocking Rules" in the Patron Auth Services configuration, scoped per-library. Rules (name, rule, message) are added/removed in the UI and sent as part of the existing libraries payload on save. The feature is gated to SIP2 in v1; the architecture is designed so that additional provider types (SirsiDynix, Millennium, etc.) can be enabled later with no structural changes.

Changes

New files

  • src/utils/patronBlockingRules.ts — supportsPatronBlockingRules(protocolName) capability gate; SIP2_PROTOCOL constant
  • src/components/PatronBlockingRulesEditor.tsx — Protocol-agnostic, reusable rule list editor with getValue() ref method, *Add Rule / Delete controls, client-side required-field validation, and error/disabled prop support
  • src/components/PatronAuthServiceEditForm.tsx — Extends ServiceEditForm; overrides editLibrary, addLibrary, and three hook methods to inject the editor for SIP2
  • tests/jest/utils/patronBlockingRulesCapability.test.ts
  • tests/jest/components/PatronBlockingRulesEditor.test.tsx
  • tests/jest/components/PatronAuthServiceEditForm.test.tsx

Modified files

  • src/interfaces.ts — New PatronBlockingRule interface; LibraryWithSettingsData widened to allow PatronBlockingRule[] values
  • src/components/ServiceEditForm.tsx — Three protected hook methods added (protocolHasLibrarySettings, renderExtraExpandedLibrarySettings, renderExtraNewLibrarySettings); no behaviour change to existing callers
  • src/components/PatronAuthServices.tsx — EditForm swapped from ServiceEditForm to PatronAuthServiceEditForm

Motivation and Context

https://ebce-lyrasis.atlassian.net/browse/PP-3820

How Has This Been Tested?

New unit test coverage added.

Checklist:

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

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