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
4ad0a98c
Commit
4ad0a98c
authored
Dec 09, 2019
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up formatting in performance issue body template
parent
698370aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
ee/app/assets/javascripts/vue_merge_request_widget/components/performance_issue_body.vue
...erge_request_widget/components/performance_issue_body.vue
+26
-12
No files found.
ee/app/assets/javascripts/vue_merge_request_widget/components/performance_issue_body.vue
View file @
4ad0a98c
...
@@ -5,6 +5,13 @@
...
@@ -5,6 +5,13 @@
*/
*/
import
ReportLink
from
'
~/reports/components/report_link.vue
'
;
import
ReportLink
from
'
~/reports/components/report_link.vue
'
;
function
formatScore
(
value
)
{
if
(
Math
.
floor
(
value
)
!==
value
)
{
return
parseFloat
(
value
).
toFixed
(
2
);
}
return
value
;
}
export
default
{
export
default
{
name
:
'
PerformanceIssueBody
'
,
name
:
'
PerformanceIssueBody
'
,
...
@@ -19,12 +26,18 @@ export default {
...
@@ -19,12 +26,18 @@ export default {
},
},
},
},
methods
:
{
computed
:
{
formatScore
(
value
)
{
issueScore
()
{
if
(
Math
.
floor
(
value
)
!==
value
)
{
return
this
.
issue
.
score
?
formatScore
(
this
.
issue
.
score
)
:
false
;
return
parseFloat
(
value
).
toFixed
(
2
);
},
issueDelta
()
{
if
(
!
this
.
issue
.
delta
)
{
return
false
;
}
if
(
this
.
issue
.
delta
>=
0
)
{
return
`+
${
formatScore
(
this
.
issue
.
delta
)}
`
;
}
}
return
value
;
return
formatScore
(
this
.
issue
.
delta
)
;
},
},
},
},
};
};
...
@@ -32,13 +45,14 @@ export default {
...
@@ -32,13 +45,14 @@ export default {
<
template
>
<
template
>
<div
class=
"report-block-list-issue-description prepend-top-5 append-bottom-5"
>
<div
class=
"report-block-list-issue-description prepend-top-5 append-bottom-5"
>
<div
class=
"report-block-list-issue-description-text"
>
<div
class=
"report-block-list-issue-description-text"
>
{{
issue
.
name
<template
v-if=
"issueScore"
>
}}
<template
v-if=
"issue.score"
{{
issue
.
name
}}
:
<strong>
{{
issueScore
}}
</strong>
>
:
<strong>
{{
formatScore
(
issue
.
score
)
}}
</strong></
template
</
template
>
>
<
template
v-else
>
{{
issue
.
name
}}
<
template
v-if=
"issue.delta != null"
>
</
template
>
(
{{
issue
.
delta
>=
0
?
'
+
'
:
''
}}{{
formatScore
(
issue
.
delta
)
}}
)
<
template
v-if=
"issueDelta"
>
(
{{
issueDelta
}}
)
</
template
>
</
template
>
</div>
</div>
...
...
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