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
e3580001
Commit
e3580001
authored
Oct 27, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
eba5eec4
772e44a3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
204 deletions
+103
-204
GITALY_SERVER_VERSION
GITALY_SERVER_VERSION
+1
-1
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/constants.js
...board/components/shared/vulnerability_report/constants.js
+49
-0
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue
...onents/shared/vulnerability_report/vulnerability_list.vue
+11
-85
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js
...ts/shared/vulnerability_report/vulnerability_list_spec.js
+42
-118
No files found.
GITALY_SERVER_VERSION
View file @
e3580001
ba8bc12dd0ff83fc726c6c09ee0cb0ebc311a748
d99f9cbac9164647666f1778eb912568c261813d
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/constants.js
0 → 100644
View file @
e3580001
import
{
__
,
s__
}
from
'
~/locale
'
;
export
const
FIELDS
=
{
CHECKBOX
:
{
key
:
'
checkbox
'
,
class
:
'
checkbox
'
,
},
DETECTED
:
{
key
:
'
detected
'
,
label
:
s__
(
'
Vulnerability|Detected
'
),
class
:
'
detected
'
,
sortable
:
true
,
},
STATUS
:
{
key
:
'
state
'
,
label
:
s__
(
'
Vulnerability|Status
'
),
class
:
'
status
'
,
sortable
:
true
,
},
SEVERITY
:
{
key
:
'
severity
'
,
label
:
s__
(
'
Vulnerability|Severity
'
),
class
:
'
severity
'
,
sortable
:
true
,
},
DESCRIPTION
:
{
key
:
'
title
'
,
label
:
__
(
'
Description
'
),
class
:
'
description gl-word-break-all
'
,
sortable
:
true
,
},
IDENTIFIER
:
{
key
:
'
identifier
'
,
label
:
s__
(
'
Vulnerability|Identifier
'
),
class
:
'
identifier gl-word-break-all
'
,
},
TOOL
:
{
key
:
'
reportType
'
,
label
:
s__
(
'
Reports|Tool
'
),
class
:
'
scanner
'
,
sortable
:
true
,
},
ACTIVITY
:
{
key
:
'
activity
'
,
label
:
s__
(
'
Vulnerability|Activity
'
),
thClass
:
'
gl-text-right
'
,
class
:
'
activity
'
,
},
};
ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue
View file @
e3580001
...
@@ -10,7 +10,7 @@ import {
...
@@ -10,7 +10,7 @@ import {
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
DashboardHasNoVulnerabilities
from
'
ee/security_dashboard/components/shared/empty_states/dashboard_has_no_vulnerabilities.vue
'
;
import
DashboardHasNoVulnerabilities
from
'
ee/security_dashboard/components/shared/empty_states/dashboard_has_no_vulnerabilities.vue
'
;
import
FiltersProducedNoResults
from
'
ee/security_dashboard/components/shared/empty_states/filters_produced_no_results.vue
'
;
import
FiltersProducedNoResults
from
'
ee/security_dashboard/components/shared/empty_states/filters_produced_no_results.vue
'
;
import
{
VULNERABILITIES_PER_PAGE
,
DASHBOARD_TYPES
}
from
'
ee/security_dashboard/store/constants
'
;
import
{
VULNERABILITIES_PER_PAGE
}
from
'
ee/security_dashboard/store/constants
'
;
import
SeverityBadge
from
'
ee/vue_shared/security_reports/components/severity_badge.vue
'
;
import
SeverityBadge
from
'
ee/vue_shared/security_reports/components/severity_badge.vue
'
;
import
convertReportType
from
'
ee/vue_shared/security_reports/store/utils/convert_report_type
'
;
import
convertReportType
from
'
ee/vue_shared/security_reports/store/utils/convert_report_type
'
;
import
getPrimaryIdentifier
from
'
ee/vue_shared/security_reports/store/utils/get_primary_identifier
'
;
import
getPrimaryIdentifier
from
'
ee/vue_shared/security_reports/store/utils/get_primary_identifier
'
;
...
@@ -19,7 +19,6 @@ import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue'
...
@@ -19,7 +19,6 @@ import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue'
import
{
VULNERABILITY_STATES
}
from
'
ee/vulnerabilities/constants
'
;
import
{
VULNERABILITY_STATES
}
from
'
ee/vulnerabilities/constants
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
convertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
import
{
convertToSnakeCase
}
from
'
~/lib/utils/text_utility
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
AutoFixHelpText
from
'
../auto_fix_help_text.vue
'
;
import
AutoFixHelpText
from
'
../auto_fix_help_text.vue
'
;
import
IssuesBadge
from
'
../issues_badge.vue
'
;
import
IssuesBadge
from
'
../issues_badge.vue
'
;
import
SelectionSummary
from
'
../selection_summary.vue
'
;
import
SelectionSummary
from
'
../selection_summary.vue
'
;
...
@@ -53,16 +52,11 @@ export default {
...
@@ -53,16 +52,11 @@ export default {
hasJiraVulnerabilitiesIntegrationEnabled
:
{
hasJiraVulnerabilitiesIntegrationEnabled
:
{
default
:
false
,
default
:
false
,
},
},
canAdminVulnerability
:
{
default
:
false
,
},
dashboardType
:
{},
},
},
props
:
{
props
:
{
filters
:
{
fields
:
{
type
:
Object
,
type
:
Array
,
required
:
false
,
required
:
true
,
default
:
()
=>
({}),
},
},
vulnerabilities
:
{
vulnerabilities
:
{
type
:
Array
,
type
:
Array
,
...
@@ -87,12 +81,6 @@ export default {
...
@@ -87,12 +81,6 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
isSortable
()
{
return
Boolean
(
this
.
$listeners
[
'
sort-changed
'
]);
},
isPipelineDashboard
()
{
return
this
.
dashboardType
===
DASHBOARD_TYPES
.
PIPELINE
;
},
hasAnyScannersOtherThanGitLab
()
{
hasAnyScannersOtherThanGitLab
()
{
return
this
.
vulnerabilities
.
some
(
return
this
.
vulnerabilities
.
some
(
(
v
)
=>
v
.
scanner
?.
vendor
!==
'
GitLab
'
&&
v
.
scanner
?.
vendor
!==
''
,
(
v
)
=>
v
.
scanner
?.
vendor
!==
'
GitLab
'
&&
v
.
scanner
?.
vendor
!==
''
,
...
@@ -108,75 +96,13 @@ export default {
...
@@ -108,75 +96,13 @@ export default {
return
Object
.
keys
(
this
.
selectedVulnerabilities
).
length
;
return
Object
.
keys
(
this
.
selectedVulnerabilities
).
length
;
},
},
shouldShowSelectionSummary
()
{
shouldShowSelectionSummary
()
{
return
this
.
canAdminVulnerability
&&
this
.
numOfSelectedVulnerabilities
>
0
;
return
this
.
numOfSelectedVulnerabilities
>
0
;
},
},
theadClass
()
{
theadClass
()
{
return
this
.
shouldShowSelectionSummary
?
'
below-selection-summary
'
:
''
;
return
this
.
shouldShowSelectionSummary
?
'
below-selection-summary
'
:
''
;
},
},
fields
()
{
const
baseFields
=
[
{
key
:
'
checkbox
'
,
class
:
'
checkbox
'
,
skip
:
!
this
.
canAdminVulnerability
,
},
{
key
:
'
detected
'
,
label
:
s__
(
'
Vulnerability|Detected
'
),
class
:
'
detected
'
,
sortable
:
this
.
isSortable
,
skip
:
this
.
isPipelineDashboard
,
},
{
key
:
'
state
'
,
label
:
s__
(
'
Vulnerability|Status
'
),
class
:
'
status
'
,
sortable
:
this
.
isSortable
,
},
{
key
:
'
severity
'
,
label
:
s__
(
'
Vulnerability|Severity
'
),
class
:
'
severity
'
,
sortable
:
this
.
isSortable
,
},
{
key
:
'
title
'
,
label
:
__
(
'
Description
'
),
class
:
'
description gl-word-break-all
'
,
sortable
:
this
.
isSortable
,
},
{
key
:
'
identifier
'
,
label
:
s__
(
'
Vulnerability|Identifier
'
),
class
:
'
identifier gl-word-break-all
'
,
},
{
key
:
'
reportType
'
,
label
:
s__
(
'
Reports|Tool
'
),
class
:
'
scanner
'
,
sortable
:
this
.
isSortable
,
},
{
key
:
'
activity
'
,
label
:
s__
(
'
Vulnerability|Activity
'
),
thClass
:
'
gl-text-right
'
,
class
:
'
activity
'
,
skip
:
this
.
isPipelineDashboard
,
},
].
filter
((
f
)
=>
!
f
.
skip
);
// Apply gl-bg-white! to every header.
baseFields
.
forEach
((
field
)
=>
{
field
.
thClass
=
[
field
.
thClass
,
'
gl-bg-white!
'
];
// eslint-disable-line no-param-reassign
});
return
baseFields
;
},
},
},
watch
:
{
watch
:
{
filters
()
{
this
.
selectedVulnerabilities
=
{};
},
vulnerabilities
()
{
vulnerabilities
()
{
const
ids
=
new
Set
(
this
.
vulnerabilities
.
map
((
v
)
=>
v
.
id
));
const
ids
=
new
Set
(
this
.
vulnerabilities
.
map
((
v
)
=>
v
.
id
));
...
@@ -282,10 +208,11 @@ export default {
...
@@ -282,10 +208,11 @@ export default {
useConvertReportType
(
reportType
)
{
useConvertReportType
(
reportType
)
{
return
convertReportType
(
reportType
);
return
convertReportType
(
reportType
);
},
},
handleSortChange
(
args
)
{
handleSortChange
(
context
)
{
if
(
args
.
sortBy
)
{
const
fieldName
=
convertToSnakeCase
(
context
.
sortBy
);
this
.
$emit
(
'
sort-changed
'
,
{
...
args
,
sortBy
:
convertToSnakeCase
(
args
.
sortBy
)
});
const
direction
=
context
.
sortDesc
?
'
desc
'
:
'
asc
'
;
}
this
.
$emit
(
'
sort-changed
'
,
`
${
fieldName
}
_
${
direction
}
`
);
},
},
getVulnerabilityState
(
state
=
''
)
{
getVulnerabilityState
(
state
=
''
)
{
const
stateName
=
state
.
toLowerCase
();
const
stateName
=
state
.
toLowerCase
();
...
@@ -306,7 +233,6 @@ export default {
...
@@ -306,7 +233,6 @@ export default {
@
vulnerability-updated=
"deselectVulnerability"
@
vulnerability-updated=
"deselectVulnerability"
/>
/>
<gl-table
<gl-table
v-if=
"filters"
:busy=
"isLoading"
:busy=
"isLoading"
:fields=
"fields"
:fields=
"fields"
:items=
"vulnerabilities"
:items=
"vulnerabilities"
...
@@ -316,12 +242,12 @@ export default {
...
@@ -316,12 +242,12 @@ export default {
sort-icon-left
sort-icon-left
no-local-sorting
no-local-sorting
stacked=
"sm"
stacked=
"sm"
class=
"vulnerability-list"
show-empty
show-empty
responsive
responsive
hover
hover
primary-key=
"id"
primary-key=
"id"
:tbody-tr-class=
"
{ 'gl-cursor-pointer': vulnerabilities.length }"
:tbody-tr-class=
"
{ 'gl-cursor-pointer': vulnerabilities.length }"
head-variant="white"
@sort-changed="handleSortChange"
@sort-changed="handleSortChange"
@row-clicked="toggleVulnerability"
@row-clicked="toggleVulnerability"
>
>
...
...
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_spec.js
View file @
e3580001
This diff is collapsed.
Click to expand it.
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