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
1b4d8322
Commit
1b4d8322
authored
Sep 21, 2020
by
Daniel Tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused refetch vulnerabilities code
parent
653e3b2e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
35 deletions
+11
-35
ee/app/assets/javascripts/security_dashboard/components/project_vulnerabilities.vue
...security_dashboard/components/project_vulnerabilities.vue
+0
-4
ee/app/assets/javascripts/security_dashboard/components/selection_summary.vue
...ripts/security_dashboard/components/selection_summary.vue
+10
-13
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+0
-1
ee/app/assets/javascripts/security_dashboard/graphql/vulnerability_dismiss.mutation.graphql
..._dashboard/graphql/vulnerability_dismiss.mutation.graphql
+1
-1
ee/spec/frontend/security_dashboard/components/selection_summary_spec.js
...d/security_dashboard/components/selection_summary_spec.js
+0
-16
No files found.
ee/app/assets/javascripts/security_dashboard/components/project_vulnerabilities.vue
View file @
1b4d8322
...
...
@@ -112,9 +112,6 @@ export default {
});
}
},
refetchVulnerabilities
()
{
this
.
$apollo
.
queries
.
vulnerabilities
.
refetch
();
},
handleSortChange
({
sortBy
,
sortDesc
})
{
this
.
sortDirection
=
sortDesc
?
'
desc
'
:
'
asc
'
;
this
.
sortBy
=
sortBy
;
...
...
@@ -144,7 +141,6 @@ export default {
:filters=
"filters"
:vulnerabilities=
"vulnerabilities"
:security-scanners=
"securityScanners"
@
refetch-vulnerabilities=
"refetchVulnerabilities"
@
sort-changed=
"handleSortChange"
/>
<gl-intersection-observer
...
...
ee/app/assets/javascripts/security_dashboard/components/selection_summary.vue
View file @
1b4d8322
...
...
@@ -3,7 +3,7 @@ import { GlButton, GlFormSelect } from '@gitlab/ui';
import
{
s__
,
n__
}
from
'
~/locale
'
;
import
toast
from
'
~/vue_shared/plugins/global_toast
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
dismissVulnerability
from
'
../graphql/dismissVulnerability
.graphql
'
;
import
vulnerabilityDismiss
from
'
../graphql/vulnerability_dismiss.mutation
.graphql
'
;
const
REASON_NONE
=
s__
(
'
SecurityReports|[No reason]
'
);
const
REASON_WONT_FIX
=
s__
(
"
SecurityReports|Won't fix / Accept risk
"
);
...
...
@@ -42,13 +42,6 @@ export default {
},
},
methods
:
{
dismissalSuccessMessage
()
{
return
n__
(
'
%d vulnerability dismissed
'
,
'
%d vulnerabilities dismissed
'
,
this
.
selectedVulnerabilities
.
length
,
);
},
handleDismiss
()
{
if
(
!
this
.
canDismissVulnerability
)
return
;
...
...
@@ -57,14 +50,21 @@ export default {
dismissSelectedVulnerabilities
()
{
const
promises
=
this
.
selectedVulnerabilities
.
map
(
vulnerability
=>
this
.
$apollo
.
mutate
({
mutation
:
dismissVulnerability
,
mutation
:
vulnerabilityDismiss
,
variables
:
{
id
:
vulnerability
.
id
,
comment
:
this
.
dismissalReason
},
}),
);
Promise
.
all
(
promises
)
.
then
(()
=>
{
toast
(
this
.
dismissalSuccessMessage
());
toast
(
n__
(
'
%d vulnerability dismissed
'
,
'
%d vulnerabilities dismissed
'
,
this
.
selectedVulnerabilities
.
length
,
),
);
this
.
$emit
(
'
deselect-all-vulnerabilities
'
);
})
.
catch
(()
=>
{
...
...
@@ -72,9 +72,6 @@ export default {
s__
(
'
SecurityReports|There was an error dismissing the vulnerabilities.
'
),
'
alert
'
,
);
})
.
finally
(()
=>
{
this
.
$emit
(
'
refetch-vulnerabilities
'
);
});
},
},
...
...
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
1b4d8322
...
...
@@ -296,7 +296,6 @@ export default {
v-if=
"shouldShowSelectionSummary"
:selected-vulnerabilities=
"Object.values(selectedVulnerabilities)"
@
deselect-all-vulnerabilities=
"deselectAllVulnerabilities"
@
refetch-vulnerabilities=
"$emit('refetch-vulnerabilities')"
/>
<gl-table
:busy=
"isLoading"
...
...
ee/app/assets/javascripts/security_dashboard/graphql/
dismissVulnerability
.graphql
→
ee/app/assets/javascripts/security_dashboard/graphql/
vulnerability_dismiss.mutation
.graphql
View file @
1b4d8322
mutation
(
$id
:
ID
!,
$comment
:
String
!)
{
dismissVulnerability
(
input
:
{
id
:
$id
,
comment
:
$comment
})
{
vulnerabilityDismiss
(
input
:
{
id
:
$id
,
comment
:
$comment
})
{
errors
vulnerability
{
id
...
...
ee/spec/frontend/security_dashboard/components/selection_summary_spec.js
View file @
1b4d8322
...
...
@@ -124,22 +124,6 @@ describe('Selection Summary component', () => {
);
});
});
it
(
'
should emit an event to refetch the vulnerabilities when the request is successful
'
,
()
=>
{
dismissButton
().
trigger
(
'
submit
'
);
return
waitForPromises
().
then
(()
=>
{
expect
(
wrapper
.
emitted
(
'
deselect-all-vulnerabilities
'
)).
toEqual
([[]]);
expect
(
wrapper
.
emitted
(
'
refetch-vulnerabilities
'
)).
toEqual
([[]]);
});
});
it
(
'
should still emit an event to refetch the vulnerabilities when the request fails
'
,
()
=>
{
mutateMock
.
mockRejectedValue
();
dismissButton
().
trigger
(
'
submit
'
);
return
waitForPromises
().
then
(()
=>
{
expect
(
wrapper
.
emitted
(
'
refetch-vulnerabilities
'
)).
toEqual
([[]]);
});
});
});
describe
(
'
when vulnerabilities are not selected
'
,
()
=>
{
...
...
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