[8.6] [Synthetics] adjust quick filers (#146886) (#146925)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Synthetics] adjust quick filers
(#146886)](https://github.com/elastic/kibana/pull/146886)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Dominique
Clarke","email":"dominique.clarke@elastic.co"},"sourceCommit":{"committedDate":"2022-12-02T21:14:23Z","message":"[Synthetics]
adjust quick filers (#146886)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/146824\r\n\r\nAdjusts logic for
querying down monitors to rely on `config_id` (the\r\nsaved object id)
rather than `id` (the monitor query id).\r\n\r\n### Testing\r\n1. Create
at least 1 project monitor and 1 UI monitor that are\r\nconsistently
down\r\n2. Navigate to Synthetics Overview page\r\n3. Click the down
filter\r\n4. Ensure both monitors
appear","sha":"a4a89cf8ab3c4e4123bb7691f46ba28738165e3a","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:uptime","release_note:skip","v8.6.0","v8.7.0"],"number":146886,"url":"https://github.com/elastic/kibana/pull/146886","mergeCommit":{"message":"[Synthetics]
adjust quick filers (#146886)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/146824\r\n\r\nAdjusts logic for
querying down monitors to rely on `config_id` (the\r\nsaved object id)
rather than `id` (the monitor query id).\r\n\r\n### Testing\r\n1. Create
at least 1 project monitor and 1 UI monitor that are\r\nconsistently
down\r\n2. Navigate to Synthetics Overview page\r\n3. Click the down
filter\r\n4. Ensure both monitors
appear","sha":"a4a89cf8ab3c4e4123bb7691f46ba28738165e3a"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146886","number":146886,"mergeCommit":{"message":"[Synthetics]
adjust quick filers (#146886)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/146824\r\n\r\nAdjusts logic for
querying down monitors to rely on `config_id` (the\r\nsaved object id)
rather than `id` (the monitor query id).\r\n\r\n### Testing\r\n1. Create
at least 1 project monitor and 1 UI monitor that are\r\nconsistently
down\r\n2. Navigate to Synthetics Overview page\r\n3. Click the down
filter\r\n4. Ensure both monitors
appear","sha":"a4a89cf8ab3c4e4123bb7691f46ba28738165e3a"}}]}]
BACKPORT-->

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
Kibana Machine 2022-12-02 17:17:32 -05:00 committed by GitHub
parent a3b8bc3bad
commit e10d203951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View file

@ -96,36 +96,42 @@ describe('useMonitorsSortedByStatus', () => {
allMonitorIds: [],
monitors: [
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location1,
isEnabled: false,
},
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location2,
@ -151,36 +157,42 @@ describe('useMonitorsSortedByStatus', () => {
expect(result.current).toEqual({
monitorsSortedByStatus: [
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location1,
@ -204,36 +216,42 @@ describe('useMonitorsSortedByStatus', () => {
expect(result.current).toEqual({
monitorsSortedByStatus: [
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location1,
@ -261,18 +279,21 @@ describe('useMonitorsSortedByStatus', () => {
expect(result.current).toEqual({
monitorsSortedByStatus: [
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location2,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location2,
@ -300,12 +321,14 @@ describe('useMonitorsSortedByStatus', () => {
expect(result.current).toEqual({
monitorsSortedByStatus: [
{
configId: 'test-monitor-2',
id: 'test-monitor-2',
name: 'Test monitor 2',
location: location1,
isEnabled: true,
},
{
configId: 'test-monitor-3',
id: 'test-monitor-3',
name: 'Test monitor 3',
location: location1,
@ -333,6 +356,7 @@ describe('useMonitorsSortedByStatus', () => {
expect(result.current).toEqual({
monitorsSortedByStatus: [
{
configId: 'test-monitor-1',
id: 'test-monitor-1',
name: 'Test monitor 1',
location: location1,

View file

@ -51,8 +51,8 @@ export function useMonitorsSortedByStatus() {
if (!monitor.isEnabled) {
orderedDisabledMonitors.push(monitor);
} else if (
monitor.id in downMonitorMap &&
downMonitorMap[monitor.id].includes(monitorLocation)
monitor.configId in downMonitorMap &&
downMonitorMap[monitor.configId].includes(monitorLocation)
) {
orderedDownMonitors.push(monitor);
} else {