diff --git a/src/client/components/facet_bar/FacetBar.js b/src/client/components/facet_bar/FacetBar.js index 897a1a071d9076ab23abb3ae5f2bbc18b17a8536..9a5db092e4f3270a9fb850924bd2cfd6b2d2c63c 100644 --- a/src/client/components/facet_bar/FacetBar.js +++ b/src/client/components/facet_bar/FacetBar.js @@ -342,6 +342,7 @@ class FacetBar extends React.Component { const { classes, facetClass, resultClass, resultCount, facetData, facetedSearchMode } = this.props const { facets } = facetData let someFacetIsFetching = false + const hasClientFSResults = facetData.results !== null if (facetedSearchMode === 'serverFS') { Object.values(facets).forEach(facet => { if (facet.isFetching) { @@ -372,7 +373,7 @@ class FacetBar extends React.Component { perspectiveID={facetClass} layoutConfig={this.props.layoutConfig} />} - {(facetedSearchMode === 'serverFS' || facetData.results !== null) && + {(facetedSearchMode === 'serverFS' || hasClientFSResults) && <Paper className={classes.facetInfoContainer}> <FacetInfo facetedSearchMode={facetedSearchMode} @@ -391,7 +392,7 @@ class FacetBar extends React.Component { screenSize={this.props.screenSize} /> </Paper>} - {(facetedSearchMode === 'serverFS' || facetData.results !== null) && + {(facetedSearchMode === 'serverFS' || hasClientFSResults) && this.renderFacets({ classes, facets, someFacetIsFetching })} </div> ) diff --git a/src/client/components/perspectives/sampo/TopBar.js b/src/client/components/perspectives/sampo/TopBar.js index 04c8f9ae5e663635ddf5cabace661f7fab51e665..c658d5c00c9b65b644bf5947274a88ae9d205b7b 100644 --- a/src/client/components/perspectives/sampo/TopBar.js +++ b/src/client/components/perspectives/sampo/TopBar.js @@ -255,6 +255,7 @@ const TopBar = props => { root: classes.mainLogoButtonRoot, label: classes.mainLogoButtonLabel }} + onClick={() => clientFSMode ? props.clientFSClearResults() : null} > {/* <img className={classes.mainLogo} src={} /> */} <Typography className={classes.mainLogoTypography} variant='h6'> diff --git a/src/client/containers/SemanticPortal.js b/src/client/containers/SemanticPortal.js index c6ff9f449b7093a9f2196ae4c9a4a46ddf039432..28b6c3c87c117d311ff40a23c01e461d7119db2f 100644 --- a/src/client/containers/SemanticPortal.js +++ b/src/client/containers/SemanticPortal.js @@ -252,7 +252,7 @@ const SemanticPortal = props => { if (lgScreen) { screenSize = 'lg' } if (xlScreen) { screenSize = 'xl' } const rootUrlWithLang = `${rootUrl}/${props.options.currentLocale}` - const noResults = props.clientFSState.results == null + const noClientFSResults = props.clientFSState.results == null useEffect(() => { document.title = intl.get('html.title') @@ -270,6 +270,7 @@ const SemanticPortal = props => { search={props.fullTextSearch} fetchFullTextResults={props.fetchFullTextResults} clearResults={props.clearResults} + clientFSClearResults={props.clientFSClearResults} perspectives={perspectiveConfig} currentLocale={props.options.currentLocale} availableLocales={props.options.availableLocales} @@ -542,7 +543,7 @@ const SemanticPortal = props => { facetData={props.clientFSState} clientFSFacetValues={props.clientFSFacetValues} fetchingResultCount={props.clientFSState.textResultsFetching} - resultCount={noResults ? 0 : props.clientFSState.results.length} + resultCount={noClientFSResults ? 0 : props.clientFSState.results.length} clientFSState={props.clientFSState} clientFSToggleDataset={props.clientFSToggleDataset} clientFSFetchResults={props.clientFSFetchResults} @@ -559,8 +560,8 @@ const SemanticPortal = props => { /> </Grid> <Grid item sm={12} md={8} lg={9} className={classes.resultsContainerClientFS}> - {noResults && <ClientFSMain />} - {!noResults && + {noClientFSResults && <ClientFSMain />} + {!noClientFSResults && <ClientFSPerspective routeProps={routeProps} perspective={perspectiveConfig.find(p => p.id === 'clientFSPlaces')}