From 7edd21abfe61ebec231e308ab6fee6256ce3b2e1 Mon Sep 17 00:00:00 2001
From: Priyanka Terala <104053200+Terala-Priyanka@users.noreply.github.com>
Date: Tue, 3 Dec 2024 16:31:51 +0530
Subject: [PATCH] UIREQ-1188 - Add optional column 'Retrieval service point'
(#1240)
* UIREQ-1188 - Add optional column 'Retrieval service point'
* Male retieval sp column sortable
* add unit test
---
src/routes/RequestsRoute.js | 5 ++++-
src/routes/RequestsRoute.test.js | 8 ++++++++
translations/ui-requests/en.json | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/routes/RequestsRoute.js b/src/routes/RequestsRoute.js
index e7f18a51..e335ba15 100644
--- a/src/routes/RequestsRoute.js
+++ b/src/routes/RequestsRoute.js
@@ -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),
});
@@ -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',
@@ -1490,6 +1492,7 @@ class RequestsRoute extends React.Component {
servicePoint: ,
requester: ,
requesterBarcode: ,
+ retrievalServicePoint: ,
singlePrint: ,
...(isProxyAvailable ? { proxy: } : {}),
...(isViewPrintDetailsEnabled && {
@@ -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}
/>
diff --git a/src/routes/RequestsRoute.test.js b/src/routes/RequestsRoute.test.js
index d18c1a8d..e59f5e31 100644
--- a/src/routes/RequestsRoute.test.js
+++ b/src/routes/RequestsRoute.test.js
@@ -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: {},
@@ -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);
diff --git a/translations/ui-requests/en.json b/translations/ui-requests/en.json
index e62ff774..19923c7a 100644
--- a/translations/ui-requests/en.json
+++ b/translations/ui-requests/en.json
@@ -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",