From 397be9ab144dc4d31ac20b34c08fa1710df3897f Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 18 May 2016 23:03:22 -0500 Subject: [PATCH] VRFS-4066 VRFS-4044 bugs fixed --- ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 2 +- .../javascripts/everywhere/everywhere.js | 3 +- .../JamClassScreen.js.jsx.coffee | 7 +- .../JamTrackLandingScreen.js.jsx.coffee | 2 +- .../TeacherSearchScreen.js.jsx.coffee | 65 ++++++++++++++++--- .../actions/SessionActions.js.coffee | 1 + .../stores/SessionStore.js.coffee | 6 ++ .../react-components/TeacherSearch.css.scss | 21 +++++- 8 files changed, 92 insertions(+), 15 deletions(-) diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index 44410c3e8..967f7e27f 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -1676,7 +1676,7 @@ module JamRuby @session_date = @lesson_session.slot.pretty_scheduled_start(true) email = @student.email - @subject = "Your lesson with #{@student.first_name} on JamKazam is starting soon" + @subject = "Your lesson with #{@teacher.first_name} on JamKazam is starting soon" unique_args = {:type => "send_starting_notice_student"} sendgrid_category "Notification" diff --git a/web/app/assets/javascripts/everywhere/everywhere.js b/web/app/assets/javascripts/everywhere/everywhere.js index 80c5f8ccd..234b7d105 100644 --- a/web/app/assets/javascripts/everywhere/everywhere.js +++ b/web/app/assets/javascripts/everywhere/everywhere.js @@ -265,11 +265,12 @@ "shoppingCart", "checkoutPayment", "checkoutOrder", "redeemComplete", "checkoutComplete", "teachers/setup/introduction", "teachers/setup/basics", "teachers/setup/experience", "teachers/setup/pricing", "account/profile", "account/profile/experience", "account/profile/interests", "account/profile/samples", - "jamclass"] + "jamclass", "jamclass/searchOptions", "teachers/search", "profile/teacher", "jamclass/test-drive-selection", "jamclass/book-lesson"] $(document).on(context.JK.EVENTS.SCREEN_CHANGED, function(e, data) { var show = false; + console.log("data.newScreen", data.newScreen) if (data.newScreen && activate.indexOf(data.newScreen) > -1) { show = true; } diff --git a/web/app/assets/javascripts/react-components/JamClassScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/JamClassScreen.js.jsx.coffee index d1e771d83..fff56dea6 100644 --- a/web/app/assets/javascripts/react-components/JamClassScreen.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/JamClassScreen.js.jsx.coffee @@ -2,6 +2,7 @@ context = window rest = context.JK.Rest() logger = context.JK.logger +SessionActions = context.SessionActions UserStore = context.UserStore LessonTimerStore = context.LessonTimerStore LessonTimerActions = context.LessonTimerActions @@ -81,7 +82,7 @@ LessonTimerActions = context.LessonTimerActions @cancelLesson(lesson) # @@app.layout.showDialog('cancel-lesson-dialog', {d1: lessonId}) else if data.lessonAction == 'join' - window.location.href = '/client#/session/' + lesson.music_session.id + SessionActions.enterSession(lesson.music_session.id) else if data.lessonAction == 'reschedule' @rescheduleLesson(lesson) else if data.lessonAction == 'start-5-min' @@ -337,7 +338,7 @@ LessonTimerActions = context.LessonTimerActions joinLessonNow: (lesson, e) -> e.preventDefault(); - window.location.href = '/client#/session/' + lesson.music_session.id + SessionActions.enterSession(lesson.music_session.id) render: () -> disabled = @state.updating @@ -437,7 +438,7 @@ LessonTimerActions = context.LessonTimerActions else if lessonData.times.initialWindow minutes = -lessonData.times.until.minutes - if minutes == 1 + if minutes == 1 || minutes == 0 timeStmt = `This lesson just started. join lesson now` else timeStmt = `Started {minutes} minutes ago. join lesson now` diff --git a/web/app/assets/javascripts/react-components/JamTrackLandingScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/JamTrackLandingScreen.js.jsx.coffee index ab6a75e1e..50909d46e 100644 --- a/web/app/assets/javascripts/react-components/JamTrackLandingScreen.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/JamTrackLandingScreen.js.jsx.coffee @@ -266,7 +266,7 @@ rest = context.JK.Rest() rest.legacyCreateSession(data).done((response) => newSessionId = response.id context.JK.SessionUtils.setAutoOpenJamTrack(jamTrack) # so that the session screen will pick this up - context.location = '/client#/session/' + newSessionId + context.SessionActions.enterSession(newSessionId) # Re-loading the session settings will cause the form to reset with the right stuff in it. # This is an extra xhr call, but it keeps things to a single codepath #loadSessionSettings() diff --git a/web/app/assets/javascripts/react-components/TeacherSearchScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/TeacherSearchScreen.js.jsx.coffee index 956edcd95..4a759376d 100644 --- a/web/app/assets/javascripts/react-components/TeacherSearchScreen.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/TeacherSearchScreen.js.jsx.coffee @@ -214,7 +214,7 @@ ProfileActions = @ProfileActions summary = '' if searchOptions.onlyMySchool - summary += "my school teachers only" + summary += "From My School Only" instruments = searchOptions.instruments if instruments? && instruments.length > 0 @@ -222,7 +222,9 @@ ProfileActions = @ProfileActions bit = "Instrument = #{InstrumentStore.display(instruments[0])}" else instruments.length > 1 - bit = "Instruments = #{InstrumentStore.display(instruments[0])}..." + bit = "Instruments = #{InstrumentStore.display(instruments[0])} ... " + if summary.length > 0 + summary += ', ' summary += " #{bit}" subjects = searchOptions.subjects @@ -231,7 +233,9 @@ ProfileActions = @ProfileActions bit = "Subject = #{SubjectStore.display(subjects[0])}" else subjects.length > 1 - bit = "Subjects = #{SubjectStore.display(subjects[0])}..." + bit = "Subjects = #{SubjectStore.display(subjects[0])} ... " + if summary.length > 0 + summary += ', ' summary += " #{bit}" genres = searchOptions.genres @@ -240,18 +244,61 @@ ProfileActions = @ProfileActions bit = "Genre = #{GenreStore.display(genres[0])}" else genres.length > 1 - bit = "Genres = #{GenreStore.display(genres[0])}..." + bit = "Genres = #{GenreStore.display(genres[0])} ... " + if summary.length > 0 + summary += ', ' summary += " #{bit}" languages = searchOptions.languages if languages? && languages.length > 0 if languages.length == 1 - bit = "Genre = #{LanguageStore.display(languages[0])}" + bit = "Language = #{LanguageStore.display(languages[0])}" else languages.length > 1 - bit = "Genres = #{LanguageStore.display(languages[0])}..." + bit = "Languages = #{LanguageStore.display(languages[0])} ... " + if summary.length > 0 + summary += ', ' summary += " #{bit}" + if searchOptions.teaches_beginner || searchOptions.teaches_intermediate || searchOptions.teaches_advanced + bit = "Teaches " + qualifier = '' + if searchOptions.teaches_beginner + qualifier += "Beginner" + if searchOptions.teaches_intermediate + if qualifier.length > 0 + qualifier += ", " + qualifier += "Intermediate" + if searchOptions.teaches_advanced + if qualifier.length > 0 + qualifier += ", " + qualifier += "Advanced" + if summary.length > 0 + summary += ', ' + summary += " #{bit}#{qualifier}" + + if searchOptions.student_age? + if summary.length > 0 + summary += ', ' + summary += "Student Age = #{searchOptions.student_age}" + + if searchOptions.years_teaching? + if summary.length > 0 + summary += ', ' + summary += "Years Teaching = #{searchOptions.years_teaching}" + + if searchOptions.location?.country? + if summary.length > 0 + summary += ', ' + summary += "Country = #{searchOptions.location.country}" + + if searchOptions.location?.region? + + if summary.length > 0 + summary += ', ' + summary += "Region = #{searchOptions.location.region}" + + if summary.length == 0 summary = 'all teachers' @@ -309,11 +356,13 @@ ProfileActions = @ProfileActions
JamKazam Home :  - JamClass Home :  - Teachers Search :  + JamClass Home :  + Teachers Search : + Search Results / {searchDesc} +
diff --git a/web/app/assets/javascripts/react-components/actions/SessionActions.js.coffee b/web/app/assets/javascripts/react-components/actions/SessionActions.js.coffee index 34f68923d..522bd8464 100644 --- a/web/app/assets/javascripts/react-components/actions/SessionActions.js.coffee +++ b/web/app/assets/javascripts/react-components/actions/SessionActions.js.coffee @@ -1,6 +1,7 @@ context = window @SessionActions = Reflux.createActions({ + enterSession: {} joinSession: {} leaveSession: {} mixersChanged: {} diff --git a/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee b/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee index bcb32e194..49c7d01b3 100644 --- a/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee +++ b/web/app/assets/javascripts/react-components/stores/SessionStore.js.coffee @@ -593,6 +593,12 @@ ConfigureTracksActions = @ConfigureTracksActions ) .fail(@app.ajaxError) + onEnterSession: (sessionId) -> + if !context.JK.guardAgainstBrowser(@app) + return false; + + window.location.href = '/client#/session/' + sessionId + onJoinSession: (sessionId) -> # poke ShareDialog diff --git a/web/app/assets/stylesheets/client/react-components/TeacherSearch.css.scss b/web/app/assets/stylesheets/client/react-components/TeacherSearch.css.scss index 26bcb1dd2..a2fec71e9 100644 --- a/web/app/assets/stylesheets/client/react-components/TeacherSearch.css.scss +++ b/web/app/assets/stylesheets/client/react-components/TeacherSearch.css.scss @@ -10,12 +10,14 @@ } .header { - height:20px; margin-bottom:10px; + + a { font-size:16px; text-decoration:underline; + margin-bottom:5px; } .search-results-options { font-size:16px; @@ -106,6 +108,23 @@ padding-right: 31px; margin-bottom: 20px; } + .search-description { + white-space: nowrap; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + vertical-align:middle; + } + .search-summary { + line-height:16px; + vertical-align: middle; + } + .result-text { + line-height:16px; + } + .teacher-quote { + margin-right: 5px; + } }