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

This commit is contained in:
Giordano Ricci 2021-04-14 15:57:29 +01:00 committed by GitHub
parent dac9393061
commit 136460d369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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)))}
>

View File

@ -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))}