show non-WASAPI in chat. fix survey

This commit is contained in:
Seth Call 2018-03-03 15:39:55 -06:00
parent 698e643996
commit 8cb9db9971
10 changed files with 61 additions and 6 deletions

View File

@ -4,6 +4,7 @@
= f.input :admin
= f.input :is_onboarder, label: 'Is Support Consultant'
= f.input :subscribe_email, label: 'Subscribed to Emails?'
= f.input :gifted_jamtracks, label: 'JamTrack Credits'
= f.input :first_name
= f.input :last_name
= f.input :city

View File

@ -386,4 +386,5 @@ better_lesson_notices.sql
teacher_search_control.sql
user_timezone.sql
onboarder_limit.sql
onboarding_emails.sql
onboarding_emails.sql
limit_counter_reminders.sql

View File

@ -0,0 +1 @@
ALTER TABLE lesson_sessions ADD COLUMN counter_reminders INTEGER NOT NULL DEFAULT 0;

View File

@ -737,7 +737,12 @@ module JamRuby
self.autocanceling = true
self.active = false
self.status = STATUS_UNCONFIRMED
save
if save
if is_test_drive?
user.jamclass_credits = user.jamclass_credits + 1
user.save(validate:false)
end
end
self
end

View File

@ -147,7 +147,7 @@ module JamRuby
if lesson_session.student_last_proposed?
relevant_time = [lesson_session.countered_at, lesson_session.lesson_booking.sent_notices_at].find { |x| !x.nil? }
UserMailer.student_no_comm_other(lesson_session.lesson_booking, relevant_time < Time.now - 3.days).deliver_now
UserMailer.student_no_comm_other(lesson_session.lesson_booking, relevant_time < 3.days.ago).deliver_now
UserMailer.teacher_counter_reminder(lesson_session).deliver_now
else
UserMailer.teacher_no_comm_other(lesson_session.lesson_booking).deliver_now

View File

@ -340,7 +340,7 @@ module JamRuby
end
if updates[:onboarding_status] == ONBOARDING_STATUS_ONBOARDED || updates[:onboarding_status] == ONBOARDING_STATUS_LOST || updates[:onboarding_status] == ONBOARDING_STATUS_ESCALATED
self.send_onboarding_survey = true
updates[:send_onboarding_survey] = true
end
User.where(id: self.id).update_all(updates)

View File

@ -9,6 +9,8 @@ describe LessonSession do
let(:lesson_booking) { b = LessonBooking.book_normal(user, teacher, [slot1, slot2], "Hey I've heard of you before.", false, LessonBooking::PAYMENT_STYLE_SINGLE, 60); b.card_presumed_ok = true; b.save!; b }
let(:lesson_session) { lesson_booking.lesson_sessions[0] }
let(:td_lesson_booking) { b = LessonBooking.book_test_drive(user, teacher, [slot1, slot2], "Hey I've heard of you before."); b.card_presumed_ok = true; b.save!; b }
let(:td_lesson_session) { td_lesson_booking.lesson_sessions[0] }
describe "counter" do
describe "recurring" do
@ -215,6 +217,21 @@ describe LessonSession do
end
describe "autocancel" do
it "returns credit" do
jamclass_credits = user.jamclass_credits
td_lesson_session.status.should eql LessonSession::STATUS_REQUESTED
Timecop.travel(Date.today + 10)
td_lesson_session.autocancel
td_lesson_session.reload
td_lesson_session.status.should eql LessonSession::STATUS_UNCONFIRMED
td_lesson_session.lesson_booking.status.should eql LessonSession::STATUS_UNCONFIRMED
user.reload
user.jamclass_credits.should eql (jamclass_credits + 1)
end
it "can't autocancel in the past" do
lesson_session.status.should eql LessonSession::STATUS_REQUESTED

View File

@ -495,7 +495,7 @@
*/
function loadAudioDrivers() {
var drivers = context.jamClient.FTUEGetDevices(false);
var chatDrivers = jamClient.FTUEGetChatInputs();
var chatDrivers = jamClient.FTUEGetChatInputs(false, false);
var optionsHtml = '<option selected="selected" value="">Choose...</option>';
var chatOptionsHtml = '<option selected="selected" value="">Choose...</option>';

View File

@ -149,8 +149,14 @@ profileUtils = context.JK.ProfileUtils
value = $target.val()
options = {id: id}
options[field] = value
@postUpdate(field, value)
@queueUpdate(options)
postUpdate: (field, value) ->
if field == 'onboarding_onboarded_at'
console.log("onboarding onboarded at set")
context.JK.Banner.showAlert({title: "One Last Thing", html: "Please send this student Email #5 right now.<br/><br/>This is a critical email, and if you don't send it now, you'll forget. Thanks!"});
queueUpdate: (update) ->
@updates.push(update)
@onUpdate()

View File

@ -354,7 +354,31 @@
var musicPorts = jamClient.FTUEGetChannels();
//var chatsOnCurrentDevice = context.jamClient.FTUEGetChatInputs(true);
var chatsOnOtherDevices = context.jamClient.FTUEGetChatInputs(false);
var chatsOnOtherDevices = context.jamClient.FTUEGetChatInputs(false, false);
// remove all virtual/remote junk form chat inputs. Their key contains' JamKazam when it's Virtual Input or Remote
Object.keys(chatsOnOtherDevices).forEach(function(key) {
if(key.indexOf('JamKazam') > -1) {
delete chatsOnOtherDevices[key]
}
} )
// this wasapi logic is this: if there are any non-WASAPI items, present only them, because WASAPI is very high latency and
// highly desirable. But if the user ONLY has wasapi, then fine, we show them (by not deleting them from the list)
var allWasapi = true;
context._.each(chatsOnOtherDevices, function (chatChannelName, chatChannelId) {
if(chatChannelName.indexOf('WASAPI') == -1) {
allWasapi = false;
return false
}
})
if(!allWasapi) {
Object.keys(chatsOnOtherDevices).forEach(function(key) {
if(chatsOnOtherDevices[key].indexOf('WASAPI') > -1) {
delete chatsOnOtherDevices[key]
}
} )
}
var chatInputs = [];
//context._.each(musicPorts.inputs, function(input) {