diff --git a/src/client/components/facet_results/LeafletMap.js b/src/client/components/facet_results/LeafletMap.js index 6af3316182556417adc6acd4d42dcbe330d36334..98f92e0dbf1ef69322ce5c2f4f11c0642232327f 100644 --- a/src/client/components/facet_results/LeafletMap.js +++ b/src/client/components/facet_results/LeafletMap.js @@ -145,8 +145,8 @@ class LeafletMap extends React.Component { this.drawPointData() } if (this.props.showExternalLayers && - (this.props.layers.updateID !== prevProps.layers.updateID)) { - this.props.layers.layerData.map(layerObj => this.populateOverlay(layerObj)) + (this.props.leafletMapState.updateID !== prevProps.leafletMapState.updateID)) { + this.props.leafletMapState.layerData.map(layerObj => this.populateOverlay(layerObj)) } } @@ -188,15 +188,15 @@ class LeafletMap extends React.Component { } if (this.props.showExternalLayers && - (this.props.layers.updateID !== prevProps.layers.updateID)) { - this.props.layers.layerData.map(layerObj => this.populateOverlay(layerObj)) + (this.props.leafletMapState.updateID !== prevProps.leafletMapState.updateID)) { + this.props.leafletMapState.layerData.map(layerObj => this.populateOverlay(layerObj)) } if (this.props.showExternalLayers) { if (this.props.customMapControl) { this.setCustomMapControlVisibility() } - if (this.props.layers.fetching) { + if (this.props.leafletMapState.fetching) { if (this.props.customMapControl) { document.getElementById('leaflet-control-custom-checkbox-buffer').disabled = true } @@ -210,7 +210,7 @@ class LeafletMap extends React.Component { this.leafletMap.keyboard.disable() if (this.leafletMap.tap) this.leafletMap.tap.disable() } - if (!this.props.layers.fetching) { + if (!this.props.leafletMapState.fetching) { if (this.props.customMapControl) { document.getElementById('leaflet-control-custom-checkbox-buffer').disabled = false } @@ -942,7 +942,7 @@ class LeafletMap extends React.Component { <div className={this.props.classes[`leafletContainer${this.props.pageType}`]}> <div id={this.props.container ? this.props.container : 'map'} className={this.props.classes.mapElement}> {(this.props.fetching || - (this.props.showExternalLayers && this.props.layers.fetching)) && + (this.props.showExternalLayers && this.props.leafletMapState.fetching)) && <div className={this.props.classes.spinnerContainer}> <CircularProgress style={{ color: purple[500] }} thickness={5} /> </div>} @@ -957,7 +957,7 @@ LeafletMap.propTypes = { classes: PropTypes.object.isRequired, pageType: PropTypes.string.isRequired, results: PropTypes.array, - layers: PropTypes.object, + leafletMapState: PropTypes.object, facetID: PropTypes.string, facet: PropTypes.object, instance: PropTypes.object, diff --git a/src/client/components/perspectives/sampo/EmloActors.js b/src/client/components/perspectives/sampo/EmloActors.js index 094dc9d29069d51ca3df7e606c8ea0423bf1a45f..b5767511bff80322ca76de4a91f349dc0c23e807 100644 --- a/src/client/components/perspectives/sampo/EmloActors.js +++ b/src/client/components/perspectives/sampo/EmloActors.js @@ -27,7 +27,7 @@ const EmloActors = props => { path={[`${props.rootUrl}/${perspective.id}/faceted-search/table`, '/iframe.html']} render={routeProps => <ResultTable - data={props.facetResults} + data={props.perspectiveState} facetUpdateID={props.facetData.facetUpdateID} resultClass='emloActors' facetClass='emloActors' @@ -66,7 +66,7 @@ const EmloActors = props => { path={`${rootUrl}/${perspective.id}/faceted-search/export`} render={() => <Export - data={props.facetResults} + data={props.perspectiveState} resultClass='emloActors' facetClass='emloActors' pageType='facetResults' diff --git a/src/client/components/perspectives/sampo/FacetedSearchPerspective.js b/src/client/components/perspectives/sampo/FacetedSearchPerspective.js index c99dcaa7a5851724c27d924a8e979ea2fe7b076c..ebce6b6d2fd61273f9e0e46edd8ed0f6d511bb8d 100644 --- a/src/client/components/perspectives/sampo/FacetedSearchPerspective.js +++ b/src/client/components/perspectives/sampo/FacetedSearchPerspective.js @@ -16,177 +16,27 @@ const FacetedSearchPerspective = props => { switch (props.perspective.id) { case 'perspective1': perspectiveElement = - <Perspective1 - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <Perspective1 {...props} /> break case 'perspective2': perspectiveElement = - <Perspective2 - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <Perspective2 {...props} /> break case 'perspective3': perspectiveElement = - <Perspective3 - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <Perspective3 {...props} /> break case 'finds': perspectiveElement = - <Finds - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <Finds {...props} /> break case 'emloActors': perspectiveElement = - <EmloActors - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <EmloActors {...props} /> break case 'hellerau': perspectiveElement = - <Hellerau - facetResults={props.facetResults} - placesResults={props.placesResults} - leafletMapLayers={props.leafletMap} - facetData={props.facetData} - facetDataConstrainSelf={props.facetDataConstrainSelf} - fetchPaginatedResults={props.fetchPaginatedResults} - fetchResults={props.fetchResults} - fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetchFacetConstrainSelf={props.fetchFacetConstrainSelf} - fetchGeoJSONLayers={props.fetchGeoJSONLayers} - fetchGeoJSONLayersBackend={props.fetchGeoJSONLayersBackend} - clearGeoJSONLayers={props.clearGeoJSONLayers} - fetchByURI={props.fetchByURI} - updatePage={props.updatePage} - updateRowsPerPage={props.updateRowsPerPage} - updateFacetOption={props.updateFacetOption} - sortResults={props.sortResults} - showError={props.showError} - routeProps={props.routeProps} - perspective={props.perspective} - animationValue={props.animationValue} - animateMap={props.animateMap} - screenSize={props.screenSize} - rootUrl={props.rootUrl} - /> + <Hellerau {...props} /> break default: perspectiveElement = <div /> @@ -205,23 +55,23 @@ FacetedSearchPerspective.propTypes = { /** * Faceted search configs and results of this perspective. */ - facetResults: PropTypes.object.isRequired, + perspectiveState: PropTypes.object.isRequired, /** * Faceted search configs and results of places related to this perspective. */ - placesResults: PropTypes.object.isRequired, + placesState: PropTypes.object.isRequired, /** * Facet configs and values. */ - facetData: PropTypes.object.isRequired, + facetState: PropTypes.object.isRequired, /** * Facet values where facets constrain themselves, used for statistics. */ - facetDataConstrainSelf: PropTypes.object.isRequired, + facetConstrainSelfState: PropTypes.object.isRequired, /** * Leaflet map config and external layers. */ - leafletMap: PropTypes.object.isRequired, + leafletMapState: PropTypes.object.isRequired, /** * Redux action for fetching paginated results. */ diff --git a/src/client/components/perspectives/sampo/Finds.js b/src/client/components/perspectives/sampo/Finds.js index adcb4f71f37c2bb9cc7df0daad6b0783cadef3d0..291fefa27dd5a0fc85f3b4ad7f494c47a4ac1b72 100644 --- a/src/client/components/perspectives/sampo/Finds.js +++ b/src/client/components/perspectives/sampo/Finds.js @@ -27,7 +27,7 @@ const Finds = props => { path={`${props.rootUrl}/${perspective.id}/faceted-search/table`} render={routeProps => <ResultTable - data={props.facetResults} + data={props.perspectiveState} facetUpdateID={props.facetData.facetUpdateID} resultClass='finds' facetClass='finds' @@ -89,8 +89,8 @@ const Finds = props => { pageType='facetResults' resultClass='findsTimeline' facetClass='finds' - data={props.facetResults.results} - dataUpdateID={props.facetResults.resultUpdateID} + data={props.perspectiveState.results} + dataUpdateID={props.perspectiveState.resultUpdateID} facetUpdateID={props.facetData.facetUpdateID} fetchResults={props.fetchResults} />} @@ -99,7 +99,7 @@ const Finds = props => { path={`${rootUrl}/${perspective.id}/faceted-search/export`} render={() => <Export - data={props.facetResults} + data={props.perspectiveState} resultClass='finds' facetClass='finds' pageType='facetResults' diff --git a/src/client/components/perspectives/sampo/Hellerau.js b/src/client/components/perspectives/sampo/Hellerau.js index 6920a91ee87b6702ed6a41e879919d74a20428ca..d769360aeb7fe66c76c87ad576b83eea8eea6bb3 100644 --- a/src/client/components/perspectives/sampo/Hellerau.js +++ b/src/client/components/perspectives/sampo/Hellerau.js @@ -25,7 +25,7 @@ const Hellerau = props => { path={[`${props.rootUrl}/${perspective.id}/faceted-search/table`, '/iframe.html']} render={routeProps => <ResultTable - data={props.facetResults} + data={props.perspectiveState} facetUpdateID={props.facetData.facetUpdateID} resultClass='hellerau' facetClass='hellerau' @@ -41,7 +41,7 @@ const Hellerau = props => { path={`${rootUrl}/${perspective.id}/faceted-search/migrations`} render={() => <Deck - results={props.facetResults.results} + results={props.perspectiveState.results} facetUpdateID={props.facetData.facetUpdateID} resultClass='hellerauMigrations' facetClass='hellerau' diff --git a/src/client/components/perspectives/sampo/Perspective1.js b/src/client/components/perspectives/sampo/Perspective1.js index 22bb510e8d03dcd5595910da1e86d93c29ea5503..96b31c655180a376f50d7cd9c4e0c97371d9ffe0 100644 --- a/src/client/components/perspectives/sampo/Perspective1.js +++ b/src/client/components/perspectives/sampo/Perspective1.js @@ -40,8 +40,8 @@ const Perspective1 = props => { path={[`${props.rootUrl}/${perspective.id}/faceted-search/table`, '/iframe.html']} render={routeProps => <ResultTable - data={props.facetResults} - facetUpdateID={props.facetData.facetUpdateID} + data={props.perspectiveState} + facetUpdateID={props.facetState.facetUpdateID} resultClass='perspective1' facetClass='perspective1' fetchPaginatedResults={props.fetchPaginatedResults} @@ -61,16 +61,16 @@ const Perspective1 = props => { // center={[60.187, 24.821]} // zoom={13} // locateUser - results={props.placesResults.results} - layers={props.leafletMapLayers} + results={props.placesState.results} + leafletMapState={props.leafletMapState} pageType='facetResults' - facetUpdateID={props.facetData.facetUpdateID} - facet={props.facetData.facets.productionPlace} + facetUpdateID={props.facetState.facetUpdateID} + facet={props.facetState.facets.productionPlace} facetID='productionPlace' resultClass='placesMsProduced' facetClass='perspective1' mapMode='cluster' - instance={props.placesResults.instanceTableData} + instance={props.placesState.instanceTableData} createPopUpContent={createPopUpContentMMM} popupMaxHeight={320} popupMinWidth={280} @@ -78,7 +78,7 @@ const Perspective1 = props => { fetchGeoJSONLayers={props.fetchGeoJSONLayers} clearGeoJSONLayers={props.clearGeoJSONLayers} fetchByURI={props.fetchByURI} - fetching={props.placesResults.fetching} + fetching={props.placesState.fetching} showInstanceCountInClusters updateFacetOption={props.updateFacetOption} showError={props.showError} @@ -86,7 +86,7 @@ const Perspective1 = props => { layerControlExpanded={layerControlExpanded} // customMapControl layerConfigs={layerConfigs} - infoHeaderExpanded={props.facetResults.facetedSearchHeaderExpanded} + infoHeaderExpanded={props.perspectiveState.facetedSearchHeaderExpanded} // activeLayers={[ // 'WFS_MV_KulttuuriymparistoSuojellut:Muinaisjaannokset_alue', // 'WFS_MV_KulttuuriymparistoSuojellut:Muinaisjaannokset_piste', @@ -99,12 +99,12 @@ const Perspective1 = props => { path={`${rootUrl}/${perspective.id}/faceted-search/production_places_heatmap`} render={() => <Deck - results={props.placesResults.results} - facetUpdateID={props.facetData.facetUpdateID} + results={props.placesState.results} + facetUpdateID={props.facetState.facetUpdateID} resultClass='placesMsProduced' facetClass='perspective1' fetchResults={props.fetchResults} - fetching={props.placesResults.fetching} + fetching={props.placesState.fetching} layerType='heatmapLayer' mapBoxAccessToken={MAPBOX_ACCESS_TOKEN} mapBoxStyle={MAPBOX_STYLE} @@ -116,17 +116,17 @@ const Perspective1 = props => { <LeafletMap center={[22.43, 10.37]} zoom={2} - results={props.placesResults.results} - layers={props.leafletMapLayers} + results={props.placesState.results} + leafletMapState={props.leafletMapState} pageType='facetResults' - facetUpdateID={props.facetData.facetUpdateID} - facet={props.facetData.facets.lastKnownLocation} + facetUpdateID={props.facetState.facetUpdateID} + facet={props.facetState.facets.lastKnownLocation} facetID='lastKnownLocation' resultClass='lastKnownLocations' facetClass='perspective1' mapMode='cluster' showMapModeControl={false} - instance={props.placesResults.instanceTableData} + instance={props.placesState.instanceTableData} createPopUpContent={createPopUpContentMMM} popupMaxHeight={320} popupMinWidth={280} @@ -134,30 +134,30 @@ const Perspective1 = props => { fetchGeoJSONLayers={props.fetchGeoJSONLayers} clearGeoJSONLayers={props.clearGeoJSONLayers} fetchByURI={props.fetchByURI} - fetching={props.placesResults.fetching} + fetching={props.placesState.fetching} showInstanceCountInClusters updateFacetOption={props.updateFacetOption} showError={props.showError} showExternalLayers layerControlExpanded={layerControlExpanded} layerConfigs={layerConfigs} - infoHeaderExpanded={props.facetResults.facetedSearchHeaderExpanded} + infoHeaderExpanded={props.perspectiveState.facetedSearchHeaderExpanded} />} /> <Route path={`${rootUrl}/${perspective.id}/faceted-search/migrations`} render={() => <Deck - results={props.placesResults.results} - facetUpdateID={props.facetData.facetUpdateID} - instanceAnalysisData={props.placesResults.instanceAnalysisData} - instanceAnalysisDataUpdateID={props.placesResults.instanceAnalysisDataUpdateID} + results={props.placesState.results} + facetUpdateID={props.facetState.facetUpdateID} + instanceAnalysisData={props.placesState.instanceAnalysisData} + instanceAnalysisDataUpdateID={props.placesState.instanceAnalysisDataUpdateID} resultClass='placesMsMigrations' facetClass='perspective1' fetchResults={props.fetchResults} fetchInstanceAnalysis={props.fetchInstanceAnalysis} - fetching={props.placesResults.fetching} - fetchingInstanceAnalysisData={props.placesResults.fetchingInstanceAnalysisData} + fetching={props.placesState.fetching} + fetchingInstanceAnalysisData={props.placesState.fetchingInstanceAnalysisData} layerType='arcLayer' getArcWidth={d => d.instanceCountScaled} fromText={intl.get('deckGlMap.manuscriptMigrations.from')} @@ -180,10 +180,10 @@ const Perspective1 = props => { render={() => <ApexChart pageType='facetResults' - rawData={props.facetResults.results} - rawDataUpdateID={props.facetResults.resultUpdateID} - facetUpdateID={props.facetData.facetUpdateID} - fetching={props.facetResults.fetching} + rawData={props.perspectiveState.results} + rawDataUpdateID={props.perspectiveState.resultUpdateID} + facetUpdateID={props.facetState.facetUpdateID} + fetching={props.perspectiveState.fetching} fetchData={props.fetchResults} createChartData={createSingleLineChartData} title='Manuscript production by decade' @@ -202,10 +202,10 @@ const Perspective1 = props => { render={() => <ApexChart pageType='facetResults' - rawData={props.facetResults.results} - rawDataUpdateID={props.facetResults.resultUpdateID} - facetUpdateID={props.facetData.facetUpdateID} - fetching={props.facetResults.fetching} + rawData={props.perspectiveState.results} + rawDataUpdateID={props.perspectiveState.resultUpdateID} + facetUpdateID={props.facetState.facetUpdateID} + fetching={props.perspectiveState.fetching} fetchData={props.fetchResults} createChartData={createMultipleLineChartData} title='Manuscript events by decade' @@ -236,11 +236,11 @@ const Perspective1 = props => { path={`${rootUrl}/${perspective.id}/faceted-search/network`} render={() => <Network - results={props.facetResults.results} - facetUpdateID={props.facetData.facetUpdateID} - resultUpdateID={props.facetResults.resultUpdateID} + results={props.perspectiveState.results} + facetUpdateID={props.facetState.facetUpdateID} + resultUpdateID={props.perspectiveState.resultUpdateID} fetchResults={props.fetchResults} - fetching={props.facetResults.fetching} + fetching={props.perspectiveState.fetching} resultClass='manuscriptFacetResultsNetwork' facetClass='perspective1' limit={500} @@ -255,7 +255,7 @@ const Perspective1 = props => { path={`${rootUrl}/${perspective.id}/faceted-search/export`} render={() => <Export - data={props.facetResults} + data={props.perspectiveState} resultClass='perspective1' facetClass='perspective1' pageType='facetResults' @@ -268,28 +268,98 @@ const Perspective1 = props => { } Perspective1.propTypes = { - facetResults: PropTypes.object.isRequired, - placesResults: PropTypes.object.isRequired, - leafletMapLayers: PropTypes.object.isRequired, - facetData: PropTypes.object.isRequired, - facetDataConstrainSelf: PropTypes.object, + /** + * Faceted search configs and results of this perspective. + */ + perspectiveState: PropTypes.object.isRequired, + /** + * Faceted search configs and results of places related to this perspective. + */ + placesState: PropTypes.object.isRequired, + /** + * Facet configs and values. + */ + facetState: PropTypes.object.isRequired, + /** + * Facet values where facets constrain themselves, used for statistics. + */ + facetConstrainSelfState: PropTypes.object.isRequired, + /** + * Leaflet map config and external layers. + */ + leafletMapState: PropTypes.object.isRequired, + /** + * Redux action for fetching paginated results. + */ + fetchPaginatedResults: PropTypes.func.isRequired, + /** + * Redux action for fetching all results. + */ fetchResults: PropTypes.func.isRequired, - clearGeoJSONLayers: PropTypes.func.isRequired, + /** + * Redux action for fetching facet values for statistics. + */ + fetchFacetConstrainSelf: PropTypes.func.isRequired, + /** + * Redux action for loading external GeoJSON layers. + */ fetchGeoJSONLayers: PropTypes.func.isRequired, + /** + * Redux action for loading external GeoJSON layers via backend. + */ fetchGeoJSONLayersBackend: PropTypes.func.isRequired, - fetchPaginatedResults: PropTypes.func.isRequired, + /** + * Redux action for clearing external GeoJSON layers. + */ + clearGeoJSONLayers: PropTypes.func.isRequired, + /** + * Redux action for fetching information about a single entity. + */ fetchByURI: PropTypes.func.isRequired, + /** + * Redux action for updating the page of paginated results. + */ updatePage: PropTypes.func.isRequired, + /** + * Redux action for updating the rows per page of paginated results. + */ updateRowsPerPage: PropTypes.func.isRequired, + /** + * Redux action for sorting the paginated results. + */ sortResults: PropTypes.func.isRequired, - routeProps: PropTypes.object.isRequired, + /** + * Redux action for updating the active selection or config of a facet. + */ + showError: PropTypes.func.isRequired, + /** + * Redux action for showing an error + */ updateFacetOption: PropTypes.func.isRequired, + /** + * Routing information from React Router. + */ + routeProps: PropTypes.object.isRequired, + /** + * Perspective config. + */ perspective: PropTypes.object.isRequired, + /** + * State of the animation, used by TemporalMap. + */ animationValue: PropTypes.array.isRequired, + /** + * Redux action for animating TemporalMap. + */ animateMap: PropTypes.func.isRequired, + /** + * Current screen size. + */ screenSize: PropTypes.string.isRequired, - rootUrl: PropTypes.string.isRequired, - showError: PropTypes.func.isRequired + /** + * Root url of the application. + */ + rootUrl: PropTypes.string.isRequired } export default Perspective1 diff --git a/src/client/components/perspectives/sampo/Perspective2.js b/src/client/components/perspectives/sampo/Perspective2.js index 2568354e01f8f280dd7ed69697969ad528860057..51c224ae7e2d39af1c7b5affeeaa9af4ab49cb45 100644 --- a/src/client/components/perspectives/sampo/Perspective2.js +++ b/src/client/components/perspectives/sampo/Perspective2.js @@ -22,8 +22,8 @@ const Perspective2 = props => { path={`${props.rootUrl}/${perspective.id}/faceted-search/table`} render={routeProps => <ResultTable - data={props.facetResults} - facetUpdateID={props.facetData.facetUpdateID} + data={props.perspectiveState} + facetUpdateID={props.facetState.facetUpdateID} resultClass='perspective2' facetClass='perspective2' fetchPaginatedResults={props.fetchPaginatedResults} @@ -38,7 +38,7 @@ const Perspective2 = props => { path={`${rootUrl}/${perspective.id}/faceted-search/export`} render={() => <Export - data={props.facetResults} + data={props.perspectiveState} resultClass='perspective2' facetClass='perspective2' pageType='facetResults' diff --git a/src/client/components/perspectives/sampo/Perspective3.js b/src/client/components/perspectives/sampo/Perspective3.js index 458b2c0881663cae478c534900503c43e3b6d770..1af0387b12e26ce6d7fa7b8e4c8389ed2ce7f9a8 100644 --- a/src/client/components/perspectives/sampo/Perspective3.js +++ b/src/client/components/perspectives/sampo/Perspective3.js @@ -27,8 +27,8 @@ const Perspective3 = props => { path={`${props.rootUrl}/${perspective.id}/faceted-search/table`} render={routeProps => <ResultTable - data={props.facetResults} - facetUpdateID={props.facetData.facetUpdateID} + data={props.perspectiveState} + facetUpdateID={props.facetState.facetUpdateID} resultClass='perspective3' facetClass='perspective3' fetchPaginatedResults={props.fetchPaginatedResults} @@ -45,16 +45,16 @@ const Perspective3 = props => { <LeafletMap center={[22.43, 10.37]} zoom={2} - results={props.placesResults.results} + results={props.placesState.results} layers={props.leafletMapLayers} pageType='facetResults' - facetUpdateID={props.facetData.facetUpdateID} - facet={props.facetData.facets.place} + facetUpdateID={props.facetState.facetUpdateID} + facet={props.facetState.facets.place} facetID='place' resultClass='placesEvents' facetClass='perspective3' mapMode='cluster' - instance={props.placesResults.instanceTableData} + instance={props.placesState.instanceTableData} createPopUpContent={createPopUpContentMMM} popupMaxHeight={320} popupMinWidth={280} @@ -62,21 +62,21 @@ const Perspective3 = props => { fetchGeoJSONLayers={props.fetchGeoJSONLayers} clearGeoJSONLayers={props.clearGeoJSONLayers} fetchByURI={props.fetchByURI} - fetching={props.placesResults.fetching} + fetching={props.placesState.fetching} showInstanceCountInClusters updateFacetOption={props.updateFacetOption} showError={props.showError} showExternalLayers layerControlExpanded={layerControlExpanded} layerConfigs={layerConfigs} - infoHeaderExpanded={props.facetResults.facetedSearchHeaderExpanded} + infoHeaderExpanded={props.perspectiveState.facetedSearchHeaderExpanded} />} /> <Route path={`${rootUrl}/${perspective.id}/faceted-search/export`} render={() => <Export - data={props.facetResults} + data={props.perspectiveState} resultClass='perspective3' facetClass='perspective3' pageType='facetResults' diff --git a/src/client/containers/SemanticPortal.js b/src/client/containers/SemanticPortal.js index 50bc1b9354eda0167e93039ce2e623815f183896..b63aa0cab527f0b4332e3628557214cfec8e2331 100644 --- a/src/client/containers/SemanticPortal.js +++ b/src/client/containers/SemanticPortal.js @@ -384,13 +384,13 @@ const SemanticPortal = props => { </Grid> <Grid item xs={12} md={9} className={classes.resultsContainer}> <FacetedSearchPerspective - facetResults={props[`${perspective.id}`]} - placesResults={props.places} - facetData={props[`${perspective.id}Facets`]} - facetDataConstrainSelf={has(props, `${perspective.id}FacetsConstrainSelf`) + perspectiveState={props[`${perspective.id}`]} + placesState={props.places} + facetState={props[`${perspective.id}Facets`]} + facetConstrainSelfState={has(props, `${perspective.id}FacetsConstrainSelf`) ? props[`${perspective.id}FacetsConstrainSelf`] : null} - leafletMap={props.leafletMap} + leafletMapState={props.leafletMap} fetchPaginatedResults={props.fetchPaginatedResults} fetchResults={props.fetchResults} fetchInstanceAnalysis={props.fetchInstanceAnalysis}