From d5999c05765cf7037f137d637c1e7b335aa83a72 Mon Sep 17 00:00:00 2001 From: Matt Arnold Date: Wed, 10 Aug 2022 22:17:10 -0400 Subject: [PATCH 1/5] Restore apostrophes --- app/controllers/publications_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/publications_controller.rb b/app/controllers/publications_controller.rb index 0e3439622..d4ba3509b 100644 --- a/app/controllers/publications_controller.rb +++ b/app/controllers/publications_controller.rb @@ -5,7 +5,6 @@ def schedule sessions = SessionService.live_sessions send_data XmlFormatter.new(sessions).render('schedule', sessions) - .gsub(/'/, '’') .gsub(/<em>/, '') .gsub(/<\/em>/, '') .gsub(/\<\?xml version="1\.0"\?\>\n/, '') From fa026852794e86004ac930500114db9d04cf6505 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 11 Aug 2022 08:51:17 -0400 Subject: [PATCH 2/5] Prep for when integrations are added to models --- app/models/person.rb | 2 +- app/models/published_session.rb | 2 +- app/models/published_session_assignment.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index f4ecebf34..5ce603be9 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -13,7 +13,7 @@ class Person < ApplicationRecord # acts_as_taggable acts_as_taggable_on :tags - has_paper_trail versions: { class_name: 'Audit::PersonVersion' }, ignore: [:updated_at, :created_at, :lock_version] + has_paper_trail versions: { class_name: 'Audit::PersonVersion' }, ignore: [:updated_at, :created_at, :lock_version, :integrations] before_destroy :check_if_assigned before_save :check_primary_email diff --git a/app/models/published_session.rb b/app/models/published_session.rb index 1b9d81cc7..10b3ab459 100644 --- a/app/models/published_session.rb +++ b/app/models/published_session.rb @@ -5,7 +5,7 @@ class PublishedSession < ApplicationRecord self.primary_key = :session_id has_paper_trail versions: { class_name: 'Audit::PublishedSessionVersion' }, - ignore: [:updated_at, :created_at, :lock_version], + ignore: [:updated_at, :created_at, :lock_version, :integrations], limit: nil belongs_to :format diff --git a/app/models/published_session_assignment.rb b/app/models/published_session_assignment.rb index d764f01d4..234e08788 100644 --- a/app/models/published_session_assignment.rb +++ b/app/models/published_session_assignment.rb @@ -2,7 +2,7 @@ class PublishedSessionAssignment < ApplicationRecord self.primary_key = :session_assignment_id has_paper_trail versions: { class_name: 'Audit::PublishedSessionVersion' }, - ignore: [:updated_at, :created_at, :lock_version, :sort_order], + ignore: [:updated_at, :created_at, :lock_version, :sort_order, :integrations], limit: nil include RankedModel From 14673711db42200771c99c6ad9832420a653a71c Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 11 Aug 2022 08:56:19 -0400 Subject: [PATCH 3/5] PLAN-682 pub reset endpoint --- app/controllers/publication_dates_controller.rb | 9 +++++++++ config/routes.rb | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/publication_dates_controller.rb b/app/controllers/publication_dates_controller.rb index 933f9f04b..8aeb709a7 100644 --- a/app/controllers/publication_dates_controller.rb +++ b/app/controllers/publication_dates_controller.rb @@ -5,6 +5,15 @@ class PublicationDatesController < ResourceController DEFAULT_SORTBY = 'timestamp' DEFAULT_ORDER = 'desc'.freeze + def reset + PublishedSession.destroy_all + PublishSnapshot.delete_all + PublicationDate.delete_all + PublicationStatus.delete_all + + Audit::PublishedSessionVersion.delete_all + end + def paginate false end diff --git a/config/routes.rb b/config/routes.rb index 6c2e038f8..489540fe5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,7 +70,7 @@ get 'report/session_reports/session_with_no_moderator', to: 'reports/session_reports#session_with_no_moderator' get 'report/session_reports/assigned_sessions_not_scheduled', to: 'reports/session_reports#assigned_sessions_not_scheduled' get 'report/session_reports/session_copy_edit_status', to: 'reports/session_reports#session_copy_edit_status' - get 'report/session_reports/daily_grid', to: 'reports/session_reports#daily_grid' + get 'report/session_reports/daily_grid', to: 'reports/session_reports#daily_grid' get 'report/session_reports/scheduled_session_no_people', to: 'reports/session_reports#scheduled_session_no_people' get 'report/session_reports/non_accepted_on_schedule', to: 'reports/session_reports#non_accepted_on_schedule' get 'report/session_reports/participants_over_session_limits', to: 'reports/session_reports#participants_over_session_limits' @@ -89,6 +89,7 @@ get 'report/people_reports/moderators', to: 'reports/people_reports#moderators' get 'report/schedule_reports/schedule_diff(/:from)(/:to)', to: 'reports/schedule_reports#schedule_diff' + get 'publication_date/reset', to: 'publication_dates#reset' resources :publication_dates, path: 'publication_date', only: [:index] resources :availabilities, path: 'availability', except: [:index] From 98b902ba6d3f87a42e45628287d393c2622b1e35 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 11 Aug 2022 12:38:30 -0400 Subject: [PATCH 4/5] signups should use audience size --- app/javascript/sessions/session_edit.vue | 4 ++-- app/javascript/sessions/session_sidebar.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/sessions/session_edit.vue b/app/javascript/sessions/session_edit.vue index a77334078..498e747aa 100644 --- a/app/javascript/sessions/session_edit.vue +++ b/app/javascript/sessions/session_edit.vue @@ -71,7 +71,7 @@ v-model="session.environment" @change="saveSession()" v-if="currentSettings && currentSettings.enums" - > + > {{SESSION_ENVIRONMENT[env]}} @@ -104,7 +104,7 @@ type="number" class="ml-1" :disabled="!session.require_signup" - v-model="session.maximum_people" + v-model="session.audience_size" @blur="saveValidatedSession(validationCtx)" :state="getValidationState(validationCtx)" > diff --git a/app/javascript/sessions/session_sidebar.vue b/app/javascript/sessions/session_sidebar.vue index ca8f1df31..3b89720ff 100644 --- a/app/javascript/sessions/session_sidebar.vue +++ b/app/javascript/sessions/session_sidebar.vue @@ -101,8 +101,8 @@
Attendee Signup Required
{{selected.require_signup ? 'Yes' : 'No'}}
If "Yes", max openings
-
{{selected.maximum_people}}
-
None Set
+
{{selected.audience_size}}
+
None Set
Attendee Age Restrictions
{{ ageRestrictionName(selected.age_restriction_id)}}
None
From 471bc0901206b3b98c44a90605dae42b9c0603f7 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 11 Aug 2022 13:56:27 -0400 Subject: [PATCH 5/5] fix so that draft sessions included in reports --- .../reports/people_reports_controller.rb | 2 +- .../reports/session_reports_controller.rb | 2 +- app/services/session_service.rb | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/controllers/reports/people_reports_controller.rb b/app/controllers/reports/people_reports_controller.rb index ab647654c..8a57da9fa 100644 --- a/app/controllers/reports/people_reports_controller.rb +++ b/app/controllers/reports/people_reports_controller.rb @@ -4,7 +4,7 @@ class Reports::PeopleReportsController < ApplicationController def moderators authorize Person, policy_class: ReportPolicy - people = SessionService.live_moderators + people = SessionService.draft_moderators workbook = FastExcel.open(constant_memory: true) worksheet = workbook.add_worksheet("Moderators and Sessions") diff --git a/app/controllers/reports/session_reports_controller.rb b/app/controllers/reports/session_reports_controller.rb index 9d35c3a2b..771a32aca 100644 --- a/app/controllers/reports/session_reports_controller.rb +++ b/app/controllers/reports/session_reports_controller.rb @@ -4,7 +4,7 @@ class Reports::SessionReportsController < ApplicationController def streamed_and_recorded authorize SessionAssignment, policy_class: Reports::SessionReportPolicy - sessions = SessionService.live_sessions + sessions = SessionService.draft_sessions workbook = FastExcel.open(constant_memory: true) worksheet = workbook.add_worksheet("Sessions streamed and recorded") diff --git a/app/services/session_service.rb b/app/services/session_service.rb index 88a798b49..5951878e7 100644 --- a/app/services/session_service.rb +++ b/app/services/session_service.rb @@ -104,6 +104,18 @@ def self.published_sessions .order(:start_time) end + def self.draft_sessions + Session.select( + ::Session.arel_table[Arel.star], + 'areas_list.area_list' + ) + .includes(:format, :room, {participant_assignments: :person}) + .joins(self.area_subquery) + .where("start_time is not null and room_id is not null") + .where("status != 'dropped'") + .order(:start_time) + end + def self.live_sessions Session.select( ::Session.arel_table[Arel.star], @@ -147,7 +159,7 @@ def self.live_people .order("people.published_name") end - def self.live_moderators + def self.draft_moderators moderator = SessionAssignmentRoleType.find_by(name: 'Moderator') people = Person.includes( @@ -157,7 +169,7 @@ def self.live_moderators ) .where("session_assignments.session_assignment_role_type_id in (?)", [moderator.id]) .where("sessions.start_time is not null and sessions.room_id is not null") - .where("sessions.status != 'dropped' and sessions.status != 'draft'") + .where("sessions.status != 'dropped'") .where("people.con_state not in (?)", ['declined', 'rejected']) #.distinct .order("people.published_name") end