Commit d091e439 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'lm-add-details-view' into 'master'

Add  status dropdown to alert management details page

See merge request gitlab-org/gitlab!30565
parents ea292ae5 ae5ef47e
<script> <script>
import { GlTabs, GlTab } from '@gitlab/ui'; import { GlNewDropdown, GlNewDropdownItem, GlTabs, GlTab } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
export default { export default {
statuses: {
triggered: s__('AlertManagement|Triggered'),
acknowledged: s__('AlertManagement|Acknowledged'),
resolved: s__('AlertManagement|Resolved'),
},
i18n: { i18n: {
fullAlertDetailsTitle: s__('AlertManagement|Full Alert Details'), fullAlertDetailsTitle: s__('AlertManagement|Full Alert Details'),
overviewTitle: s__('AlertManagement|Overview'), overviewTitle: s__('AlertManagement|Overview'),
}, },
components: { components: {
GlNewDropdown,
GlNewDropdownItem,
GlTab, GlTab,
GlTabs, GlTabs,
}, },
...@@ -15,7 +22,18 @@ export default { ...@@ -15,7 +22,18 @@ export default {
</script> </script>
<template> <template>
<div> <div>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between border-bottom pb-2 pt-1">
<gl-new-dropdown class="align-self-center" right>
<gl-new-dropdown-item
v-for="(label, field) in $options.statuses"
:key="field"
data-testid="statusDropdownItem"
class="align-middle"
>{{ label }}
</gl-new-dropdown-item>
</gl-new-dropdown>
</div>
<div class="d-flex">
<gl-tabs> <gl-tabs>
<gl-tab data-testid="overviewTab" :title="$options.i18n.overviewTitle"> <gl-tab data-testid="overviewTab" :title="$options.i18n.overviewTitle">
<ul class="pl-3"> <ul class="pl-3">
......
...@@ -30,5 +30,9 @@ describe('AlertDetails', () => { ...@@ -30,5 +30,9 @@ describe('AlertDetails', () => {
it('renders alert details', () => { it('renders alert details', () => {
expect(wrapper.find('[data-testid="startTimeItem"]').exists()).toBe(true); expect(wrapper.find('[data-testid="startTimeItem"]').exists()).toBe(true);
}); });
it('renders a status dropdown', () => {
expect(wrapper.find('[data-testid="statusDropdownItem"]').exists()).toBe(true);
});
}); });
}); });
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