Commit bff5deed833a54edc823201424bf2786a77c5829
1 parent
bcbee13b
Exists in
master
and in
1 other branch
disable create issue for campfire, using is_a? instead of string matching
Showing
2 changed files
with
17 additions
and
17 deletions
Show diff stats
app/models/notice_observer.rb
... | ... | @@ -5,7 +5,7 @@ class NoticeObserver < Mongoid::Observer |
5 | 5 | return unless should_notify? notice |
6 | 6 | |
7 | 7 | # if the app has the campfire tracker, post into the chat |
8 | - if !notice.app.issue_tracker.nil? && notice.app.issue_tracker.class.name == "IssueTrackers::CampfireTracker" | |
8 | + if !notice.app.issue_tracker.nil? && notice.app.issue_tracker.is_a?(CampfireTracker) | |
9 | 9 | app.issue_tracker.create_issue(notice) |
10 | 10 | end |
11 | 11 | |
... | ... | @@ -20,5 +20,4 @@ class NoticeObserver < Mongoid::Observer |
20 | 20 | (Errbit::Config.per_app_email_at_notices && app.email_at_notices || Errbit::Config.email_at_notices).include?(notice.problem.notices_count) && |
21 | 21 | app.notification_recipients.any? |
22 | 22 | end |
23 | - | |
24 | 23 | end | ... | ... |
app/views/errs/_issue_tracker_links.html.haml
1 | -- if @app.issue_tracker_configured? || current_user.github_account? | |
2 | - - if @problem.issue_link.present? | |
3 | - %span= link_to 'go to issue', @problem.issue_link, :class => "#{@problem.issue_type}_goto goto-issue" | |
4 | - = link_to 'unlink issue', unlink_issue_app_err_path(@app, @problem), :method => :delete, :data => { :confirm => "Unlink err issues?" }, :class => "unlink-issue" | |
5 | - - elsif @problem.issue_link == "pending" | |
6 | - %span.disabled= link_to 'creating...', '#', :class => "#{@problem.issue_type}_inactive create-issue" | |
7 | - = link_to 'retry', create_issue_app_err_path(@app, @problem), :method => :post | |
8 | - - else | |
9 | - - if @app.github_repo? | |
10 | - - if current_user.can_create_github_issues? | |
11 | - %span= link_to 'create issue', create_issue_app_err_path(@app, @problem, :tracker => 'user_github'), :method => :post, :class => "github_create create-issue" | |
12 | - - elsif @app.issue_tracker_configured? && @app.issue_tracker.is_a?(GithubIssuesTracker) | |
13 | - %span= link_to 'create issue', create_issue_app_err_path(@app, @problem), :method => :post, :class => "github_create create-issue" | |
14 | - - if @app.issue_tracker_configured? && !@app.issue_tracker.is_a?(GithubIssuesTracker) | |
15 | - %span= link_to 'create issue', create_issue_app_err_path(@app, @problem), :method => :post, :class => "#{@app.issue_tracker.label}_create create-issue" | |
1 | +- unless @app.issue_tracker_configured? && @app.issue_tracker.is_a?(CampfireTracker) | |
2 | + - if @app.issue_tracker_configured? || current_user.github_account? | |
3 | + - if @problem.issue_link.present? | |
4 | + %span= link_to 'go to issue', @problem.issue_link, :class => "#{@problem.issue_type}_goto goto-issue" | |
5 | + = link_to 'unlink issue', unlink_issue_app_err_path(@app, @problem), :method => :delete, :data => { :confirm => "Unlink err issues?" }, :class => "unlink-issue" | |
6 | + - elsif @problem.issue_link == "pending" | |
7 | + %span.disabled= link_to 'creating...', '#', :class => "#{@problem.issue_type}_inactive create-issue" | |
8 | + = link_to 'retry', create_issue_app_err_path(@app, @problem), :method => :post | |
9 | + - else | |
10 | + - if @app.github_repo? | |
11 | + - if current_user.can_create_github_issues? | |
12 | + %span= link_to 'create issue', create_issue_app_err_path(@app, @problem, :tracker => 'user_github'), :method => :post, :class => "github_create create-issue" | |
13 | + - elsif @app.issue_tracker_configured? && @app.issue_tracker.is_a?(GithubIssuesTracker) | |
14 | + %span= link_to 'create issue', create_issue_app_err_path(@app, @problem), :method => :post, :class => "github_create create-issue" | |
15 | + - if @app.issue_tracker_configured? && !@app.issue_tracker.is_a?(GithubIssuesTracker) | |
16 | + %span= link_to 'create issue', create_issue_app_err_path(@app, @problem), :method => :post, :class => "#{@app.issue_tracker.label}_create create-issue" | ... | ... |