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

UIORGS-193 Add additional filters to support reporting requirements #620

Merged
merged 2 commits into from
Apr 17, 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 @@ -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
Loading