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
eb585a41
Commit
eb585a41
authored
Oct 08, 2020
by
Savas Vedova
Committed by
Alexander Turinske
Oct 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide issues badge when there are no issues
parent
dcc29126
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+1
-1
ee/spec/frontend/security_dashboard/components/mock_data.js
ee/spec/frontend/security_dashboard/components/mock_data.js
+3
-0
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
.../security_dashboard/components/vulnerability_list_spec.js
+7
-3
No files found.
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
eb585a41
...
...
@@ -436,7 +436,7 @@ export default {
<
template
#cell(activity)=
"{ item }"
>
<div
class=
"gl-display-flex gl-justify-content-end"
>
<issues-badge
:issues=
"issues(item)"
/>
<issues-badge
v-if=
"issues(item).length > 0"
:issues=
"issues(item)"
/>
<remediated-badge
v-if=
"item.resolvedOnDefaultBranch"
class=
"gl-ml-3"
/>
</div>
</
template
>
...
...
ee/spec/frontend/security_dashboard/components/mock_data.js
View file @
eb585a41
...
...
@@ -27,6 +27,9 @@ export const generateVulnerabilities = () => [
scanner
:
{
vendor
:
'
GitLab
'
,
},
issueLinks
:
{
nodes
:
[{
issue
:
{
iid
:
15
}
}],
},
},
{
id
:
'
id_1
'
,
...
...
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
View file @
eb585a41
...
...
@@ -46,7 +46,7 @@ describe('Vulnerability list component', () => {
const
findRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
findRow
=
(
index
=
0
)
=>
findRows
().
at
(
index
);
const
findRowById
=
id
=>
wrapper
.
find
(
`tbody tr[data-pk="
${
id
}
"`
);
const
findIssuesBadge
=
(
)
=>
wrapper
.
find
(
IssuesBadge
);
const
findIssuesBadge
=
(
index
=
0
)
=>
wrapper
.
findAll
(
IssuesBadge
).
at
(
index
);
const
findRemediatedBadge
=
()
=>
wrapper
.
find
(
RemediatedBadge
);
const
findSecurityScannerAlert
=
()
=>
wrapper
.
find
(
SecurityScannerAlert
);
const
findDismissalButton
=
()
=>
findSecurityScannerAlert
().
find
(
'
button[aria-label="Dismiss"]
'
);
...
...
@@ -92,8 +92,12 @@ describe('Vulnerability list component', () => {
expect
(
cell
.
text
()).
toBe
(
newVulnerabilities
[
0
].
title
);
});
it
(
'
should display the issues badge
'
,
()
=>
{
expect
(
findIssuesBadge
().
exists
()).
toBe
(
true
);
it
(
'
should display the issues badge for the first item
'
,
()
=>
{
expect
(
findIssuesBadge
(
0
).
exists
()).
toBe
(
true
);
});
it
(
'
should not display the issues badge for the second item
'
,
()
=>
{
expect
(()
=>
findIssuesBadge
(
1
)).
toThrow
();
});
it
(
'
should display the remediated badge
'
,
()
=>
{
...
...
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