Skip to content
Snippets Groups Projects
Commit 018c67a9 authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Make composed dashcard custom titles unclickable

parent f9ef010a
No related branches found
No related tags found
No related merge requests found
......@@ -188,11 +188,12 @@ export default class LineAreaBarChart extends Component<*, VisualizationProps, *
let originalSeries = series._raw || series;
let cardIds = _.uniq(originalSeries.map(s => s.card.id))
const isComposedOfMultipleQuestions = cardIds.length > 1;
if (showTitle && settings["card.title"]) {
titleHeaderSeries = [{ card: {
name: settings["card.title"],
id: cardIds.length === 1 ? cardIds[0] : null
id: isComposedOfMultipleQuestions ? null : cardIds[0]
}}];
}
......@@ -208,7 +209,9 @@ export default class LineAreaBarChart extends Component<*, VisualizationProps, *
series={titleHeaderSeries}
description={settings["card.description"]}
actionButtons={actionButtons}
onChangeCardAndRun={onChangeCardAndRun}
// If a dashboard card is composed of multiple questions, its custom card title
// shouldn't act as a link as it's ambiguous that which question it should open
onChangeCardAndRun={ isComposedOfMultipleQuestions ? null : onChangeCardAndRun }
/>
: null }
{ multiseriesHeaderSeries || (!titleHeaderSeries && actionButtons) ? // always show action buttons if we have them
......
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