Elasticsearch: Force re-rendering of each editor row type change (#32993)

pull/32997/head
Giordano Ricci 4 years ago committed by GitHub
parent dac9393061
commit 136460d369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/index.tsx
  2. 2
      public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/index.tsx

@ -21,7 +21,7 @@ export const BucketAggregationsEditor: FunctionComponent<Props> = ({ nextId }) =
<>
{bucketAggs!.map((bucketAgg, index) => (
<QueryEditorRow
key={bucketAgg.id}
key={`${bucketAgg.type}-${bucketAgg.id}`}
label={index === 0 ? 'Group By' : 'Then By'}
onRemoveClick={totalBucketAggs > 1 && (() => dispatch(removeBucketAggregation(bucketAgg.id)))}
>

@ -22,7 +22,7 @@ export const MetricAggregationsEditor: FunctionComponent<Props> = ({ nextId }) =
<>
{metrics?.map((metric, index) => (
<QueryEditorRow
key={metric.id}
key={`${metric.type}-${metric.id}`}
label={`Metric (${metric.id})`}
hidden={metric.hide}
onHideClick={() => dispatch(toggleMetricVisibility(metric.id))}

Loading…
Cancel
Save