Skip to content

Commit

Permalink
UIORGS-193 Add additional filters to support reporting requirements (#…
Browse files Browse the repository at this point in the history
…620)

* UIORGS-193 Add additional filters to support reporting requirements

* update test
  • Loading branch information
usavkov-epam authored Apr 17, 2024
1 parent 648284a commit 9b2fcf6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 5.2.0 (IN PROGRESS)

* UX Consistency: HTML Page Title display when the third pane (detail record) displays. Refs UIORGS-423.
* Add additional filters to support reporting requirements. Refs UIORG-193.

## [5.1.0](https://github.com/folio-org/ui-organizations/tree/v5.1.0) (2024-03-19)
[Full Changelog](https://github.com/folio-org/ui-organizations/compare/v5.0.0...v5.1.0)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
"@folio/plugin-find-organization": "^5.0.0",
"@folio/stripes-acq-components": "~5.1.0",
"lodash": "^4.17.5",
"moment": "^2.24.0",
"moment-timezone": "^0.5.20",
"prop-types": "^15.5.10",
"query-string": "^6.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import moment from 'moment';
import { useQuery } from 'react-query';
import { useLocation } from 'react-router';
import queryString from 'query-string';

import {
useNamespace,
useOkapiKy,
useStripes,
} from '@folio/stripes/core';
import {
getFiltersCount,
Expand All @@ -19,14 +21,20 @@ export const useOrganizations = ({
options = {},
}) => {
const ky = useOkapiKy();
const stripes = useStripes();
const [namespace] = useNamespace({ key: 'organizations-list' });

const { search } = useLocation();
const buildQuery = useBuildQuery();
const queryParams = queryString.parse(search);
const query = buildQuery(queryParams);
const filtersCount = getFiltersCount(queryParams);

moment.tz.setDefault(stripes.timezone);

const query = buildQuery(queryParams);

moment.tz.setDefault();

const defaultSearchParams = {
query,
limit: pagination.limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jest.mock('@folio/stripes/core', () => ({
...jest.requireActual('@folio/stripes/core'),
useNamespace: () => ['namespace'],
useOkapiKy: jest.fn(),
useStripes: jest.fn(() => ({})),
}));

const organizations = [organization];
Expand Down
4 changes: 4 additions & 0 deletions translations/ui-organizations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"filterConfig.addressCategory": "Address category",
"filterConfig.contactPeopleCategory": "Contact people category",
"filterConfig.country": "Country",
"filterConfig.createdBy": "Created by",
"filterConfig.dateCreated": "Date created",
"filterConfig.dateUpdated": "Date updated",
"filterConfig.isVendor": "Is vendor",
"filterConfig.isDonor": "Is donor",
"filterConfig.languages": "Languages",
Expand All @@ -52,6 +55,7 @@
"filterConfig.boolean.true": "Yes",
"filterConfig.boolean.false": "No",
"filterConfig.types": "Types",
"filterConfig.updatedBy": "Updated by",

"search.keyword": "All",
"search.name": "Name",
Expand Down

0 comments on commit 9b2fcf6

Please sign in to comment.