Rename document count aggregation and add default filter title (#170845)

Closes #166472

## Summary

Rename document count aggregation and add default filter title.



134b9253-eb09-4613-85c4-b262af062338
This commit is contained in:
Maryam Saeidi 2023-11-08 17:12:27 +01:00 committed by GitHub
parent 55d8ea45ac
commit 552e87ba8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -38,6 +38,11 @@ interface MetricRowWithAggProps extends MetricRowBaseProps {
fields: NormalizedFields;
}
const DEFAULT_COUNT_FILTER_TITLE = i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.customEquationEditor.defaultCountFilterTitle',
{ defaultMessage: 'all documents' }
);
export function MetricRowWithAgg({
name,
aggType = Aggregators.COUNT,
@ -126,7 +131,9 @@ export function MetricRowWithAgg({
<EuiExpression
data-test-subj="aggregationName"
description={aggregationTypes[aggType].text}
value={aggType === Aggregators.COUNT ? filter : field}
value={
aggType === Aggregators.COUNT ? filter || DEFAULT_COUNT_FILTER_TITLE : field
}
isActive={aggTypePopoverOpen}
display="columns"
onClick={() => {

View file

@ -292,7 +292,7 @@ export const aggregationType: { [key: string]: AggregationType } = {
text: i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.aggregationText.count',
{
defaultMessage: 'Document count',
defaultMessage: 'Count',
}
),
fieldRequired: false,