Skip to content
Snippets Groups Projects
Commit d98ea8ae authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #3184 from metabase/release-0.19.3

Merge release-0.19.3 into master
parents 0566dbfe eca4cd9d
No related branches found
No related tags found
No related merge requests found
......@@ -11,8 +11,8 @@ fullscreen dashboard mode
}
:local .LegendHeader {
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-top: 0.25em;
margin-bottom: 0.25em;
}
:local(.LegendItem).muted {
......
......@@ -6,6 +6,10 @@ import Ellipsified from "metabase/components/Ellipsified.jsx";
import cx from "classnames";
// Don't use a <a> tag if there's no href
const LegendLink = (props) =>
props.href ? <a {...props} /> : <span {...props} />
export default class LegendItem extends Component {
constructor(props, context) {
super(props, context);
......@@ -24,7 +28,7 @@ export default class LegendItem extends Component {
render() {
const { title, href, color, showDot, showTitle, isMuted, showTooltip, showDotTooltip, onMouseEnter, onMouseLeave, className } = this.props;
return (
<a
<LegendLink
href={href}
className={cx(className, "LegendItem", "no-decoration flex align-center fullscreen-normal-text fullscreen-night-text", { mr1: showTitle, muted: isMuted })}
style={{ overflowX: "hidden", flex: "0 1 auto" }}
......@@ -42,7 +46,7 @@ export default class LegendItem extends Component {
{ showTitle &&
<Ellipsified showTooltip={showTooltip}>{title}</Ellipsified>
}
</a>
</LegendLink>
);
}
}
......@@ -13,8 +13,6 @@ import {
getFriendlyName
} from "metabase/visualizations/lib/utils";
import Urls from "metabase/lib/urls";
import { MinRowsError, ChartSettingsError } from "metabase/visualizations/lib/errors";
import crossfilter from "crossfilter";
......@@ -208,29 +206,33 @@ export default class LineAreaBarChart extends Component {
}
render() {
const { hovered, isDashboard, onAddSeries, onRemoveSeries, actionButtons } = this.props;
const { hovered, isDashboard, actionButtons } = this.props;
const { series } = this.state;
const card = this.props.series[0].card;
let settings = this.getSettings();
const settings = this.getSettings();
let isMultiseries = this.state.series.length > 1;
let isDashboardMultiseries = this.props.series.length > 1;
let isCardMultiseries = isMultiseries && !isDashboardMultiseries;
const isMultiseries = this.state.series.length > 1;
const isDashboardMultiseries = this.props.series.length > 1;
const isCardMultiseries = isMultiseries && !isDashboardMultiseries;
return (
<div className={cx("flex flex-column p1", this.getHoverClasses(), this.props.className)}>
{ (isDashboard && !isDashboardMultiseries) &&
<a href={card.id && Urls.card(card.id)} className="Card-title pt1 px1 flex-no-shrink no-decoration h3 text-bold fullscreen-night-text fullscreen-normal-text" style={{fontSize: '1em'}}>{card.name}</a>
{/* This is always used to show the original card titles/links + action buttons */}
{ isDashboard &&
<LegendHeader
className="flex-no-shrink"
series={this.props.series}
actionButtons={actionButtons}
hovered={hovered}
onHoverChange={this.props.onHoverChange}
settings={settings}
/>
}
{ isMultiseries &&
{/* This only shows transformed card multiseries titles */}
{ isCardMultiseries &&
<LegendHeader
className="flex-no-shrink"
series={series}
onAddSeries={isCardMultiseries ? undefined : onAddSeries}
onRemoveSeries={onRemoveSeries}
actionButtons={actionButtons}
hovered={hovered}
onHoverChange={this.props.onHoverChange}
settings={settings}
......
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