decidim-decidim_awesome 0.10.3 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-decidim_awesome might be problematic. Click here for more details.

Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -5
  3. data/README.md +65 -67
  4. data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
  5. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +44 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
  7. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
  8. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
  9. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
  10. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
  11. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +1 -1
  12. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
  13. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +2 -2
  14. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  17. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
  19. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
  20. data/app/commands/decidim/decidim_awesome/command.rb +1 -7
  21. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +1 -1
  22. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +3 -4
  23. data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
  24. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
  25. data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +22 -9
  26. data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
  27. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
  28. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +7 -7
  29. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +8 -10
  30. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +20 -19
  31. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -8
  32. data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +2 -2
  33. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -8
  34. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +2 -2
  35. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
  36. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
  37. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
  38. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
  39. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +11 -5
  40. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +1 -1
  41. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -25
  42. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
  43. data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
  44. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
  45. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +8 -1
  46. data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
  47. data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +23 -39
  48. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +2 -2
  49. data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
  50. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
  51. data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
  52. data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +1 -1
  53. data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
  54. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +4 -8
  55. data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +1 -1
  56. data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
  57. data/app/overrides/decidim/proposals/proposals/{show → _proposal_aside}/limit_amendments_modal.html.erb.deface +1 -1
  58. data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
  59. data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
  60. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
  61. data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
  62. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
  63. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
  64. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
  65. data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
  66. data/app/packs/entrypoints/decidim_editor.js +14 -0
  67. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +95 -70
  68. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
  69. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
  70. data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
  71. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -1
  72. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
  73. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
  74. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
  75. data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +20 -22
  76. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
  77. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  78. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +0 -15
  79. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
  80. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
  81. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
  82. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
  83. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
  84. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
  85. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
  86. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
  87. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
  88. data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
  89. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
  90. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +9 -14
  91. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
  92. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
  93. data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
  94. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
  95. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
  96. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +19 -12
  97. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +8 -32
  98. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -78
  99. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
  100. data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
  101. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +15 -24
  102. data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
  103. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +9 -47
  104. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +3 -12
  105. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +3 -19
  106. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
  107. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +27 -21
  108. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
  109. data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +32 -101
  110. data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +5 -26
  111. data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +34 -52
  112. data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
  113. data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
  114. data/app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb +10 -2
  115. data/app/presenters/concerns/decidim/decidim_awesome/menu_presenter_override.rb +8 -0
  116. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
  117. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +11 -11
  118. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
  119. data/app/queries/decidim/decidim_awesome/private_data_finder.rb +1 -1
  120. data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +0 -8
  121. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
  122. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +1 -3
  123. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +3 -3
  124. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +20 -21
  125. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +6 -5
  126. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +2 -2
  127. data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
  128. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -6
  129. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +64 -76
  130. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +15 -11
  131. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
  132. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
  133. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
  134. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
  135. data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
  136. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
  137. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
  138. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +15 -15
  139. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
  140. data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +4 -4
  141. data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
  142. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
  143. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +16 -18
  144. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
  145. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
  146. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +18 -11
  147. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +3 -5
  148. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
  149. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
  150. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
  151. data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
  152. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
  153. data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
  154. data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +3 -12
  155. data/config/assets.rb +3 -33
  156. data/config/i18n-tasks.yml +1 -0
  157. data/config/locales/ca.yml +17 -94
  158. data/config/locales/cs.yml +15 -93
  159. data/config/locales/de.yml +15 -91
  160. data/config/locales/en.yml +24 -28
  161. data/config/locales/es.yml +18 -96
  162. data/config/locales/eu.yml +8 -18
  163. data/config/locales/fr.yml +15 -94
  164. data/config/locales/hu.yml +4 -18
  165. data/config/locales/it.yml +9 -26
  166. data/config/locales/ja.yml +16 -93
  167. data/config/locales/lt.yml +2 -4
  168. data/config/locales/nl.yml +8 -18
  169. data/config/locales/pt-BR.yml +11 -25
  170. data/config/locales/ro-RO.yml +2 -14
  171. data/config/locales/sv.yml +10 -21
  172. data/config/rubocop/disabled.yml +11 -0
  173. data/config/rubocop/faker.yml +480 -0
  174. data/config/rubocop/rails.yml +88 -0
  175. data/config/rubocop/rspec.yml +65 -0
  176. data/config/rubocop/ruby.yml +1210 -0
  177. data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
  178. data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +1 -1
  179. data/db/seeds.rb +3 -3
  180. data/lib/decidim/decidim_awesome/admin_engine.rb +4 -1
  181. data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +2 -3
  182. data/lib/decidim/decidim_awesome/awesome.rb +42 -28
  183. data/lib/decidim/decidim_awesome/awesome_helpers.rb +1 -1
  184. data/lib/decidim/decidim_awesome/checksums.yml +39 -60
  185. data/lib/decidim/decidim_awesome/config.rb +1 -1
  186. data/lib/decidim/decidim_awesome/custom_fields.rb +5 -5
  187. data/lib/decidim/decidim_awesome/engine.rb +24 -6
  188. data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
  189. data/lib/decidim/decidim_awesome/lock.rb +2 -2
  190. data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
  191. data/lib/decidim/decidim_awesome/menu.rb +33 -14
  192. data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
  193. data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
  194. data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
  195. data/lib/decidim/decidim_awesome/test/initializer.rb +3 -11
  196. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
  197. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
  198. data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +18 -18
  199. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +3 -3
  200. data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +11 -11
  201. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
  202. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +26 -66
  203. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +10 -9
  204. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +30 -20
  205. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +19 -10
  206. data/lib/decidim/decidim_awesome/version.rb +2 -2
  207. data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
  208. data/lib/decidim/decidim_awesome.rb +1 -2
  209. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
  210. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
  211. data/package.json +19 -28
  212. metadata +40 -56
  213. data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -18
  214. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
  215. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
  216. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
  217. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
  218. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
  219. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
  220. data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
  221. data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
  222. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
  223. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
  224. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
  225. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -213
  226. data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
  227. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
  228. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
  229. data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -65
  230. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
  231. data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
  232. /data/app/packs/src/decidim/decidim_awesome/{editors/tabs_focus.js → admin/tabs_change.js} +0 -0
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- welcome_text = "Welcome to the Admin Panel."
4
- welcome_text = "Welcome to the Decidim Admin Panel." if legacy_version?
3
+ welcome_text = "Dashboard"
5
4
 
6
5
  shared_examples "redirects to index" do |_link|
7
6
  it "display index page" do
@@ -88,7 +87,7 @@ shared_examples "allows external accesses" do
88
87
 
89
88
  it "shows participants access" do
90
89
  visit decidim_admin.users_path
91
- expect(page).to have_content(legacy_version? ? "New user" : "New admin")
90
+ expect(page).to have_content("New admin")
92
91
  end
93
92
 
94
93
  it "shows pages access" do
@@ -110,6 +109,10 @@ end
110
109
  shared_examples "allows all admin routes" do
111
110
  before do
112
111
  visit decidim_admin.root_path
112
+ # this is a workaround to wait for the page to load
113
+ # it seems that the test might fail randomly otherwise
114
+ # underlaying issue is unknown, maybe capybara is faster clicking than ruby is at storing class variables?
115
+ sleep 0.1
113
116
  end
114
117
 
115
118
  it "allows the admin root page" do
@@ -123,6 +126,7 @@ shared_examples "allows all admin routes" do
123
126
 
124
127
  it "allows the processes page" do
125
128
  click_link_or_button "Processes"
129
+
126
130
  expect(page).to have_content("New process")
127
131
  end
128
132
  end
@@ -130,6 +134,7 @@ end
130
134
  shared_examples "allows scoped admin routes" do
131
135
  before do
132
136
  visit decidim_admin.root_path
137
+ sleep 0.1
133
138
  end
134
139
 
135
140
  it "allows the admin root page" do
@@ -137,14 +142,14 @@ shared_examples "allows scoped admin routes" do
137
142
  end
138
143
 
139
144
  it "allows the assemblies page" do
140
- click_link "Assemblies"
145
+ click_link_or_button "Assemblies"
141
146
 
142
147
  expect(page).to have_content("New assembly")
143
148
  end
144
149
 
145
150
  describe "forbids processes" do
146
151
  before do
147
- click_link "Processes"
152
+ click_link_or_button "Processes"
148
153
  end
149
154
 
150
155
  it_behaves_like "redirects to index"
@@ -157,16 +162,16 @@ end
157
162
 
158
163
  shared_examples "has admin link" do
159
164
  it "has menu link" do
160
- within ".topbar__dropmenu.topbar__user__logged" do
161
- expect(page).to have_selector("#user-menu li", text: "Admin dashboard", visible: :hidden)
165
+ within "header" do
166
+ expect(page).to have_css("#admin-bar", text: "Admin dashboard")
162
167
  end
163
168
  end
164
169
  end
165
170
 
166
171
  shared_examples "has no admin link" do
167
- it "has menu link" do
168
- within ".topbar__dropmenu.topbar__user__logged" do
169
- expect(page).not_to have_selector("#user-menu li", text: "Admin dashboard", visible: :hidden)
172
+ it "has no menu link" do
173
+ within "header" do
174
+ expect(page).not_to have_css("#admin-bar", text: "Admin dashboard")
170
175
  end
171
176
  end
172
177
  end
@@ -214,7 +219,7 @@ shared_examples "can edit assembly" do
214
219
  ca: "Assamblea editada",
215
220
  es: "Asamblea editada"
216
221
  )
217
- find("*[type=submit]").click
222
+ click_link_or_button "Update"
218
223
  expect(page).to have_admin_callout("successfully")
219
224
  end
220
225
  end
@@ -263,7 +268,7 @@ shared_examples "can manage component" do
263
268
  expect(page).to have_content("Title")
264
269
  expect(page).to have_content(proposal.title["en"])
265
270
 
266
- click_link "Edit proposal"
271
+ click_link_or_button "Edit proposal"
267
272
  expect(page).to have_content("Update proposal")
268
273
  fill_in_i18n(
269
274
  :proposal_title,
@@ -272,14 +277,14 @@ shared_examples "can manage component" do
272
277
  ca: "Proposta editada",
273
278
  es: "Propuesta editada"
274
279
  )
275
- find("*[type=submit]").click
280
+ click_link_or_button "Update"
276
281
  expect(page).to have_admin_callout("successfully")
277
282
  end
278
283
 
279
284
  it "can create a proposal" do
280
285
  visit manage_component_path(component)
281
286
 
282
- click_link "New proposal"
287
+ click_link_or_button "New proposal"
283
288
  expect(page).to have_content("Create proposal")
284
289
  fill_in_i18n(
285
290
  :proposal_title,
@@ -295,7 +300,7 @@ shared_examples "can manage component" do
295
300
  ca: "Body creat",
296
301
  es: "Body creat"
297
302
  )
298
- find("*[type=submit]").click
303
+ click_link_or_button "Create"
299
304
  expect(page).to have_admin_callout("successfully")
300
305
  end
301
306
  end
@@ -303,6 +308,7 @@ end
303
308
  shared_examples "edits allowed components" do
304
309
  before do
305
310
  visit decidim_admin.root_path
311
+ sleep 0.1
306
312
  end
307
313
 
308
314
  it_behaves_like "can manage component"
@@ -363,8 +369,10 @@ shared_examples "allows access to group processes" do
363
369
  end
364
370
 
365
371
  it "shows the list of processes" do
366
- expect(page).to have_content("Participatory processes")
367
- expect(page).to have_content(participatory_process.title["en"])
372
+ within("[data-content]") do
373
+ expect(page).to have_content("Processes")
374
+ expect(page).to have_content(participatory_process.title["en"])
375
+ end
368
376
  end
369
377
 
370
378
  describe "forbids editing processes" do
@@ -381,8 +389,10 @@ shared_examples "allows access to group processes" do
381
389
  end
382
390
 
383
391
  it "shows the list of groups" do
384
- expect(page).to have_content("Participatory process groups")
385
- expect(page).to have_content(process_group.title["en"])
392
+ within("[data-content]") do
393
+ expect(page).to have_content("Process groups")
394
+ expect(page).to have_content(process_group.title["en"])
395
+ end
386
396
  end
387
397
  end
388
398
  end
@@ -401,7 +411,7 @@ shared_examples "allows edit any group process" do
401
411
  ca: "Proces grup editat",
402
412
  es: "Grupo de procesos editado"
403
413
  )
404
- find("*[type=submit]").click
414
+ click_link_or_button "Update"
405
415
  expect(page).to have_admin_callout("successfully")
406
416
  end
407
417
  end
@@ -26,6 +26,8 @@ shared_examples "activated concerns" do |enabled|
26
26
  it "common concerns are registered" do
27
27
  expect(ActionView::Base.included_modules).to include(Decidim::DecidimAwesome::AwesomeHelpers)
28
28
  expect(Decidim::ViewModel.included_modules).to include(Decidim::DecidimAwesome::AwesomeHelpers)
29
+ expect(Decidim::ApplicationController.included_modules).to include(Decidim::DecidimAwesome::ContentSecurityPolicy)
30
+ expect(Decidim::Admin::ApplicationController.included_modules).to include(Decidim::DecidimAwesome::ContentSecurityPolicy)
29
31
  end
30
32
 
31
33
  if enabled
@@ -43,8 +45,12 @@ shared_examples "activated concerns" do |enabled|
43
45
  expect(Decidim::Proposals::ProposalVote.included_modules).to include(Decidim::DecidimAwesome::HasVoteWeight)
44
46
  expect(Decidim::Proposals::ProposalType.included_modules).to include(Decidim::DecidimAwesome::AddProposalTypeVoteWeights)
45
47
  expect(Decidim::Proposals::ProposalType.included_modules).to include(Decidim::DecidimAwesome::AddProposalTypeCustomFields)
48
+ expect(Decidim::Proposals::ProposalLCell.included_modules).to include(Decidim::DecidimAwesome::ProposalLCellOverride)
46
49
  expect(Decidim::Proposals::Proposal.included_modules).to include(Decidim::DecidimAwesome::HasProposalExtraFields)
47
50
  expect(Decidim::Proposals::CollaborativeDraft.included_modules).to include(Decidim::DecidimAwesome::HasProposalExtraFields)
51
+ expect(Decidim::ContentBlocks::GlobalMenuCell.included_modules).to include(Decidim::DecidimAwesome::GlobalMenuCellOverride)
52
+ expect(Decidim::BreadcrumbHelper.included_modules).to include(Decidim::DecidimAwesome::BreadcrumbHelperOverride)
53
+ expect(Decidim::BreadcrumbRootMenuItemPresenter.included_modules).to include(Decidim::DecidimAwesome::BreadcrumbRootMenuItemPresenterOverride)
48
54
  expect(Decidim::Proposals::ProposalSerializer.included_modules).to include(Decidim::DecidimAwesome::Proposals::ProposalSerializerOverride)
49
55
  expect(Decidim::Proposals::ProposalVotesController.included_modules).to include(Decidim::DecidimAwesome::Proposals::ProposalVotesControllerOverride)
50
56
  expect(Decidim::AmendmentsController.included_modules).to include(Decidim::DecidimAwesome::LimitPendingAmendments)
@@ -67,8 +73,12 @@ shared_examples "activated concerns" do |enabled|
67
73
  expect(Decidim::Proposals::ProposalVote.included_modules).not_to include(Decidim::DecidimAwesome::HasVoteWeight)
68
74
  expect(Decidim::Proposals::ProposalType.included_modules).not_to include(Decidim::DecidimAwesome::AddProposalTypeVoteWeights)
69
75
  expect(Decidim::Proposals::ProposalType.included_modules).not_to include(Decidim::DecidimAwesome::AddProposalTypeCustomFields)
76
+ expect(Decidim::Proposals::ProposalLCell.included_modules).not_to include(Decidim::DecidimAwesome::ProposalLCellOverride)
70
77
  expect(Decidim::Proposals::Proposal.included_modules).not_to include(Decidim::DecidimAwesome::HasProposalExtraFields)
71
78
  expect(Decidim::Proposals::CollaborativeDraft.included_modules).not_to include(Decidim::DecidimAwesome::HasProposalExtraFields)
79
+ expect(Decidim::ContentBlocks::GlobalMenuCell.included_modules).not_to include(Decidim::DecidimAwesome::GlobalMenuCellOverride)
80
+ expect(Decidim::BreadcrumbHelper.included_modules).not_to include(Decidim::DecidimAwesome::BreadcrumbHelperOverride)
81
+ expect(Decidim::BreadcrumbRootMenuItemPresenter.included_modules).not_to include(Decidim::DecidimAwesome::BreadcrumbRootMenuItemPresenterOverride)
72
82
  expect(Decidim::Proposals::ProposalSerializer.included_modules).not_to include(Decidim::DecidimAwesome::Proposals::ProposalSerializerOverride)
73
83
  expect(Decidim::Proposals::ProposalVotesController.included_modules).not_to include(Decidim::DecidimAwesome::Proposals::ProposalVotesControllerOverride)
74
84
  expect(Decidim::AmendmentsController.included_modules).not_to include(Decidim::DecidimAwesome::LimitPendingAmendments)
@@ -148,11 +158,9 @@ shared_examples "basic rendering" do |enabled|
148
158
  let(:image_vars) do
149
159
  [
150
160
  :allow_images_in_proposals,
151
- :allow_images_in_small_editor,
152
- :allow_images_in_full_editor,
161
+ :allow_videos_in_editors,
162
+ :allow_images_in_editors,
153
163
  :allow_images_in_proposals,
154
- :use_markdown_editor,
155
- :allow_images_in_markdown_editor,
156
164
  :auto_save_forms,
157
165
  :intergram_for_admins,
158
166
  :intergram_for_public
@@ -165,7 +173,7 @@ shared_examples "basic rendering" do |enabled|
165
173
  end
166
174
 
167
175
  it "renders the home page" do
168
- expect(page).to have_content("Home")
176
+ expect(page).to have_css(".home")
169
177
  end
170
178
 
171
179
  it "has DecidimAwesome object" do
@@ -185,7 +193,7 @@ shared_examples "basic rendering" do |enabled|
185
193
  end
186
194
 
187
195
  it "has custom fields javascript" do
188
- expect(page).to have_xpath("//script[contains(@src,'decidim_decidim_awesome_proposals_custom_fields')]", visible: :all)
196
+ expect(page).to have_xpath("//script[contains(@src,'decidim_decidim_awesome_custom_fields')]", visible: :all)
189
197
  end
190
198
 
191
199
  it "has custom styles CSS" do
@@ -199,7 +207,7 @@ shared_examples "basic rendering" do |enabled|
199
207
  end
200
208
 
201
209
  it "do not have custom fields javascript" do
202
- expect(page).not_to have_xpath("//script[contains(@src,'decidim_decidim_awesome_proposals_custom_fields')]", visible: :all)
210
+ expect(page).not_to have_xpath("//script[contains(@src,'decidim_decidim_awesome_custom_fields')]", visible: :all)
203
211
  end
204
212
 
205
213
  it "do not have custom styles CSS" do
@@ -217,7 +225,8 @@ shared_examples "basic rendering" do |enabled|
217
225
  "config/styles",
218
226
  "config/proposal_custom_fields",
219
227
  "config/admins",
220
- "menu_hacks",
228
+ "menus/menu/hacks",
229
+ "menus/home_content_block_menu/hacks",
221
230
  "custom_redirects",
222
231
  "config/livechat"
223
232
  ]
@@ -246,7 +255,7 @@ shared_examples "basic rendering" do |enabled|
246
255
 
247
256
  it "has all admin menus" do
248
257
  menus.each do |menu|
249
- within ".secondary-nav" do
258
+ within ".sidebar-menu" do
250
259
  expect(page).to have_link(href: "/admin/decidim_awesome/#{menu}")
251
260
  end
252
261
  end
@@ -258,7 +267,7 @@ shared_examples "basic rendering" do |enabled|
258
267
 
259
268
  it "has no admin menus" do
260
269
  menus.each do |menu|
261
- within ".secondary-nav" do
270
+ within ".sidebar-menu" do
262
271
  expect(page).not_to have_link(href: "/admin/decidim_awesome/#{menu}")
263
272
  end
264
273
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-decidim_awesome version.
5
5
  module DecidimAwesome
6
- VERSION = "0.10.3"
7
- COMPAT_DECIDIM_VERSION = [">= 0.26.0", "< 0.28"].freeze
6
+ VERSION = "0.11.1"
7
+ COMPAT_DECIDIM_VERSION = [">= 0.28.0", "< 0.29"].freeze
8
8
  end
9
9
  end
@@ -4,12 +4,7 @@ module Decidim
4
4
  module DecidimAwesome
5
5
  class VotingManifest
6
6
  include ActiveModel::Model
7
- # From 0.27 onwards, Virtus is deprecated
8
- if defined? Decidim::AttributeObject::Model
9
- include Decidim::AttributeObject::Model
10
- else
11
- include Virtus.model
12
- end
7
+ include Decidim::AttributeObject::Model
13
8
 
14
9
  attribute :name, Symbol
15
10
 
@@ -17,12 +12,12 @@ module Decidim
17
12
  # not defining it will use the original view from Decidim
18
13
  # setting it to an empty string will hide the original content
19
14
 
20
- # original is decidim-proposals/app/views/proposals/proposals/_vote_button.html.erb
15
+ # original is decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb
21
16
  attribute :show_vote_button_view, String
22
- # original is decidim-proposals/app/views/proposals/proposals/_votes_count.html.erb
17
+ # original is decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb
23
18
  attribute :show_votes_count_view, String
24
- # original is decidim-proposals/app/cells/proposals/proposal_m/footer.erb
25
- attribute :proposal_m_cell_footer, String
19
+ # original is from decidim-proposals/app/cells/decidim/proposals/proposal_metadata_cell.rb
20
+ attribute :proposal_metadata_cell, String
26
21
 
27
22
  # a callback that will be called by the method valid_weight?
28
23
  # Do not access this parameter directly, use the weight_validator method to register a block
@@ -14,9 +14,8 @@ require "decidim/decidim_awesome/iframe_component/component"
14
14
  require "decidim/decidim_awesome/content_parsers/editor_images_parser"
15
15
 
16
16
  # Engines to handle logic unrelated to participatory spaces or components
17
-
18
17
  Decidim.register_global_engine(
19
18
  :decidim_decidim_awesome, # this is the name of the global method to access engine routes
20
- ::Decidim::DecidimAwesome::Engine,
19
+ Decidim::DecidimAwesome::Engine,
21
20
  at: "/decidim_awesome"
22
21
  )
@@ -28,7 +28,7 @@ namespace :decidim_awesome do
28
28
  cw_attribute: "image",
29
29
  cw_uploader: Decidim::Cw::DecidimAwesome::ImageUploader,
30
30
  as_attribute: "file",
31
- logger: logger
31
+ logger:
32
32
  )
33
33
  end
34
34
  end
@@ -4,6 +4,10 @@ Rake::Task["decidim:webpacker:install"].enhance do
4
4
  Rake::Task["decidim_decidim_awesome:webpacker:install"].invoke
5
5
  end
6
6
 
7
+ Rake::Task["decidim:choose_target_plugins"].enhance do
8
+ ENV["FROM"] = "#{ENV.fetch("FROM", nil)},decidim_decidim_awesome"
9
+ end
10
+
7
11
  Rake::Task["decidim:webpacker:upgrade"].enhance do
8
12
  Rake::Task["decidim_decidim_awesome:webpacker:install"].invoke
9
13
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decidim-module-decidim_awesome",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "description": "Mods and tweaks for Decidim",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -12,7 +12,9 @@
12
12
  "lint": "eslint -c .eslintrc.json --ext .js app/packs/",
13
13
  "lint-fix": "eslint -c .eslintrc.json --ext .js app/packs/ --fix",
14
14
  "stylelint": "stylelint **/*.scss",
15
- "stylelint-fix": "stylelint **/*.scss --fix"
15
+ "stylelint-fix": "stylelint **/*.scss --fix",
16
+ "prettier": "prettier --check '**/*.scss'",
17
+ "prettify": "prettier --write '**/*.scss'"
16
18
  },
17
19
  "repository": {
18
20
  "type": "git",
@@ -28,43 +30,32 @@
28
30
  },
29
31
  "homepage": "https://github.com/decidim-ice/decidim-module-decidim_awesome#readme",
30
32
  "stylelint": {
31
- "extends": "@decidim/stylelint-config",
32
- "rules": {
33
- "block-opening-brace-space-before": "always"
34
- }
33
+ "extends": "@decidim/stylelint-config"
35
34
  },
35
+ "prettier": "@decidim/prettier-config",
36
36
  "devDependencies": {
37
- "@babel/eslint-parser": "^7.19.1",
38
- "@babel/plugin-proposal-class-properties": "^7.18.6",
39
- "@babel/plugin-proposal-private-methods": "^7.18.6",
40
- "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
41
- "@babel/plugin-transform-classes": "^7.20.7",
42
- "@babel/plugin-transform-regenerator": "^7.20.5",
43
- "@babel/plugin-transform-runtime": "^7.19.6",
44
- "@babel/preset-env": "^7.20.2",
45
- "@babel/preset-react": "^7.18.6",
46
- "@decidim/dev": "0.27.4",
47
- "@decidim/eslint-config": "0.27.4",
48
- "@decidim/stylelint-config": "0.27.4",
49
- "eslint-config-prettier": "^8.2.0",
50
- "eslint-config-standard": "^11.0.0",
51
- "eslint-plugin-import": "^2.22.0",
52
- "eslint-plugin-standard": "^3.1.0",
37
+ "@babel/eslint-parser": "^7.23.10",
38
+ "@babel/plugin-transform-classes": "^7.23.8",
39
+ "@babel/plugin-transform-regenerator": "^7.23.3",
40
+ "@babel/plugin-transform-runtime": "^7.23.9",
41
+ "@babel/preset-env": "^7.23.9",
42
+ "@babel/preset-react": "^7.23.3",
43
+ "@decidim/dev": "0.28.0",
44
+ "@decidim/eslint-config": "0.28.0",
45
+ "@decidim/prettier-config": "0.28.0",
46
+ "@decidim/stylelint-config": "0.28.0",
47
+ "postcss-scss": "^4.0.9",
53
48
  "sass-embedded": "~1.57.1"
54
49
  },
55
50
  "dependencies": {
56
51
  "@rails/actioncable": "^6.1.7-6",
57
52
  "codemirror": "^5.65.0",
58
- "europa": "^4.0.0",
59
53
  "form-storage": "^1.3.5",
60
54
  "formBuilder": "^3.19.12",
61
55
  "highlight.js": "^11.4.0",
62
- "inline-attachment": "^2.0.3",
63
- "inscrybmde": "^1.11.6",
64
- "jquery-ui": "^1.13.0",
56
+ "inline-attacher": "^0.0.7",
65
57
  "jsrender": "^1.0.9",
66
58
  "leaflet.featuregroup.subgroup": "^1.0.2",
67
- "marked": "^5.1.2",
68
- "select2": "^4.1.0-rc.0"
59
+ "tom-select": "2.2.2"
69
60
  }
70
61
  }