From a00704943af785cfb02a439f31f7303e2340908c Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 8 Sep 2015 18:21:44 +0200 Subject: [PATCH] prepare for 5 builds per branch request --- app/components/branch-row.coffee | 18 ++++++++++++++++++ app/controllers/branches.coffee | 10 ---------- app/templates/components/branch-row.hbs | 12 +++--------- app/templates/components/build-tile.hbs | 14 ++++++++------ 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 25ee44bb..cbdbb7fb 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -17,6 +17,14 @@ BranchRowComponent = Ember.Component.extend getLast5Builds: (-> + array = [{}, {}, {}, {}, {}] + + if @get('build.last_build') == null + @set('isLoading', false) + array + else + array + # apiEndpoint = config.apiEndpoint # repoId = @get('build.repository.id') @@ -29,4 +37,14 @@ BranchRowComponent = Ember.Component.extend # @set('isLoading', false) ).property('build') + actions: + tiggerBuild: (branch) -> + console.log('trigger build') + + viewAllBuilds: (branch) -> + console.log('view all builds') + # updateFilter: (value) -> + # @set('_lastFilterValue', value) + # Ember.run.throttle this, @updateFilter, [], 200, false + `export default BranchRowComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 7cf00272..a0a0c96e 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -22,14 +22,4 @@ BranchesController = Ember.Controller.extend item if item.exists_on_github == false ).property('model') - actions: - tiggerBuild: (branch) -> - console.log('trigger build') - - viewAllBuilds: (branch) -> - console.log('view all builds') - # updateFilter: (value) -> - # @set('_lastFilterValue', value) - # Ember.run.throttle this, @updateFilter, [], 200, false - `export default BranchesController` diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index d70e952d..2313b85f 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -163,14 +163,8 @@
diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs index d2c640b1..b96158db 100644 --- a/app/templates/components/build-tile.hbs +++ b/app/templates/components/build-tile.hbs @@ -1,6 +1,8 @@ - - {{status-icon build=build}} -
- {{request-icon build=build}} #{{build.number}} -
-
+{{#unless build}} + + {{status-icon build=build}} +
+ {{request-icon build=build}} #{{build.number}} +
+
+{{/unless}} \ No newline at end of file