Skip to content
Snippets Groups Projects
Commit 467c1d7b authored by esikkala's avatar esikkala
Browse files

Fetch new facet values values when filters have changed

parent 829251d8
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,15 @@ const styles = () => ({ ...@@ -23,10 +23,15 @@ const styles = () => ({
class FacetDialog extends React.Component { class FacetDialog extends React.Component {
componentDidMount = () => { componentDidMount = () => {
// console.log('facet dialog mounted, fetch facet');
this.props.fetchFacet(); this.props.fetchFacet();
} }
componentDidUpdate = prevProps => {
if (prevProps.facet.facetFilters != this.props.facet.facetFilters) {
this.props.fetchFacet();
}
}
handleClose = () => this.props.closeFacetDialog(); handleClose = () => this.props.closeFacetDialog();
facetRenderer = facetValues => { facetRenderer = facetValues => {
......
...@@ -82,22 +82,12 @@ class ResultTable extends React.Component { ...@@ -82,22 +82,12 @@ class ResultTable extends React.Component {
}); });
} }
if (prevProps.facetFilters != this.props.facetFilters) { if (prevProps.facetFilters != this.props.facetFilters) {
console.log('filters updated') // console.log('filters updated')
this.props.updatePage(0); this.props.updatePage(0);
this.props.fetchManuscripts(); this.props.fetchManuscripts();
} }
} }
// idRenderer = id => {
// const plainId = id.substring(id.lastIndexOf('/') + 1);
// return (
// <div className={this.props.classes.tableColumn}>
// <a target='_blank' rel='noopener noreferrer' href={id}>{plainId}</a>
// </div>
// );
// };
stringListRenderer = cell => { stringListRenderer = cell => {
if (cell == null || cell === '-'){ if (cell == null || cell === '-'){
return '-'; return '-';
......
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