Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
maryam-saeidi committed Aug 22, 2024
1 parent fd2d043 commit e8165da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getGroupStats: GetGroupStats<AlertsByGroupingAgg> = (selectedGroup,
title: 'Sources:',
badge: {
value: bucket.sourceCountAggregation?.value ?? 0,
width: 50,
},
},
...defaultBadges,
Expand All @@ -37,6 +38,7 @@ export const getGroupStats: GetGroupStats<AlertsByGroupingAgg> = (selectedGroup,
title: 'Rules:',
badge: {
value: bucket.rulesCountAggregation?.value ?? 0,
width: 50,
},
},
...defaultBadges,
Expand All @@ -47,6 +49,7 @@ export const getGroupStats: GetGroupStats<AlertsByGroupingAgg> = (selectedGroup,
title: 'Rules:',
badge: {
value: bucket.rulesCountAggregation?.value ?? 0,
width: 50,
},
},
...defaultBadges,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('getGroupAggregations()', () => {
type: 'keyword',
script: {
source:
"if (doc[params['selectedGroup']].size()==0) { emit(params['uniqueValue']) }" +
"if (!doc.containsKey(params['selectedGroup']) || doc[params['selectedGroup']].size()==0) { emit(params['uniqueValue']) }" +
" else { emit(doc[params['selectedGroup']].join(params['uniqueValue']))}",
params: {
selectedGroup: groupByField,
Expand Down

0 comments on commit e8165da

Please sign in to comment.