mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
[time_table] adding support for URLs / links (#3600)
Using Mustache templating and providing {{ metric }} as well as
{{ ...formData }} as context.
This commit is contained in:
committed by
GitHub
parent
80eb9c2c64
commit
d7f8a7fde3
@@ -6,17 +6,18 @@ import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
|
||||
const propTypes = {
|
||||
metric: PropTypes.object.isRequired,
|
||||
showFormula: PropTypes.bool,
|
||||
url: PropTypes.string,
|
||||
};
|
||||
const defaultProps = {
|
||||
showFormula: true,
|
||||
};
|
||||
|
||||
export default function MetricOption({ metric, showFormula }) {
|
||||
export default function MetricOption({ metric, showFormula, url }) {
|
||||
const verbose = metric.verbose_name || metric.metric_name;
|
||||
const link = url ? <a href={url}>{verbose}</a> : verbose;
|
||||
return (
|
||||
<div>
|
||||
<span className="m-r-5 option-label">
|
||||
{metric.verbose_name || metric.metric_name}
|
||||
</span>
|
||||
<span className="m-r-5 option-label">{link}</span>
|
||||
{metric.description &&
|
||||
<InfoTooltipWithTrigger
|
||||
className="m-r-5 text-muted"
|
||||
|
||||
Reference in New Issue
Block a user