fix: query builder update legend on empty values (#1367)

This commit is contained in:
Pranshu Chittora 2022-07-11 19:03:16 +05:30 committed by GitHub
parent 80c80b2180
commit 4ee92b7c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -30,8 +30,8 @@ function PromQLQueryContainer({
}: IPromQLQueryHandleChange): void => {
const allQueries = queryData[WIDGET_PROMQL_QUERY_KEY_NAME];
const currentIndexQuery = allQueries[queryIndex];
if (query) currentIndexQuery.query = query;
if (legend) currentIndexQuery.legend = legend;
if (query !== undefined) currentIndexQuery.query = query;
if (legend !== undefined) currentIndexQuery.legend = legend;
if (toggleDisable) {
currentIndexQuery.disabled = !currentIndexQuery.disabled;

View File

@ -55,7 +55,7 @@ function QueryBuilderQueryContainer({
currentIndexQuery.aggregateOperator = aggregateFunction;
}
if (metricName) {
if (metricName !== undefined) {
currentIndexQuery.metricName = metricName;
}