mirror of
https://github.com/apache/superset.git
synced 2026-04-09 19:35:21 +00:00
* [explore] improve metric(s) and groupby(s) controls - surface verbose_name, description & expression in controls - [table viz] surface verbose name in table header * Fixing tests * Addressing comments * Fixing tests (once more)
33 lines
842 B
JavaScript
33 lines
842 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
|
|
const propTypes = {
|
|
metric: PropTypes.object.isRequired,
|
|
};
|
|
|
|
export default function MetricOption({ metric }) {
|
|
return (
|
|
<div>
|
|
<span className="m-r-5 option-label">
|
|
{metric.verbose_name || metric.metric_name}
|
|
</span>
|
|
{metric.description &&
|
|
<InfoTooltipWithTrigger
|
|
className="m-r-5 text-muted"
|
|
icon="info"
|
|
tooltip={metric.description}
|
|
label={`descr-${metric.metric_name}`}
|
|
/>
|
|
}
|
|
<InfoTooltipWithTrigger
|
|
className="m-r-5 text-muted"
|
|
icon="question-circle-o"
|
|
tooltip={metric.expression}
|
|
label={`expr-${metric.metric_name}`}
|
|
/>
|
|
</div>);
|
|
}
|
|
MetricOption.propTypes = propTypes;
|