Fix URL link in Bitbucket status

This commit is contained in:
Stan Hu 2018-07-01 05:55:23 -07:00
parent 3735ce43fc
commit 8377057364
2 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,7 @@
- @repos.each do |repo|
%tr{ id: "repo_#{repo.owner}___#{repo.slug}" }
%td
= link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: '_blank', rel: 'noopener noreferrer'
= link_to repo.full_name, repo.browse_url, target: '_blank', rel: 'noopener noreferrer'
%td.import-target
%fieldset.row
.input-group

View File

@ -13,6 +13,10 @@ module BitbucketServer
raw['slug']
end
def browse_url
link = raw.dig('project', 'links', 'self').first.fetch('href')
end
def clone_url
raw['links']['clone'].find { |link| link['name'].starts_with?('http') }.fetch('href')
end