Skip to content

Commit 9892fe8

Browse files
committed
Fetches new title info when an issue is opened, adds issue title changed activity events for reference
1 parent f82a95e commit 9892fe8

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

ember-app/app/helpers/truncate.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Ember from 'ember';
2+
3+
export function truncate(params) {
4+
var string = params[0];
5+
var length = params[1];
6+
if(string.length < length){
7+
return string;
8+
}
9+
return `${string.substring(0, length)}...`;
10+
}
11+
12+
export default Ember.HTMLBars.makeBoundHelper(truncate);

ember-app/app/models/issue.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ var Issue = Ember.Object.extend(Serializable,{
9797

9898
return Ember.$.getJSON("/api/" + full_name + "/issues/" + this.get("number") + "/details")
9999
.success(function(details){
100+
this.set("title", details.title);
101+
this.set("body", details.body);
102+
this.set("body_html", details.body_html);
100103
this.set("repo", details.repo);
101104
this.set("activities", details.activities);
102105
this.set("processing", false);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<span class="ui-icon-pencil"></span> {{hb-avatar user=model.actor width=20 height=20}}
2+
<strong> <a target="_blank" href="{{model.actor.html_url}}"> {{model.actor.login}}</a></strong> changed the title from <strong>{{truncate model.rename.from 28}}</strong> to <strong>{{truncate model.rename.to 28}}</strong> {{ago model.created_at }}

0 commit comments

Comments
 (0)