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
7e378cca
Commit
7e378cca
authored
Mar 12, 2021
by
Yogi
Committed by
Savas Vedova
Mar 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add selected state for chart button in vulnerabilities dashboard
parent
aa8384f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
changelogs/unreleased/seleced-state-vulnerabilities-dashboard.yml
...gs/unreleased/seleced-state-vulnerabilities-dashboard.yml
+5
-0
ee/app/assets/javascripts/security_dashboard/components/vulnerability_chart_buttons.vue
...rity_dashboard/components/vulnerability_chart_buttons.vue
+1
-1
ee/spec/frontend/security_dashboard/components/first_class_vulnerability_chart_spec.js
...hboard/components/first_class_vulnerability_chart_spec.js
+1
-1
ee/spec/frontend/security_dashboard/components/vulnerability_chart_button_spec.js
...y_dashboard/components/vulnerability_chart_button_spec.js
+5
-5
No files found.
changelogs/unreleased/seleced-state-vulnerabilities-dashboard.yml
0 → 100644
View file @
7e378cca
---
title
:
Add selected state for chart button in vulnerabilities dashboard
merge_request
:
54763
author
:
Yogi (@yo)
type
:
changed
ee/app/assets/javascripts/security_dashboard/components/vulnerability_chart_buttons.vue
View file @
7e378cca
...
...
@@ -35,7 +35,7 @@ export default {
<gl-button
v-for=
"day in days"
:key=
"day"
:class=
"
{
active
: activeDay === day }"
:class=
"
{
selected
: activeDay === day }"
:data-days="day"
@click="clickHandler(day)"
>
...
...
ee/spec/frontend/security_dashboard/components/first_class_vulnerability_chart_spec.js
View file @
7e378cca
...
...
@@ -18,7 +18,7 @@ describe('First class vulnerability chart component', () => {
const
findTimeInfo
=
()
=>
wrapper
.
find
({
ref
:
'
timeInfo
'
});
const
findChartButtons
=
()
=>
wrapper
.
find
(
ChartButtons
);
const
findActiveChartButton
=
()
=>
findChartButtons
().
find
(
'
.
active
'
);
const
findActiveChartButton
=
()
=>
findChartButtons
().
find
(
'
.
selected
'
);
const
find90DaysChartButton
=
()
=>
findChartButtons
().
find
(
'
[data-days="90"]
'
);
const
createComponent
=
({
$apollo
,
propsData
,
stubs
,
data
}
=
{})
=>
{
...
...
ee/spec/frontend/security_dashboard/components/vulnerability_chart_button_spec.js
View file @
7e378cca
...
...
@@ -26,7 +26,7 @@ describe('Vulnerability Chart Buttons', () => {
const
activeDay
=
DAYS
.
ninety
;
createWrapper
({
activeDay
});
const
activeButton
=
wrapper
.
find
(
'
[data-days="90"].
active
'
);
const
activeButton
=
wrapper
.
find
(
'
[data-days="90"].
selected
'
);
expect
(
activeButton
.
attributes
(
'
data-days
'
)).
toMatch
(
'
90
'
);
});
...
...
@@ -35,7 +35,7 @@ describe('Vulnerability Chart Buttons', () => {
const
activeDay
=
DAYS
.
sixty
;
createWrapper
({
activeDay
});
const
activeButton
=
wrapper
.
find
(
'
[data-days="60"].
active
'
);
const
activeButton
=
wrapper
.
find
(
'
[data-days="60"].
selected
'
);
expect
(
activeButton
.
attributes
(
'
data-days
'
)).
toMatch
(
'
60
'
);
});
...
...
@@ -44,7 +44,7 @@ describe('Vulnerability Chart Buttons', () => {
const
activeDay
=
DAYS
.
thirty
;
createWrapper
({
activeDay
});
const
activeButton
=
wrapper
.
find
(
'
[data-days="30"].
active
'
);
const
activeButton
=
wrapper
.
find
(
'
[data-days="30"].
selected
'
);
expect
(
activeButton
.
attributes
(
'
data-days
'
)).
toMatch
(
'
30
'
);
});
...
...
@@ -59,13 +59,13 @@ describe('Vulnerability Chart Buttons', () => {
it
(
'
should call the clickHandler
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
clickHandler
'
);
wrapper
.
find
(
'
[data-days="30"].
active
'
).
trigger
(
'
click
'
,
DAYS
.
thirty
);
wrapper
.
find
(
'
[data-days="30"].
selected
'
).
trigger
(
'
click
'
,
DAYS
.
thirty
);
expect
(
wrapper
.
vm
.
clickHandler
).
toHaveBeenCalledWith
(
DAYS
.
thirty
);
});
it
(
'
should emit a click event
'
,
()
=>
{
wrapper
.
find
(
'
[data-days="30"].
active
'
).
trigger
(
'
click
'
,
DAYS
.
thirty
);
wrapper
.
find
(
'
[data-days="30"].
selected
'
).
trigger
(
'
click
'
,
DAYS
.
thirty
);
expect
(
wrapper
.
emitted
().
click
[
0
]).
toEqual
([
DAYS
.
thirty
]);
});
...
...
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