Conversation
…ateItemFormatter, add tests
| isInitialLoading={isLoading} | ||
| fieldLabelsMap={fieldLabelsMap} | ||
| fieldFormatter={fieldFormatter} | ||
| itemFormatter={itemFormatter} |
There was a problem hiding this comment.
could you describe the difference between itemFormatter and fieldFormatter, please?
There was a problem hiding this comment.
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.
But you are right, I have to adapt the README.md here:
folio-org/stripes-components#2519
There was a problem hiding this comment.
I added itemFormatter to AuditLog/readme.md
| || value; | ||
|
|
||
| return ( | ||
| <li key={i}> |
There was a problem hiding this comment.
do you think it is possible to use stripes' List component here?
There was a problem hiding this comment.
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.
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)