Skip to content

Commit 054d61c

Browse files
committed
Update configs
1 parent 9c73376 commit 054d61c

File tree

9 files changed

+195
-164
lines changed

9 files changed

+195
-164
lines changed

src/client/components/facet_results/ResultClassRoute.js

+34
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import { Route } from 'react-router-dom'
44
import { has } from 'lodash'
55
const ResultTable = lazy(() => import('./ResultTable'))
66
const InstancePageTable = lazy(() => import('../main_layout/InstancePageTable'))
7+
const ReactVirtualizedList = lazy(() => import('./ReactVirtualizedList'))
78
const LeafletMap = lazy(() => import('./LeafletMap'))
89
const Deck = lazy(() => import('./Deck'))
910
const ApexCharts = lazy(() => import('./ApexCharts'))
1011
const Network = lazy(() => import('./Network'))
1112
// const BarChartRace = lazy(() => import('../../facet_results/BarChartRace'))
13+
const ExportCSV = lazy(() => import('./ExportCSV'))
1214
const Export = lazy(() => import('./Export'))
1315

1416
const getVisibleRows = perspectiveState => {
@@ -67,6 +69,22 @@ const ResultClassRoute = props => {
6769
/>
6870
)
6971
break
72+
case 'ReactVirtualizedList':
73+
routeComponent = (
74+
<Route
75+
path={path}
76+
render={routeProps =>
77+
<ReactVirtualizedList
78+
resultClass={resultClass}
79+
facetClass={facetClass}
80+
fetchResults={props.fetchResults}
81+
perspectiveState={perspectiveState}
82+
facetUpdateID={facetState.facetUpdateID}
83+
layoutConfig={layoutConfig}
84+
/>}
85+
/>
86+
)
87+
break
7088
case 'InstancePageTable': {
7189
routeComponent = (
7290
<Route
@@ -321,6 +339,22 @@ const ResultClassRoute = props => {
321339
)
322340
break
323341
}
342+
case 'ExportCSV': {
343+
routeComponent = (
344+
<Route
345+
path={path}
346+
render={routeProps =>
347+
<ExportCSV
348+
resultClass={resultClass}
349+
facetClass={facetClass}
350+
facetUpdateID={facetState.facetUpdateID}
351+
facets={facetState.facets}
352+
layoutConfig={layoutConfig}
353+
/>}
354+
/>
355+
)
356+
break
357+
}
324358
default:
325359
routeComponent = <></>
326360
break

src/client/reducers/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import portalConfig from '../../configs/portalConfig.json'
22
import { combineReducers } from 'redux'
3+
import { has } from 'lodash'
34
import { reducer as toastrReducer } from 'react-redux-toastr'
45
import { createResultsReducer } from './general/results'
56
import { createFacetsReducer } from './general/facets'
@@ -82,6 +83,14 @@ for (const perspective of perspectiveConfig) {
8283
reducers[perspectiveID] = resultsReducer
8384
reducers[`${perspectiveID}Facets`] = facetsReducer
8485
reducers[`${perspectiveID}FacetsConstrainSelf`] = facetsConstrainSelfReducer
86+
} else if (perspective.searchMode && perspective.searchMode === 'dummy-internal' && has(perspective, 'resultClasses')) {
87+
const { resultClasses, maps = null } = perspective
88+
const resultsInitialStateFull = {
89+
...resultsInitialState,
90+
maps
91+
}
92+
const resultsReducer = createResultsReducer(resultsInitialStateFull, new Set(Object.keys(resultClasses)))
93+
reducers[perspectiveID] = resultsReducer
8594
}
8695
}
8796

src/configs/sampo/only_instance_pages/actors.json

+18-30
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,26 @@
1010
"URITemplate": "<BASE_URI>/actor/<LOCAL_ID>",
1111
"resultClasses": {
1212
"actors": {
13-
"instanceConfig": {
14-
"propertiesQueryBlock": "actorProperties",
15-
"instancePageResultClasses": {
16-
"instancePageTable": {
17-
"tabID": 0,
18-
"component": "InstancePageTable",
19-
"tabPath": "table",
20-
"tabIcon": "CalendarViewDay"
21-
},
22-
"instancePageExport": {
23-
"tabID": 1,
24-
"component": "Export",
25-
"tabPath": "export",
26-
"tabIcon": "CloudDownload",
27-
"pageType": "instancePage"
28-
}
29-
}
13+
"instanceConfig": {
14+
"propertiesQueryBlock": "actorProperties",
15+
"instancePageResultClasses": {
16+
"instancePageTable": {
17+
"tabID": 0,
18+
"component": "InstancePageTable",
19+
"tabPath": "table",
20+
"tabIcon": "CalendarViewDay"
21+
},
22+
"instancePageExport": {
23+
"tabID": 1,
24+
"component": "Export",
25+
"tabPath": "export",
26+
"tabIcon": "CloudDownload",
27+
"pageType": "instancePage"
28+
}
3029
}
30+
}
3131
}
32-
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
32+
},
4533
"properties": [
4634
{
4735
"id": "uri",

src/configs/sampo/only_instance_pages/collections.json

-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
}
3131
}
3232
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
4533
"properties": [
4634
{
4735
"id": "uri",

src/configs/sampo/only_instance_pages/events.json

-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
}
3131
}
3232
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
4533
"properties": [
4634
{
4735
"id": "uri",

src/configs/sampo/only_instance_pages/expressions.json

-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
}
3131
}
3232
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
4533
"properties": [
4634
{
4735
"id": "uri",

src/configs/sampo/only_instance_pages/places.json

-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
}
3131
}
3232
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
4533
"properties": [
4634
{
4735
"id": "uri",

src/configs/sampo/only_instance_pages/works.json

-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@
3030
}
3131
}
3232
},
33-
"instancePageTabs": [
34-
{
35-
"id": "table",
36-
"value": 0,
37-
"icon": "CalendarViewDay"
38-
},
39-
{
40-
"id": "export",
41-
"value": 1,
42-
"icon": "CloudDownload"
43-
}
44-
],
4533
"properties": [
4634
{
4735
"id": "uri",

0 commit comments

Comments
 (0)