Skip to content

Commit

Permalink
[8.12] [Synthetics] Fixes pending count filtering (#177499) (#177507)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Synthetics] Fixes pending count filtering
(#177499)](#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=\"https://github.com/elastic/kibana/assets/3505601/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=\"https://github.com/elastic/kibana/assets/3505601/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=\"https://github.com/elastic/kibana/assets/3505601/3dea1684-d6a9-44ab-b9a7-ad6c60079542\">","sha":"1f8bfae21c14c5d4dfe259691e9f71b366cdfc92"}}]}]
BACKPORT-->

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
  • Loading branch information
kibanamachine and shahzad31 authored Feb 21, 2024
1 parent a060b80 commit f5eb91e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,30 @@ export function OverviewStatus() {
pending: 0,
});
break;
case 'down': {
case 'down':
setStatusConfig({
up: 0,
down: status?.down || 0,
disabledCount: 0,
pending: 0,
});
break;
}
case 'disabled': {
case 'disabled':
setStatusConfig({
up: 0,
down: 0,
disabledCount: status?.disabledCount || 0,
pending: 0,
});
break;
}
case 'pending':
setStatusConfig({
up: 0,
down: 0,
disabledCount: 0,
pending: status?.pending || 0,
});
break;
}
} else if (status) {
setStatusConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export function useMonitorsSortedByStatus() {
monitorsSortedByStatus: monitorsSortedByStatus.disabled,
downMonitors: downMonitors.current,
};
case 'pending':
return {
monitorsSortedByStatus: monitorsSortedByStatus.pending,
downMonitors: downMonitors.current,
};
default:
break;
}
Expand Down

0 comments on commit f5eb91e

Please sign in to comment.