-
Notifications
You must be signed in to change notification settings - Fork 7
UIREQ-1314: Display Anonymized Requesters in the Request List #1337
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,19 @@ export const urls = { | |
| }, | ||
| }; | ||
|
|
||
| function userFormatter(id, user) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
and use it in this function. With this approach it will be clearer what is happening. We correctly check that id === null and it will be clear why we are doing this. |
||
| if (user) { | ||
| return getFullName(user); | ||
| } | ||
|
|
||
| if (id) { | ||
| // User has been deleted | ||
| return <NoValue />; | ||
| } | ||
|
|
||
| return <FormattedMessage id="ui-requests.requestMeta.anonymized" />; | ||
| } | ||
|
|
||
| export const getListFormatter = ( | ||
| { | ||
| getRowURL, | ||
|
|
@@ -241,13 +254,13 @@ export const getListFormatter = ( | |
| />), | ||
| 'itemBarcode': rq => (rq?.item?.barcode || <NoValue />), | ||
| 'position': rq => (rq.position || <NoValue />), | ||
| 'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : <NoValue />), | ||
| 'proxy': rq => userFormatter(rq.proxyUserId, rq.proxy), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From https://folio-org.atlassian.net/browse/UXPROD-4302 |
||
| 'requestDate': rq => ( | ||
| <AppIcon size="small" app="requests"> | ||
| <FormattedTime value={rq.requestDate} day="numeric" month="numeric" year="numeric" /> | ||
| </AppIcon> | ||
| ), | ||
| 'requester': rq => (rq.requester ? getFullName(rq.requester) : <NoValue />), | ||
| 'requester': rq => userFormatter(rq.requesterId, rq.requester), | ||
| 'singlePrint': rq => { | ||
| const singlePrintButtonProps = { | ||
| request: rq, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,6 +232,19 @@ export const urls = { | |
| }, | ||
| }; | ||
|
|
||
| function userFormatter(id, user) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please take a look on comment above for userFormatter? |
||
| if (user) { | ||
| return getFullName(user); | ||
| } | ||
|
|
||
| if (id) { | ||
| // User has been deleted | ||
| return <NoValue />; | ||
| } | ||
|
|
||
| return <FormattedMessage id="ui-requests.requestMeta.anonymized" />; | ||
| } | ||
|
|
||
| export const getListFormatter = ( | ||
| { | ||
| getRowURL, | ||
|
|
@@ -259,13 +272,13 @@ export const getListFormatter = ( | |
| />), | ||
| 'itemBarcode': rq => (rq?.item?.barcode || <NoValue />), | ||
| 'position': rq => (rq.position || <NoValue />), | ||
| ...(isProxyAvailable ? { 'proxy': rq => (rq.proxy ? getFullName(rq.proxy) : <NoValue />) } : {}), | ||
| ...(isProxyAvailable ? { 'proxy': rq => userFormatter(rq.proxyUserId, rq.proxy) } : {}), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please take a look on comment above for 'proxy'? |
||
| 'requestDate': rq => ( | ||
| <AppIcon size="small" app="requests"> | ||
| <FormattedTime value={rq.requestDate} day="numeric" month="numeric" year="numeric" /> | ||
| </AppIcon> | ||
| ), | ||
| 'requester': rq => (rq.requester ? getFullName(rq.requester) : <NoValue />), | ||
| 'requester': rq => userFormatter(rq.requesterId, rq.requester), | ||
| 'singlePrint': rq => { | ||
| const singlePrintButtonProps = { | ||
| request: rq, | ||
|
|
||
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.
It's better to move it down to visualize that it was made last in this release (after * When creating or viewing a request, show whether the a loan on the item would be use-at-location. Fixes UIREQ-1327.).