diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 203c281a2..5469175a7 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -438,7 +438,8 @@ def participant_availabilities person.published_name, person.con_state, person.attendance_type, - person.availabilities.order('start_time').collect{|av| "#{av.start_time} to #{av.end_time}" }.join(";\n"), + # TODO: format time .... + person.availabilities.order('start_time').collect{|av| "#{av.start_time.strftime('%Y-%m-%d %H:%M %Z')} to #{av.end_time.strftime('%Y-%m-%d %H:%M %Z')}" }.join(";\n"), person.session_limits.order('day').collect{|l| "#{l.day ? l.day : 'Global'}: #{l.max_sessions}" }.join(";\n"), person.exclusions.collect{|e| "#{e.title}"}.join(";\n"), person.availability_notes diff --git a/app/controllers/schedule_controller.rb b/app/controllers/schedule_controller.rb new file mode 100644 index 000000000..02d7fd031 --- /dev/null +++ b/app/controllers/schedule_controller.rb @@ -0,0 +1,24 @@ +# Produce a schedule suitable for Conclar +class ScheduleController < ApplicationController + skip_before_action :check_up, :authenticate_person!, only: [:index, :participants] + + def index + sessions = ReportsService.scheduled_sessions + + render json: ActiveModel::Serializer::CollectionSerializer.new( + sessions, + serializer: Conclar::SessionSerializer + ), + content_type: 'application/json' + end + + def participants + participants = ReportsService.scheduled_people + + render json: ActiveModel::Serializer::CollectionSerializer.new( + participants, + serializer: Conclar::ParticipantSerializer + ), + content_type: 'application/json' + end +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index ee162f40f..a586dc93c 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -143,7 +143,8 @@ def before_update # if time or room have changed removed ignored conflicts p = _permitted_params(model: object_name, instance: @object) if (@object.start_time || @object.room_id) - if p[:start_time] != @object.start_time || p[:room_id] != @object.room_id + if (p.has_key?(:start_time) && p[:start_time] != @object.start_time) || + (p.has_key?(:room_id) && p[:room_id] != @object.room_id) # so we remove any ignore conflicts for this session cids = @object.ignored_session_conflicts.pluck(:conflict_id) cids += @object.ignored_conflict_sessions.pluck(:conflict_id) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index a5d35e76c..2abf311b3 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -27,6 +27,8 @@ def index end settings = { + # + env: Rails.env, # 1. model information enums: enums, # 2. con wide role types for assignments diff --git a/app/javascript/constants/strings.js b/app/javascript/constants/strings.js index c64b68cc5..b6455e482 100644 --- a/app/javascript/constants/strings.js +++ b/app/javascript/constants/strings.js @@ -241,6 +241,18 @@ module.exports = { }, PERSON_SAVE_SUCCESS: "Profile record saved successfully", PERSON_NEVER_LOGGED_IN: "Never logged in", + PERSON_CON_STATE: { + not_set: "Not Set", + applied: "Applied", + vetted: "Vetted", + wait_list: "Wait List", + invite_pending: "Invite Pending", + invited: "Invited", + probable: "Probable", + accepted: "Accepted", + declined: "Declined", + rejected: "Rejected" + }, SURVEY_REDIRECT: "Unfortunately due to the browser refreshing we have lost any answers you filled in. Please fill the survey out again.", SURVEY_PUBLIC_NO_EDIT: "You cannot edit a published survey. Close the survey to enable editing.", @@ -269,7 +281,7 @@ module.exports = { SCHEDULE_DRAFT_CONFIRM_MESSAGE: "This will publish a Draft Schedule to all participants, who will see their own sessions. This action is irreversible and will bring the server down for a short time. Please double check that you wish to perform this action.", SCHEDULE_FIRM_CONFIRM_MESSAGE: "This will publish a Firm Schedule to all participants, who will see their own sessions - live. This action is irreversible. Please double check that you wish to perform this action.", SCHEDULE_DRAFT_SUCCESS_MESSAGE: "Draft schedule has been published successfully", - SCHEDULE_FIRM_SUCCESS_MESSAGE: "Firm schedule has been published successfully", + SCHEDULE_FIRM_SUCCESS_MESSAGE: "Firm schedule has been published successfully", SCHEDULE_APPROVAL_FAIL_TO_LOAD: "Couldn't load the approval form. Try again soon.", // The below is intended to become a way to override defaults in the model mixin easily. Hasn't happened yet though. SPECIFIC_MODEL_SAVE_SUCCESS: { diff --git a/app/javascript/people/people.js b/app/javascript/people/people.js index 168c8adef..ddd8928ae 100644 --- a/app/javascript/people/people.js +++ b/app/javascript/people/people.js @@ -1,3 +1,4 @@ +import {PERSON_CON_STATE, SESSION_STATUS} from "@/constants/strings"; import { personScheduleApprovalStateOptionsForSearch } from "@/store/person_schedule_approval"; export const people_columns = [ @@ -34,19 +35,11 @@ export const people_columns = [ search_key: 'con_state', label: 'Status', type: "select", - // TODO: needs to be driven by settings enums + formatter: (value) => PERSON_CON_STATE[value] || value, choices: [ - {label: "not_set", value: "not_set"}, - {label: "applied", value: "applied"}, - {label: "vetted", value: "vetted"}, - {label: "wait_list", value: "wait_list"}, - {label: "invite_pending", value: "invite_pending"}, - {label: "invited", value: "invited"}, - {label: "probable", value: "probable"}, - {label: "accepted", value: "accepted"}, - {label: "declined", value: "declined"}, - {label: "rejected", value: "rejected"} - ], + "not_set", "applied", "vetted", "wait_list", "invite_pending", + "invited", "probable", "accepted", "declined", "rejected" + ].map(value => ({label: PERSON_CON_STATE[value], value})), operators: ["equal", "does not equal"], sortable: false }, diff --git a/app/javascript/people/people_admin_tab.vue b/app/javascript/people/people_admin_tab.vue index a1ef304ec..31f519b03 100644 --- a/app/javascript/people/people_admin_tab.vue +++ b/app/javascript/people/people_admin_tab.vue @@ -1,18 +1,20 @@ @@ -20,6 +22,7 @@ import { makeSelectedFieldMixin } from '@/mixins' import { modelMixinNoProp } from '@/store/model.mixin'; import { personModel as model } from '@/store/person.store'; +import { PERSON_CON_STATE } from '@/constants/strings'; const commentsMixin = makeSelectedFieldMixin('comments'); export default { @@ -29,8 +32,14 @@ export default { commentsMixin ], data: () => ({ - model - }) + model, + PERSON_CON_STATE + }), + computed: { + conventionClasses() { + return (Object.values(this.selected.convention_roles) || []).map(r => r.role[0].toUpperCase() + r.role.substring(1)).join(', ') + } + } } diff --git a/app/javascript/people/people_table.vue b/app/javascript/people/people_table.vue index af6eb31f4..e3de1cb8e 100644 --- a/app/javascript/people/people_table.vue +++ b/app/javascript/people/people_table.vue @@ -98,11 +98,9 @@