Skip to content

Conversation

@brycekbargar
Copy link

@brycekbargar brycekbargar commented Oct 10, 2025

Purpose

We're in the process of anonymizing requests, like how loans have been. Previously if user data was not returned for a request it was caused by something weird but now it indicates the request has been anonymized (probably).

Approach

There were many disparate places that were handling the display and logic around requesters. I consolidated all the ways to create a link to a user/barcode into a component as well as all the ways to display the requester/proxy. Once these were all consistent I changed the text/link behavior for when a user does not exist to Anonymized. I'm going to be updating the request list in another PR to better display anonymized requests which will now be a easier because of the consistency.

I'm not super happy with the amount of duplication with the React PropTypes but I'm not a React developer and don't know how this is usually deduplicated.

Refs

https://folio-org.atlassian.net/browse/UIREQ-1313
Corresponding Backend PR: folio-org/mod-circulation#1623

Screenshots

To test this I nulled out the requester in the database.

image image

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@CLAassistant
Copy link

CLAassistant commented Oct 10, 2025

CLA assistant check
All committers have signed the CLA.

<div>
{userHighlightBox(<FormattedMessage id="ui-requests.requester.requester" />, name, id, barcode)}
<UserHighlightBox
title=<FormattedMessage id="ui-requests.requester.requester" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title=<FormattedMessage id="ui-requests.requester.requester" />
title={<FormattedMessage id="ui-requests.requester.requester" />}

{proxySection}
{isProxyFunctionalityAvailable(isEcsTlrSettingEnabled) && proxy?.id &&
<UserHighlightBox
title=<FormattedMessage id="ui-requests.requester.proxy" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title=<FormattedMessage id="ui-requests.requester.proxy" />
title={<FormattedMessage id="ui-requests.requester.proxy" />}

screen,
cleanup,
} from '@folio/jest-config-stripes/testing-library/react';
import { MemoryRouter } from 'react-router-dom';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put react related imports above folio imports

src/UserForm.js Outdated
<div>
{userSection}
<UserHighlightBox
title=<FormattedMessage id="ui-requests.requester.requester" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title=<FormattedMessage id="ui-requests.requester.requester" />
title={<FormattedMessage id="ui-requests.requester.requester" />}

BarcodeLink.propTypes = propTypes;
FullNameLink.propTypes = propTypes;

export { BarcodeLink, FullNameLink };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what rules are in ui-requests, but I would suggest splitting components into different files to have one component per file. It will make testing easier

@brycekbargar brycekbargar changed the title [UIREQ-1313] Change display of anonymized requester from Unknown to Anonymized [UIREQ-1313] Display Anonymized Requesters Oct 22, 2025
@brycekbargar
Copy link
Author

image image

I've mucked with the database to simulate deleted vs anonymized and they're now both displaying correctly.

@Dmitriy-Litvinenko
Copy link
Contributor

We was not able run Sonar for fork and we created pull #1336.

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.

4 participants