From fc6c226031f569bd611380beff11fb0dd3f71093 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 9 Mar 2017 22:38:52 -0500 Subject: Render issue-edit msgs including legacy renames and reopens --- lib/render-msg.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'lib/render-msg.js') diff --git a/lib/render-msg.js b/lib/render-msg.js index 017e8f6..c99b206 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -193,6 +193,7 @@ RenderMsg.prototype.message = function (raw, cb) { case 'git-update': return this.gitUpdate(cb) case 'pull-request': return this.gitPullRequest(cb) case 'issue': return this.issue(cb) + case 'issue-edit': return this.issueEdit(cb) case 'music-release-cc': return this.musicRelease(cb) case 'ferment/audio': case 'robeson/audio': @@ -435,6 +436,10 @@ RenderMsg.prototype.issue = function (cb) { }) } +RenderMsg.prototype.issueEdit = function (cb) { + this.wrap('', cb) +} + RenderMsg.prototype.object = function (cb) { this.wrapMini(h('pre', this.c.type), cb) } @@ -442,7 +447,15 @@ RenderMsg.prototype.object = function (cb) { RenderMsg.prototype.issues = function (cb) { var self = this var done = multicb({pluck: 1, spread: true}) - var els = u.toArray(self.c.issues).map(function (issue) { + var issues = u.toArray(self.c.issues) + if (self.c.type === 'issue-edit' && self.c.issue) { + issues.push({ + link: self.c.issue, + title: self.c.title, + open: self.c.open, + }) + } + var els = issues.map(function (issue) { var commit = issue.object || issue.label ? [ issue.object ? h('code', issue.object) : '', ' ', issue.label ? h('q', issue.label) : ''] : '' @@ -452,6 +465,12 @@ RenderMsg.prototype.issues = function (cb) { if (issue.open === false) return h('div', 'closed ', self.link1(issue, done())) + if (issue.open === true) + return h('div', + 'reopened ', self.link1(issue, done())) + if (typeof issue.title === 'string') + return h('div', + 'renamed ', self.link1(issue, done()), ' to ', h('ins', issue.title)) }) done(cb) return els.length > 0 ? [els, h('br')] : '' -- cgit v1.2.3