Commit 3d01285d24f71f016486fc8a6ad30a52fc6cf96f

Authored by Stephen Crosby
1 parent 2b1f4c6d
Exists in master and in 1 other branch production

have only one 'create issue' button

Formerly, if an app had a github repo, but another issue tracker was
configured, there would be two 'create issue' buttons (one for github
and one for the other issue tracker.) If there is an issue tracker
configured, we should use only that one.
app/views/problems/_issue_tracker_links.html.haml
... ... @@ -6,10 +6,10 @@
6 6 %span.disabled= link_to 'creating...', '#', :class => "#{problem.issue_type}_inactive create-issue"
7 7 = link_to 'retry', create_issue_app_problem_path(app, problem), :method => :post
8 8 - else
9   - - if app.github_repo?
  9 + - if app.issue_tracker_configured? && !app.issue_tracker.label.eql?('github')
  10 + %span= link_to 'create issue', create_issue_app_problem_path(app, problem), :method => :post, :class => "#{app.issue_tracker.label}_create create-issue"
  11 + - elsif app.github_repo?
10 12 - if current_user.can_create_github_issues?
11 13 %span= link_to 'create issue', create_issue_app_problem_path(app, problem, :tracker => 'user_github'), :method => :post, :class => "github_create create-issue"
12 14 - elsif app.issue_tracker_configured? && app.issue_tracker.label.eql?('github')
13 15 %span= link_to 'create issue', create_issue_app_problem_path(app, problem), :method => :post, :class => "github_create create-issue"
14   - - if app.issue_tracker_configured? && !app.issue_tracker.label.eql?('github')
15   - %span= link_to 'create issue', create_issue_app_problem_path(app, problem), :method => :post, :class => "#{app.issue_tracker.label}_create create-issue"
... ...