Navigation Menu

Skip to content

Commit

Permalink
update waterfall for coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
  • Loading branch information
Pierre Tardy committed Aug 15, 2014
1 parent 05419c4 commit 1ff21c6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions www/.gitignore
Expand Up @@ -3,6 +3,7 @@ build
!src/app/builders/build
dist/
static/
coverage/
VERSION
node_modules
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion www/waterfall_view/package.json
Expand Up @@ -5,6 +5,6 @@
"npm": ">=1.4.10"
},
"devDependencies": {
"guanlecoja": "0.2.7"
"guanlecoja": "0.2.9"
}
}
4 changes: 3 additions & 1 deletion www/waterfall_view/src/module/data/data.service.coffee
@@ -1,4 +1,6 @@
class Data extends Service
constructor: ->
{}
# Returns groups and adds builds to builders
getGroups: (builders, builds, threshold) ->
# Sort builds by buildid
Expand Down Expand Up @@ -37,4 +39,4 @@ class Data extends Service
for build in builder.builds
latest ?= build
if build.number > latest.number then latest = build
builder.results = latest?.results
builder.results = latest?.results
4 changes: 2 additions & 2 deletions www/waterfall_view/src/module/main.module.coffee
Expand Up @@ -73,13 +73,13 @@ class Waterfall extends Controller
angular.element(@$window).bind 'resize', => @render()

# Update view on data change
@$scope.$watch 'builds', (builds) =>
@$scope.$watch('builds', ((builds) =>
if builds? and @builds.length isnt builds.length
@builds = builds
@groups = @dataService.getGroups(@builders, @builds, @c.threshold)
@dataService.addStatus(@builders)
@render()
, true
), true)

# Lazy load builds on scroll
containerParent = @container.node().parentNode
Expand Down
1 change: 1 addition & 0 deletions www/waterfall_view/src/module/main.module.spec.coffee
Expand Up @@ -20,6 +20,7 @@ describe 'Waterfall view controller', ->

# make sure we remove the element from the dom
afterEach ->
expect($document.find("svg").length).toEqual(2)
elem.remove()
expect($document.find("svg").length).toEqual(0)

Expand Down
4 changes: 2 additions & 2 deletions www/waterfall_view/src/module/scale/scale.service.coffee
Expand Up @@ -7,7 +7,7 @@ class ScaleService extends Factory
getX: (builders, width) ->
@d3.scale.ordinal()
.domain(builders.map (builder) -> builder.builderid)
.rangeRoundBands([0, width], .1)
.rangeRoundBands([0, width], 0.1)

# Returns y scale
getY: (groups, gap, height) ->
Expand Down Expand Up @@ -46,4 +46,4 @@ class ScaleService extends Factory
getBuilderName: (builders) ->
@d3.scale.ordinal()
.domain(builders.map (builder) -> builder.builderid)
.range(builders.map (builder) -> builder.name)
.range(builders.map (builder) -> builder.name)

0 comments on commit 1ff21c6

Please sign in to comment.