Skip to content

Commit 9c73376

Browse files
committed
ApexCharts config: support multiple result classes
1 parent a24d833 commit 9c73376

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

src/client/components/facet_results/ResultClassRoute.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ const ResultClassRoute = props => {
213213
seriesTitle,
214214
stroke,
215215
fill,
216-
createChartData
216+
createChartData,
217+
doNotRenderOnMount = false,
218+
dropdownForResultClasses = false
217219
} = resultClassConfig
218220
const apexProps = {
219221
portalConfig,
@@ -235,7 +237,14 @@ const ResultClassRoute = props => {
235237
seriesTitle,
236238
stroke,
237239
fill,
238-
layoutConfig: props.layoutConfig
240+
layoutConfig: props.layoutConfig,
241+
doNotRenderOnMount,
242+
dropdownForResultClasses
243+
}
244+
if (dropdownForResultClasses && has(resultClassConfig, 'resultClasses')) {
245+
apexProps.resultClass = resultClassConfig.resultClasses[0]
246+
apexProps.resultClasses = resultClassConfig.resultClasses
247+
apexProps.dropdownForResultClasses = true
239248
}
240249
routeComponent = (
241250
<Route

src/client/components/main_layout/MuiIcon.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
PieChart,
1010
CloudDownload,
1111
BubbleChart,
12-
ShowChart
12+
ShowChart,
13+
FormatAlignJustify
1314
} from '@material-ui/icons'
1415
import has from 'lodash'
1516

@@ -24,7 +25,8 @@ const MuiIcon = props => {
2425
PieChart: PieChart,
2526
CloudDownload: CloudDownload,
2627
BubbleChart: BubbleChart,
27-
ShowChart: ShowChart
28+
ShowChart: ShowChart,
29+
FormatAlignJustify: FormatAlignJustify
2830
}
2931
if (has(MuiIcons, props.iconName)) {
3032
const MuiIconComponent = MuiIcons[props.iconName]

src/client/library_configs/Leaflet/LeafletConfig.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export const createPopUpContentDefault = ({ data, resultClass }) => {
1414
link.textContent = data.prefLabel.prefLabel
1515
link.style.cssText = 'cursor: pointer; text-decoration: underline'
1616
h3.appendChild(link)
17+
} else if (has(data, 'dataProviderUrl')) {
18+
const link = document.createElement('a')
19+
link.addEventListener('click', () => history.push(data.dataProviderUrl))
20+
link.textContent = data.prefLabel.prefLabel
21+
link.style.cssText = 'cursor: pointer; text-decoration: underline'
22+
h3.appendChild(link)
1723
} else {
1824
h3.textContent = data.prefLabel.prefLabel
1925
}

0 commit comments

Comments
 (0)