Add patron debug authentication UI (PP-3765)#198
Merged
jonathangreen merged 9 commits intomainfrom Feb 27, 2026
Merged
Conversation
Add the frontend for the patron debug authentication admin tool, allowing library managers to run diagnostic auth checks and view step-by-step results from the admin interface. - Add API functions for fetching auth methods and running debug - Add DebugAuthentication component with auth method selector, credential form, and results display - Add DebugResult component for rendering string, list, and dict detail types with success/failure styling - Integrate as new tab in ManagePatronsTabContainer - Add Jest tests for both components and update legacy mocha tests
- Remove redundant QueryClientProvider wrapper from DebugAuthentication, provide QueryClient in Mocha test setup instead - Use explicit null check for password in API call - Memoize authMethods fallback to avoid unnecessary effect runs - Clear username/password on method or library change - Extract hardcoded #809F69 into $green-muted SCSS variable
…ig tab styles The broad ul:not() selector in config_tab_container.scss was overriding the debug results list styling due to higher specificity. Adding :not(.debug-results-list) follows the existing exclusion pattern.
2 tasks
jonathangreen
commented
Feb 25, 2026
tdilauro
approved these changes
Feb 26, 2026
Contributor
tdilauro
left a comment
There was a problem hiding this comment.
This is well done and the new functionality is super helpful. I've approved it, but there are a couple of change requests and suggestions that I'd like to see updated before this goes in. The minor comments aren't show stoppers at all and you can feel free to skip them. I added them in for front end insight, since you've mentioned that that you find it helpful.
Obscure the password field by default instead of displaying it as plain text.
Avoid DOM id collisions when multiple results share the same label by deriving Panel ids from a sequence number instead of the label text. The repeated id expression is DRYed into a single `detailId` variable.
Rename the component to better reflect its DOM role (renders an <li>) and restructure the file so the component definition comes first, with renderDetails extracted as a standalone function taking explicit params.
Display an alert when the auth methods response is empty, so admins can see why the debug form isn't available for a given library.
ResultDetails doesn't include undefined in its type union, so only the null check is needed.
Remove unused AuthMethodInfo import, add JSDoc for the active prop, disable browser autofill on patron credential inputs, and use a template literal for URL construction.
jonathangreen
added a commit
that referenced
this pull request
Feb 27, 2026
## Description Replaces the broad `ul:not(.input-list-ul):not(.announcements-ul):not(.debug-results-list)` selector in `config_tab_container.scss` with a positively scoped `.list-container > ul` selector. Also removes the `li:not(.panel):not(.announcement)` exclusions which should be unnecessary once the `ul` is properly scoped. ## Motivation and Context The previous approach required every new component rendering a `<ul>` inside `.tab-content` to add itself to a growing `:not()` exclusion list. This was the root cause of the `!important` overrides needed in the debug authentication styles. From what I can tell, the rule only ever targets the bare `<ul>` rendered by `EditableConfigList` inside `.list-container` (line 168), and no `<li>` elements inside that `<ul>` have `.panel` or `.announcement` classes. But given the accumulated tech debt with all the negative selectors, it's hard to be fully confident there isn't an edge case I'm missing. Initial visual inspection of the config list pages looks fine, but this could use extra eyes. Stacked on #198. ## How Has This Been Tested? - Production webpack build compiles successfully - Spot-checked config list pages visually — styling appears unchanged - Would appreciate additional visual review of Collections, Libraries, Patron Auth Services, and other config list pages to confirm nothing regressed ## Checklist: - [x] I have updated the documentation accordingly. - [x] All new and existing tests passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a "Debug Authentication" tab to the Manage Patrons page, allowing library managers and system admins to run diagnostic authentication checks against patron auth providers. The UI lets users select an authentication method, enter patron credentials, and view step-by-step results with pass/fail indicators. Supports multiple result detail formats including strings, numbers, booleans, lists, and key-value tables.
New files:
src/api/patronDebug.ts— API layer with types and fetch functions for auth methods and debug auth endpointssrc/components/DebugAuthentication.tsx— Main form component using React Query for data fetching and mutationssrc/components/DebugResult.tsx— Renders individual debug result steps with collapsible detail panelssrc/stylesheets/debug_authentication.scss— Styles for the debug UI, result list, and detail tablesModified files:
src/components/ManagePatronsTabContainer.tsx— Adds the new tab alongside Reset Adobe ID; removes single-tab workaroundsrc/stylesheets/colors.scss— Extracts$green-mutedvariable for reuseMotivation and Context
Frontend for the backend API added in ThePalaceProject/circulation#3076. Library admins need the ability to troubleshoot patron authentication issues directly from the admin interface rather than relying on server logs.
Ref: PP-3765
How Has This Been Tested?
DebugAuthentication(8 tests) andDebugResult(10 tests) using MSW and React Testing LibraryManagePatronsTabContainerto verify the new tab appears correctlyChecklist: