Commit d641a757 authored by David O'Regan's avatar David O'Regan Committed by Natalia Tepluhina

Move Alert details to overview section

We move the Alert details tab into the
overview section and create a new
tab for the activity feed.
parent d795ab07
...@@ -42,16 +42,16 @@ export default { ...@@ -42,16 +42,16 @@ export default {
tabsConfig: [ tabsConfig: [
{ {
id: 'overview', id: 'overview',
title: s__('AlertManagement|Overview'),
},
{
id: 'fullDetails',
title: s__('AlertManagement|Alert details'), title: s__('AlertManagement|Alert details'),
}, },
{ {
id: 'metrics', id: 'metrics',
title: s__('AlertManagement|Metrics'), title: s__('AlertManagement|Metrics'),
}, },
{
id: 'activity',
title: s__('AlertManagement|Activity feed'),
},
], ],
components: { components: {
GlBadge, GlBadge,
...@@ -330,18 +330,9 @@ export default { ...@@ -330,18 +330,9 @@ export default {
</div> </div>
<div class="gl-pl-2" data-testid="runbook">{{ alert.runbook }}</div> <div class="gl-pl-2" data-testid="runbook">{{ alert.runbook }}</div>
</div> </div>
<template>
<div v-if="alert.notes.nodes" class="issuable-discussion py-5">
<ul class="notes main-notes-list timeline">
<system-note v-for="note in alert.notes.nodes" :key="note.id" :note="note" />
</ul>
</div>
</template>
</gl-tab>
<gl-tab :data-testid="$options.tabsConfig[1].id" :title="$options.tabsConfig[1].title">
<gl-table <gl-table
class="alert-management-details-table" class="alert-management-details-table"
:items="[{ key: 'Value', ...alert }]" :items="[{ 'Full Alert Payload': 'Value', ...alert }]"
:show-empty="true" :show-empty="true"
:busy="loading" :busy="loading"
stacked stacked
...@@ -354,9 +345,16 @@ export default { ...@@ -354,9 +345,16 @@ export default {
</template> </template>
</gl-table> </gl-table>
</gl-tab> </gl-tab>
<gl-tab :data-testid="$options.tabsConfig[2].id" :title="$options.tabsConfig[2].title"> <gl-tab :data-testid="$options.tabsConfig[1].id" :title="$options.tabsConfig[1].title">
<alert-metrics :dashboard-url="alert.metricsDashboardUrl" /> <alert-metrics :dashboard-url="alert.metricsDashboardUrl" />
</gl-tab> </gl-tab>
<gl-tab :data-testid="$options.tabsConfig[2].id" :title="$options.tabsConfig[2].title">
<div v-if="alert.notes.nodes.length > 0" class="issuable-discussion">
<ul class="notes main-notes-list timeline">
<system-note v-for="note in alert.notes.nodes" :key="note.id" :note="note" />
</ul>
</div>
</gl-tab>
</gl-tabs> </gl-tabs>
<alert-sidebar <alert-sidebar
:alert="alert" :alert="alert"
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
</script> </script>
<template> <template>
<li :id="noteAnchorId" class="timeline-entry note system-note note-wrapper"> <li :id="noteAnchorId" class="timeline-entry note system-note note-wrapper gl-px-0!">
<div class="timeline-entry-inner"> <div class="timeline-entry-inner">
<div class="timeline-icon" v-html="iconHtml"></div> <div class="timeline-icon" v-html="iconHtml"></div>
<div class="timeline-content"> <div class="timeline-content">
......
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
} }
} }
.main-notes-list::before {
left: 15px !important;
}
.note-header-info { .note-header-info {
@include gl-mt-1; @include gl-mt-1;
} }
......
---
title: Resolve Combine the Overview and Alert Detail sections
merge_request: 39714
author:
type: changed
...@@ -2078,6 +2078,9 @@ msgstr[1] "" ...@@ -2078,6 +2078,9 @@ msgstr[1] ""
msgid "AlertManagement|Acknowledged" msgid "AlertManagement|Acknowledged"
msgstr "" msgstr ""
msgid "AlertManagement|Activity feed"
msgstr ""
msgid "AlertManagement|Alert" msgid "AlertManagement|Alert"
msgstr "" msgstr ""
...@@ -2165,9 +2168,6 @@ msgstr "" ...@@ -2165,9 +2168,6 @@ msgstr ""
msgid "AlertManagement|Opsgenie is enabled" msgid "AlertManagement|Opsgenie is enabled"
msgstr "" msgstr ""
msgid "AlertManagement|Overview"
msgstr ""
msgid "AlertManagement|Please try again." msgid "AlertManagement|Please try again."
msgstr "" msgstr ""
......
...@@ -87,8 +87,8 @@ describe('AlertDetails', () => { ...@@ -87,8 +87,8 @@ describe('AlertDetails', () => {
expect(wrapper.find('[data-testid="overview"]').exists()).toBe(true); expect(wrapper.find('[data-testid="overview"]').exists()).toBe(true);
}); });
it('renders a tab with full alert information', () => { it('renders a tab with an activity feed', () => {
expect(wrapper.find('[data-testid="fullDetails"]').exists()).toBe(true); expect(wrapper.find('[data-testid="activity"]').exists()).toBe(true);
}); });
it('renders severity', () => { it('renders severity', () => {
...@@ -198,7 +198,6 @@ describe('AlertDetails', () => { ...@@ -198,7 +198,6 @@ describe('AlertDetails', () => {
mountComponent({ data: { alert: mockAlert } }); mountComponent({ data: { alert: mockAlert } });
}); });
it('should display a table of raw alert details data', () => { it('should display a table of raw alert details data', () => {
wrapper.find('[data-testid="fullDetails"]').trigger('click');
expect(findDetailsTable().exists()).toBe(true); expect(findDetailsTable().exists()).toBe(true);
}); });
}); });
...@@ -268,8 +267,8 @@ describe('AlertDetails', () => { ...@@ -268,8 +267,8 @@ describe('AlertDetails', () => {
it.each` it.each`
index | tabId index | tabId
${0} | ${'overview'} ${0} | ${'overview'}
${1} | ${'fullDetails'} ${1} | ${'metrics'}
${2} | ${'metrics'} ${2} | ${'activity'}
`('will navigate to the correct tab via $tabId', ({ index, tabId }) => { `('will navigate to the correct tab via $tabId', ({ index, tabId }) => {
wrapper.setData({ currentTabIndex: index }); wrapper.setData({ currentTabIndex: index });
expect($router.replace).toHaveBeenCalledWith({ name: 'tab', params: { tabId } }); expect($router.replace).toHaveBeenCalledWith({ name: 'tab', params: { tabId } });
......
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