Skip to content

Commit

Permalink
Rename document count aggregation and add default filter title (elast…
Browse files Browse the repository at this point in the history
…ic#170845)

Closes elastic#166472

## Summary

Rename document count aggregation and add default filter title.



https://github.com/elastic/kibana/assets/12370520/134b9253-eb09-4613-85c4-b262af062338
  • Loading branch information
maryam-saeidi authored Nov 8, 2023
1 parent 55d8ea4 commit 552e87b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 552e87b

Please sign in to comment.