Conversation
Add a new settings section under Users > General > Version history that allows configuring version history behavior: - Radio buttons to choose retention mode (Never/Indefinitely/Duration) - Duration length and unit fields when set duration is selected - Checkbox to anonymize the change source - Multi-select to exclude contact info and custom fields - Warning modal when changes would result in data loss
Declare `audit-config` as an optional okapi interface and filter the Version History settings entry with it, so tenants without mod-audit don't see a settings entry that cannot work.
- Gate the Save button with `ui-users.settings.versionHistory.edit`. - Move the duration-mode InfoPopover out of the RadioButton label so its click doesn't toggle the radio and its content doesn't bleed into the accessible name; lay it out with stripes' Layout flex helper. - Make the warning modal dismissible (Esc and backdrop now cancel). - Always invalidate the audit-settings query cache after a save so a partial PUT failure can't leave the UI out of sync with the server. - Track `storedRetentionDays` outside form state instead of carrying it through `initialValues`, and thread it explicitly to utils. - Wait for `useCustomFieldsQuery` before rendering, and label orphaned/loading custom-field IDs as "Unknown field (<id>)" instead of leaking the raw `customFields.<refId>` path. - Reuse existing translation keys for departments, tags, and proxy/sponsor. - Add 13.1.0 IN PROGRESS changelog entry.
Replaces hand-rolled Modal+ModalFooter+Buttons with stripes' ConfirmationModal. Same Esc-to-cancel behavior, drops the X close button, gains automatic focus on the confirm button.
s3fs
approved these changes
Apr 28, 2026
handleSubmit returns a promise that final-form awaits — for the warning path it resolves only after confirm/cancel + the in-flight PUT. Without this, `submitting` cleared synchronously and a fast user could re-click Save mid-save. Also adds tests for useVersionHistorySettings, getStoredRetentionDays, and the customFields loading branch; drops the assertion-free "passes open=false" test and the no-op `waitFor(renderForm)` wrappers; renames the mock submit buttons since destructiveness depends on initial state, not submitted values.
A standalone Label was incorrect semantics for a section heading. RadioButtonGroup's label prop renders the text as <legend> inside <fieldset>, which is the right element for naming a group of form controls. Small CSS override to restore the prior bold/form-label visual weight, since stripes styles legends small/regular by default.
@babel/preset-react runs with runtime: 'automatic', so the bare React import isn't needed for JSX.
|
Dmytro-Melnyshyn
approved these changes
Apr 29, 2026
|
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.



UIU-3385
Purpose
The Users app handles more sensitive personal data than most other FOLIO apps. Before rolling out Version History in Users, institutions must be able to configure (or fully disable) what is tracked, in order to comply with local and national data protection regulations.
This PR implements the initial settings UI under Settings > Users > General > Version history, giving Systems Librarians control over:
Approach
A new
VersionHistorySettingsentry is added at the end of thesettingsGenerallist insrc/settings/sections.js, gated behind a newui-users.settings.versionHistory.viewpermission.The UI consists of three components:
VersionHistoryFormrenders the full settings form. Fields that require version history to beenabled are wrapped in a Tooltip explaining how to activate them.
VersionHistoryWarningModalis shown before saving whenever the new settings would delete previously stored data / not store all data in a way that differs from before.VersionHistorySettingsis the top-level container wiring these together with data fetching and custom fields loading.On the data layer,
useAuditSettingsQueryfetches from mod-audit anduseVersionHistorySettingsissues individual PUT requests per changed setting key. The utility functions inutils.jshandle conversion between the API's flat settings array and form values, diffing current vs. submitted values to minimise API calls, warning detection, and form validation.Two new permissions are declared in
package.json: a view permission (read access to the mod-audit group settings) and an edit permission (extends view with per-key PUT permissions for each of the four setting keys: enabled, records.retention.period, anonymize, excluded.fields).Pre-Merge Checklist
Before merging this PR, please go through the following list and take appropriate actions.
Should be merged after the Trillium release is fixed with CHANGELOG at the correct location.Should be merged at the same time as the version history display PR for UIU-3388 as both together complement each other (user facing vs settings).