Skip to content

Conversation

@elsenhans
Copy link
Contributor

@elsenhans elsenhans commented Dec 18, 2025

Purpose

Adding additionalCallNumbers to the inventorys' item history as requested here:
https://folio-org.atlassian.net/browse/UIIN-3558
https://folio-org.atlassian.net/browse/UIIN-3541

We noticed, that objects are currently being displayed as unordered, unnamed lists. This seems to be deficient as the user has to guess which value belongs to which property.

Since circulationNotes are also objects we added those sub-fields also to fieldLabelsMap.

Approach

We define and pass a itemFormatter to the AuditLogModal which allows us to display object properties as name-value pairs.

Refs

folio-org/stripes-components#2519
folio-org/mod-audit#229

Screenshots

with itemFormatter (if object -> add fieldnames)

Screenshot from 2025-12-11 15-54-34

without itemFormatter (no fieldnames)

Version history lists

@elsenhans elsenhans requested review from a team, BogdanDenis and mariia-aloshyna December 18, 2025 11:27
@elsenhans elsenhans mentioned this pull request Dec 18, 2025
@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Jest Unit Test Results

    1 files  ±0    316 suites  ±0   10m 28s ⏱️ +33s
1 396 tests +7  1 377 ✅ +7  19 💤 ±0  0 ❌ ±0 
1 410 runs  +7  1 391 ✅ +7  19 💤 ±0  0 ❌ ±0 

Results for commit 9b78f4e. ± Comparison against base commit f53d896.

♻️ This comment has been updated with latest results.

isInitialLoading={isLoading}
fieldLabelsMap={fieldLabelsMap}
fieldFormatter={fieldFormatter}
itemFormatter={itemFormatter}
Copy link
Contributor

Choose a reason for hiding this comment

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

could you describe the difference between itemFormatter and fieldFormatter, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The itemFormatter is adding the fieldname before the value (in case its an object). It is formatting a list inside the list (of the fieldFormatter).
I added a second screenshot to the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But you are right, I have to adapt the README.md here:
folio-org/stripes-components#2519

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added itemFormatter to AuditLog/readme.md

|| value;

return (
<li key={i}>
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think it is possible to use stripes' List component here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stripes List component includes <ul>:
https://github.com/folio-org/stripes-components/blob/58e8eb022e3ef11726fcb90d129e946f57b9703d/lib/List/List.js#L52
but for the itemFormatter, we just like to define <li>, since the itemFormatter is called already inside a List:

      <List
        items={map(fieldValue, (value, name) => ({ name, value, collectionName: fieldName }))}
        itemFormatter={listItemFormatter}
        listStyle="bullets"
        marginBottom0
      />

@mariia-aloshyna mariia-aloshyna self-requested a review December 18, 2025 15:09
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

Thank you for the second screenshot; I finally understand what is happening in this PR!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

@elsenhans elsenhans merged commit ded4829 into master Jan 5, 2026
15 checks passed
@elsenhans elsenhans deleted the UIIN-3558-add-additionalCallNumber-to-versionHistory-for-item branch January 5, 2026 09:48
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