From 7d359c1f3ea386afd4ecdbc99701757eb5b16440 Mon Sep 17 00:00:00 2001 From: dcterman <105614148+dcterman@users.noreply.github.com> Date: Fri, 26 Aug 2022 16:08:44 -0400 Subject: [PATCH 1/2] Small wording changes to Ops Reports State explicitly that "published sessions" means that a publish has been done. Modify wording of Airmeet Magic Links and Airmeet Diffs. --- app/javascript/reports/reports_screen.vue | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/javascript/reports/reports_screen.vue b/app/javascript/reports/reports_screen.vue index 889480a16..6e0fd8daa 100644 --- a/app/javascript/reports/reports_screen.vue +++ b/app/javascript/reports/reports_screen.vue @@ -321,7 +321,7 @@

Description: Session information for daily grid, one line per session
Fields: Session title, area(s) of session, session format, session start time, session duration, session room
- Session data included: all scheduled sessions that are visible and published + Session data included: all published sessions in the most recent publish

  • @@ -338,7 +338,7 @@

    Description: Maximum number of attendees in sessions requiring signup, one line per session
    Fields: Session title, session description, session room, session start time, session duration, session format, participants, session environment, max number of attendees
    - Session data included: all published sessions
    + Session data included: all published sessions in the most recent publish

  • @@ -346,7 +346,7 @@

    Description: Session setup requirements, one line per session
    Fields: Session title, session start time, session room, session environment, session format, session area(s), required room features∕services, tech∕hotel notes, room setup
    - Session data included: all published sessions
    + Session data included: all published sessions in the most recent publish

  • @@ -362,7 +362,7 @@

    Description: Room sign data for mail merge, one line per room and day of week
    Fields: Room, day of week, sessions (title, start time, description, moderators, participants)
    - Session data included: all published sessions
    + Session data included: all published sessions in the most recent publish
    Person data included: moderators, participants

  • @@ -371,7 +371,7 @@

    Description: Table tent data for mail merge, one line per session and participant
    Fields: Session title, published name, session description, scheduled participant notes, moderators and their pronouns, participants and their pronouns
    - Session data included: published sessions with environment of "in person" or "hybrid"
    + Session data included: published sessions in the most recent publish, with environment of "in person" or "hybrid"
    Person data included: moderators, participants

    @@ -380,24 +380,25 @@

    Description: List of emails for moderators and participants of published sessions, with indicator about whether they are assigned to any session(s) of environment virtual, one line per participant
    Fields: Published name, name, whether person is assigned to a virtual session (y ∕ n), primary email, other emails
    - Session data included: all published sessions
    + Session data included: all published sessions in the most recent publish
    Person data included: moderators and participants

  • Airmeet Magic Links

    - Description: Links that get you into the program airmeet as each speaker in the system. For emergency customer service use.
    - Fields: Published name, primary email, airmeet magic link
    - Person data included: all moderators and participants on virtual panels + Description: Links to get each participant (speaker) into Airmeet, one line per person. For emergency customer service use.
    + Fields: Published name, primary email, Airmeet magic link
    + Person data included: all moderators and participants assigned to virtual sessions

  • Airmeet Diffs

    - Description: People data that has changed for airmeet people since they were last synced (manually or automatically)
    - Fields: Last sync, person last updated, airmeet email, what changed, from what, to what
    - Person data included: all moderators and participants on virtual panels who have changed since their last sync to airmeet + Description: Changes to person information since the last sync (manual or automatic) with Airmeet, one line per change
    + Fields: Time of last sync, time when person last updated, Airmeet email, what changed, from what, to what
    + Session data included: all published sessions with environment of "virtual", in the most recent publish
    + Person data included: moderators and participants assigned to published virtual sessions, whose published name, email, or bio has changed since their last sync to Airmeet

  • From 611e14b2da3fa8f945ac87b1fa7d6a58f0838aa4 Mon Sep 17 00:00:00 2001 From: Gail Terman Date: Fri, 26 Aug 2022 22:52:12 -0400 Subject: [PATCH 2/2] city/country, registered, and magic links --- app/services/airmeet_api_service.rb | 14 +++++++++----- lib/tasks/import.rake | 30 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/app/services/airmeet_api_service.rb b/app/services/airmeet_api_service.rb index 644e198b7..ea2332e46 100644 --- a/app/services/airmeet_api_service.rb +++ b/app/services/airmeet_api_service.rb @@ -76,6 +76,10 @@ def self.create_speaker(name:, email:, organisation: "", designation: "", imageU end def self.person_to_airmeet(person, dont_send = false) + if !person.registered + p "skipping #{person.primary_email.email} - they are not registered" + return + end speaker_email = person.primary_email.email country = nil city = nil @@ -103,7 +107,7 @@ def self.person_to_airmeet(person, dont_send = false) end puts result newly_created = result["status"] == "SPEAKER_CREATED" || dont_send - person.update({integrations: person.integrations.merge({airmeet: {speaker_email: speaker_email, synced: newly_created || (person.integrations["airmeet"] || {})["synced"], data: newly_created ? args : (person.integrations["airmeet"] || {})["data"], synced_at: newly_created ? Time.now.iso8601 : (person.integrations["airmeet"] || {})["synced_at"] }})}) + person.update({integrations: person.integrations.merge({airmeet: (person.integrations["airmeet"] || {}).merge({speaker_email: speaker_email, synced: newly_created || (person.integrations["airmeet"] || {})["synced"], data: newly_created ? args : (person.integrations["airmeet"] || {})["data"], synced_at: newly_created ? Time.now.iso8601 : (person.integrations["airmeet"] || {})["synced_at"] })})}) end def self.session_to_airmeet(session, dont_send = false) @@ -113,10 +117,10 @@ def self.session_to_airmeet(session, dont_send = false) sessionStartTime: session.start_time, hostEmail: room_hosts[session.room_id] }; - participants = session.published_session_assignments.filter { |sa| sa.session_assignment_role_type_id == moderator_id || sa.session_assignment_role_type_id == participant_id }.map { |sa| sa.person } + participants = session.published_session_assignments.filter { |sa| (sa.session_assignment_role_type_id == moderator_id || sa.session_assignment_role_type_id == participant_id) && sa.person.registered }.map { |sa| sa.person } if session.environment == "virtual" args[:speakerEmails] = participants.map{|p| p.integrations["airmeet"]["speaker_email"]} - args[:cohostEmails] = session.published_session_assignments.filter { |sa| sa.session_assignment_role_type_id == moderator_id }.map { |sa| sa.person.integrations["airmeet"]["speaker_email"] } + args[:cohostEmails] = session.published_session_assignments.filter { |sa| sa.session_assignment_role_type_id == moderator_id && sa.person.registered }.map { |sa| sa.person.integrations["airmeet"]["speaker_email"] } end if session.id === "e3e249ee-2800-40cc-a245-f462187833b9" args[:sessionTitle] = "Never Give Up, Never Surrender! The Art of Eric Wilkerson: Scifi Illustrator and Visual Afrofuturist" @@ -131,9 +135,9 @@ def self.session_to_airmeet(session, dont_send = false) success = result["uid"] || dont_send old_airmeet_data = session.integrations["airmeet"] || {} session.update({integrations: session.integrations.merge({airmeet: {session_id: result["uid"] || old_airmeet_data["session_id"], synced: success || old_airmeet_data["synced"] , synced_at: success ? Time.now() : old_airmeet_data["synced_at"] , data: success ? args : old_airmeet_data["data"]}})}) - if session.environment == "virtual" && !dont_send + if session.environment == "virtual" && success && !dont_send people_tokens = (result["token"] || []).inject({}) {|p,c| p[c["email"]] = c["token"]; p} - participants.each { |p| p.update({integrations: p.integrations.merge({airmeet: (p.integrations["airmeet"] || {}).merge({token: people_tokens[(p.integrations["airmeet"] || {})["speaker_email"]] || (p.integrations["airmeet"] || {})["token"]})})})} + participants.each { |p| p.update({integrations: p.integrations.merge({airmeet: (p.integrations["airmeet"] || {}).merge({token: people_tokens[(p.integrations["airmeet"] || {})["speaker_email"]] || (p.integrations["airmeet"] || {})[:token]})})})} end end diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index eb28d3210..5413ceac1 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -6,6 +6,36 @@ strip_converter = proc {|field| field ? field.strip : field} CSV::Converters[:strip] = strip_converter namespace :import do + task :airmeet_people, [:filename] => :environment do |t, args| + if !args[:filename] + p "You need to add the filename as an argument: rake import:filename[/path/to/file]" + end + + File.open(args[:filename]) do |file| + parsed_output = CSV.read(file, headers: true, header_converters: :symbol, converters: :strip) + count = 0 + parsed_output.each do |o| + email = o[:primary_email] + paid = o[:is_paid]&.downcase == "yes" + city = o[:city] + country = o[:country] + person = Person.joins(:primary_email).find_by(email_addresses: {email: email}); + if !person + p "Skipping because can't find person with email #{email}" + next + end + person.update({ + registered: paid, + integrations: person.integrations.merge({airmeet: (person.integrations["airmeet"] || {}).merge({city: city, country: country})}) + }) + p person + count += 1 + end + p "Imported #{count} users country & city, skipped #{parsed_output.length - count}" + end + end + + task :users, [:filename] => :environment do |t, args| if !args[:filename] p "You need to add the filename as an argument: rake import:users[/path/to/file]"