Skip to content
Snippets Groups Projects
Commit 4dc86ddc authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #1831 from metabase/fix-query-error-display

Fix query error display
parents d8a82871 71003334
No related branches found
No related tags found
No related merge requests found
......@@ -148,9 +148,6 @@ function initializeChart(card, elementId, defaultWidth, defaultHeight, chartType
// disable animations
chart.transitionDuration(0);
// set card title
setCardTitle(card, elementId);
return chart;
}
......@@ -179,18 +176,6 @@ function applyChartLegend(dcjsChart, card) {
}
}
function setCardTitle(card, elementId) {
// SET THE CARD TITLE if applicable (probably not, since there's no UI to set this AFAIK)
var settings = card.visualization_settings,
chartTitle = settings.global.title;
if (chartTitle) {
var titleElement = document.getElementById('card-title--' + elementId);
if (titleElement) {
titleElement.innerText = chartTitle;
}
}
}
function applyChartTimeseriesXAxis(chart, card, coldefs, data) {
// setup an x-axis where the dimension is a timeseries
......@@ -631,15 +616,6 @@ function ChartRenderer(id, card, result, chartType) {
// I'm sure it made sense to somebody at some point to make this setting live in two different places depending on the type of chart.
var legendEnabled = chartType === 'pieChart' ? this.settings.pie.legend_enabled : this.settings.chart.legend_enabled;
if (legendEnabled) this.chart.legend(dc.legend());
// SET THE CARD TITLE if applicable (probably not, since there's no UI to set this AFAIK)
var chartTitle = this.settings.global.title;
if (chartTitle) {
var titleElement = document.getElementById('card-title--' + id);
if (titleElement) {
titleElement.innerText = chartTitle;
}
}
}
function GeoHeatmapChartRenderer(id, card, result) {
......
......@@ -131,7 +131,6 @@ export default class QueryVisualizationChart extends Component {
render() {
// rendering a chart of some type
var titleId = 'card-title--'+this.state.chartId;
var innerId = 'card-inner--'+this.state.chartId;
var errorMessage;
......@@ -150,8 +149,7 @@ export default class QueryVisualizationChart extends Component {
return (
<div className={"Card--" + this.props.card.display + " Card-outer px1"} id={this.state.chartId}>
<div id={titleId} className="text-centered"></div>
<div id={innerId} className="card-inner"></div>
<div id={innerId} className="card-inner" style={{ display: errorMessage ? "none" : undefined }}></div>
{errorMessage}
</div>
);
......
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