spina-admin-conferences-fork 2.1.1 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -57
  3. data/app/assets/config/spina_admin_conferences_manifest.js +3 -3
  4. data/app/assets/javascripts/spina/admin/conferences/application.js +0 -4
  5. data/app/assets/javascripts/{controllers/spina/admin/conferences → spina/admin/conferences/controllers}/select_options_controller.js +1 -1
  6. data/app/assets/stylesheets/spina/admin/conferences/application.tailwind.css +0 -0
  7. data/app/components/spina/admin/conferences/application_component.rb +11 -0
  8. data/app/components/spina/admin/conferences/form_group_component.html.haml +4 -0
  9. data/app/components/spina/admin/conferences/form_group_component.rb +17 -0
  10. data/app/controllers/spina/admin/conferences/application_controller.rb +8 -1
  11. data/app/controllers/spina/admin/conferences/conferences_controller.rb +13 -25
  12. data/app/controllers/spina/admin/conferences/delegates_controller.rb +12 -24
  13. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +12 -24
  14. data/app/controllers/spina/admin/conferences/institutions_controller.rb +12 -24
  15. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +12 -24
  16. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +12 -26
  17. data/app/controllers/spina/admin/conferences/presentations_controller.rb +12 -24
  18. data/app/controllers/spina/admin/conferences/rooms_controller.rb +12 -26
  19. data/app/controllers/spina/admin/conferences/sessions_controller.rb +12 -26
  20. data/app/jobs/spina/admin/conferences/import_job.rb +2 -2
  21. data/app/models/spina/admin/conferences/conference.rb +1 -1
  22. data/app/models/spina/admin/conferences/delegate.rb +3 -3
  23. data/app/models/spina/admin/conferences/presentation.rb +1 -1
  24. data/app/views/spina/admin/conferences/application/_conferences.html.haml +10 -11
  25. data/app/views/spina/admin/conferences/application/_delegates.html.haml +9 -10
  26. data/app/views/spina/admin/conferences/application/_dietary_requirements.html.haml +7 -8
  27. data/app/views/spina/admin/conferences/application/_empty_list.html.haml +1 -1
  28. data/app/views/spina/admin/conferences/application/_institutions.html.haml +8 -9
  29. data/app/views/spina/admin/conferences/application/_presentation_attachment_types.html.haml +8 -9
  30. data/app/views/spina/admin/conferences/application/_presentation_types.html.haml +9 -10
  31. data/app/views/spina/admin/conferences/application/_presentations.html.haml +9 -10
  32. data/app/views/spina/admin/conferences/application/_rooms.html.haml +9 -10
  33. data/app/views/spina/admin/conferences/application/_sessions.html.haml +9 -10
  34. data/app/views/spina/admin/conferences/conferences/_conference.html.haml +13 -9
  35. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +18 -25
  36. data/app/views/spina/admin/conferences/conferences/_form.html.haml +24 -22
  37. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +29 -22
  38. data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +1 -0
  39. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +6 -7
  40. data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +1 -0
  41. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +1 -0
  42. data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +1 -0
  43. data/app/views/spina/admin/conferences/conferences/index.html.haml +25 -5
  44. data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +10 -12
  45. data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -19
  46. data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +1 -0
  47. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +24 -53
  48. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +1 -0
  49. data/app/views/spina/admin/conferences/delegates/index.html.haml +17 -11
  50. data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +7 -6
  51. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -18
  52. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +1 -0
  53. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +4 -8
  54. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +9 -5
  55. data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -19
  56. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +1 -0
  57. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +25 -25
  58. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +1 -0
  59. data/app/views/spina/admin/conferences/institutions/_institution.html.haml +9 -7
  60. data/app/views/spina/admin/conferences/institutions/index.html.haml +22 -5
  61. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +17 -20
  62. data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +7 -6
  63. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +9 -5
  64. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -19
  65. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +8 -16
  66. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +1 -0
  67. data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +1 -0
  68. data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +11 -8
  69. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +25 -5
  70. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +10 -16
  71. data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -18
  72. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +56 -55
  73. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +1 -0
  74. data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +10 -8
  75. data/app/views/spina/admin/conferences/presentations/index.html.haml +18 -11
  76. data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -18
  77. data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +1 -0
  78. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +8 -16
  79. data/app/views/spina/admin/conferences/rooms/_room.html.haml +11 -8
  80. data/app/views/spina/admin/conferences/rooms/index.html.haml +22 -5
  81. data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -18
  82. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +1 -0
  83. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +14 -19
  84. data/app/views/spina/admin/conferences/sessions/_session.html.haml +11 -8
  85. data/app/views/spina/admin/conferences/sessions/index.html.haml +25 -5
  86. data/app/views/spina/admin/hooks/conferences/_head.html.haml +0 -6
  87. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +25 -19
  88. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +0 -6
  89. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -2
  90. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +2 -2
  91. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -2
  92. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +2 -2
  93. data/config/locales/en.yml +31 -40
  94. data/config/routes.rb +1 -4
  95. data/db/migrate/20180907141242_add_type_to_spina_pages.rb +1 -1
  96. data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +1 -1
  97. data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +1 -1
  98. data/db/migrate/20190408131354_change_spina_resources.rb +10 -10
  99. data/db/migrate/20190701174807_remove_spina_conference_pages.rb +15 -15
  100. data/db/migrate/20190704135524_add_constraints_to_columns.rb +1 -1
  101. data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +1 -1
  102. data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +1 -1
  103. data/db/migrate/20200911161739_move_conference_parts.rb +3 -3
  104. data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +1 -1
  105. data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +2 -2
  106. data/db/migrate/20210315164411_convert_partables_to_json.rb +10 -18
  107. data/db/migrate/20210417102513_add_locale_to_action_text_rich_texts.rb +1 -1
  108. data/lib/spina/admin/conferences/engine.rb +13 -0
  109. data/lib/spina/admin/conferences/migration/renaming.rb +4 -4
  110. data/lib/spina/admin/conferences/railtie.rb +1 -0
  111. data/lib/spina/admin/conferences/version.rb +1 -1
  112. data/lib/spina/admin/conferences.rb +1 -2
  113. metadata +65 -82
  114. data/app/assets/javascripts/controllers/spina/admin/conferences/conference_events_form_controller.js +0 -174
  115. data/app/assets/javascripts/controllers/spina/admin/conferences/presentation_attachments_form_controller.js +0 -174
  116. data/app/assets/javascripts/importmap.json.erb +0 -6
  117. data/app/assets/stylesheets/spina/admin/conferences/application.sass +0 -3
  118. data/app/controllers/spina/admin/conferences/events_controller.rb +0 -24
  119. data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +0 -24
  120. data/app/views/layouts/spina/admin/conferences/application.html.haml +0 -6
  121. data/app/views/layouts/spina/admin/conferences/conferences.html.haml +0 -17
  122. data/app/views/layouts/spina/admin/conferences/delegates.html.haml +0 -8
  123. data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +0 -8
  124. data/app/views/layouts/spina/admin/conferences/institutions.html.haml +0 -15
  125. data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +0 -8
  126. data/app/views/layouts/spina/admin/conferences/presentations.html.haml +0 -8
  127. data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +0 -5
  128. data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +0 -19
  129. data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +0 -13
  130. data/app/views/spina/admin/conferences/events/new.js.erb +0 -21
  131. data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +0 -21
  132. data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +0 -2
  133. data/config/initializers/assets.rb +0 -13
@@ -2,9 +2,9 @@
2
2
 
3
3
  # This migration comes from spina_conferences (originally 20190701174807)
4
4
 
5
- class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
5
+ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] # :nodoc:
6
6
  def up
7
- insert <<-SQL, 'Insert conferences parts'
7
+ insert <<-SQL.squish, 'Insert conferences parts'
8
8
  WITH parts AS (
9
9
  SELECT
10
10
  title,
@@ -29,7 +29,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
29
29
  INSERT INTO spina_conferences_parts (title, name, partable_id, partable_type, pageable_id, pageable_type)
30
30
  SELECT title, name, page_partable_id, page_partable_type, pageable_id, pageable_type FROM parts
31
31
  SQL
32
- delete <<-SQL, 'Delete page parts'
32
+ delete <<-SQL.squish, 'Delete page parts'
33
33
  WITH parts AS (
34
34
  SELECT spina_page_parts.id AS id
35
35
  FROM spina_conferences_conferences
@@ -47,10 +47,10 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
47
47
  )
48
48
  DELETE FROM spina_page_parts USING parts WHERE spina_page_parts.id = parts.id
49
49
  SQL
50
- delete <<-SQL, 'Delete pages'
50
+ delete <<-SQL.squish, 'Delete pages'
51
51
  DELETE FROM spina_pages USING spina_conferences_conference_page_parts WHERE conference_page_id = spina_pages.id
52
52
  SQL
53
- delete <<-SQL, 'Delete conference page parts'
53
+ delete <<-SQL.squish, 'Delete conference page parts'
54
54
  DELETE FROM spina_conferences_conference_page_parts
55
55
  USING spina_conferences_conferences, spina_conferences_presentations
56
56
  WHERE (
@@ -62,10 +62,10 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
62
62
  AND conference_page_partable_type = 'Spina::Conferences::Presentation'
63
63
  )
64
64
  SQL
65
- delete <<-SQL, 'Delete conferences page'
65
+ delete <<-SQL.squish, 'Delete conferences page'
66
66
  DELETE FROM spina_pages WHERE name = 'conferences'
67
67
  SQL
68
- delete <<-SQL, 'Delete conference pages resource'
68
+ delete <<-SQL.squish, 'Delete conference pages resource'
69
69
  DELETE FROM spina_resources WHERE name = 'conference_pages'
70
70
  SQL
71
71
  remove_column :spina_pages, :type
@@ -73,13 +73,13 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
73
73
 
74
74
  def down
75
75
  add_column :spina_pages, :type, :string
76
- insert <<-SQL, 'Insert resource if missing'
76
+ insert <<-SQL.squish, 'Insert resource if missing'
77
77
  INSERT INTO spina_resources (name, label, created_at, updated_at)
78
78
  SELECT 'conference_pages', 'Conference pages', current_timestamp, current_timestamp
79
79
  WHERE NOT EXISTS (SELECT name FROM spina_resources WHERE name = 'conference_pages')
80
80
  SQL
81
81
  locale = ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)
82
- insert <<-SQL, 'Insert root page if missing', nil, nil, nil, [locale]
82
+ insert <<-SQL.squish, 'Insert root page if missing', nil, nil, nil, [locale]
83
83
  WITH pages AS (
84
84
  INSERT INTO spina_pages (name, view_template, deletable, created_at, updated_at)
85
85
  SELECT 'conferences', 'conferences', false, current_timestamp, current_timestamp
@@ -89,7 +89,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
89
89
  INSERT INTO spina_page_translations (title, spina_page_id, locale, created_at, updated_at)
90
90
  SELECT 'Conferences', pages.id, $1, current_timestamp, current_timestamp FROM pages
91
91
  SQL
92
- insert <<-SQL, 'Insert conference pages for conferences', nil, nil, nil, [locale]
92
+ insert <<-SQL.squish, 'Insert conference pages for conferences', nil, nil, nil, [locale]
93
93
  WITH
94
94
  resources AS (SELECT id FROM spina_resources WHERE name = 'conference_pages' LIMIT 1),
95
95
  conferences_pages AS (SELECT id FROM spina_pages WHERE view_template = 'conferences' LIMIT 1),
@@ -124,7 +124,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
124
124
  ) AS pages_with_indices USING (index)
125
125
  )
126
126
  INSERT INTO spina_conferences_conference_page_parts
127
- (conference_page_id, conference_page_partable_id, conference_page_partable_type, created_at, updated_at)
127
+ (conference_page_id, conference_page_partable_id, conference_page_partable_type, created_at, updated_at)#{' '}
128
128
  SELECT page_id, conference_id, type, current_timestamp, current_timestamp
129
129
  FROM (
130
130
  SELECT conference_id, type, row_number() OVER (ORDER BY type, conference_id) AS index FROM conference_pages_to_insert
@@ -133,7 +133,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
133
133
  SELECT page_id, row_number() OVER (ORDER BY page_id) AS index FROM conference_pages
134
134
  ) AS pages_with_indices USING (index)
135
135
  SQL
136
- insert <<-SQL, 'Insert conference pages for presentations', nil, nil, nil, [locale]
136
+ insert <<-SQL.squish, 'Insert conference pages for presentations', nil, nil, nil, [locale]
137
137
  WITH
138
138
  resources AS (SELECT id FROM spina_resources WHERE name = 'conference_pages' LIMIT 1),
139
139
  conference_pages_to_insert AS (
@@ -169,7 +169,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
169
169
  ) AS pages_with_indices USING (index)
170
170
  )
171
171
  INSERT INTO spina_conferences_conference_page_parts
172
- (conference_page_id, conference_page_partable_id, conference_page_partable_type, created_at, updated_at)
172
+ (conference_page_id, conference_page_partable_id, conference_page_partable_type, created_at, updated_at)#{' '}
173
173
  SELECT page_id, presentation_id, type, current_timestamp, current_timestamp
174
174
  FROM (
175
175
  SELECT presentation_id, type, row_number() OVER (ORDER BY type, presentation_id) AS index FROM conference_pages_to_insert
@@ -178,7 +178,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
178
178
  SELECT page_id, row_number() OVER (ORDER BY page_id) AS index FROM conference_pages
179
179
  ) AS pages_with_indices USING (index)
180
180
  SQL
181
- insert <<-SQL, 'Insert page parts'
181
+ insert <<-SQL.squish, 'Insert page parts'
182
182
  INSERT INTO spina_page_parts (title, name, page_id, page_partable_id, page_partable_type, created_at, updated_at)
183
183
  SELECT
184
184
  spina_conferences_parts.title, spina_conferences_parts.name, spina_pages.id, partable_id, partable_type, current_timestamp,
@@ -192,7 +192,7 @@ class RemoveSpinaConferencePages < ActiveRecord::Migration[6.0] #:nodoc:
192
192
  ON pageable_id = conference_page_partable_id AND pageable_type = conference_page_partable_type
193
193
  INNER JOIN spina_pages ON conference_page_id = spina_pages.id
194
194
  SQL
195
- delete <<-SQL, 'Delete conference parts'
195
+ delete <<-SQL.squish, 'Delete conference parts'
196
196
  DELETE FROM spina_conferences_parts USING spina_page_parts WHERE page_partable_id = partable_id AND page_partable_type = partable_type
197
197
  SQL
198
198
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AddConstraintsToColumns < ActiveRecord::Migration[6.0] # :nodoc:
4
- def change # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
4
+ def change # rubocop:disable Metrics/AbcSize
5
5
  change_column_null :spina_conferences_conferences, :dates, false
6
6
  change_column_null :spina_conferences_conferences, :institution_id, false
7
7
  change_column_null :spina_conferences_delegates, :first_name, false
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class CreateSpinaConferencesPresentationAttachments < ActiveRecord::Migration[6.0] # :nodoc:
4
- def change # rubocop:disable Metrics/MethodLength
4
+ def change
5
5
  create_table :spina_conferences_presentation_attachments do |t|
6
6
  t.references :presentation,
7
7
  null: false, foreign_key: { to_table: :spina_conferences_presentations, on_delete: :cascade },
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class CreateSpinaConferencesEventNameDescriptionAndLocationTranslations < ActiveRecord::Migration[6.0] # rubocop:disable Style/Documentation
4
- def change # rubocop:disable Metrics/MethodLength
4
+ def change
5
5
  create_table :spina_conferences_event_translations do |t|
6
6
  # Translated attribute(s)
7
7
  t.string :name
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MoveConferenceParts < ActiveRecord::Migration[6.0] # rubocop:disable Metrics/ClassLength, Style/Documentation
3
+ class MoveConferenceParts < ActiveRecord::Migration[6.0] # rubocop:disable Style/Documentation
4
4
  def up
5
5
  insert <<-SQL.squish, 'Create events', nil, nil, nil
6
6
  WITH event_structure_items_with_parts AS (
@@ -75,7 +75,7 @@ class MoveConferenceParts < ActiveRecord::Migration[6.0] # rubocop:disable Metri
75
75
  RETURNING id
76
76
  ), event_translations AS (
77
77
  INSERT INTO spina_conferences_event_translations
78
- (name, description, location, locale, spina_conferences_event_id, created_at, updated_at)
78
+ (name, description, location, locale, spina_conferences_event_id, created_at, updated_at)#{' '}
79
79
  SELECT DISTINCT ON (event_structure_items_with_parts_and_indices.structure_item_id, locale)
80
80
  title, description, location, locale, structure_item_events.id, current_timestamp, current_timestamp
81
81
  FROM (
@@ -203,7 +203,7 @@ class MoveConferenceParts < ActiveRecord::Migration[6.0] # rubocop:disable Metri
203
203
  ) AS time_parts_with_indices USING (index)
204
204
  ), structure_parts AS (
205
205
  INSERT INTO spina_structure_parts
206
- (structure_item_id, structure_partable_id, structure_partable_type, name, title, created_at, updated_at)
206
+ (structure_item_id, structure_partable_id, structure_partable_type, name, title, created_at, updated_at)#{' '}
207
207
  SELECT
208
208
  structure_items_with_indices.id, partable_id, type, replace(lower(title), '\W', '_'), title, current_timestamp,
209
209
  current_timestamp
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class RemoveSpinaConferencesConferencePageParts < ActiveRecord::Migration[6.0]
3
+ class RemoveSpinaConferencesConferencePageParts < ActiveRecord::Migration[6.0] # :nodoc:
4
4
  def change
5
5
  drop_table :spina_conferences_conference_page_parts do |t|
6
6
  t.references :conference_page, foreign_key: { to_table: :spina_pages, on_delete: :cascade },
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddTimestampsToSpinaConferencesParts < ActiveRecord::Migration[6.0]
3
+ class AddTimestampsToSpinaConferencesParts < ActiveRecord::Migration[6.0] # :nodoc:
4
4
  def change
5
- default = Time.now
5
+ default = Time.zone.now
6
6
  add_timestamps :spina_conferences_parts, default: default
7
7
  change_column_default :spina_conferences_parts, :created_at, from: default, to: nil
8
8
  change_column_default :spina_conferences_parts, :updated_at, from: default, to: nil
@@ -11,7 +11,7 @@ Spina::Part.register(Spina::Parts::Admin::Conferences::Url)
11
11
  # If you have custom partables you must modify this migration to ensure the conversion of your partables is handled appropriately
12
12
  # by implementing <tt>convert_to_json!</tt> for your partables.
13
13
  class ConvertPartablesToJson < ActiveRecord::Migration[6.1]
14
- def up # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
14
+ def up # rubocop:disable Metrics/AbcSize
15
15
  announce 'converting partables to JSON parts'
16
16
  Spina.config.locales.each do |locale|
17
17
  I18n.with_locale(locale) do
@@ -37,7 +37,7 @@ class ConvertPartablesToJson < ActiveRecord::Migration[6.1]
37
37
  end
38
38
  end
39
39
 
40
- def down # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
40
+ def down # rubocop:disable Metrics/AbcSize
41
41
  announce 'converting JSON parts to partables'
42
42
  Spina.config.locales.each do |locale|
43
43
  I18n.with_locale(locale) do
@@ -204,15 +204,13 @@ module Spina # :nodoc: all
204
204
 
205
205
  def convert_page_parts_to_json!
206
206
  page_parts.reject { |page_part| page_part.page_partable.nil? }
207
- .collect(&:convert_to_json!)
208
- .compact
207
+ .filter_map(&:convert_to_json!)
209
208
  .then { |parts| send(:"#{I18n.locale}_content").union(parts) }
210
209
  .then { |parts| update("#{I18n.locale}_content": parts) }
211
210
  end
212
211
 
213
212
  def convert_json_to_parts!
214
- update(page_parts: send(:"#{I18n.locale}_content").collect(&:convert_to_partable!)
215
- .compact
213
+ update(page_parts: send(:"#{I18n.locale}_content").filter_map(&:convert_to_partable!)
216
214
  .collect { |partable| PagePart.new(page_partable: partable) })
217
215
  end
218
216
  end
@@ -222,16 +220,14 @@ module Spina # :nodoc: all
222
220
 
223
221
  def convert_layout_parts_to_json!
224
222
  layout_parts.reject { |layout_part| layout_part.layout_partable.nil? }
225
- .collect(&:convert_to_json!)
226
- .compact
223
+ .filter_map(&:convert_to_json!)
227
224
  .then { |parts| send(:"#{I18n.locale}_content").union(parts) }
228
225
  .then { |parts| update("#{I18n.locale}_content": parts) }
229
226
  end
230
227
 
231
228
  def convert_json_to_parts!
232
229
  update(layout_parts: send(:"#{I18n.locale}_content")
233
- .collect(&:convert_to_partable!)
234
- .compact
230
+ .filter_map(&:convert_to_partable!)
235
231
  .collect { |partable| LayoutPart.new(layout_partable: partable) })
236
232
  end
237
233
  end
@@ -242,8 +238,7 @@ module Spina # :nodoc: all
242
238
 
243
239
  def convert_to_json!
244
240
  Parts::RepeaterContent.new(parts: structure_parts.reject { |structure_part| structure_part.structure_partable.nil? }
245
- .collect(&:convert_to_json!)
246
- .compact)
241
+ .filter_map(&:convert_to_json!))
247
242
  end
248
243
  end
249
244
 
@@ -298,8 +293,7 @@ module Spina # :nodoc: all
298
293
 
299
294
  class RepeaterContent < Base
300
295
  def convert_to_structure_item!
301
- Spina::StructureItem.new(structure_parts: parts.collect(&:convert_to_partable!)
302
- .compact
296
+ Spina::StructureItem.new(structure_parts: parts.filter_map(&:convert_to_partable!)
303
297
  .collect { |partable| StructurePart.new(structure_partable: partable) })
304
298
  end
305
299
  end
@@ -381,15 +375,13 @@ module Spina # :nodoc: all
381
375
 
382
376
  def convert_parts_to_json!
383
377
  parts.reject { |part| part.partable.nil? }
384
- .collect(&:convert_to_json!)
385
- .compact
378
+ .filter_map(&:convert_to_json!)
386
379
  .then { |parts| send(:"#{I18n.locale}_content").union(parts) }
387
380
  .then { |parts| update("#{I18n.locale}_content": parts) }
388
381
  end
389
382
 
390
383
  def convert_json_to_parts!
391
- update(parts: send(:"#{I18n.locale}_content").collect(&:convert_to_partable!)
392
- .compact
384
+ update(parts: send(:"#{I18n.locale}_content").filter_map(&:convert_to_partable!)
393
385
  .collect { |partable| Part.new(partable: partable) })
394
386
  end
395
387
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddLocaleToActionTextRichTexts < ActiveRecord::Migration[6.1]
3
+ class AddLocaleToActionTextRichTexts < ActiveRecord::Migration[6.1] # :nodoc:
4
4
  def change
5
5
  add_column :action_text_rich_texts, :locale, :string
6
6
  remove_index :action_text_rich_texts, column: %i[record_type record_id name], name: :index_action_text_rich_texts_uniqueness,
@@ -8,6 +8,19 @@ module Spina
8
8
  class Engine < ::Rails::Engine
9
9
  isolate_namespace Spina::Admin::Conferences
10
10
 
11
+ initializer 'spina.admin.conferences.assets' do
12
+ Spina.config.importmap.draw do
13
+ pin_all_from Spina::Admin::Conferences::Engine.root.join('app/assets/javascripts/spina/admin/conferences/controllers'),
14
+ under: 'controllers', to: 'spina/admin/conferences/controllers'
15
+ end
16
+
17
+ Spina.config.tailwind_content.concat(["#{Spina::Admin::Conferences::Engine.root}/app/views/**/*.*",
18
+ "#{Spina::Admin::Conferences::Engine.root}/app/components/**/*.*",
19
+ "#{Spina::Admin::Conferences::Engine.root}/app/helpers/**/*.*",
20
+ "#{Spina::Admin::Conferences::Engine.root}/app/assets/javascripts/**/*.js",
21
+ "#{Spina::Admin::Conferences::Engine.root}/app/**/application.tailwind.css"])
22
+ end
23
+
11
24
  config.before_initialize do
12
25
  ::Spina::Plugin.register do |plugin|
13
26
  plugin.name = 'conferences'
@@ -6,7 +6,7 @@ module Spina
6
6
  module Admin
7
7
  module Conferences
8
8
  module Migration
9
- module Renaming
9
+ module Renaming # :nodoc:
10
10
  extend ActiveSupport::Concern
11
11
 
12
12
  included do
@@ -14,7 +14,7 @@ module Spina
14
14
  @migrations_path ||= nil
15
15
  end
16
16
 
17
- class_methods do
17
+ class_methods do # rubocop:disable Metrics/BlockLength
18
18
  def rename_migration(name, to:)
19
19
  config.after_initialize do
20
20
  migration = {}
@@ -32,7 +32,7 @@ module Spina
32
32
 
33
33
  attr_reader :duplicate_migrations
34
34
 
35
- class DuplicateMigrationsError < ::StandardError
35
+ class DuplicateMigrationsError < ::StandardError # :nodoc:
36
36
  def initialize(migrations)
37
37
  messages = migrations.collect { |migration| generate_message(migration) }
38
38
  super(messages.join("\n"))
@@ -42,7 +42,7 @@ module Spina
42
42
 
43
43
  MIGRATION_REGEXP = /([0-9]+)_.+\.(spina(_admin)?_conferences).rb$/.freeze
44
44
 
45
- def generate_message(migration)
45
+ def generate_message(migration) # rubocop:disable Metrics/AbcSize
46
46
  old_version, old_scope = parse_filename(migration[:old][:file])
47
47
  messages = []
48
48
  messages << "#{File.basename(migration[:new][:file])} is a renamed version of #{File.basename(migration[:old][:file])}."
@@ -5,6 +5,7 @@ require 'spina/admin/conferences/migration/renaming'
5
5
  module Spina
6
6
  module Admin
7
7
  module Conferences
8
+ # Railtie for renaming some migrations to be more concise, if they were previously installed
8
9
  class Railtie < Rails::Railtie
9
10
  include Migration::Renaming
10
11
 
@@ -4,7 +4,7 @@ module Spina
4
4
  module Admin
5
5
  module Conferences
6
6
  # Version number.
7
- VERSION = '2.1.1'
7
+ VERSION = '3.0.0.rc3'
8
8
  end
9
9
  end
10
10
  end
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'haml-rails'
3
4
  require 'spina'
4
5
  require 'spina/admin/conferences/engine'
5
6
  require 'spina/admin/conferences/railtie' if defined?(Rails::Railtie)
6
7
  require 'rails-i18n'
7
- require 'stimulus-rails'
8
- require 'turbo-rails'
9
8
  require 'icalendar'
10
9
  require 'icalendar/tzinfo'
11
10