[Synthetics] Fixes pending count filtering (#177499)

## Summary

Fixes pending count filtering !!

Follow up to https://github.com/elastic/kibana/pull/177406

<img width="1728" alt="image"
src="3dea1684-d6a9-44ab-b9a7-ad6c60079542">
This commit is contained in:
Shahzad 2024-02-21 20:25:57 +01:00 committed by GitHub
parent 534c337831
commit 1f8bfae21c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 4 deletions

View file

@ -44,6 +44,11 @@ export const useMonitorQueryIds = () => {
case 'disabled':
monitorIds = status?.disabledMonitorQueryIds ?? [];
break;
case 'pending':
monitorIds = status
? Object.entries(status.pendingConfigs).map(([id, config]) => config.monitorQueryId)
: [];
break;
default:
break;
}

View file

@ -51,7 +51,7 @@ export function OverviewStatus() {
pending: 0,
});
break;
case 'down': {
case 'down':
setStatusConfig({
up: 0,
down: status?.down || 0,
@ -59,8 +59,7 @@ export function OverviewStatus() {
pending: 0,
});
break;
}
case 'disabled': {
case 'disabled':
setStatusConfig({
up: 0,
down: 0,
@ -68,7 +67,14 @@ export function OverviewStatus() {
pending: 0,
});
break;
}
case 'pending':
setStatusConfig({
up: 0,
down: 0,
disabledCount: 0,
pending: status?.pending || 0,
});
break;
}
} else if (status) {
setStatusConfig({

View file

@ -89,6 +89,11 @@ export function useMonitorsSortedByStatus() {
monitorsSortedByStatus: monitorsSortedByStatus.disabled,
downMonitors: downMonitors.current,
};
case 'pending':
return {
monitorsSortedByStatus: monitorsSortedByStatus.pending,
downMonitors: downMonitors.current,
};
default:
break;
}