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
eabe01a0
Commit
eabe01a0
authored
Aug 25, 2020
by
Daniel Tian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make vulnerability list columns have consistent widths
parent
fd39b75a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
18 deletions
+58
-18
app/assets/stylesheets/framework/tables.scss
app/assets/stylesheets/framework/tables.scss
+30
-0
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+23
-18
ee/changelogs/unreleased/227281-create-consistent-widths-for-vulnerability-list-columns.yml
...eate-consistent-widths-for-vulnerability-list-columns.yml
+5
-0
No files found.
app/assets/stylesheets/framework/tables.scss
View file @
eabe01a0
...
...
@@ -180,3 +180,33 @@ table {
border-top
:
0
;
}
}
.vulnerability-list
{
@media
(
min-width
:
$breakpoint-sm
)
{
.checkbox
{
padding-left
:
$gl-spacing-scale-4
;
padding-right
:
0
;
+
td
,
+
th
{
padding-left
:
$gl-spacing-scale-4
;
}
}
.status
{
width
:
8%
;
}
.severity
{
width
:
9%
;
}
.identifier
{
width
:
12%
;
}
.scanner
{
width
:
15%
;
}
}
}
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
eabe01a0
...
...
@@ -119,30 +119,32 @@ export default {
return
this
.
shouldShowSelectionSummary
?
'
below-selection-summary
'
:
''
;
},
fields
()
{
const
commonThClass
=
[
'
table-th-transparent
'
,
'
original-gl-th
'
,
'
gl-bg-white!
'
].
join
(
'
'
);
const
baseFields
=
[
{
key
:
'
state
'
,
label
:
s__
(
'
Vulnerability|Status
'
),
thClass
:
`vulnerability-td
${
commonThClass
}
`
,
thClass
:
'
status
'
,
tdClass
:
'
status
'
,
},
{
key
:
'
severity
'
,
label
:
s__
(
'
Vulnerability|Severity
'
),
thClass
:
`vulnerability-td
${
commonThClass
}
`
,
thClass
:
'
severity
'
,
tdClass
:
'
severity
'
,
},
{
key
:
'
title
'
,
label
:
__
(
'
Description
'
),
thClass
:
commonThClass
,
tdClass
:
'
gl-word-break-all
'
,
thClass
:
'
description
'
,
tdClass
:
'
description
gl-word-break-all
'
,
},
];
if
(
this
.
shouldShowSelection
)
{
baseFields
.
unshift
({
key
:
'
checkbox
'
,
thClass
:
`gl-w-9
${
commonThClass
}
`
,
thClass
:
'
checkbox
'
,
tdClass
:
'
checkbox
'
,
});
}
...
...
@@ -150,8 +152,8 @@ export default {
baseFields
.
push
({
key
:
'
identifier
'
,
label
:
s__
(
'
Vulnerability|Identifier
'
),
thClass
:
commonThClass
,
tdClass
:
'
gl-word-break-all
'
,
thClass
:
'
identifier
'
,
tdClass
:
'
identifier
gl-word-break-all
'
,
});
}
...
...
@@ -159,9 +161,16 @@ export default {
baseFields
.
push
({
key
:
'
reportType
'
,
label
:
s__
(
'
Reports|Scanner
'
),
thClass
:
commonThClass
,
thClass
:
'
scanner
'
,
tdClass
:
'
scanner
'
,
});
}
// 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
;
},
},
...
...
@@ -270,12 +279,13 @@ export default {
:items=
"vulnerabilities"
:thead-class=
"theadClass"
stacked=
"sm"
class=
"vulnerability-list"
show-empty
responsive
>
<template
#head
(
checkbox
)
>
<gl-form-checkbox
class=
"
mr-0 mb
-0"
class=
"
gl-m
-0"
data-testid=
"vulnerability-checkbox-all"
:checked=
"hasSelectedAllVulnerabilities"
@
change=
"toggleAllVulnerabilities"
...
...
@@ -283,7 +293,7 @@ export default {
</
template
>
<
template
v-if=
"shouldShowScannersAlert"
#top-row
>
<td
:colspan=
"fields.length"
>
<td
:colspan=
"fields.length"
class=
"gl-px-0!"
>
<security-scanner-alert
:not-enabled-scanners=
"notEnabledSecurityScanners"
:no-pipeline-run-scanners=
"noPipelineRunSecurityScanners"
...
...
@@ -294,7 +304,7 @@ export default {
<
template
#cell(checkbox)=
"{ item }"
>
<gl-form-checkbox
class=
"
d-inline-block mr-0 mb
-0"
class=
"
gl-display-inline-block! gl-m
-0"
data-testid=
"vulnerability-checkbox"
:checked=
"isSelected(item)"
@
change=
"toggleVulnerability(item)"
...
...
@@ -306,7 +316,7 @@ export default {
</
template
>
<
template
#cell(severity)=
"{ item }"
>
<severity-badge
class=
"js-severity"
:severity=
"item.severity"
/>
<severity-badge
class=
"js-severity
gl-white-space-normal!
"
:severity=
"item.severity"
/>
</
template
>
<
template
#cell(title)=
"{ item }"
>
...
...
@@ -381,8 +391,3 @@ export default {
</gl-table>
</div>
</template>
<
style
>
.vulnerability-td
{
width
:
8rem
;
}
</
style
>
ee/changelogs/unreleased/227281-create-consistent-widths-for-vulnerability-list-columns.yml
0 → 100644
View file @
eabe01a0
---
title
:
Make vulnerability list columns have consistent widths
merge_request
:
40561
author
:
type
:
fixed
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