From c3817452eaab5df3f2a626ce67fc494d69718b89 Mon Sep 17 00:00:00 2001 From: Priyanka Terala Date: Fri, 13 Dec 2024 17:53:24 +0530 Subject: [PATCH 1/2] UIU-1191 - Include `Retrieval service point` column in csv exports. --- CHANGELOG.md | 1 + src/constants.js | 2 ++ src/routes/RequestsRoute.js | 3 +++ translations/ui-requests/en.json | 1 + 4 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49016346..05fb70c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Add optional column "Retrieval service point" to requests search list. Refs UIREQ-1188. * Increase code coverage for src/ChooseRequestTypeDialog.js by Jest/RTL tests. Refs UIREQ-1044. * Cleanup retrieval service point implementation from deprecated folder. Refs UIREQ-1211. +* Include `Retrieval service point` column in csv exports. Refs UIREQ-1191. ## [11.0.2] (https://github.com/folio-org/ui-requests/tree/v11.0.2) (2024-12-10) [Full Changelog](https://github.com/folio-org/ui-requests/compare/v11.0.1...v11.0.2) diff --git a/src/constants.js b/src/constants.js index 225b174b..5ee53821 100644 --- a/src/constants.js +++ b/src/constants.js @@ -187,6 +187,7 @@ export const reportHeaders = [ 'holdShelfExpirationDate', 'position', 'item.barcode', + 'item.retrievalServicePointName', 'instance.title', 'instance.contributorNames', 'item.location.libraryName', @@ -219,6 +220,7 @@ export const reportHeaders = [ export const expiredHoldsReportHeaders = [ 'requester.name', 'requester.barcode', + 'item.retrievalServicePointName', 'instance.title', 'item.barcode', 'item.callNumberComponents.prefix', diff --git a/src/routes/RequestsRoute.js b/src/routes/RequestsRoute.js index e335ba15..d46829b1 100644 --- a/src/routes/RequestsRoute.js +++ b/src/routes/RequestsRoute.js @@ -1002,6 +1002,9 @@ class RequestsRoute extends React.Component { const { addressLine1, city, region, postalCode, countryId } = record.deliveryAddress; record.deliveryAddress = `${addressLine1 || ''} ${city || ''} ${region || ''} ${countryId || ''} ${postalCode || ''}`; } + if (record.item.retrievalServicePointName) { + record.retrievalServicePointName = record.item.retrievalServicePointName; + } record.instance.contributorNames = contributorNamesMap.join('; '); if (record.tags) record.tags.tagList = tagListMap.join('; '); }); diff --git a/translations/ui-requests/en.json b/translations/ui-requests/en.json index 19923c7a..7fb5ecc2 100644 --- a/translations/ui-requests/en.json +++ b/translations/ui-requests/en.json @@ -198,6 +198,7 @@ "deliveryAddress": "Delivery address", "requester.pickupLocation": "Pickup location", "pickupServicePoint.name": "Pickup service point", + "item.retrievalServicePointName": "Retrieval service point", "requester.patronGroup.group": "Requester patron group", "tags.tagList": "Tags", "printDetails.printCount": "# Copies", From 0c50bf7a28b6176c6f05f87979943f44a5003afe Mon Sep 17 00:00:00 2001 From: Priyanka Terala Date: Wed, 18 Dec 2024 16:47:49 +0530 Subject: [PATCH 2/2] fix test --- src/routes/RequestsRoute.test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/RequestsRoute.test.js b/src/routes/RequestsRoute.test.js index e59f5e31..c85beafd 100644 --- a/src/routes/RequestsRoute.test.js +++ b/src/routes/RequestsRoute.test.js @@ -234,6 +234,8 @@ const mockedRequest = { instanceId: 'instanceId', item: { barcode: 'itemBarcode', + retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f', + retrievalServicePointName: 'Circ Desk 1', }, requester: { barcode: 'requesterBarcode', @@ -357,6 +359,10 @@ describe('RequestsRoute', () => { } ], }, + item: { + retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f', + retrievalServicePointName: 'Circ Desk 1', + }, tags: { tagList: ['tag1', 'tag2'], }, @@ -628,7 +634,7 @@ describe('RequestsRoute', () => { expect(printContent).toBeInTheDocument(); }); - it('should trigger "exportCsv"', async () => { + it("should trigger 'exportCsv'", async () => { await userEvent.click(screen.getByRole('button', { name: 'ui-requests.exportSearchResultsToCsv' })); await waitFor(() => {