-
Notifications
You must be signed in to change notification settings - Fork 18
UIIN-3558: Add additional call number to version history for item #2953
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
UIIN-3558: Add additional call number to version history for item #2953
Conversation
…ateItemFormatter, add tests
| isInitialLoading={isLoading} | ||
| fieldLabelsMap={fieldLabelsMap} | ||
| fieldFormatter={fieldFormatter} | ||
| itemFormatter={itemFormatter} |
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.
could you describe the difference between itemFormatter and fieldFormatter, please?
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.
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.
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.
But you are right, I have to adapt the README.md here:
folio-org/stripes-components#2519
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.
I added itemFormatter to AuditLog/readme.md
| || value; | ||
|
|
||
| return ( | ||
| <li key={i}> |
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.
do you think it is possible to use stripes' List component here?
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.
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
/>
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.
Thank you for the second screenshot; I finally understand what is happening in this PR!
…ionHistory-for-item
|



Purpose
Adding
additionalCallNumbersto 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
circulationNotesare also objects we added those sub-fields also tofieldLabelsMap.Approach
We define and pass a itemFormatter to the
AuditLogModalwhich 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)
without itemFormatter (no fieldnames)