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

UIU-1191 - Include Retrieval service point column in csv exports. #1249

Merged
merged 3 commits into from
Dec 20, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Increase code coverage for src/ViewRequest.js by Jest/RTL tests. Refs UIREQ-1046.
* React v19: refactor away from default props for functional components. Refs UIREQ-1101.
* Add "Retrieval service point" filter. Refs UIREQ-1190.
* 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)
Expand Down
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export const reportHeaders = [
'holdShelfExpirationDate',
'position',
'item.barcode',
'item.retrievalServicePointName',
'instance.title',
'instance.contributorNames',
'item.location.libraryName',
Expand Down Expand Up @@ -219,6 +220,7 @@ export const reportHeaders = [
export const expiredHoldsReportHeaders = [
'requester.name',
'requester.barcode',
'item.retrievalServicePointName',
'instance.title',
'item.barcode',
'item.callNumberComponents.prefix',
Expand Down
3 changes: 3 additions & 0 deletions src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('; ');
});
Expand Down
8 changes: 7 additions & 1 deletion src/routes/RequestsRoute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ const mockedRequest = {
instanceId: 'instanceId',
item: {
barcode: 'itemBarcode',
retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f',
retrievalServicePointName: 'Circ Desk 1',
},
requester: {
barcode: 'requesterBarcode',
Expand Down Expand Up @@ -357,6 +359,10 @@ describe('RequestsRoute', () => {
}
],
},
item: {
retrievalServicePointId: '3a40852d-49fd-4df2-a1f9-6e2641a6e91f',
retrievalServicePointName: 'Circ Desk 1',
},
tags: {
tagList: ['tag1', 'tag2'],
},
Expand Down Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion translations/ui-requests/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"deliveryAddress": "Delivery address",
"requester.pickupLocation": "Pickup location",
"pickupServicePoint.name": "Pickup service point",
"retrievalServicePoint.name": "Retrieval service point",
"item.retrievalServicePointName": "Retrieval service point",
"requester.patronGroup.group": "Requester patron group",
"tags.tagList": "Tags",
"printDetails.printCount": "# Copies",
Expand Down
Loading