diff --git a/web/app/assets/javascripts/createSession.js b/web/app/assets/javascripts/createSession.js index 31363bcb8..b3e866f0e 100644 --- a/web/app/assets/javascripts/createSession.js +++ b/web/app/assets/javascripts/createSession.js @@ -14,7 +14,7 @@ var userPhotoUrls = []; var MAX_GENRES = 1; var selectedFriendIds = {}; - var sessionSettings = {}; + var sessionSettings = {}; function beforeShow(data) { userNames = []; diff --git a/web/app/controllers/application_controller.rb b/web/app/controllers/application_controller.rb index 6d4bf3c1e..b73db5ca9 100644 --- a/web/app/controllers/application_controller.rb +++ b/web/app/controllers/application_controller.rb @@ -1,4 +1,21 @@ class ApplicationController < ActionController::Base protect_from_forgery include SessionsHelper + + + # inject username/email into bugsnag data + before_bugsnag_notify :add_user_info_to_bugsnag + + private + def add_user_info_to_bugsnag(notif) + # Add some app-specific data which will be displayed on a custom + # "User Info" tab on each error page on bugsnag.com + + unless current_user.nil? + notif.add_tab(:user_info, { + name: current_user.name, + email: current_user.email + }) + end + end end diff --git a/web/app/views/layouts/application.html.erb b/web/app/views/layouts/application.html.erb index 788a39568..7d5d78b31 100644 --- a/web/app/views/layouts/application.html.erb +++ b/web/app/views/layouts/application.html.erb @@ -23,6 +23,8 @@ <%= stylesheet_link_tag "client/search", media: "all" %> <%= stylesheet_link_tag "client/ftue", media: "all" %> <%= stylesheet_link_tag "client/createSession", media: "all" %> + + <%= include_gon %> <%= csrf_meta_tags %> diff --git a/web/app/views/layouts/client.html.erb b/web/app/views/layouts/client.html.erb index f6028e0e3..bfaa43d12 100644 --- a/web/app/views/layouts/client.html.erb +++ b/web/app/views/layouts/client.html.erb @@ -7,6 +7,8 @@ <%= stylesheet_link_tag "client/client", media: "all" %> + + <%= include_gon %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> diff --git a/web/app/views/layouts/corporate.html.erb b/web/app/views/layouts/corporate.html.erb index 8ea0135ad..67476673e 100644 --- a/web/app/views/layouts/corporate.html.erb +++ b/web/app/views/layouts/corporate.html.erb @@ -5,6 +5,8 @@ <%= stylesheet_link_tag "corp/corporate", :media => "all" %> + + <%= javascript_include_tag "corp/corporate" %> <%= csrf_meta_tags %> diff --git a/web/app/views/layouts/landing.erb b/web/app/views/layouts/landing.erb index dff9ab8a5..448dff97d 100644 --- a/web/app/views/layouts/landing.erb +++ b/web/app/views/layouts/landing.erb @@ -8,6 +8,8 @@ <%= stylesheet_link_tag "landing/landing", media: "all" %> + + <%= include_gon %> <%= csrf_meta_tags %> diff --git a/web/config/application.rb b/web/config/application.rb index aa736e3d3..56a4daea8 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -148,5 +148,7 @@ if defined?(Bundler) # allow hot-key to switch between native and normal client config.allow_force_native_client = true + + config.bugsnag_key = "4289fc981c8ce3eb0969003c4f498b01" end end diff --git a/web/config/initializers/bugsnag.rb b/web/config/initializers/bugsnag.rb index 46e5f163e..b4bb811fb 100644 --- a/web/config/initializers/bugsnag.rb +++ b/web/config/initializers/bugsnag.rb @@ -1,7 +1,7 @@ Bugsnag.configure do |config| - config.api_key = "4289fc981c8ce3eb0969003c4f498b01" + config.api_key = Rails.application.config.bugsnag_key config.use_ssl = false - config.notify_release_stages = ["production"] + config.notify_release_stages = ["production"] # add 'development' if you want to test a feature locally config.auto_notify = true config.app_version = JamWeb::VERSION end