diff --git a/src/client/components/FacetBar.js b/src/client/components/FacetBar.js index dfc065d90611808209366ae105d0aba3ed1897e4..c6678eddf9c303e3704950f8b005bc24aca06999 100644 --- a/src/client/components/FacetBar.js +++ b/src/client/components/FacetBar.js @@ -30,7 +30,7 @@ const styles = theme => ({ padding: theme.spacing.unit, }, facetValuesContainerThree: { - height: 95, + height: 108, padding: theme.spacing.unit, }, }); @@ -51,7 +51,7 @@ class FacetBar extends React.Component { render() { const { classes, facet } = this.props; - + //console.log(facet) return ( <div className={classes.root}> {this.props.facet.fetchingFacet ? @@ -63,6 +63,8 @@ class FacetBar extends React.Component { </Paper> <div className={classes.facetValuesContainerThree}> <Tree + property='source' + lastUpdatedFacet={facet.lastUpdatedFacet} data={facet.facetValues.source} updateFilter={this.props.updateFilter} /> @@ -87,6 +89,8 @@ class FacetBar extends React.Component { </Paper> <div className={classes.facetValuesContainerTen}> <Tree + property='productionPlace' + lastUpdatedFacet={facet.lastUpdatedFacet} data={facet.facetValues.productionPlace} updateFilter={this.props.updateFilter} /> diff --git a/src/client/components/Tree.js b/src/client/components/Tree.js index 5280ee56d15773ce52406aeebbaff59abc41bfc3..51acd116b74cce63c31955752335e09dfebac283 100644 --- a/src/client/components/Tree.js +++ b/src/client/components/Tree.js @@ -37,6 +37,11 @@ class Tree extends Component { }; } + // componentDidUpdate = prevProps => { + // console.log(this.props.lastUpdatedFacet); + // //if (prevProps.facetFilters[this.props.property] != this.props.facetFilters ) + // }; + handleCheckboxChange = treeObj => event => { const newTreeData = changeNodeAtPath({ treeData: this.state.treeData, @@ -49,7 +54,7 @@ class Tree extends Component { }); this.setState({ treeData: newTreeData }); this.props.updateFilter({ - property: 'productionPlace', + property: this.props.property, value: treeObj.node.id }); }; @@ -183,6 +188,8 @@ class Tree extends Component { Tree.propTypes = { classes: PropTypes.object.isRequired, + property: PropTypes.string.isRequired, + lastUpdatedFacet: PropTypes.string.isRequired, data: PropTypes.array.isRequired, updateFilter: PropTypes.func.isRequired, }; diff --git a/src/client/reducers/facet.js b/src/client/reducers/facet.js index b9de6d3423ea4f8cea465d43d16f33dcdc5a620b..3e76908878ff38ee5b2a6b98e238190e787d4e9d 100644 --- a/src/client/reducers/facet.js +++ b/src/client/reducers/facet.js @@ -39,7 +39,8 @@ export const INITIAL_STATE = { }, fetchingFacet : false, facetDialogOpen: false, - activeFacet: '' + activeFacet: '', + lastUpdatedFacet: '' }; const facet = (state = INITIAL_STATE, action) => { diff --git a/src/server/sparql/Datasets.js b/src/server/sparql/Datasets.js index 82a61f45883d8bc6d502b537586c63da193b6aec..760d33f7c362b1140c86575818743f68c6c13d71 100644 --- a/src/server/sparql/Datasets.js +++ b/src/server/sparql/Datasets.js @@ -42,9 +42,6 @@ module.exports = { SELECT DISTINCT ?id { <FILTER> ?id a frbroo:F4_Manifestation_Singleton . - # ?id dct:source mmm-schema:Bodley . - # ?id dct:source mmm-schema:SDBM . - # ?id dct:source mmm-schema:Bibale . # ?id (^frbroo:R18_created|^crm:P108_has_produced)/crm:P7_took_place_at/skos:prefLabel ?orderBy . } #ORDER BY (!BOUND(?orderBy)) ?orderBy diff --git a/src/server/sparql/Manuscripts.js b/src/server/sparql/Manuscripts.js index 5a715239bddc4f46db7be1d50b663c3ce2701ad2..779e65d80244e4d7f73d1296e4484042d99534ac 100644 --- a/src/server/sparql/Manuscripts.js +++ b/src/server/sparql/Manuscripts.js @@ -53,7 +53,7 @@ const getManuscriptData = (page, pagesize, filters) => { manuscriptQuery = manuscriptQuery.replace('<FILTER>', generateResultFilter(filters)); } manuscriptQuery = manuscriptQuery.replace('<PAGE>', `LIMIT ${pagesize} OFFSET ${page * pagesize}`); - // console.log(manuscriptQuery) + //console.log(manuscriptQuery) return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, makeObjectList); };