Skip to content

Commit d96a476

Browse files
UIREQMED-112: ECS with mod-tlr enabled - Add ability to search by Mediated requests UUID
1 parent 9d4d685 commit d96a476

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* *BREAKING* Use `convertToSlipData` and supporting functions from `stripes-util`. Refs UIREQMED-92.
66
* Replace moment with day.js. Refs UIREQMED-96.
77
* Reduce count of eslint errors after update eslint-config-stripes. Refs UIREQMED-95.
8+
* Add ability to search by Mediated requests UUID. Refs UIREQMED-112.
89

910
## [3.0.2] (https://github.com/folio-org/ui-requests-mediated/tree/v3.0.2) (2025-06-19)
1011
[Full Changelog](https://github.com/folio-org/ui-requests-mediated/compare/v3.0.1...v3.0.2)

src/components/MediatedRequestsActivities/MediatedRequestsActivities.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
FILTER_CONFIG,
4848
REPORT_HEADERS,
4949
CONTENT_DATA_PROP_TYPES,
50+
MEDIATED_REQUEST_SEARCH_PARAMS,
5051
getMediatedRequestsActivitiesUrl,
5152
} from '../../constants';
5253
import {
@@ -134,7 +135,7 @@ export const getActionMenu = ({
134135
const queryParams = [];
135136

136137
if (searchValue?.query) {
137-
const searchQuery = SEARCH_FIELDS.map(searchSubQuery => `${searchSubQuery}==${searchValue.query}*`).join(' or ');
138+
const searchQuery = SEARCH_FIELDS.map((searchSubQuery) => (searchSubQuery === MEDIATED_REQUEST_SEARCH_PARAMS.ID ? `${searchSubQuery}==${searchValue.query}` : `${searchSubQuery}==${searchValue.query}*`)).join(' or ');
138139

139140
queryParams.push(`(${searchQuery})`);
140141
}

src/components/MediatedRequestsActivities/MediatedRequestsActivities.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
MODULE_ROUTE,
2626
MEDIATED_REQUESTS_ACTIVITIES,
2727
FILTER_CONFIG, SEARCH_FIELDS,
28+
MEDIATED_REQUEST_SEARCH_PARAMS,
2829
} from '../../constants';
2930

3031
jest.mock('../NavigationMenu', () => jest.fn((props) => (<div {...props} />)));
@@ -267,7 +268,7 @@ describe('getActionMenu', () => {
267268
});
268269

269270
it('should get data to report with correct query', () => {
270-
const query = SEARCH_FIELDS.map(searchSubQuery => `${searchSubQuery}==${actionMenuData.searchValue.query}*`).join(' or ');
271+
const query = SEARCH_FIELDS.map(searchSubQuery => (searchSubQuery === MEDIATED_REQUEST_SEARCH_PARAMS.ID ? `${searchSubQuery}==${actionMenuData.searchValue.query}` : `${searchSubQuery}==${actionMenuData.searchValue.query}*`)).join(' or ');
271272

272273
expect(actionMenuData.reportRecords.GET).toHaveBeenCalledWith({
273274
params: {

src/constants/mediatedRequestsActivities.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';
44
export const MEDIATED_REQUESTS_RECORDS_NAME = 'mediatedRequestsRecords';
55

66
export const MEDIATED_REQUEST_SEARCH_PARAMS = {
7+
ID: 'idText',
78
INSTANCE_TITLE: 'instanceTitle',
89
ITEM_BARCODE: 'itemBarcode',
910
REQUESTER_BARCODE: 'requesterBarcode',
@@ -300,13 +301,14 @@ export const FILTER_CONFIG = [
300301
},
301302
{
302303
name: MEDIATED_REQUEST_FILTER_TYPES.MEDIATED_REQUEST_LEVELS,
303-
cql: MEDIATED_REQUEST_FILTER_TYPES.MEDIATED_REQUEST_LEVELS,
304+
cql: `${MEDIATED_REQUEST_FILTER_TYPES.MEDIATED_REQUEST_LEVELS}Text`,
304305
values: [],
305306
operator: '==',
306307
},
307308
];
308309

309310
export const SEARCH_FIELDS = [
311+
MEDIATED_REQUEST_SEARCH_PARAMS.ID,
310312
MEDIATED_REQUEST_SEARCH_PARAMS.INSTANCE_TITLE,
311313
MEDIATED_REQUEST_SEARCH_PARAMS.ITEM_BARCODE,
312314
MEDIATED_REQUEST_SEARCH_PARAMS.REQUESTER_BARCODE,

src/routes/MediatedRequestsActivitiesContainer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import {
2222
SEARCH_FIELDS,
2323
FILTER_CONFIG,
2424
CONTENT_DATA_PROP_TYPES,
25+
MEDIATED_REQUEST_SEARCH_PARAMS,
2526
} from '../constants';
2627

2728
export const buildQuery = (queryParams, pathComponents, resourceData, logger, props) => {
2829
const customFilterConfig = buildFilterConfig(queryParams.filters);
29-
const mapFields = (index) => `${index}=="%{query.query}*"`;
30+
const mapFields = (index) => (index === MEDIATED_REQUEST_SEARCH_PARAMS.ID ? `${index}=="%{query.query}"` : `${index}=="%{query.query}*"`);
3031
const getCql = makeQueryFunction(
3132
'cql.allRecords=1',
3233
SEARCH_FIELDS.map(mapFields).join(' or '),

0 commit comments

Comments
 (0)