Skip to content
Snippets Groups Projects
Commit 9c733766 authored by esikkala's avatar esikkala
Browse files

ApexCharts config: support multiple result classes

parent a24d8333
No related branches found
No related tags found
No related merge requests found
...@@ -213,7 +213,9 @@ const ResultClassRoute = props => { ...@@ -213,7 +213,9 @@ const ResultClassRoute = props => {
seriesTitle, seriesTitle,
stroke, stroke,
fill, fill,
createChartData createChartData,
doNotRenderOnMount = false,
dropdownForResultClasses = false
} = resultClassConfig } = resultClassConfig
const apexProps = { const apexProps = {
portalConfig, portalConfig,
...@@ -235,7 +237,14 @@ const ResultClassRoute = props => { ...@@ -235,7 +237,14 @@ const ResultClassRoute = props => {
seriesTitle, seriesTitle,
stroke, stroke,
fill, fill,
layoutConfig: props.layoutConfig layoutConfig: props.layoutConfig,
doNotRenderOnMount,
dropdownForResultClasses
}
if (dropdownForResultClasses && has(resultClassConfig, 'resultClasses')) {
apexProps.resultClass = resultClassConfig.resultClasses[0]
apexProps.resultClasses = resultClassConfig.resultClasses
apexProps.dropdownForResultClasses = true
} }
routeComponent = ( routeComponent = (
<Route <Route
......
...@@ -9,7 +9,8 @@ import { ...@@ -9,7 +9,8 @@ import {
PieChart, PieChart,
CloudDownload, CloudDownload,
BubbleChart, BubbleChart,
ShowChart ShowChart,
FormatAlignJustify
} from '@material-ui/icons' } from '@material-ui/icons'
import has from 'lodash' import has from 'lodash'
...@@ -24,7 +25,8 @@ const MuiIcon = props => { ...@@ -24,7 +25,8 @@ const MuiIcon = props => {
PieChart: PieChart, PieChart: PieChart,
CloudDownload: CloudDownload, CloudDownload: CloudDownload,
BubbleChart: BubbleChart, BubbleChart: BubbleChart,
ShowChart: ShowChart ShowChart: ShowChart,
FormatAlignJustify: FormatAlignJustify
} }
if (has(MuiIcons, props.iconName)) { if (has(MuiIcons, props.iconName)) {
const MuiIconComponent = MuiIcons[props.iconName] const MuiIconComponent = MuiIcons[props.iconName]
......
...@@ -14,6 +14,12 @@ export const createPopUpContentDefault = ({ data, resultClass }) => { ...@@ -14,6 +14,12 @@ export const createPopUpContentDefault = ({ data, resultClass }) => {
link.textContent = data.prefLabel.prefLabel link.textContent = data.prefLabel.prefLabel
link.style.cssText = 'cursor: pointer; text-decoration: underline' link.style.cssText = 'cursor: pointer; text-decoration: underline'
h3.appendChild(link) h3.appendChild(link)
} else if (has(data, 'dataProviderUrl')) {
const link = document.createElement('a')
link.addEventListener('click', () => history.push(data.dataProviderUrl))
link.textContent = data.prefLabel.prefLabel
link.style.cssText = 'cursor: pointer; text-decoration: underline'
h3.appendChild(link)
} else { } else {
h3.textContent = data.prefLabel.prefLabel h3.textContent = data.prefLabel.prefLabel
} }
......
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