[8.12] [Synthetics] Fixes pending count filtering (#177499) (#177507)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Synthetics] Fixes pending count filtering
(#177499)](https://github.com/elastic/kibana/pull/177499)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2024-02-21T19:25:57Z","message":"[Synthetics]
Fixes pending count filtering (#177499)\n\n## Summary\r\n\r\nFixes
pending count filtering !!\r\n\r\nFollow up to
https://github.com/elastic/kibana/pull/177406\r\n\r\n<img width=\"1728\"
alt=\"image\"\r\nsrc=\"3dea1684-d6a9-44ab-b9a7-ad6c60079542\">","sha":"1f8bfae21c14c5d4dfe259691e9f71b366cdfc92","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:obs-ux-infra_services","v8.13.0","v8.12.2","v8.14.0"],"title":"[Synthetics]
Fixes pending count
filtering","number":177499,"url":"https://github.com/elastic/kibana/pull/177499","mergeCommit":{"message":"[Synthetics]
Fixes pending count filtering (#177499)\n\n## Summary\r\n\r\nFixes
pending count filtering !!\r\n\r\nFollow up to
https://github.com/elastic/kibana/pull/177406\r\n\r\n<img width=\"1728\"
alt=\"image\"\r\nsrc=\"3dea1684-d6a9-44ab-b9a7-ad6c60079542\">","sha":"1f8bfae21c14c5d4dfe259691e9f71b366cdfc92"}},"sourceBranch":"main","suggestedTargetBranches":["8.13","8.12"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.12","label":"v8.12.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177499","number":177499,"mergeCommit":{"message":"[Synthetics]
Fixes pending count filtering (#177499)\n\n## Summary\r\n\r\nFixes
pending count filtering !!\r\n\r\nFollow up to
https://github.com/elastic/kibana/pull/177406\r\n\r\n<img width=\"1728\"
alt=\"image\"\r\nsrc=\"3dea1684-d6a9-44ab-b9a7-ad6c60079542\">","sha":"1f8bfae21c14c5d4dfe259691e9f71b366cdfc92"}}]}]
BACKPORT-->

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
This commit is contained in:
Kibana Machine 2024-02-21 15:52:54 -05:00 committed by GitHub
parent a060b80c5f
commit f5eb91ee6a
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

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