put in backend details
This commit is contained in:
parent
cb0375bc32
commit
98bde49131
|
|
@ -388,4 +388,5 @@ user_timezone.sql
|
|||
onboarder_limit.sql
|
||||
onboarding_emails.sql
|
||||
limit_counter_reminders.sql
|
||||
amazon_v2.sql
|
||||
amazon_v2.sql
|
||||
store_backend_details_rate_session.sql
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE music_sessions_user_history ADD COLUMN backend_details VARCHAR;
|
||||
|
|
@ -131,10 +131,14 @@ module JamRuby
|
|||
self.perf_data.try(:uri)
|
||||
end
|
||||
|
||||
def add_rating(rval, comment='')
|
||||
def add_rating(rval, comment='', backend_details=nil)
|
||||
rval = rval.to_i
|
||||
self.rating = rval if 0 != rval
|
||||
self.rating_comment = comment
|
||||
if backend_details
|
||||
self.backend_details = backend_details.to_json
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
MIN_SESSION_DURATION_RATING = 60
|
||||
|
|
|
|||
|
|
@ -89,10 +89,15 @@
|
|||
return false;
|
||||
}
|
||||
var url = "/api/participant_histories/"+clientId+"/rating";
|
||||
// get backend details too
|
||||
if(context.jamClient.getAllClientsStateMap) {
|
||||
var backendDetails = context.jamClient.getAllClientsStateMap()
|
||||
console.log("got backend details", backendDetails)
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: { rating: getRating(), comment: getComment() }
|
||||
data: { rating: getRating(), comment: getComment(), backend_details: backendDetails }
|
||||
}).done(function (response) {
|
||||
var qq = getRating();
|
||||
if (0 < qq) {
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class ApiMusicSessionsController < ApiController
|
|||
def participant_rating
|
||||
if @history = MusicSessionUserHistory.latest_history(params[:client_id])
|
||||
if request.post?
|
||||
@history.add_rating(params[:rating], params[:comment])
|
||||
@history.add_rating(params[:rating], params[:comment], params[:backend_details])
|
||||
@history.save
|
||||
|
||||
if @history.errors.any?
|
||||
|
|
@ -386,6 +386,15 @@ class ApiMusicSessionsController < ApiController
|
|||
end
|
||||
body << "Session Comments: #{@history.rating_comment}\n"
|
||||
|
||||
if @history.backend_details
|
||||
begin
|
||||
details = JSON.parse(@history.backend_details)
|
||||
body << "Backend Detail:\n" + JSON.pretty_generate(details) + "\n"
|
||||
rescue Exception => e
|
||||
logger.error("Unable to send out retails email due to bad backend data #{e}")
|
||||
end
|
||||
end
|
||||
|
||||
AdminMailer.jamclass_alerts({subject: subject, body: body}).deliver_now
|
||||
rescue Exception => e
|
||||
logger.error("Exception sending out ratings email. Boo #{e}")
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat
|
|||
find('a.amazon-a-button-text', text: 'Submit Code').trigger(:click)
|
||||
|
||||
find('.success-msg wbr', 'Your code has been validated!')
|
||||
fill_in "first", with: "Seth"
|
||||
fill_in "email", with: "amzposa1@jamkazam.com"
|
||||
fill_in "password", with: "jam123"
|
||||
select 'Acoustic Guitar', from: "instrument"
|
||||
|
|
@ -58,11 +59,13 @@ describe "Activate Account Card", :js => true, :type => :feature, :capybara_feat
|
|||
find('a.amazon-a-button-text', text: 'Submit Code').trigger(:click)
|
||||
|
||||
find('.success-msg wbr', 'Your code has been validated!')
|
||||
fill_in "first", with: "Seth"
|
||||
select 'Acoustic Guitar', from: "instrument"
|
||||
|
||||
find('a.amazon-a-button-text', text: 'Create Account').trigger(:click)
|
||||
find('.error', text: "Email can't be blank")
|
||||
|
||||
fill_in "first", with: "Seth"
|
||||
fill_in "email", with: "amzpos2@jamkazam.com"
|
||||
fill_in "password", with: "jam123"
|
||||
select 'Acoustic Guitar', from: "instrument"
|
||||
|
|
|
|||
Loading…
Reference in New Issue