feat: reset metrics on dataset change (#12782)

* reset metrics on dataset change take one

* remove code

* part 2 or reseting adhoc controls

* update input controls and customize defaults

* remove conosles

* remove extra method

* simplify logic for controls reset and have them use their defaults

* remove consoles

* add annotation control to defaultvalues

* remove line
This commit is contained in:
Phillip Kelley-Dotson
2021-02-04 22:08:27 -08:00
committed by GitHub
parent ac3e16d0ac
commit 3bb14ab950
9 changed files with 67 additions and 7 deletions

View File

@@ -38,6 +38,7 @@ const propTypes = {
savedMetricsOptions: PropTypes.arrayOf(savedMetricType),
multi: PropTypes.bool,
datasourceType: PropTypes.string,
datasource: PropTypes.string,
};
export default function MetricDefinitionValue({
@@ -51,6 +52,7 @@ export default function MetricDefinitionValue({
onMoveLabel,
onDropLabel,
index,
datasource,
}) {
const getSavedMetricByName = metricName =>
savedMetrics.find(metric => metric.metric_name === metricName);
@@ -77,6 +79,7 @@ export default function MetricDefinitionValue({
onDropLabel,
index,
savedMetric: savedMetric ?? {},
datasource,
};
return <AdhocMetricOption {...metricOptionProps} />;