FEATURE: Installed Version link shows GitHub Compare to branch being followed

This commit is contained in:
cpradio 2016-08-01 17:30:04 -04:00
parent e79c216bc0
commit 1b89c2f0ef
3 changed files with 7 additions and 2 deletions

View File

@ -24,8 +24,11 @@ const VersionCheck = Discourse.Model.extend({
}.property('missing_versions_count'), }.property('missing_versions_count'),
gitLink: function() { gitLink: function() {
const git_branch = this.get('git_branch');
if (git_branch)
return "https://github.com/discourse/discourse/compare/" + this.get('installed_sha') + "..." + git_branch;
return "https://github.com/discourse/discourse/tree/" + this.get('installed_sha'); return "https://github.com/discourse/discourse/tree/" + this.get('installed_sha');
}.property('installed_sha'), }.property('installed_sha', 'git_branch'),
shortSha: function() { shortSha: function() {
return this.get('installed_sha').substr(0,10); return this.get('installed_sha').substr(0,10);

View File

@ -1,5 +1,5 @@
class DiscourseVersionCheck class DiscourseVersionCheck
include ActiveModel::Model include ActiveModel::Model
attr_accessor :latest_version, :critical_updates, :installed_version, :installed_sha, :installed_describe, :missing_versions_count, :updated_at, :version_check_pending attr_accessor :latest_version, :critical_updates, :installed_version, :installed_sha, :installed_describe, :missing_versions_count, :git_branch, :updated_at, :version_check_pending
end end

View File

@ -8,6 +8,7 @@ module DiscourseUpdates
installed_version: Discourse::VERSION::STRING, installed_version: Discourse::VERSION::STRING,
installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version), installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version),
installed_describe: `git describe --dirty`, installed_describe: `git describe --dirty`,
git_branch: Discourse.git_branch,
updated_at: nil updated_at: nil
) )
else else
@ -18,6 +19,7 @@ module DiscourseUpdates
installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version), installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version),
installed_describe: `git describe --dirty`, installed_describe: `git describe --dirty`,
missing_versions_count: missing_versions_count, missing_versions_count: missing_versions_count,
git_branch: Discourse.git_branch,
updated_at: updated_at updated_at: updated_at
) )
end end