From d78ec1a4387661bc086a80a407252d178ac6c157 Mon Sep 17 00:00:00 2001
From: Lisa P
Date: Thu, 3 Dec 2015 12:32:48 +0100
Subject: [PATCH] fix commit link in build header
---
app/components/build-header.coffee | 5 +++++
app/templates/build.hbs | 2 +-
app/templates/components/build-header.hbs | 2 +-
app/templates/job.hbs | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/components/build-header.coffee b/app/components/build-header.coffee
index 5448b23e..3d0e584b 100644
--- a/app/components/build-header.coffee
+++ b/app/components/build-header.coffee
@@ -2,6 +2,7 @@
`import { gravatarImage } from 'travis/utils/urls'`
`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'`
`import { durationFrom, safe } from 'travis/utils/helpers'`
+`import { githubCommit } from 'travis/utils/urls'`
BuildHeaderComponent = Ember.Component.extend
@@ -21,6 +22,10 @@ BuildHeaderComponent = Ember.Component.extend
if @get('item.build') then true else false
).property('item')
+ urlGithubCommit: (->
+ githubCommit(@get('repo.slug'), @get('commit.sha'))
+ ).property('item')
+
elapsedTime: (->
durationFrom(@get('item.startedAt'), @get('item.finishedAt'))
).property('item.startedAt', 'item.finishedAt', 'item.duration')
diff --git a/app/templates/build.hbs b/app/templates/build.hbs
index 41e53594..40e72f2a 100644
--- a/app/templates/build.hbs
+++ b/app/templates/build.hbs
@@ -2,7 +2,7 @@
{{loading-indicator}}
{{else}}
- {{build-header item=build user=auth.currentUser commit=commit}}
+ {{build-header item=build user=auth.currentUser commit=commit repo=repo}}
{{#unless build.isMatrix}}
{{view 'annotations' annotations=build.jobs.firstObject.annotations}}
diff --git a/app/templates/components/build-header.hbs b/app/templates/components/build-header.hbs
index 15805312..b1c3c807 100644
--- a/app/templates/components/build-header.hbs
+++ b/app/templates/components/build-header.hbs
@@ -18,7 +18,7 @@
-
-
+
Commit {{format-sha commit.sha}}
-
diff --git a/app/templates/job.hbs b/app/templates/job.hbs
index 84af3edc..ac49a931 100644
--- a/app/templates/job.hbs
+++ b/app/templates/job.hbs
@@ -1,6 +1,6 @@
{{#if job.isLoaded}}
- {{build-header item=job user=auth.currentUser commit=job.commit}}
+ {{build-header item=job user=auth.currentUser commit=job.commit repo=repo}}
{{view 'annotations' annotations=view.annotations}}