Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ce9fb73b
Commit
ce9fb73b
authored
Jul 07, 2020
by
David O'Regan
Committed by
Kushal Pandya
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide dropdown header on list view
parent
a4695b01
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
147 additions
and
4 deletions
+147
-4
app/assets/javascripts/alert_management/components/alert_status.vue
.../javascripts/alert_management/components/alert_status.vue
+1
-1
changelogs/unreleased/alert-list-dropdown-header.yml
changelogs/unreleased/alert-list-dropdown-header.yml
+5
-0
spec/frontend/alert_management/components/alert_management_list_spec.js
...alert_management/components/alert_management_list_spec.js
+9
-0
spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js
...ponents/sidebar/alert_managment_sidebar_assignees_spec.js
+1
-1
spec/frontend/alert_management/components/sidebar/alert_sidebar_spec.js
...alert_management/components/sidebar/alert_sidebar_spec.js
+1
-1
spec/frontend/alert_management/components/sidebar/alert_sidebar_status_spec.js
...anagement/components/sidebar/alert_sidebar_status_spec.js
+129
-0
spec/frontend/alert_management/components/system_notes/alert_management_system_note_spec.js
...ponents/system_notes/alert_management_system_note_spec.js
+1
-1
No files found.
app/assets/javascripts/alert_management/components/alert_status.vue
View file @
ce9fb73b
...
@@ -88,7 +88,7 @@ export default {
...
@@ -88,7 +88,7 @@ export default {
@
keydown.esc.native=
"$emit('hide-dropdown')"
@
keydown.esc.native=
"$emit('hide-dropdown')"
@
hide=
"$emit('hide-dropdown')"
@
hide=
"$emit('hide-dropdown')"
>
>
<div
class=
"dropdown-title text-center"
>
<div
v-if=
"isSidebar"
class=
"dropdown-title text-center"
>
<span
class=
"alert-title"
>
{{
s__
(
'
AlertManagement|Assign status
'
)
}}
</span>
<span
class=
"alert-title"
>
{{
s__
(
'
AlertManagement|Assign status
'
)
}}
</span>
<gl-button
<gl-button
:aria-label=
"__('Close')"
:aria-label=
"__('Close')"
...
...
changelogs/unreleased/alert-list-dropdown-header.yml
0 → 100644
View file @
ce9fb73b
---
title
:
Hide dropdown header on list view
merge_request
:
35954
author
:
type
:
other
spec/frontend/alert_management/components/alert_management_list_spec.js
View file @
ce9fb73b
...
@@ -207,6 +207,15 @@ describe('AlertManagementList', () => {
...
@@ -207,6 +207,15 @@ describe('AlertManagementList', () => {
expect
(
findStatusDropdown
().
exists
()).
toBe
(
true
);
expect
(
findStatusDropdown
().
exists
()).
toBe
(
true
);
});
});
it
(
'
does not display a dropdown status header
'
,
()
=>
{
mountComponent
({
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
data
:
{
alerts
:
{
list
:
mockAlerts
},
alertsCount
,
errored
:
false
},
loading
:
false
,
});
expect
(
findStatusDropdown
().
contains
(
'
.dropdown-title
'
)).
toBe
(
false
);
});
it
(
'
shows correct severity icons
'
,
()
=>
{
it
(
'
shows correct severity icons
'
,
()
=>
{
mountComponent
({
mountComponent
({
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
props
:
{
alertManagementEnabled
:
true
,
userCanEnableAlertManagement
:
true
},
...
...
spec/frontend/alert_management/components/alert_managment_sidebar_assignees_spec.js
→
spec/frontend/alert_management/components/
sidebar/
alert_managment_sidebar_assignees_spec.js
View file @
ce9fb73b
...
@@ -5,7 +5,7 @@ import { GlDropdownItem } from '@gitlab/ui';
...
@@ -5,7 +5,7 @@ import { GlDropdownItem } from '@gitlab/ui';
import
SidebarAssignee
from
'
~/alert_management/components/sidebar/sidebar_assignee.vue
'
;
import
SidebarAssignee
from
'
~/alert_management/components/sidebar/sidebar_assignee.vue
'
;
import
SidebarAssignees
from
'
~/alert_management/components/sidebar/sidebar_assignees.vue
'
;
import
SidebarAssignees
from
'
~/alert_management/components/sidebar/sidebar_assignees.vue
'
;
import
AlertSetAssignees
from
'
~/alert_management/graphql/mutations/alert_set_assignees.mutation.graphql
'
;
import
AlertSetAssignees
from
'
~/alert_management/graphql/mutations/alert_set_assignees.mutation.graphql
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
import
mockAlerts
from
'
../
../
mocks/alerts.json
'
;
const
mockAlert
=
mockAlerts
[
0
];
const
mockAlert
=
mockAlerts
[
0
];
...
...
spec/frontend/alert_management/components/alert_sidebar_spec.js
→
spec/frontend/alert_management/components/
sidebar/
alert_sidebar_spec.js
View file @
ce9fb73b
...
@@ -3,7 +3,7 @@ import axios from 'axios';
...
@@ -3,7 +3,7 @@ import axios from 'axios';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
AlertSidebar
from
'
~/alert_management/components/alert_sidebar.vue
'
;
import
AlertSidebar
from
'
~/alert_management/components/alert_sidebar.vue
'
;
import
SidebarAssignees
from
'
~/alert_management/components/sidebar/sidebar_assignees.vue
'
;
import
SidebarAssignees
from
'
~/alert_management/components/sidebar/sidebar_assignees.vue
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
import
mockAlerts
from
'
../
../
mocks/alerts.json
'
;
const
mockAlert
=
mockAlerts
[
0
];
const
mockAlert
=
mockAlerts
[
0
];
...
...
spec/frontend/alert_management/components/alert_sidebar_status_spec.js
→
spec/frontend/alert_management/components/
sidebar/
alert_sidebar_status_spec.js
View file @
ce9fb73b
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlDropdownItem
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdown
Item
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
trackAlertStatusUpdateOptions
}
from
'
~/alert_management/constants
'
;
import
{
trackAlertStatusUpdateOptions
}
from
'
~/alert_management/constants
'
;
import
AlertSidebarStatus
from
'
~/alert_management/components/sidebar/sidebar_status.vue
'
;
import
AlertSidebarStatus
from
'
~/alert_management/components/sidebar/sidebar_status.vue
'
;
import
updateAlertStatus
from
'
~/alert_management/graphql/mutations/update_alert_status.mutation.graphql
'
;
import
updateAlertStatus
from
'
~/alert_management/graphql/mutations/update_alert_status.mutation.graphql
'
;
import
Tracking
from
'
~/tracking
'
;
import
Tracking
from
'
~/tracking
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
import
mockAlerts
from
'
../
../
mocks/alerts.json
'
;
const
mockAlert
=
mockAlerts
[
0
];
const
mockAlert
=
mockAlerts
[
0
];
describe
(
'
Alert Details Sidebar Status
'
,
()
=>
{
describe
(
'
Alert Details Sidebar Status
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
findStatusDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findStatusDropdownItem
=
()
=>
wrapper
.
find
(
GlDropdownItem
);
const
findStatusDropdownItem
=
()
=>
wrapper
.
find
(
GlDropdownItem
);
const
findStatusLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findStatusLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
...
@@ -41,6 +42,23 @@ describe('Alert Details Sidebar Status', () => {
...
@@ -41,6 +42,23 @@ describe('Alert Details Sidebar Status', () => {
}
}
});
});
describe
(
'
Alert Sidebar Dropdown Status
'
,
()
=>
{
beforeEach
(()
=>
{
mountComponent
({
data
:
{
alert
:
mockAlert
},
sidebarCollapsed
:
false
,
loading
:
false
,
});
});
it
(
'
displays status dropdown
'
,
()
=>
{
expect
(
findStatusDropdown
().
exists
()).
toBe
(
true
);
});
it
(
'
displays the dropdown status header
'
,
()
=>
{
expect
(
findStatusDropdown
().
contains
(
'
.dropdown-title
'
)).
toBe
(
true
);
});
describe
(
'
updating the alert status
'
,
()
=>
{
describe
(
'
updating the alert status
'
,
()
=>
{
const
mockUpdatedMutationResult
=
{
const
mockUpdatedMutationResult
=
{
data
:
{
data
:
{
...
@@ -100,7 +118,11 @@ describe('Alert Details Sidebar Status', () => {
...
@@ -100,7 +118,11 @@ describe('Alert Details Sidebar Status', () => {
const
status
=
findStatusDropdownItem
().
text
();
const
status
=
findStatusDropdownItem
().
text
();
setImmediate
(()
=>
{
setImmediate
(()
=>
{
const
{
category
,
action
,
label
}
=
trackAlertStatusUpdateOptions
;
const
{
category
,
action
,
label
}
=
trackAlertStatusUpdateOptions
;
expect
(
Tracking
.
event
).
toHaveBeenCalledWith
(
category
,
action
,
{
label
,
property
:
status
});
expect
(
Tracking
.
event
).
toHaveBeenCalledWith
(
category
,
action
,
{
label
,
property
:
status
,
});
});
});
});
});
});
});
});
...
...
spec/frontend/alert_management/components/alert_management_system_note_spec.js
→
spec/frontend/alert_management/components/
system_notes/
alert_management_system_note_spec.js
View file @
ce9fb73b
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SystemNote
from
'
~/alert_management/components/system_notes/system_note.vue
'
;
import
SystemNote
from
'
~/alert_management/components/system_notes/system_note.vue
'
;
import
mockAlerts
from
'
../mocks/alerts.json
'
;
import
mockAlerts
from
'
../
../
mocks/alerts.json
'
;
const
mockAlert
=
mockAlerts
[
1
];
const
mockAlert
=
mockAlerts
[
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment