mirror of
https://github.com/apache/superset.git
synced 2026-04-10 11:55:24 +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)
35 lines
936 B
JavaScript
35 lines
936 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
|
|
|
const propTypes = {
|
|
column: PropTypes.object.isRequired,
|
|
};
|
|
|
|
export default function ColumnOption({ column }) {
|
|
return (
|
|
<span>
|
|
<span className="m-r-5 option-label">
|
|
{column.verbose_name || column.column_name}
|
|
</span>
|
|
{column.description &&
|
|
<InfoTooltipWithTrigger
|
|
className="m-r-5 text-muted"
|
|
icon="info"
|
|
tooltip={column.description}
|
|
label={`descr-${column.column_name}`}
|
|
/>
|
|
}
|
|
{column.expression && column.expression !== column.column_name &&
|
|
<InfoTooltipWithTrigger
|
|
className="m-r-5 text-muted"
|
|
icon="question-circle-o"
|
|
tooltip={column.expression}
|
|
label={`expr-${column.column_name}`}
|
|
/>
|
|
}
|
|
</span>);
|
|
}
|
|
ColumnOption.propTypes = propTypes;
|