Reset for Testing
THIS DELETES THE SNAPSHOT AND YOU CAN'T EVER GET IT BACK
Note: this minecart isn't actually hooked up to any status yet. So while it does actually produce a snapshot, the toggle won't
@@ -42,12 +41,14 @@ import {
} from '@/constants/strings';
import { scheduleWorkflowMixin } from '@/store/schedule_workflow';
+import settingsMixin from "@/store/settings.mixin";
export default {
name: "ScheduleSettings",
mixins: [
toastMixin,
scheduleWorkflowMixin,
+ settingsMixin
],
components: {
PlanoModal
diff --git a/app/javascript/sessions/format_select_for_search.vue b/app/javascript/sessions/format_select_for_search.vue
new file mode 100644
index 000000000..5e40eddf2
--- /dev/null
+++ b/app/javascript/sessions/format_select_for_search.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/app/javascript/sessions/room_select_for_search.vue b/app/javascript/sessions/room_select_for_search.vue
new file mode 100644
index 000000000..519eb8fb0
--- /dev/null
+++ b/app/javascript/sessions/room_select_for_search.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
diff --git a/app/javascript/sessions/session.js b/app/javascript/sessions/session.js
index 120716c46..04ecb8d76 100644
--- a/app/javascript/sessions/session.js
+++ b/app/javascript/sessions/session.js
@@ -1,5 +1,7 @@
-import { SESSION_STATUS } from '@/constants/strings';
+import { SESSION_STATUS, SESSION_ENVIRONMENT } from '@/constants/strings';
import AreaSelectForSearch from './area_select_for_search'
+import FormatSelectForSearch from './format_select_for_search'
+import RoomSelectForSearch from './room_select_for_search'
export const session_columns = [
// {
@@ -35,7 +37,10 @@ export const session_columns = [
key: 'format.name',
label: 'Format',
sortKey: 'formats.name',
- sortable: true
+ sortable: true,
+ component: FormatSelectForSearch,
+ type: 'custom-component',
+ operators: ['is','is not', 'is empty','is not empty'],
},
{
key: 'start_time',
@@ -53,7 +58,14 @@ export const session_columns = [
key: 'room.name',
label: 'Room',
sortKey: 'rooms.name',
- sortable: true
+ sortable: true,
+ // type: "text"
+ component: RoomSelectForSearch,
+ type: 'custom-component',
+ operators: ['is','is not', 'is empty','is not empty'],
+ // TODO: how would we create a select drop down for room to be fetched from server????
+ // type: "select",
+ // choices: roomOptionsForSearch,
},
{
key: 'status',
@@ -61,9 +73,23 @@ export const session_columns = [
formatter: (value) => SESSION_STATUS[value] || value,
sortable: true,
sortKey: 'status',
- choices: ['draft', 'reviewed', 'revised', 'dropped'].map(value => ({label: SESSION_STATUS[value], value})),
+ choices: Object.entries(SESSION_STATUS).map(([value, label]) => ({label, value})),
type: "select"
},
+ {
+ key: 'proofed',
+ label: 'Copy Edited/Proofed',
+ type: "select",
+ choices: [{label: "Yes", value: true}, {label: "No", value: false}],
+ formatter: (value) => value ? "Yes" : "No"
+ },
+ {
+ key: 'environment',
+ label: 'Environment',
+ type: "select",
+ choices: Object.entries(SESSION_ENVIRONMENT).map(([value, label]) => ({label, value})),
+ formatter: (value) => SESSION_ENVIRONMENT[value] || value,
+ },
{
key: 'open_for_interest',
label: 'Open for Interest',
diff --git a/app/lib/migration_helpers/plano_views.rb b/app/lib/migration_helpers/plano_views.rb
index ff29ed9cd..f183a054f 100644
--- a/app/lib/migration_helpers/plano_views.rb
+++ b/app/lib/migration_helpers/plano_views.rb
@@ -48,7 +48,7 @@ def self.create_person_schedules
join
session_assignment_role_type sart on
sart.id = sa.session_assignment_role_type_id
- and sart.role_type = 'participant'
+ and sart.role_type = 'participant' AND sart.name != 'Reserve'
join
people p on
p.id = sa.person_id
@@ -325,6 +325,7 @@ def self.create_person_back_to_back_to_back
person_back_to_back psc1
inner join person_back_to_back psc2 on
psc2.session_id = psc1.conflict_session_id
+ and psc2.person_id = psc1.person_id
SQL
ActiveRecord::Base.connection.execute(query)
end
diff --git a/app/serializers/conclar/participant_serializer.rb b/app/serializers/conclar/participant_serializer.rb
new file mode 100644
index 000000000..85492d0bb
--- /dev/null
+++ b/app/serializers/conclar/participant_serializer.rb
@@ -0,0 +1,55 @@
+class Conclar::ParticipantSerializer < ActiveModel::Serializer
+ attributes :id, :bio
+
+ attribute :name do
+ object.published_name
+ end
+
+ attribute :sortname do
+ object.published_name_sort_by
+ end
+
+ attribute :prog do
+ res = []
+ moderator = SessionAssignmentRoleType.find_by(name: 'Moderator')
+ participant = SessionAssignmentRoleType.find_by(name: 'Participant')
+
+ object.session_assignments.each do |assignment|
+ next if assignment.session_assignment_role_type_id != moderator.id and assignment.session_assignment_role_type_id != participant.id
+
+ res << assignment.session_id
+ end
+
+ res
+ end
+
+ # links ????
+ # what about social media URLs?
+ # tags - not supported yet
+end
+
+# All participants on the schedule ...
+# var people = [
+# {
+# "id": "4567",
+# "name": [ "Friend Andhis Jr." ],
+# "sortname" : "Andhis Jr., Friend",
+# "tags": [],
+# "prog": [ "1234", "614", "801" ],
+# "links": [],
+# "bio": "Prior art for Adams's satirical point – that humans attach such importance to their automobiles that a visiting extraterrestrial might reasonably mistake them for the planet's dominant life form – can be found in a widely reprinted article from The Rockefeller Institute Review titled Life on Earth (by a Martian) by Paul Weiss. The idea was also expounded by Carl Sagan, though this may have postdated Adams's creation of the character of Ford. The 1967 Oscar-nominated animated film What on Earth! from the National Film Board of Canada is also based on this premise."
+# },
+# {
+# "id": "1234",
+# "name": [ "Galahad", "", "Sir" ],
+# "sortname": "Sir Galahad",
+# "tags": [ "GoH" ],
+# "prog": [ "416" ],
+# "links": {
+# "img": "/images/galahad.jpg",
+# "photo": "/images/galahad.jpg",
+# "img_256_url": "/images/galahad.jpg",
+# "url": "http://en.wikipedia.org/wiki/Galahad"
+# },
+# "bio": "Sir Galahad (/ˈɡæləhæd/; Middle Welsh: Gwalchavad, sometimes referred to as Galeas /ɡəˈliːəs/ or Galath /ˈɡæləθ/), in Arthurian legend, is a knight of King Arthur's Round Table and one of the three achievers of the Holy Grail."
+# },
diff --git a/app/serializers/conclar/session_serializer.rb b/app/serializers/conclar/session_serializer.rb
new file mode 100644
index 000000000..5189ff8b9
--- /dev/null
+++ b/app/serializers/conclar/session_serializer.rb
@@ -0,0 +1,60 @@
+class Conclar::SessionSerializer < ActiveModel::Serializer
+ attributes :id, :title
+
+ attribute :desc do
+ object.description
+ end
+
+ attribute :datetime do
+ object.start_time
+ end
+
+ # TODO: change for when we do have tags
+ attribute :tags do
+ res = []
+
+ # TODO: optimize
+ res.concat object.areas.collect(&:name)
+
+ res.concat [object.age_restriction.name] if object.age_restriction
+ res.concat [object.environment] if object.environment != 'unknown'
+
+ if object.minors_participation && object.minors_participation.class == Array
+ res.concat object.minors_participation
+ end
+
+ res
+ end
+
+ attribute :mins do
+ object.duration
+ end
+
+ attribute :loc do
+ # [ "Some Room", "Some Area" ],
+ if object.room
+ [object.room.name, object.room.venue.name]
+ else
+ []
+ end
+ end
+
+ attribute :people do
+ moderator = SessionAssignmentRoleType.find_by(name: 'Moderator')
+ invisible = SessionAssignmentRoleType.find_by(name: 'Invisible')
+ parts = []
+ object.participant_assignments.each do |assignment|
+ next if assignment.session_assignment_role_type_id == invisible.id
+
+ p = {
+ id: assignment.person.id,
+ name: assignment.person.published_name
+ # role: nil
+ }
+ p['role'] = 'moderator' if assignment.session_assignment_role_type_id == moderator.id
+ parts << p
+ end
+
+ parts
+ end
+end
diff --git a/app/services/reports_service.rb b/app/services/reports_service.rb
index 8ad900bb8..14b2ad268 100644
--- a/app/services/reports_service.rb
+++ b/app/services/reports_service.rb
@@ -106,6 +106,34 @@ def self.scheduled_session_no_people
# .order(:start_time)
end
+ # Get all the schedule sessions
+ def self.scheduled_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' and status != 'draft'")
+ .order(:start_time)
+ end
+
+ def self.scheduled_people
+ moderator = SessionAssignmentRoleType.find_by(name: 'Moderator')
+ participant = SessionAssignmentRoleType.find_by(name: 'Participant')
+
+ people = Person.includes(
+ {session_assignments: [:session, :session_assignment_role_type]}
+ ).references(
+ {session_assignments: :session}
+ )
+ .where("session_assignments.session_assignment_role_type_id in (?)", [moderator.id, participant.id])
+ .where("sessions.start_time is not null and sessions.room_id is not null")
+ .where("sessions.status != 'dropped' and sessions.status != 'draft'")
+ .where("people.con_state not in (?)", ['declined', 'rejected']) #.distinct
+ .order("people.published_name")
+ end
def self.sessions_with_no_moderator
sched_table = PersonSchedule.arel_table
diff --git a/config/routes.rb b/config/routes.rb
index 836027960..b03ae03f4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -20,6 +20,9 @@
get '/settings', to: 'settings#index'
+ get '/conclar/schedule', to: 'schedule#index'
+ get '/conclar/participants', to: 'schedule#participants'
+
# REST based resources
get 'person/session/me', to: 'people#me'
get 'person/me', to: 'people#me'
diff --git a/db/migrate/20220723213605_fix_proofed_col.rb b/db/migrate/20220723213605_fix_proofed_col.rb
new file mode 100644
index 000000000..a088e3210
--- /dev/null
+++ b/db/migrate/20220723213605_fix_proofed_col.rb
@@ -0,0 +1,7 @@
+class FixProofedCol < ActiveRecord::Migration[6.1]
+ def change
+ # proofed boolean col needs to default to false
+ change_column_null :sessions, :proofed, false, false
+ change_column :sessions, :proofed, :boolean, default: false, null: false
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 6ca2c6e23..ce7c5342e 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -690,7 +690,7 @@ CREATE TABLE public.sessions (
updated_by character varying,
interest_opened_by character varying,
interest_opened_at timestamp without time zone,
- proofed boolean,
+ proofed boolean DEFAULT false NOT NULL,
status public.session_status_enum DEFAULT 'draft'::public.session_status_enum,
environment public.session_environments_enum DEFAULT 'unknown'::public.session_environments_enum,
tech_notes text,
@@ -1123,7 +1123,7 @@ CREATE VIEW public.person_schedules AS
sessions.description,
sessions.environment
FROM (((public.session_assignments sa
- JOIN public.session_assignment_role_type sart ON (((sart.id = sa.session_assignment_role_type_id) AND (sart.role_type = 'participant'::public.assignment_role_enum))))
+ JOIN public.session_assignment_role_type sart ON (((sart.id = sa.session_assignment_role_type_id) AND (sart.role_type = 'participant'::public.assignment_role_enum) AND ((sart.name)::text <> 'Reserve'::text))))
JOIN public.people p ON ((p.id = sa.person_id)))
LEFT JOIN public.sessions ON ((sessions.id = sa.session_id)))
WHERE ((sa.session_assignment_role_type_id IS NOT NULL) AND (sessions.room_id IS NOT NULL) AND (sessions.start_time IS NOT NULL) AND ((sa.state)::text <> 'rejected'::text));
@@ -3333,6 +3333,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220713185329'),
('20220714124643'),
('20220714124706'),
-('20220719000644');
+('20220719000644'),
+('20220723213605');