-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97b0544
commit f24ebbd
Showing
7 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/components/RequestsFilters/RetrievalServicePointFilter/RetrievalServicePointFilter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React, { | ||
useCallback, | ||
useMemo, | ||
} from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { isEmpty } from 'lodash'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { | ||
Accordion, | ||
FilterAccordionHeader, | ||
} from '@folio/stripes/components'; | ||
import { | ||
MultiSelectionFilter, | ||
} from '@folio/stripes/smart-components'; | ||
|
||
import { | ||
requestFilterTypes, | ||
} from '../../../constants'; | ||
|
||
const RetrievalServicePointFilter = ({ | ||
activeValues, | ||
onChange, | ||
onClear, | ||
}) => { | ||
const name = requestFilterTypes.RETRIEVAL_SERVICE_POINT; | ||
const clearFilter = useCallback(() => { | ||
onClear(name); | ||
}, [name, onClear]); | ||
|
||
const filterOptions = []; | ||
|
||
return ( | ||
<div> | ||
<Accordion | ||
displayClearButton={!isEmpty(activeValues)} | ||
id={name} | ||
header={FilterAccordionHeader} | ||
label={<FormattedMessage id="ui-requests.retrievalServicePoint.name" />} | ||
name={name} | ||
separator={false} | ||
onClearFilter={clearFilter} | ||
> | ||
<MultiSelectionFilter | ||
ariaLabelledBy={`accordion-toggle-button-${name}`} | ||
dataOptions={filterOptions} | ||
id="req-retrieval-service-point-filter" | ||
name={name} | ||
onChange={onChange} | ||
selectedValues={activeValues} | ||
/> | ||
</Accordion> | ||
</div> | ||
); | ||
}; | ||
|
||
RetrievalServicePointFilter.propTypes = { | ||
activeValues: PropTypes.arrayOf(PropTypes.string), | ||
onChange: PropTypes.func.isRequired, | ||
onClear: PropTypes.func.isRequired, | ||
}; | ||
export default RetrievalServicePointFilter; |
Empty file.
1 change: 1 addition & 0 deletions
1
src/components/RequestsFilters/RetrievalServicePointFilter/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as RetrievalServicePointFilter } from './RetrievalServicePointFilter'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters