From d88fcc327a7f3b75a5b277955ca63b3b46973137 Mon Sep 17 00:00:00 2001 From: Julian Ladisch Date: Wed, 22 Jan 2025 13:33:12 +0100 Subject: [PATCH] UIIN-3207: Sort holdings by location name and call number The instance view shows the holdings that belong to that instance. There are many libraries with many holdings per instance, they need this sorted by effectiveLocation.name, callNumberPrefix, callNumber, callNumberSuffix. Solution: Use this CQL query: `instanceId==5b966ed6-3cd6-4dda-a0c7-f9b5e2826ccd sortBy effectiveLocation.name callNumberPrefix callNumber callNumberSuffix` --- CHANGELOG.md | 1 + src/ViewInstance.js | 2 +- src/providers/HoldingsProvider.js | 2 +- src/routes/ViewRequestsRoute.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e13db2b..a3a55e165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Add "linked-data 1.0" interface to "optionalOkapiInterfaces". Refs UIIN-3166. * Remove hover-over text next to "Effective call number" on the Item record detail view. Refs UIIN-3131. * Change import of `exportToCsv` from `stripes-util` to `stripes-components`. Refs UIIN-3025. +* Sort holdings by location name and call number. Refs UIIN-3207. ## [12.0.10](https://github.com/folio-org/ui-inventory/tree/v12.0.10) (2025-01-20) [Full Changelog](https://github.com/folio-org/ui-inventory/compare/v12.0.9...v12.0.10) diff --git a/src/ViewInstance.js b/src/ViewInstance.js index fba152477..9caf53e1a 100644 --- a/src/ViewInstance.js +++ b/src/ViewInstance.js @@ -106,7 +106,7 @@ class ViewInstance extends React.Component { fetch: true, throwErrors: false, params: { - query: 'instanceId==:{id}', + query: 'instanceId==:{id} sortBy effectiveLocation.name callNumberPrefix callNumber callNumberSuffix', limit: '1000', }, tenant: '!{tenantId}', diff --git a/src/providers/HoldingsProvider.js b/src/providers/HoldingsProvider.js index 3606fc1e9..a2fe4efe7 100644 --- a/src/providers/HoldingsProvider.js +++ b/src/providers/HoldingsProvider.js @@ -40,7 +40,7 @@ export const useInstanceHoldingsQuery = (instanceId, options = {}) => { const searchParams = { limit: LIMIT, - query: `instanceId==${instanceId}`, + query: `instanceId==${instanceId} sortBy effectiveLocation.name callNumberPrefix callNumber callNumberSuffix`, }; const [namespace] = useNamespace({ key: 'fetch-holding-by-instance-id' }); diff --git a/src/routes/ViewRequestsRoute.js b/src/routes/ViewRequestsRoute.js index 155d808d4..6b89f3e5d 100644 --- a/src/routes/ViewRequestsRoute.js +++ b/src/routes/ViewRequestsRoute.js @@ -101,7 +101,7 @@ ViewRequestsRoute.manifest = { fetch: true, throwErrors: false, params: { - query: 'instanceId==:{id}', + query: 'instanceId==:{id} sortBy effectiveLocation.name callNumberPrefix callNumber callNumberSuffix', limit: '1000', }, },