Commit 040f3180 authored by Tristan Read's avatar Tristan Read Committed by Nicolò Maria Mezzopera

Add hosts field to alert detail table

parent 7b1aab82
...@@ -10,6 +10,7 @@ fragment AlertDetailItem on AlertManagementAlert { ...@@ -10,6 +10,7 @@ fragment AlertDetailItem on AlertManagementAlert {
description description
updatedAt updatedAt
endedAt endedAt
hosts
details details
runbook runbook
todos { todos {
......
...@@ -13,6 +13,7 @@ query getAlert($iid: String!, $fullPath: ID!) { ...@@ -13,6 +13,7 @@ query getAlert($iid: String!, $fullPath: ID!) {
service service
description description
endedAt endedAt
hosts
details details
} }
} }
......
...@@ -23,6 +23,7 @@ const allowedFields = [ ...@@ -23,6 +23,7 @@ const allowedFields = [
'endedAt', 'endedAt',
'details', 'details',
'environment', 'environment',
'hosts',
]; ];
const isAllowed = fieldName => allowedFields.includes(fieldName); const isAllowed = fieldName => allowedFields.includes(fieldName);
......
---
title: Add hosts field to alert detail table
merge_request: 43087
author:
type: changed
...@@ -14,6 +14,7 @@ const mockAlert = { ...@@ -14,6 +14,7 @@ const mockAlert = {
assignees: { nodes: [] }, assignees: { nodes: [] },
notes: { nodes: [] }, notes: { nodes: [] },
todos: { nodes: [] }, todos: { nodes: [] },
hosts: ['host1', 'host2'],
__typename: 'AlertManagementAlert', __typename: 'AlertManagementAlert',
}; };
...@@ -83,6 +84,7 @@ describe('AlertDetails', () => { ...@@ -83,6 +84,7 @@ describe('AlertDetails', () => {
expect(findTableField(fields, 'Severity').exists()).toBe(true); expect(findTableField(fields, 'Severity').exists()).toBe(true);
expect(findTableField(fields, 'Status').exists()).toBe(true); expect(findTableField(fields, 'Status').exists()).toBe(true);
expect(findTableField(fields, 'Environment').exists()).toBe(true); expect(findTableField(fields, 'Environment').exists()).toBe(true);
expect(findTableField(fields, 'Hosts').exists()).toBe(true);
}); });
it('should not show disallowed alert fields', () => { it('should not show disallowed alert fields', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment