Skip to content

Commit

Permalink
[Synthetics] Filtering - location filter counts are off when filter i…
Browse files Browse the repository at this point in the history
…s applied (#155437)

Co-authored-by: Anjola Adeuyi <[email protected]>
Co-authored-by: gitstart_bot <[email protected]>
Co-authored-by: shahzad31 <[email protected]>
  • Loading branch information
4 people authored Apr 21, 2023
1 parent b494716 commit f95ebdf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,18 @@ export const FilterGroup = ({
label: LOCATION_LABEL,
field: 'locations',
values: getSyntheticsFilterDisplayValues(
mixUrlValues(data.locations, urlParams.locations),
mixUrlValues(
data.locations.map((locationData) => {
const matchingLocation = locations.find(
(location) => location.id === locationData.label
);
return {
label: matchingLocation ? matchingLocation.label : locationData.label,
count: locationData.count,
};
}),
urlParams.locations
),
'locations',
locations
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const useFilters = (): FiltersList => {
})) ?? [],
schedules:
schedules?.buckets?.map(({ key, doc_count: count }) => ({
label: key,
label: String(key),
count,
})) ?? [],
};
Expand Down

0 comments on commit f95ebdf

Please sign in to comment.