Skip to content
Snippets Groups Projects
Commit 7d2ad800 authored by esikkala's avatar esikkala
Browse files

Simplify FacetedSearchPerspective component

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