-
Notifications
You must be signed in to change notification settings - Fork 37
STCOM-1475 AuditLogModal: accept itemFormatter prop #2519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
zburke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. In an ideal world, there would be a test showing custom vs default formatting with vs without this prop to prove it gets drilled through correctly. The changes here are not elaborate though; this may not be that world.
When you commit, please make sure the Jira slug in the commit-title correctly matches the story ("STCOM-1475", not "Stcom 1475") and that the commit title contains a useful summary of the work.
Thanks and sorry, was opened in a bit of a rush. It will be my last day working for folio, so I won't be able to add those tests. |
Still using karma tests? Shouldn't they be replaced by |
|
@zburke I added tests for the |
|
@elsenhans, stripes-components and stripes-smart-compoents, which are UI-heavy as opposed to business-logic-heavy, use browser-based tests (yes, still karma 😢, hopefully Cypress some day) instead of jest. We have deliberately chosen to keep things this way. |
zburke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for alphabetizing the props while you were in there.
|
@elsenhans Please add |
zburke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation, what even is that? 🫶
Content looks great but please fix the formatting before you merge
lib/AuditLog/readme.md
Outdated
| itemFormatter | func | | ||
| Formats changed field values of objects or arrays in modal content, used to format oldValue/newValue items of object or array, e.g. showing the field name before the field value. | ||
| Receives a field object with `name`, `value`, and `collectionName` properties and the item index. Returns a list item element. | `<li>{field.value}</li>` | false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to all be on one line.
|
# Description These changes add the possibility to pass a customItemFormatter to the AuditLogModal and add to this Formatter the collectionName. # Why is this change necessary? While adding additionalCallNumbers to the inventorys item history as requested per this user story: https://folio-org.atlassian.net/browse/UIIN-3540 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. By adding a custom formatter, we are able to display these objects like this: <img width="2978" height="1269" alt="Screenshot from 2025-12-11 15-54-34" src="https://github.com/user-attachments/assets/8ea804fd-6dcf-4dea-8825-c931c1b9b171" /> # Related changes ## Mod-Audit folio-org/mod-audit#229 ## UI-Inventory folio-org/ui-inventory#2950 --------- Co-authored-by: elsenhans <elsenhans@users.noreply.github.com> Co-authored-by: elsenhans <48911833+elsenhans@users.noreply.github.com>



Description
These changes add the possibility to pass a customItemFormatter to the AuditLogModal and add to this Formatter the collectionName.
Why is this change necessary?
While adding additionalCallNumbers to the inventorys item history as requested per this user story: https://folio-org.atlassian.net/browse/UIIN-3540 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.
By adding a custom formatter, we are able to display these objects like this:
Related changes
Mod-Audit
folio-org/mod-audit#229
UI-Inventory
folio-org/ui-inventory#2950