Skip to content
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

UIREQ-1188 - Add optional column 'Retrieval service point' #1240

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export const getListFormatter = (
'year': rq => getFormattedYears(rq.instance?.publication, DEFAULT_DISPLAYED_YEARS_AMOUNT),
'callNumber': rq => effectiveCallNumber(rq.item),
'servicePoint': rq => get(rq, 'pickupServicePoint.name', DEFAULT_FORMATTER_VALUE),
'retrievalServicePoint': rq => get(rq, 'item.retrievalServicePointName', DEFAULT_FORMATTER_VALUE),
'copies': rq => get(rq, PRINT_DETAILS_COLUMNS.COPIES, DEFAULT_FORMATTER_VALUE),
'printed': rq => (rq.printDetails ? getLastPrintedDetails(rq.printDetails, intl) : DEFAULT_FORMATTER_VALUE),
});
Expand Down Expand Up @@ -353,6 +354,7 @@ class RequestsRoute extends React.Component {
'requestStatus': 'status',
'servicePoint': 'searchIndex.pickupServicePointName',
'requesterBarcode': 'requester.barcode',
'retrievalServicePoint': 'item.retrievalServicePointName',
'requestDate': 'requestDate',
'position': 'position/number',
'proxy': 'proxy',
Expand Down Expand Up @@ -1490,6 +1492,7 @@ class RequestsRoute extends React.Component {
servicePoint: <FormattedMessage id="ui-requests.requests.servicePoint" />,
requester: <FormattedMessage id="ui-requests.requests.requester" />,
requesterBarcode: <FormattedMessage id="ui-requests.requests.requesterBarcode" />,
retrievalServicePoint: <FormattedMessage id="ui-requests.requests.retrievalServicePoint" />,
singlePrint: <FormattedMessage id="ui-requests.requests.singlePrint" />,
...(isProxyAvailable ? { proxy: <FormattedMessage id="ui-requests.requests.proxy" /> } : {}),
...(isViewPrintDetailsEnabled && {
Expand Down Expand Up @@ -1763,7 +1766,7 @@ class RequestsRoute extends React.Component {
resultIsSelected={this.resultIsSelected}
onFilterChange={this.handleFilterChange}
sortableColumns={['requestDate', 'title', 'year', 'itemBarcode', 'callNumber', 'type', 'requestStatus',
'position', 'servicePoint', 'requester', 'requesterBarcode', ...(isProxyAvailable ? ['proxy'] : []), 'copies', 'printed']}
'position', 'servicePoint', 'requester', 'requesterBarcode', 'retrievalServicePoint', ...(isProxyAvailable ? ['proxy'] : []), 'copies', 'printed']}
pageAmount={100}
pagingType={MCLPagingTypes.PREV_NEXT}
/>
Expand Down
8 changes: 8 additions & 0 deletions src/routes/RequestsRoute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,8 @@ describe('RequestsRoute', () => {
select: 'test value',
item: {
barcode: 'itemBarcode',
retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f',
retrievalServicePointName: 'Circ Desk 1',
},
position: 'position',
proxy: {},
Expand Down Expand Up @@ -1522,6 +1524,12 @@ describe('RequestsRoute', () => {
});
});

describe('retrieval service point', () => {
it('should return retrieval service point', () => {
expect(listFormatter.retrievalServicePoint(requestWithData)).toBe(requestWithData.item.retrievalServicePointName);
});
});

describe('when formatting copies column', () => {
it('should return copies for copies column', () => {
expect(listFormatter.copies(requestWithData)).toBe(requestWithData.printDetails.printCount);
Expand Down
1 change: 1 addition & 0 deletions translations/ui-requests/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"requests.itemBarcode": "Item barcode",
"requests.callNumber": "Effective call number string",
"requests.servicePoint": "Pickup service point",
"requests.retrievalServicePoint": "Retrieval service point",
"requests.createTitleLevelRequest": "Create title level request",
"requests.singlePrint": "Single print",
"requests.printButtonLabel": "Print",
Expand Down
Loading