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
8d102f26
Commit
8d102f26
authored
Nov 08, 2018
by
samdbeckham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a dismissed vulnerability bug on GSD
where GSD is the group security dashbaord
parent
d8ef45c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
53 deletions
+86
-53
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js
...rity_dashboard/store/modules/vulnerabilities/mutations.js
+1
-0
ee/changelogs/unreleased/8343-dismissed-state-not-correctly-set-in-vulnerability-modal-on-group-security-dashboard.yml
...et-in-vulnerability-modal-on-group-security-dashboard.yml
+5
-0
ee/spec/javascripts/security_dashboard/store/vulnerabilities/mutations_spec.js
...ecurity_dashboard/store/vulnerabilities/mutations_spec.js
+80
-53
No files found.
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js
View file @
8d102f26
...
@@ -63,6 +63,7 @@ export default {
...
@@ -63,6 +63,7 @@ export default {
Vue
.
set
(
state
.
modal
.
data
.
instances
,
'
value
'
,
vulnerability
.
instances
);
Vue
.
set
(
state
.
modal
.
data
.
instances
,
'
value
'
,
vulnerability
.
instances
);
Vue
.
set
(
state
.
modal
,
'
vulnerability
'
,
vulnerability
);
Vue
.
set
(
state
.
modal
,
'
vulnerability
'
,
vulnerability
);
Vue
.
set
(
state
.
modal
.
vulnerability
,
'
hasIssue
'
,
Boolean
(
vulnerability
.
issue_feedback
));
Vue
.
set
(
state
.
modal
.
vulnerability
,
'
hasIssue
'
,
Boolean
(
vulnerability
.
issue_feedback
));
Vue
.
set
(
state
.
modal
.
vulnerability
,
'
isDismissed
'
,
Boolean
(
vulnerability
.
dismissal_feedback
));
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
},
},
[
types
.
REQUEST_CREATE_ISSUE
](
state
)
{
[
types
.
REQUEST_CREATE_ISSUE
](
state
)
{
...
...
ee/changelogs/unreleased/8343-dismissed-state-not-correctly-set-in-vulnerability-modal-on-group-security-dashboard.yml
0 → 100644
View file @
8d102f26
---
title
:
Fixes a dismissed vulnerability bug on the group security dashboard
merge_request
:
8343
author
:
type
:
fixed
ee/spec/javascripts/security_dashboard/store/vulnerabilities/mutations_spec.js
View file @
8d102f26
...
@@ -132,59 +132,86 @@ describe('vulnerabilities module mutations', () => {
...
@@ -132,59 +132,86 @@ describe('vulnerabilities module mutations', () => {
});
});
describe
(
'
SET_MODAL_DATA
'
,
()
=>
{
describe
(
'
SET_MODAL_DATA
'
,
()
=>
{
const
vulnerability
=
mockData
[
0
];
describe
(
'
with all the data
'
,
()
=>
{
let
payload
;
const
vulnerability
=
mockData
[
0
];
let
state
;
let
payload
;
let
state
;
beforeEach
(()
=>
{
state
=
createState
();
beforeEach
(()
=>
{
payload
=
{
vulnerability
};
state
=
createState
();
mutations
[
types
.
SET_MODAL_DATA
](
state
,
payload
);
payload
=
{
vulnerability
};
});
mutations
[
types
.
SET_MODAL_DATA
](
state
,
payload
);
});
it
(
'
should set the modal title
'
,
()
=>
{
expect
(
state
.
modal
.
title
).
toEqual
(
vulnerability
.
name
);
it
(
'
should set the modal title
'
,
()
=>
{
});
expect
(
state
.
modal
.
title
).
toEqual
(
vulnerability
.
name
);
});
it
(
'
should set the modal description
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
description
.
value
).
toEqual
(
vulnerability
.
description
);
it
(
'
should set the modal description
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
description
.
value
).
toEqual
(
vulnerability
.
description
);
});
it
(
'
should set the modal project
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
project
.
value
).
toEqual
(
vulnerability
.
project
.
full_name
);
it
(
'
should set the modal project
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
project
.
url
).
toEqual
(
vulnerability
.
project
.
full_path
);
expect
(
state
.
modal
.
data
.
project
.
value
).
toEqual
(
vulnerability
.
project
.
full_name
);
});
expect
(
state
.
modal
.
data
.
project
.
url
).
toEqual
(
vulnerability
.
project
.
full_path
);
});
it
(
'
should set the modal file
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
file
.
value
).
toEqual
(
vulnerability
.
location
.
file
);
it
(
'
should set the modal file
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
file
.
value
).
toEqual
(
vulnerability
.
location
.
file
);
});
it
(
'
should set the modal identifiers
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
identifiers
.
value
).
toEqual
(
vulnerability
.
identifiers
);
it
(
'
should set the modal identifiers
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
identifiers
.
value
).
toEqual
(
vulnerability
.
identifiers
);
});
it
(
'
should set the modal severity
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
severity
.
value
).
toEqual
(
vulnerability
.
severity
);
it
(
'
should set the modal severity
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
severity
.
value
).
toEqual
(
vulnerability
.
severity
);
});
it
(
'
should set the modal confidence
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
confidence
.
value
).
toEqual
(
vulnerability
.
confidence
);
it
(
'
should set the modal confidence
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
confidence
.
value
).
toEqual
(
vulnerability
.
confidence
);
});
it
(
'
should set the modal solution
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
solution
.
value
).
toEqual
(
vulnerability
.
solution
);
it
(
'
should set the modal solution
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
solution
.
value
).
toEqual
(
vulnerability
.
solution
);
});
it
(
'
should set the modal links
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
links
.
value
).
toEqual
(
vulnerability
.
links
);
it
(
'
should set the modal links
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
links
.
value
).
toEqual
(
vulnerability
.
links
);
});
it
(
'
should set the modal instances
'
,
()
=>
{
expect
(
state
.
modal
.
data
.
instances
.
value
).
toEqual
(
vulnerability
.
instances
);
it
(
'
should set the modal instances
'
,
()
=>
{
});
expect
(
state
.
modal
.
data
.
instances
.
value
).
toEqual
(
vulnerability
.
instances
);
});
it
(
'
should set the modal vulnerability
'
,
()
=>
{
expect
(
state
.
modal
.
vulnerability
).
toEqual
(
vulnerability
);
it
(
'
should set the modal vulnerability
'
,
()
=>
{
expect
(
state
.
modal
.
vulnerability
).
toEqual
(
vulnerability
);
});
});
describe
(
'
with irregular data
'
,
()
=>
{
const
vulnerability
=
mockData
[
0
];
let
state
;
beforeEach
(()
=>
{
state
=
createState
();
});
it
(
'
should set isDismissed when the vulnerabilitiy is dismissed
'
,
()
=>
{
const
payload
=
{
vulnerability
:
{
...
vulnerability
,
dismissal_feedback
:
'
I am dismissed
'
},
};
mutations
[
types
.
SET_MODAL_DATA
](
state
,
payload
);
expect
(
state
.
modal
.
vulnerability
.
isDismissed
).
toEqual
(
true
);
});
it
(
'
should set hasIssue when the vulnerabilitiy has a related issue
'
,
()
=>
{
const
payload
=
{
vulnerability
:
{
...
vulnerability
,
issue_feedback
:
'
I am an issue
'
}
};
mutations
[
types
.
SET_MODAL_DATA
](
state
,
payload
);
expect
(
state
.
modal
.
vulnerability
.
hasIssue
).
toEqual
(
true
);
});
});
});
});
});
...
...
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