FEATURE: simplify link to changes on GitHub

Instead of linking commit shas, link the test `N new commits`.

This simplifies the UX and makes it clearer what is going to happen.
This commit is contained in:
Sam Saffron 2018-12-26 10:23:18 +02:00
parent f0d181a858
commit a929416aa2
7 changed files with 2494 additions and 2486 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,14 +0,0 @@
import Ember from 'ember';
export default Ember.Helper.helper(function(params) {
const [sha1, url, branch] = params;
if (Ember.isNone(url)) { return; }
if (Ember.isNone(branch)) {
return new Ember.String.htmlSafe("(<a href='" + url + "'>" + sha1 + "</a>)");
}
var _url = url.substr(0, url.search(/(\.git)?$/));
var _branch = (branch.indexOf('/') !== -1) ? branch.split('/')[1] : branch;
return new Ember.String.htmlSafe("(<a href='" + _url + "/compare/" + sha1 + "..." + _branch + "'>" + sha1 + "</a>)");
});

View File

@ -0,0 +1,22 @@
import Ember from "ember";
export default Ember.Helper.helper(function(params) {
const [commitsBehind, oldSha, newSha, url] = params;
if (parseInt(commitsBehind) === 0) {
return "";
}
let description = `${commitsBehind} new commit${
commitsBehind === 1 ? "" : "s"
}`;
if (Ember.isNone(url)) {
return description;
}
var _url = url.substr(0, url.search(/(\.git)?$/));
description = `<a href='${_url}/compare/${oldSha}..${newSha}'>${description}</a>`;
return new Ember.String.htmlSafe(description);
});

View File

@ -5,7 +5,7 @@
</td>
<td>
{{repo.name}}
{{fmt-commit repo.version repo.url repo.branch}}
{{repo.version}}
</td>
<td>
{{#if repo.checkingStatus}}
@ -16,7 +16,7 @@
<div class='new-version'>
<h4>New Version Available!</h4>
<ul>
<li>Remote Version: {{fmt-commit repo.latest.version repo.url repo.branch}}</li>
<li>Remote Version: {{repo.latest.version}}</li>
<li>Last Updated:
{{#if repo.latest.date}}
{{moment-from-now repo.latest.date interval=1000}}
@ -24,7 +24,7 @@
&mdash;
{{/if}}
</li>
<li class='new-commits'>{{repo.latest.commits_behind}} new commits</li>
<li class='new-commits'>{{new-commits repo.latest.commits_behind repo.version repo.latest.version repo.url}}</li>
</ul>
{{#if repo.upgrading}}
<button class="btn" {{action "upgrade"}}>Currently Upgrading...</button>

File diff suppressed because it is too large Load Diff