diff --git a/CHANGELOG.md b/CHANGELOG.md index 9859bea2..6119fd95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Implement organization's banking information details view. Refs UIORGS-389. * Modify summary display in organization view mode. Refs UIORGS-398. * Protection of viewing and changes of banking information by permissions. Refs UIORGS-388. +* Search organization on bank account number. Refs UIORGS-392. ## [5.0.0](https://github.com/folio-org/ui-organizations/tree/v5.0.0) (2023-10-12) [Full Changelog](https://github.com/folio-org/ui-organizations/compare/v4.0.0...v5.0.0) diff --git a/src/Organizations/OrganizationsList/OrganizationsList.js b/src/Organizations/OrganizationsList/OrganizationsList.js index c71377cb..da5a063b 100644 --- a/src/Organizations/OrganizationsList/OrganizationsList.js +++ b/src/Organizations/OrganizationsList/OrganizationsList.js @@ -32,8 +32,8 @@ import { useLocationSorting, } from '@folio/stripes-acq-components'; import { + getSearchableIndexes, OrganizationsListFilter, - searchableIndexes, } from '@folio/plugin-find-organization'; import { @@ -105,6 +105,10 @@ const OrganizationsList = ({ const { isFiltersOpened, toggleFilters } = useFiltersToogle('ui-organizations/filters'); + const searchableIndexes = useMemo(() => ( + getSearchableIndexes(stripes) + ), [stripes]); + const urlParams = useMemo(() => ( matchPath(location.pathname, { path: `${VIEW_ORG_DETAILS}:id` }) ), [location.pathname]); diff --git a/src/Organizations/OrganizationsList/hooks/useBuildQuery/useBuildQuery.js b/src/Organizations/OrganizationsList/hooks/useBuildQuery/useBuildQuery.js index 1948d180..e0363d41 100644 --- a/src/Organizations/OrganizationsList/hooks/useBuildQuery/useBuildQuery.js +++ b/src/Organizations/OrganizationsList/hooks/useBuildQuery/useBuildQuery.js @@ -1,8 +1,7 @@ import { useCallback } from 'react'; -import { - makeQueryBuilder, -} from '@folio/stripes-acq-components'; +import { useStripes } from '@folio/stripes/core'; +import { makeQueryBuilder } from '@folio/stripes-acq-components'; import { filterMap, getKeywordQuery, @@ -16,6 +15,8 @@ const CUSTOM_SORT_MAP = { }; export const useBuildQuery = () => { + const stripes = useStripes() + return useCallback(makeQueryBuilder( 'cql.allRecords=1', (query, qindex) => { @@ -23,7 +24,7 @@ export const useBuildQuery = () => { return `(${qindex}=${query}*)`; } - return getKeywordQuery(query); + return getKeywordQuery(query, stripes); }, 'sortby name/sort.ascending', filterMap, diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json index 9434d9ae..55ea98f8 100644 --- a/translations/ui-organizations/en.json +++ b/translations/ui-organizations/en.json @@ -61,6 +61,7 @@ "search.erpCode": "Accounting code", "search.taxId": "Tax ID", "search.interfaces": "Interfaces", + "search.bankingInformation.bankAccountNumber": "Bank account number", "search.placeholder.language": "Search with language code", "organization.delete.heading": "Delete {organizationName}?",