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
b9e9f856
Commit
b9e9f856
authored
Dec 09, 2019
by
Zack Cuddy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Null safe percentages
Tests and linting Changelog Changes based on @nfriend feedback Rename test
parent
25a97e59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue
...avascripts/vue_shared/components/stacked_progress_bar.vue
+4
-0
ee/changelogs/unreleased/7707-fix-infinity-progress.yml
ee/changelogs/unreleased/7707-fix-infinity-progress.yml
+5
-0
spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js
...cripts/vue_shared/components/stacked_progress_bar_spec.js
+6
-0
No files found.
app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue
View file @
b9e9f856
...
...
@@ -71,6 +71,10 @@ export default {
},
methods
:
{
getPercent
(
count
)
{
if
(
!
this
.
totalCount
)
{
return
0
;
}
const
percent
=
roundOffFloat
((
count
/
this
.
totalCount
)
*
100
,
1
);
if
(
percent
>
0
&&
percent
<
1
)
{
return
'
< 1
'
;
...
...
ee/changelogs/unreleased/7707-fix-infinity-progress.yml
0 → 100644
View file @
b9e9f856
---
title
:
Fix Infinity % / Infinity % on Stacked Progress Bar
merge_request
:
21437
author
:
type
:
fixed
spec/javascripts/vue_shared/components/stacked_progress_bar_spec.js
View file @
b9e9f856
...
...
@@ -53,6 +53,12 @@ describe('StackedProgressBarComponent', () => {
it
(
'
returns percentage as `< 1` from provided count based on `totalCount` when evaluated value is less than 1
'
,
()
=>
{
expect
(
vm
.
getPercent
(
10
)).
toBe
(
'
< 1
'
);
});
it
(
'
returns 0 if totalCount is falsy
'
,
()
=>
{
vm
=
createComponent
({
totalCount
:
0
});
expect
(
vm
.
getPercent
(
100
)).
toBe
(
0
);
});
});
describe
(
'
barStyle
'
,
()
=>
{
...
...
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