From f9442bd07dd94e0e5c5000cb8283a64211b5db04 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 20:01:47 +0100 Subject: [PATCH 1/6] Only replace selected schedule if there is none We have introduced this task a long time ago without any release. In the meantime there might be people who have deployed, hence have selected schedules already. Happened to openSUSE. --- lib/tasks/several_schedules.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/several_schedules.rake b/lib/tasks/several_schedules.rake index 759951f7..9c58942e 100644 --- a/lib/tasks/several_schedules.rake +++ b/lib/tasks/several_schedules.rake @@ -6,8 +6,8 @@ namespace :data do task move_events_attributes: :environment do Program.all.each do |program| schedule = Schedule.create(program: program) - program.selected_schedule = schedule - program.save + program.selected_schedule = schedule unless program.selected_schedule + program.save! program.events.each do |event| unless event.start_time.nil? && event.room_id.nil? # we can not use .room as this relation has been removed From 4ef067328e52eab099cb1bb986d6df0bc5c4bfdf Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 20:12:05 +0100 Subject: [PATCH 2/6] Add a CHANGES.md To document changes for users --- CHANGES.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CHANGES.md diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 00000000..a5aa8339 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,49 @@ +# Changes in OSEM 2.0 + +Not release yet... + +## Update from 1.0 + +### Multiple Schedules +A conference can have multiple schedules now so it's easier for organizers to +test schedules and collaborate on different versions. + +For this some of the existing data needs to be changed. If you update +from 1.0 please run this rake task to move your old schedules to the +new system. + +``` +bundle exec rake data:move_events_attributes RAILS_ENV=production +``` + +### Dropped visit/campaign tracking +We have dropped the feature to track visits and campaigns (utm parameters) +inside OSEM. We recommend you use [matomo](https://matomo.org/) for things +like that. Before you update to OSEM 1.1 you should drop all the data we +have collected. + +``` +bundle exec rake data:drop_all_ahoy_events RAILS_ENV=production +``` + +# Changes in OSEM 1.0 + +[Released May 24, 2016](https://osem.io/1.0) + +Our first release after developing and using this app in production for +many years. Too many changes to list, see the release announcement to +learn what OSEM is about. + +https://osem.io/1.0 + +## Update from master + +### Configuration through the environment +If you have deployed OSEM from master before there is one thing you need to do +manually. OSEM is now configured through environment variables and not through +the config/options.yml anymore. There is a rake task to migrate your existing +data to a .env file that OSEM will use: + +``` +bundle exec rake data:migrate:config2dotenv RAILS_ENV=production +``` From b57c771d3e760e9db8b58cb3f98152c315501cf1 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 21:00:38 +0100 Subject: [PATCH 3/6] Allow viewing the schedule/events in ichain mode This abilit is not specific to one mode. --- app/models/ability.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 23eba7a7..4ae77007 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -31,6 +31,10 @@ class Ability event.state == 'confirmed' end + can [:show, :events], Schedule do |schedule| + schedule.program.schedule_public + end + # can view Commercials of confirmed Events can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id) can [:show, :create], User @@ -52,10 +56,6 @@ class Ability event.program.cfp_open? && event.new_record? end - can [:show, :events], Schedule do |schedule| - schedule.program.schedule_public - end - can [:index, :show], Survey, surveyable_type: 'Conference' end end From 1a1da83bf2a4f0b4e82c389271f40dcbad889598 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 21:17:52 +0100 Subject: [PATCH 4/6] Document the ichain specific ability --- app/models/ability.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 4ae77007..47d68705 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -38,7 +38,14 @@ class Ability # can view Commercials of confirmed Events can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id) can [:show, :create], User - unless ENV['OSEM_ICHAIN_ENABLED'] == 'true' + + # Things that are possible without ichain enabled that are **not*+ possible with ichain mode enabled. + if ENV['OSEM_ICHAIN_ENABLED'] != 'true' + # There is no reliable way for this workflow (enable not logged in users to fill out a form, then telling + # them to sign up once they submit) in ichain. So enable it only without ichain. + + # FIXME: The following abilities need to be checked. Are they about the type of workflow mentioned above? Or are + # they just here because they worked in development mode (without ichain). We are suspicious that it's the latter! can :show, Registration do |registration| registration.new_record? end From 455fc0a270950c0fc120c80ca9d46028e42fca79 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 21:23:14 +0100 Subject: [PATCH 5/6] Make it possible to view Surveys in ichain mode This is not ichain specific. --- app/models/ability.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 47d68705..85fe9cf8 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -39,6 +39,8 @@ class Ability can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id) can [:show, :create], User + can [:index, :show], Survey, surveyable_type: 'Conference' + # Things that are possible without ichain enabled that are **not*+ possible with ichain mode enabled. if ENV['OSEM_ICHAIN_ENABLED'] != 'true' # There is no reliable way for this workflow (enable not logged in users to fill out a form, then telling @@ -62,8 +64,6 @@ class Ability can [:new, :create], Event do |event| event.program.cfp_open? && event.new_record? end - - can [:index, :show], Survey, surveyable_type: 'Conference' end end From ad56b4bb787a0772d11bffc095c9dd8018418950 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 5 Mar 2019 23:28:57 +0100 Subject: [PATCH 6/6] Document/fix conference versions view --- CHANGES.md | 9 +++++++++ app/views/admin/versions/_object_desc_and_link.html.haml | 4 ++-- lib/tasks/version.rake | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a5aa8339..309aabb0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,15 @@ have collected. bundle exec rake data:drop_all_ahoy_events RAILS_ENV=production ``` +### Conference wide revision history +There is now a conference wide revision history that will show organizers +everything that is happening. To be able to do this we need to change old +data. + +``` +bundle exec rake data:set_conference_in_versions RAILS_ENV=production +``` + # Changes in OSEM 1.0 [Released May 24, 2016](https://osem.io/1.0) diff --git a/app/views/admin/versions/_object_desc_and_link.html.haml b/app/views/admin/versions/_object_desc_and_link.html.haml index bd06c92a..5f81f29e 100644 --- a/app/views/admin/versions/_object_desc_and_link.html.haml +++ b/app/views/admin/versions/_object_desc_and_link.html.haml @@ -79,8 +79,8 @@ = link_to (current_or_last_object_state('Event', object.event_id).try(:title) || 'deleted'), admin_conference_program_event_path(conference_short_title, object.event_id) in - = link_to "Schedule #{event_schedule.schedule_id}", - admin_conference_schedule_path(conference_short_title, event_schedule.schedule_id) + = link_to "Schedule #{version.item.schedule_id}", + admin_conference_schedule_path(conference_short_title, version.item.schedule_id) - when 'Schedule' = link_if_alive version, "Schedule #{version.item_id}", diff --git a/lib/tasks/version.rake b/lib/tasks/version.rake index 08a0b2ec..0827e6a5 100644 --- a/lib/tasks/version.rake +++ b/lib/tasks/version.rake @@ -10,8 +10,12 @@ namespace :data do version.update_attributes(conference_id: version.item_id) elsif version.item_type == 'Event' - event = (version.item || version.reify || version.next.reify) - + event = version.item + unless event || Event.find_by(id: version.item_id) + puts 'Not updating versions of deleted event...' + next + end + event ||= (version.reify || version.next.reify) conference_id = if event.try(:program) event.program.conference_id # Event had attribute conference_id before it was replaced with program_id