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/app/controllers/publications_controller.rb b/app/controllers/publications_controller.rb index 4de160891..b16e5e419 100644 --- a/app/controllers/publications_controller.rb +++ b/app/controllers/publications_controller.rb @@ -10,7 +10,6 @@ def schedule end send_data XmlFormatter.new(sessions).render('schedule', sessions) - .gsub(/'/, '’') .gsub(/<em>/, '') .gsub(/<\/em>/, '') .gsub(/\<\?xml version="1\.0"\?\>\n/, '') 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/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
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 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 diff --git a/config/routes.rb b/config/routes.rb index 15f70ee48..a9ec66af6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -92,6 +92,7 @@ get 'report/program_ops_reports/back_of_badge', to: 'reports/program_ops_reports#back_of_badge' 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]