diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b3d592..8d27b5ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ * Add "Amount must be a positive number" validation for "Set exchange rate" field. Refs UISACQCOMP-218. * Create common utilities for managing response errors. Refs UISACQCOMP-219. * ECS - expand `ConsortiumFieldInventory` component with `additionalAffiliationIds` prop to display affiliation name for User without affiliation in specific tenant. Refs UISACQCOMP-220. +* Change `FundFilter` component to support multi-selection for Fund codes. Refs UISACQCOMP-221. +* Use `actionDate` value for version history card title instead of `eventDate`. Refs UISACQCOMP-222. * ECS - Add reusable custom hooks to fix invalid reference issues related to holding names and locations. Refs UISACQCOMP-223. ## [5.1.2](https://github.com/folio-org/stripes-acq-components/tree/v5.1.2) (2024-09-13) diff --git a/lib/FundFilter/FundFilter.js b/lib/FundFilter/FundFilter.js index b27f88ac..1aa0e9ac 100644 --- a/lib/FundFilter/FundFilter.js +++ b/lib/FundFilter/FundFilter.js @@ -1,28 +1,62 @@ -import React from 'react'; import PropTypes from 'prop-types'; -import { SelectionFilter } from '../SelectionFilter'; +import { MultiSelectionFilter } from '@folio/stripes/smart-components'; + +import { FilterAccordion } from '../FilterAccordion'; const getFundOptions = (funds = []) => funds.map(fund => ({ value: fund.id, label: fund.code, })); -const FundFilter = ({ funds, labelId, ...rest }) => { - const options = getFundOptions(funds); +const FundFilter = ({ + funds, + labelId, + name, + id, + disabled, + activeFilters, + closedByDefault, + onChange, + ...rest +}) => { + const dataOptions = getFundOptions(funds); return ( - + name={name} + onChange={onChange} + > + {!dataOptions ? '' : ( + + )} + ); }; FundFilter.propTypes = { funds: PropTypes.arrayOf(PropTypes.object), + activeFilters: PropTypes.arrayOf(PropTypes.string), + closedByDefault: PropTypes.bool, + disabled: PropTypes.bool, + id: PropTypes.string.isRequired, labelId: PropTypes.string, + name: PropTypes.string.isRequired, + onChange: PropTypes.func.isRequired, }; FundFilter.defaultProps = { diff --git a/lib/FundFilter/FundFilter.test.js b/lib/FundFilter/FundFilter.test.js index d7bd2f77..c7487302 100644 --- a/lib/FundFilter/FundFilter.test.js +++ b/lib/FundFilter/FundFilter.test.js @@ -48,7 +48,7 @@ describe('FundFilter component', () => { it('should render all passed options', async () => { const { findAllByText, getByText } = renderFundFilter(fundRecords); - fireEvent.click(getByText('stripes-components.selection.controlLabel')); + fireEvent.click(getByText('0 items selected')); const renderedFilterOptions = await findAllByText(/Fund #[0-9]/); diff --git a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js index 047ac84e..17bf8887 100644 --- a/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js +++ b/lib/VersionHistory/VersionHistoryPane/VersionHistoryPane.js @@ -54,7 +54,7 @@ const VersionHistoryPane = ({ const versionCards = useMemo(() => ( versionsToDisplay.map(({ id: versionId, - eventDate, + actionDate, userId, }, i) => { const user = usersMap[userId]; @@ -83,7 +83,7 @@ const VersionHistoryPane = ({ isCurrent={versionId === currentVersion} isLatest={i === 0} onSelect={onSelectVersion} - title={} + title={} source={source} changedFields={changedFields} />