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
66a84b23
Commit
66a84b23
authored
Aug 04, 2020
by
Daniel Tian
Committed by
Ezekiel Kigbo
Aug 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Truncate long vulnerability names on security report
parent
d6146737
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
6 deletions
+36
-6
app/assets/javascripts/reports/components/modal_open_name.vue
...assets/javascripts/reports/components/modal_open_name.vue
+20
-2
ee/app/assets/javascripts/vue_shared/security_reports/components/security_issue_body.vue
...hared/security_reports/components/security_issue_body.vue
+7
-3
ee/changelogs/unreleased/38043-truncate-long-vulnerability-names.yml
...gs/unreleased/38043-truncate-long-vulnerability-names.yml
+5
-0
ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
...red/security_reports/grouped_security_reports_app_spec.js
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/assets/javascripts/reports/components/modal_open_name.vue
View file @
66a84b23
<
script
>
import
{
GlTooltipDirective
,
GlResizeObserverDirective
}
from
'
@gitlab/ui
'
;
import
{
mapActions
}
from
'
vuex
'
;
export
default
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlResizeObserverDirective
,
},
props
:
{
issue
:
{
type
:
Object
,
...
...
@@ -13,19 +18,32 @@ export default {
required
:
true
,
},
},
data
:
()
=>
({
tooltipTitle
:
''
,
}),
mounted
()
{
this
.
updateTooltipTitle
();
},
methods
:
{
...
mapActions
([
'
openModal
'
]),
handleIssueClick
()
{
const
{
issue
,
status
,
openModal
}
=
this
;
openModal
({
issue
,
status
});
},
updateTooltipTitle
()
{
// Only show the tooltip if the text is truncated with an ellipsis.
this
.
tooltipTitle
=
this
.
$el
.
offsetWidth
<
this
.
$el
.
scrollWidth
?
this
.
issue
.
title
:
''
;
},
},
};
</
script
>
<
template
>
<button
type=
"button"
class=
"btn-link btn-blank text-left break-link vulnerability-name-button"
v-gl-tooltip=
"
{ boundary: 'viewport' }"
v-gl-resize-observer-directive="updateTooltipTitle"
class="btn-link gl-text-truncate"
:aria-label="s__('Reports|Vulnerability Name')"
:title="tooltipTitle"
@click="handleIssueClick()"
>
{{
issue
.
title
}}
...
...
ee/app/assets/javascripts/vue_shared/security_reports/components/security_issue_body.vue
View file @
66a84b23
...
...
@@ -34,9 +34,13 @@ export default {
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue-description gl-mt-2 gl-mb-2"
>
<div
class=
"report-block-list-issue-description-text"
>
<severity-badge
v-if=
"issue.severity"
class=
"d-inline-block"
:severity=
"issue.severity"
/>
<div
class=
"report-block-list-issue-description gl-mt-2 gl-mb-2 gl-w-full"
>
<div
class=
"report-block-list-issue-description-text gl-display-flex gl-w-full"
>
<severity-badge
v-if=
"issue.severity"
class=
"d-inline-block gl-mr-1"
:severity=
"issue.severity"
/>
<modal-open-name
:issue=
"issue"
:status=
"status"
/>
</div>
<report-link
v-if=
"showReportLink && issue.path"
:issue=
"issue"
/>
...
...
ee/changelogs/unreleased/38043-truncate-long-vulnerability-names.yml
0 → 100644
View file @
66a84b23
---
title
:
Truncate long vulnerability names on security report
merge_request
:
38056
author
:
type
:
fixed
ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
View file @
66a84b23
...
...
@@ -308,7 +308,7 @@ describe('Grouped security reports app', () => {
});
it
(
'
opens modal with more information
'
,
()
=>
{
wrapper
.
vm
.
$el
.
querySelector
(
'
.break-link
'
).
click
();
wrapper
.
vm
.
$el
.
querySelector
(
'
[aria-label="Vulnerability Name"]
'
).
click
();
return
Vue
.
nextTick
().
then
(()
=>
{
expect
(
wrapper
.
vm
.
$el
.
querySelector
(
'
.modal-title
'
).
textContent
.
trim
()).
toEqual
(
...
...
locale/gitlab.pot
View file @
66a84b23
...
...
@@ -20245,6 +20245,9 @@ msgstr ""
msgid "Reports|Vulnerability"
msgstr ""
msgid "Reports|Vulnerability Name"
msgstr ""
msgid "Reports|no changed test results"
msgstr ""
...
...
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