Skip to content
Snippets Groups Projects
Commit 85a0e53f authored by esikkala's avatar esikkala
Browse files

Disable active facet chips while loading

parent 919bb73b
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import intl from 'react-intl-universal'
import ChipsArray from './ChipsArray'
const ActiveFilters = props => {
const { uriFilters, textFilters, timespanFilters, integerFilters, facetClass, someFacetIsFetching } = props
const { uriFilters, textFilters, timespanFilters, integerFilters, facetClass, someFacetIsFetching, fetchingResultCount } = props
const facetValues = []
Object.keys(uriFilters).map(activeFacetID => {
// URI filter may have multiple values
......@@ -47,6 +47,7 @@ const ActiveFilters = props => {
facetClass={props.facetClass}
updateFacetOption={props.updateFacetOption}
someFacetIsFetching={someFacetIsFetching}
fetchingResultCount={fetchingResultCount}
fetchFacet={props.fetchFacet}
/>
)
......@@ -61,6 +62,7 @@ ActiveFilters.propTypes = {
integerFilters: PropTypes.object.isRequired,
updateFacetOption: PropTypes.func.isRequired,
someFacetIsFetching: PropTypes.bool.isRequired,
fetchingResultCount: PropTypes.bool.isRequired,
fetchFacet: PropTypes.func.isRequired
}
......
......@@ -22,7 +22,7 @@ const styles = theme => ({
*/
const ChipsArray = props => {
const handleDelete = item => () => {
if (!props.someFacetIsFetching) {
if (!props.someFacetIsFetching && !props.fetchingResultCount) {
switch (item.filterType) {
case 'uriFilter':
props.updateFacetOption({
......@@ -100,6 +100,7 @@ const ChipsArray = props => {
icon={icon}
label={generateLabel(item.facetLabel, valueLabel, item.filterType)}
className={classes.chip}
disabled={props.someFacetIsFetching || props.fetchingResultCount}
onDelete={handleDelete(item)}
color='primary'
/>
......@@ -116,6 +117,7 @@ ChipsArray.propTypes = {
facetClass: PropTypes.string.isRequired,
updateFacetOption: PropTypes.func.isRequired,
someFacetIsFetching: PropTypes.bool.isRequired,
fetchingResultCount: PropTypes.bool.isRequired,
fetchFacet: PropTypes.func.isRequired
}
......
......@@ -98,6 +98,7 @@ class FacetInfo extends React.Component {
integerFilters={integerFilters}
updateFacetOption={this.props.updateFacetOption}
someFacetIsFetching={someFacetIsFetching}
fetchingResultCount={this.props.fetchingResultCount}
fetchFacet={this.props.fetchFacet}
/>
</div>
......
......@@ -277,9 +277,6 @@ const generateUriFilter = ({
VALUES ?${facetID}Filter { ${valuesStr} }
`
}
if (inverse) {
console.log(s)
}
return s
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment