decidim-admin 0.28.5 → 0.29.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/app/cells/decidim/admin/content_block_cell.rb +0 -1
  4. data/app/cells/decidim/admin/results_per_page/show.erb +2 -2
  5. data/app/cells/decidim/admin/results_per_page_cell.rb +0 -2
  6. data/app/commands/decidim/admin/block_user.rb +0 -1
  7. data/app/commands/decidim/admin/create_area.rb +4 -32
  8. data/app/commands/decidim/admin/create_area_type.rb +4 -33
  9. data/app/commands/decidim/admin/create_attachment.rb +5 -4
  10. data/app/commands/decidim/admin/create_attachment_collection.rb +3 -3
  11. data/app/commands/decidim/admin/create_category.rb +4 -37
  12. data/app/commands/decidim/admin/create_component.rb +7 -40
  13. data/app/commands/decidim/admin/create_newsletter.rb +11 -29
  14. data/app/commands/decidim/admin/create_participatory_space_private_user.rb +4 -4
  15. data/app/commands/decidim/admin/create_scope.rb +15 -32
  16. data/app/commands/decidim/admin/create_scope_type.rb +3 -32
  17. data/app/commands/decidim/admin/create_static_page.rb +6 -47
  18. data/app/commands/decidim/admin/create_static_page_topic.rb +4 -26
  19. data/app/commands/decidim/admin/deliver_newsletter.rb +4 -5
  20. data/app/commands/decidim/admin/destroy_area.rb +2 -25
  21. data/app/commands/decidim/admin/destroy_category.rb +4 -29
  22. data/app/commands/decidim/admin/destroy_component.rb +5 -43
  23. data/app/commands/decidim/admin/destroy_newsletter.rb +2 -30
  24. data/app/commands/decidim/admin/destroy_participatory_space_private_user.rb +5 -32
  25. data/app/commands/decidim/admin/destroy_scope.rb +6 -33
  26. data/app/commands/decidim/admin/officialize_user.rb +1 -1
  27. data/app/commands/decidim/admin/participatory_space/create_admin.rb +4 -4
  28. data/app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb +5 -4
  29. data/app/commands/decidim/admin/promote_managed_user.rb +4 -5
  30. data/app/commands/decidim/admin/unofficialize_user.rb +1 -1
  31. data/app/commands/decidim/admin/update_area.rb +2 -41
  32. data/app/commands/decidim/admin/update_area_type.rb +2 -42
  33. data/app/commands/decidim/admin/update_attachment.rb +10 -7
  34. data/app/commands/decidim/admin/update_attachment_collection.rb +3 -3
  35. data/app/commands/decidim/admin/update_category.rb +2 -45
  36. data/app/commands/decidim/admin/update_component.rb +4 -5
  37. data/app/commands/decidim/admin/update_component_permissions.rb +3 -3
  38. data/app/commands/decidim/admin/{update_external_domain_whitelist.rb → update_external_domain_allowlist.rb} +6 -5
  39. data/app/commands/decidim/admin/update_help_sections.rb +6 -3
  40. data/app/commands/decidim/admin/update_newsletter.rb +8 -8
  41. data/app/commands/decidim/admin/update_organization.rb +9 -53
  42. data/app/commands/decidim/admin/update_organization_appearance.rb +10 -81
  43. data/app/commands/decidim/admin/update_scope.rb +7 -40
  44. data/app/commands/decidim/admin/update_scope_type.rb +2 -42
  45. data/app/commands/decidim/admin/update_static_page.rb +5 -46
  46. data/app/commands/decidim/admin/update_static_page_topic.rb +2 -43
  47. data/app/constraints/decidim/admin/organization_dashboard_constraint.rb +1 -1
  48. data/app/controllers/concerns/decidim/admin/content_blocks/landing_page.rb +2 -2
  49. data/app/controllers/concerns/decidim/admin/filterable.rb +79 -4
  50. data/app/controllers/concerns/decidim/admin/global_moderation_context.rb +1 -1
  51. data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +0 -7
  52. data/app/controllers/concerns/decidim/admin/paginable.rb +20 -0
  53. data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +1 -1
  54. data/app/controllers/decidim/admin/application_controller.rb +2 -1
  55. data/app/controllers/decidim/admin/area_types_controller.rb +8 -9
  56. data/app/controllers/decidim/admin/areas_controller.rb +1 -1
  57. data/app/controllers/decidim/admin/authorization_workflows_controller.rb +1 -1
  58. data/app/controllers/decidim/admin/block_user_controller.rb +1 -1
  59. data/app/controllers/decidim/admin/categories_controller.rb +2 -2
  60. data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
  61. data/app/controllers/decidim/admin/components_controller.rb +2 -2
  62. data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +2 -2
  63. data/app/controllers/decidim/admin/concerns/has_attachments.rb +2 -2
  64. data/app/controllers/decidim/admin/concerns/has_private_users.rb +1 -1
  65. data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +1 -1
  66. data/app/controllers/decidim/admin/conflicts_controller.rb +6 -14
  67. data/app/controllers/decidim/admin/help_sections_controller.rb +1 -1
  68. data/app/controllers/decidim/admin/impersonations_controller.rb +0 -1
  69. data/app/controllers/decidim/admin/managed_users/promotions_controller.rb +1 -1
  70. data/app/controllers/decidim/admin/moderations/reports_controller.rb +4 -4
  71. data/app/controllers/decidim/admin/moderations_controller.rb +7 -7
  72. data/app/controllers/decidim/admin/newsletter_templates_controller.rb +1 -1
  73. data/app/controllers/decidim/admin/newsletters_controller.rb +6 -7
  74. data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -1
  75. data/app/controllers/decidim/admin/organization_controller.rb +1 -1
  76. data/app/controllers/decidim/admin/{organization_external_domain_whitelist_controller.rb → organization_external_domain_allowlist_controller.rb} +7 -7
  77. data/app/controllers/decidim/admin/scope_types_controller.rb +7 -8
  78. data/app/controllers/decidim/admin/scopes_controller.rb +1 -1
  79. data/app/controllers/decidim/admin/share_tokens_controller.rb +1 -1
  80. data/app/controllers/decidim/admin/static_page_topics_controller.rb +2 -2
  81. data/app/controllers/decidim/admin/static_pages_controller.rb +2 -2
  82. data/app/forms/decidim/admin/attachment_form.rb +7 -1
  83. data/app/forms/decidim/admin/help_section_form.rb +1 -1
  84. data/app/forms/decidim/admin/impersonate_user_form.rb +0 -5
  85. data/app/forms/decidim/admin/organization_appearance_form.rb +2 -5
  86. data/app/forms/decidim/admin/{organization_external_domain_whitelist_form.rb → organization_external_domain_allowlist_form.rb} +3 -3
  87. data/app/forms/decidim/admin/organization_form.rb +4 -4
  88. data/app/forms/decidim/admin/static_page_form.rb +1 -2
  89. data/app/forms/decidim/admin/transfer_user_form.rb +0 -15
  90. data/app/helpers/decidim/admin/application_helper.rb +0 -13
  91. data/app/helpers/decidim/admin/filterable_helper.rb +19 -3
  92. data/app/helpers/decidim/admin/moderations/reports_helper.rb +3 -1
  93. data/app/helpers/decidim/admin/newsletters_helper.rb +3 -3
  94. data/app/helpers/decidim/admin/paginable/per_page_helper.rb +22 -0
  95. data/app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb +2 -2
  96. data/app/packs/entrypoints/decidim_admin.js +4 -1
  97. data/app/packs/src/decidim/admin/application.js +19 -15
  98. data/app/packs/src/decidim/admin/css_preview.js +39 -0
  99. data/app/packs/src/decidim/admin/form.js +18 -1
  100. data/app/packs/src/decidim/admin/newsletters.js +9 -18
  101. data/app/packs/src/decidim/admin/participatory_space_search.js +1 -1
  102. data/app/packs/src/decidim/admin/proposal_infinite_edit.js +2 -2
  103. data/app/packs/src/decidim/admin/sync_radio_buttons.js +27 -0
  104. data/app/packs/src/decidim/admin/text_copy.js +19 -0
  105. data/app/packs/stylesheets/decidim/admin/_cards.scss +1 -1
  106. data/app/packs/stylesheets/decidim/admin/_datepicker.scss +62 -0
  107. data/app/packs/stylesheets/decidim/admin/_item_edit.scss +1 -1
  108. data/app/packs/stylesheets/decidim/admin/_item_show.scss +8 -0
  109. data/app/packs/stylesheets/decidim/admin/_moderations.scss +0 -8
  110. data/app/packs/stylesheets/decidim/admin/_proposal_status.scss +5 -0
  111. data/app/packs/stylesheets/decidim/admin/application.scss +2 -0
  112. data/app/permissions/decidim/admin/permissions.rb +2 -2
  113. data/app/queries/decidim/admin/newsletter_recipients.rb +5 -9
  114. data/app/queries/decidim/admin/user_filter.rb +4 -4
  115. data/app/queries/decidim/admin/user_groups_evaluation.rb +1 -1
  116. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  117. data/app/views/decidim/admin/attachments/_form.html.erb +21 -2
  118. data/app/views/decidim/admin/attachments/index.html.erb +2 -2
  119. data/app/views/decidim/admin/authorization_workflows/index.html.erb +26 -8
  120. data/app/views/decidim/admin/block_user/new.html.erb +1 -1
  121. data/app/views/decidim/admin/categories/index.html.erb +2 -2
  122. data/app/views/decidim/admin/components/_form.html.erb +1 -1
  123. data/app/views/decidim/admin/components/index.html.erb +1 -5
  124. data/app/views/decidim/admin/conflicts/edit.html.erb +11 -21
  125. data/app/views/decidim/admin/conflicts/index.html.erb +6 -29
  126. data/app/views/decidim/admin/dashboard/_pending_moderations.html.erb +1 -1
  127. data/app/views/decidim/admin/dashboard/show.html.erb +1 -1
  128. data/app/views/decidim/admin/exports/_dropdown.html.erb +6 -6
  129. data/app/views/decidim/admin/impersonatable_users/index.html.erb +3 -3
  130. data/app/views/decidim/admin/imports/_dropdown.html.erb +5 -7
  131. data/app/views/decidim/admin/imports/new.html.erb +6 -7
  132. data/app/views/decidim/admin/logs/_filters.html.erb +3 -3
  133. data/app/views/decidim/admin/managed_users/promotions/new.html.erb +1 -1
  134. data/app/views/decidim/admin/moderated_users/index.html.erb +4 -4
  135. data/app/views/decidim/admin/moderations/index.html.erb +5 -5
  136. data/app/views/decidim/admin/moderations/reports/index.html.erb +6 -6
  137. data/app/views/decidim/admin/moderations/reports/show.html.erb +4 -4
  138. data/app/views/decidim/admin/newsletter_templates/index.html.erb +3 -2
  139. data/app/views/decidim/admin/newsletter_templates/show.html.erb +7 -7
  140. data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
  141. data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +6 -7
  142. data/app/views/decidim/admin/newsletters/show.html.erb +1 -1
  143. data/app/views/decidim/admin/organization/_form.html.erb +3 -3
  144. data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +0 -3
  145. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +5 -5
  146. data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +3 -3
  147. data/app/views/decidim/admin/{organization_external_domain_whitelist → organization_external_domain_allowlist}/_external_domain.html.erb +4 -4
  148. data/app/views/decidim/admin/{organization_external_domain_whitelist → organization_external_domain_allowlist}/_form.html.erb +2 -2
  149. data/app/views/decidim/admin/{organization_external_domain_whitelist → organization_external_domain_allowlist}/edit.html.erb +2 -2
  150. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
  151. data/app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb +1 -1
  152. data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +1 -1
  153. data/app/views/decidim/admin/shared/_adjacent_navigation.html.erb +30 -0
  154. data/app/views/decidim/admin/shared/_admin_confirm_modal.html.erb +7 -7
  155. data/app/views/decidim/admin/shared/_filters.html.erb +1 -1
  156. data/app/views/decidim/admin/shared/_gallery.html.erb +1 -1
  157. data/app/views/decidim/admin/shared/landing_page/_content_blocks.html.erb +2 -2
  158. data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +1 -1
  159. data/app/views/decidim/admin/static_page_topics/index.html.erb +1 -1
  160. data/app/views/decidim/admin/static_pages/_form.html.erb +0 -4
  161. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +2 -2
  162. data/app/views/layouts/decidim/admin/_admin_timeout_modal.html.erb +2 -2
  163. data/app/views/layouts/decidim/admin/_application.html.erb +4 -4
  164. data/app/views/layouts/decidim/admin/_callouts_full.html.erb +1 -1
  165. data/app/views/layouts/decidim/admin/_js_configuration.html.erb +3 -1
  166. data/app/views/layouts/decidim/admin/_title_bar.html.erb +2 -2
  167. data/app/views/layouts/decidim/admin/_title_bar_responsive.html.erb +2 -2
  168. data/config/locales/ar.yml +1 -54
  169. data/config/locales/bg.yml +15 -12
  170. data/config/locales/ca.yml +18 -15
  171. data/config/locales/cs.yml +15 -17
  172. data/config/locales/de.yml +18 -15
  173. data/config/locales/el.yml +0 -11
  174. data/config/locales/en.yml +15 -12
  175. data/config/locales/es-MX.yml +17 -14
  176. data/config/locales/es-PY.yml +17 -14
  177. data/config/locales/es.yml +19 -16
  178. data/config/locales/eu.yml +145 -154
  179. data/config/locales/fi-plain.yml +18 -15
  180. data/config/locales/fi.yml +39 -36
  181. data/config/locales/fr-CA.yml +15 -12
  182. data/config/locales/fr.yml +13 -10
  183. data/config/locales/ga-IE.yml +0 -3
  184. data/config/locales/gl.yml +2 -6
  185. data/config/locales/hu.yml +9 -10
  186. data/config/locales/id-ID.yml +0 -7
  187. data/config/locales/is-IS.yml +0 -15
  188. data/config/locales/it.yml +3 -10
  189. data/config/locales/ja.yml +20 -17
  190. data/config/locales/kaa.yml +3 -3
  191. data/config/locales/ko.yml +1 -6
  192. data/config/locales/lb.yml +4 -11
  193. data/config/locales/lt.yml +0 -12
  194. data/config/locales/lv.yml +2 -6
  195. data/config/locales/nl.yml +1 -8
  196. data/config/locales/no.yml +1 -8
  197. data/config/locales/pl.yml +15 -10
  198. data/config/locales/pt-BR.yml +8 -12
  199. data/config/locales/pt.yml +0 -11
  200. data/config/locales/ro-RO.yml +5 -22
  201. data/config/locales/ru.yml +1 -6
  202. data/config/locales/sk.yml +2 -6
  203. data/config/locales/sl.yml +2 -0
  204. data/config/locales/sq-AL.yml +3 -3
  205. data/config/locales/sr-CS.yml +3 -6
  206. data/config/locales/sv.yml +209 -357
  207. data/config/locales/th-TH.yml +0 -13
  208. data/config/locales/tr-TR.yml +2 -6
  209. data/config/locales/uk.yml +0 -6
  210. data/config/locales/zh-CN.yml +6 -3
  211. data/config/locales/zh-TW.yml +0 -11
  212. data/config/routes.rb +2 -2
  213. data/decidim-admin.gemspec +2 -2
  214. data/lib/decidim/admin/engine.rb +0 -1
  215. data/lib/decidim/admin/import/creator.rb +1 -1
  216. data/lib/decidim/admin/import/importer_factory.rb +2 -2
  217. data/lib/decidim/admin/menu.rb +4 -4
  218. data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +3 -2
  219. data/lib/decidim/admin/test/commands/create_category_examples.rb +4 -2
  220. data/lib/decidim/admin/test/commands/update_attachment_collection_examples.rb +3 -2
  221. data/lib/decidim/admin/test/commands/update_category_examples.rb +3 -2
  222. data/lib/decidim/admin/test/filterable_examples.rb +5 -3
  223. data/lib/decidim/admin/test/filters_participatory_space_user_roles_examples.rb +5 -5
  224. data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +1 -1
  225. data/lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb +0 -1
  226. data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +12 -12
  227. data/lib/decidim/admin/test/manage_attachments_examples.rb +52 -28
  228. data/lib/decidim/admin/test/manage_categories_examples.rb +13 -13
  229. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +5 -5
  230. data/lib/decidim/admin/test/manage_hide_content_examples.rb +4 -4
  231. data/lib/decidim/admin/test/manage_moderations_examples.rb +21 -21
  232. data/lib/decidim/admin/test/manage_paginated_collection_examples.rb +5 -5
  233. data/lib/decidim/admin/test/manage_participatory_space_publications_examples.rb +2 -2
  234. data/lib/decidim/admin/version.rb +1 -1
  235. data/lib/decidim/admin.rb +15 -0
  236. metadata +28 -27
  237. data/app/commands/decidim/admin/destroy_share_token.rb +0 -46
  238. data/app/commands/decidim/admin/destroy_static_page.rb +0 -40
  239. data/app/commands/decidim/admin/destroy_static_page_topic.rb +0 -40
  240. data/app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb +0 -31
  241. data/app/views/layouts/decidim/admin/login.html.erb +0 -19
  242. data/config/locales/bn-BD.yml +0 -1
  243. data/config/locales/bs-BA.yml +0 -528
  244. /data/app/packs/src/decidim/admin/{external_domain_whitelist.js → external_domain_allowlist.js} +0 -0
@@ -23,7 +23,7 @@ shared_examples "Managing component permissions" do
23
23
  context "when setting permissions" do
24
24
  before do
25
25
  within ".component-#{component.id}" do
26
- click_link "Permissions"
26
+ click_on "Permissions"
27
27
  end
28
28
  end
29
29
 
@@ -54,7 +54,7 @@ shared_examples "Managing component permissions" do
54
54
  before do
55
55
  allow_any_instance_of(Decidim::Admin::PermissionsForm).to receive(:valid?).and_return(false)
56
56
  within ".component-#{component.id}" do
57
- click_link "Permissions"
57
+ click_on "Permissions"
58
58
  end
59
59
  within "#components form" do
60
60
  within ".foo-permission" do
@@ -85,7 +85,7 @@ shared_examples "Managing component permissions" do
85
85
  )
86
86
 
87
87
  within ".component-#{component.id}" do
88
- click_link "Permissions"
88
+ click_on "Permissions"
89
89
  end
90
90
  end
91
91
 
@@ -120,7 +120,7 @@ shared_examples "Managing component permissions" do
120
120
  )
121
121
 
122
122
  within ".component-#{component.id}" do
123
- click_link "Permissions"
123
+ click_on "Permissions"
124
124
  end
125
125
  end
126
126
 
@@ -206,7 +206,7 @@ shared_examples "Managing component permissions" do
206
206
  let(:component_settings) { { resources_permissions_enabled: false } }
207
207
 
208
208
  it "does not show the resource permissions settings" do
209
- expect(page).not_to have_content(resource.title)
209
+ expect(page).to have_no_content(resource.title)
210
210
  end
211
211
  end
212
212
 
@@ -19,7 +19,7 @@ shared_examples "hideable resource during block" do
19
19
  visit reportable_path
20
20
 
21
21
  within ".profile__actions-secondary", match: :first do
22
- click_button(I18n.t("decidim.shared.flag_modal.report"))
22
+ click_on(I18n.t("decidim.shared.flag_modal.report"))
23
23
  end
24
24
  within ".flag-modal" do
25
25
  find(:css, "input[name='report[block]']").set(true)
@@ -31,7 +31,7 @@ shared_examples "hideable resource during block" do
31
31
  within ".flag-modal" do
32
32
  find(:css, "input[name='report[hide]']").set(true)
33
33
  end
34
- click_button I18n.t("decidim.shared.flag_user_modal.block")
34
+ click_on I18n.t("decidim.shared.flag_user_modal.block")
35
35
  expect(page).to have_current_path(decidim_admin.new_user_block_path(user_id: reportable.id, hide: true))
36
36
  end
37
37
 
@@ -46,12 +46,12 @@ shared_examples "hideable resource during block" do
46
46
  within ".flag-modal" do
47
47
  find(:css, "input[name='report[hide]']").set(true)
48
48
  end
49
- click_button I18n.t("decidim.shared.flag_user_modal.block")
49
+ click_on I18n.t("decidim.shared.flag_user_modal.block")
50
50
  expect(page).to have_current_path(decidim_admin.new_user_block_path(user_id: reportable.id, hide: true))
51
51
 
52
52
  fill_in :block_user_justification, with: "This user is a spammer" * 2 # to have at least 15 chars
53
53
 
54
- click_button I18n.t("decidim.admin.block_user.new.action")
54
+ click_on I18n.t("decidim.admin.block_user.new.action")
55
55
 
56
56
  expect(content.reload).to be_hidden
57
57
 
@@ -15,16 +15,16 @@ shared_examples "sorted moderations" do
15
15
  before do
16
16
  visit participatory_space_path
17
17
  if moderations_link_in_admin_menu
18
- within_admin_sidebar_menu { click_link(moderations_link_text) }
18
+ within_admin_sidebar_menu { click_on(moderations_link_text) }
19
19
  else
20
- within("div.layout-nav") { click_link(moderations_link_text) }
20
+ within("div.layout-nav") { click_on(moderations_link_text) }
21
21
  end
22
22
  end
23
23
 
24
24
  it "sorts the most recent first" do
25
25
  link_text = find("ul[data-pages]").text.split("\n")[-2]
26
26
  within "ul[data-pages]" do
27
- click_link link_text
27
+ click_on link_text
28
28
  end
29
29
  all("tbody tr").each_with_index do |row, _index|
30
30
  expect(row.find("td:first-child")).to have_content(reportables.first.id)
@@ -54,9 +54,9 @@ shared_examples "manage moderations" do
54
54
  before do
55
55
  visit participatory_space_path
56
56
  if moderations_link_in_admin_menu
57
- within_admin_sidebar_menu { click_link(moderations_link_text) }
57
+ within_admin_sidebar_menu { click_on(moderations_link_text) }
58
58
  else
59
- within("div.layout-nav") { click_link(moderations_link_text) }
59
+ within("div.layout-nav") { click_on(moderations_link_text) }
60
60
  end
61
61
  end
62
62
 
@@ -68,7 +68,7 @@ shared_examples "manage moderations" do
68
68
 
69
69
  visit current_path
70
70
 
71
- expect(page).not_to have_selector("tr[data-id=\"#{external_moderation.id}\"]")
71
+ expect(page).to have_no_css("tr[data-id=\"#{external_moderation.id}\"]")
72
72
  end
73
73
 
74
74
  it "user can review them" do
@@ -82,7 +82,7 @@ shared_examples "manage moderations" do
82
82
 
83
83
  it "user can un-report a resource" do
84
84
  within "tr[data-id=\"#{moderation.id}\"]" do
85
- click_link "Unreport"
85
+ click_on "Unreport"
86
86
  end
87
87
 
88
88
  expect(page).to have_admin_callout("Resource successfully unreported")
@@ -90,11 +90,11 @@ shared_examples "manage moderations" do
90
90
 
91
91
  it "user can hide a resource" do
92
92
  within "tr[data-id=\"#{moderation.id}\"]" do
93
- click_link "Hide"
93
+ click_on "Hide"
94
94
  end
95
95
 
96
96
  expect(page).to have_admin_callout("Resource successfully hidden")
97
- expect(page).not_to have_content(moderation.reportable.reported_content_url)
97
+ expect(page).to have_no_content(moderation.reportable.reported_content_url)
98
98
  end
99
99
 
100
100
  it "user can sort by report count" do
@@ -102,7 +102,7 @@ shared_examples "manage moderations" do
102
102
  moderations_ordered_by_report_count_asc = moderations.sort_by(&:report_count)
103
103
 
104
104
  within "table" do
105
- click_link "Reports count"
105
+ click_on "Reports count"
106
106
 
107
107
  all("tbody tr").each_with_index do |row, index|
108
108
  reportable_id = moderations_ordered_by_report_count_asc[index].reportable.id
@@ -116,23 +116,23 @@ shared_examples "manage moderations" do
116
116
  within ".filters__section" do
117
117
  find(:xpath, "//a[contains(text(), 'Filter')]").hover
118
118
  find(:xpath, "//a[contains(text(), 'Type')]").hover
119
- click_link reportable_type
119
+ click_on reportable_type
120
120
  end
121
- expect(page).to have_selector("tbody tr", count: moderations.length)
121
+ expect(page).to have_css("tbody tr", count: moderations.length)
122
122
  end
123
123
 
124
124
  it "user can filter by reported content" do
125
125
  search = moderation.reportable.id
126
126
  within ".filters__section" do
127
127
  fill_in("Search Moderation by reportable id or content.", with: search)
128
- click_button(type: "submit")
128
+ within(".input-group-button") { click_on(class: "text-secondary") }
129
129
  end
130
- expect(page).to have_selector("tbody tr", count: 1)
130
+ expect(page).to have_css("tbody tr", count: 1)
131
131
  end
132
132
 
133
133
  it "user can see moderation details" do
134
134
  within "tr[data-id=\"#{moderation.id}\"]" do
135
- click_link "Expand"
135
+ click_on "Expand"
136
136
  end
137
137
 
138
138
  reported_content_slice = moderation.reportable.reported_searchable_content_text.split("\n").first
@@ -144,7 +144,7 @@ shared_examples "manage moderations" do
144
144
  moderation.reportable.destroy
145
145
  visit current_path
146
146
 
147
- expect(page).not_to have_selector("tr[data-id=\"#{moderation.id}\"]")
147
+ expect(page).to have_no_css("tr[data-id=\"#{moderation.id}\"]")
148
148
  end
149
149
  end
150
150
 
@@ -170,7 +170,7 @@ shared_examples "manage moderations" do
170
170
  )
171
171
 
172
172
  within_language_menu(admin: true) do
173
- click_link "Català"
173
+ click_on "Català"
174
174
  end
175
175
  end
176
176
 
@@ -184,11 +184,11 @@ shared_examples "manage moderations" do
184
184
 
185
185
  context "when listing hidden resources" do
186
186
  before do
187
- click_link "Hidden"
187
+ click_on "Hidden"
188
188
  end
189
189
 
190
190
  it "user cannot unreport them" do
191
- expect(page).not_to have_css(".action-icon--unreport")
191
+ expect(page).to have_no_css(".action-icon--unreport")
192
192
  end
193
193
 
194
194
  it "user can review them" do
@@ -231,11 +231,11 @@ shared_examples "manage moderations" do
231
231
  it "user can hide them" do
232
232
  moderation_id = moderations.first.id
233
233
  within "tr[data-id=\"#{moderation_id}\"]" do
234
- click_link "Hide"
234
+ click_on "Hide"
235
235
  end
236
236
 
237
237
  expect(page).to have_admin_callout("Resource successfully hidden")
238
- expect(page).not_to have_selector("tr[data-id=\"#{moderation_id}\"]")
238
+ expect(page).to have_no_css("tr[data-id=\"#{moderation_id}\"]")
239
239
  end
240
240
  end
241
241
  end
@@ -3,7 +3,7 @@
3
3
  shared_examples "a paginated collection" do |options|
4
4
  before do
5
5
  # Current path strips out the request parameters, use current_url when needed
6
- # Be aware that current_utl can lead to flaky, use with caution
6
+ # Be aware that current_url can lead to flaky, use with caution
7
7
  if options&.dig(:url)
8
8
  visit current_url
9
9
  else
@@ -12,17 +12,17 @@ shared_examples "a paginated collection" do |options|
12
12
  end
13
13
 
14
14
  describe "Number of results per page" do
15
- it "lists 25 resources per page by default" do
16
- expect(page).to have_css(".table-list tbody tr", count: 25)
15
+ it "lists 15 resources per page by default" do
16
+ expect(page).to have_css(".table-list tbody tr", count: 15)
17
17
  end
18
18
 
19
19
  it "changes the number of results per page" do
20
20
  within "[data-pagination]" do
21
- page.find("details", text: "25").click
21
+ page.find("details", text: "15").click
22
22
  click_on "50"
23
23
  end
24
24
 
25
- expect(page).to have_selector(".table-list tbody tr", count: 50)
25
+ expect(page).to have_css(".table-list tbody tr", count: 50)
26
26
  end
27
27
  end
28
28
  end
@@ -15,7 +15,7 @@ shared_examples "manage participatory space publications" do |_options|
15
15
  end
16
16
 
17
17
  it "publishes it" do
18
- click_link "Publish"
18
+ click_on "Publish"
19
19
 
20
20
  expect(page).to have_content("successfully")
21
21
 
@@ -42,7 +42,7 @@ shared_examples "manage participatory space publications" do |_options|
42
42
  it "unpublishes it" do
43
43
  # we cannot use "a 404 page" shared example as we want to check it
44
44
  # inside an example
45
- click_link "Unpublish"
45
+ click_on "Unpublish"
46
46
 
47
47
  expect(page).to have_content("successfully")
48
48
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-admin version.
5
5
  module Admin
6
6
  def self.version
7
- "0.28.5"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
data/lib/decidim/admin.rb CHANGED
@@ -17,6 +17,21 @@ module Decidim
17
17
 
18
18
  include ActiveSupport::Configurable
19
19
 
20
+ # Public Setting that configures Kaminari configuration options
21
+ # https://github.com/kaminari/kaminari#general-configuration-options
22
+
23
+ # Range of number of results per_page. Defaults to [15, 50, 100].
24
+ # per_page_range.first sets the default number per page
25
+ # per_page_range.last sets the default max_per_page
26
+ config_accessor :per_page_range do
27
+ [15, 50, 100]
28
+ end
29
+
30
+ Kaminari.configure do |config|
31
+ config.default_per_page = Decidim::Admin.per_page_range.first
32
+ config.max_per_page = Decidim::Admin.per_page_range.last
33
+ end
34
+
20
35
  # Public: Stores an instance of ViewHooks
21
36
  def self.view_hooks
22
37
  @view_hooks ||= ViewHooks.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.5
4
+ version: 0.29.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-02-12 00:00:00.000000000 Z
13
+ date: 2024-07-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.28.5
35
+ version: 0.29.0.rc1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.28.5
42
+ version: 0.29.0.rc1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: devise
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -94,28 +94,28 @@ dependencies:
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 0.28.5
97
+ version: 0.29.0.rc1
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: 0.28.5
104
+ version: 0.29.0.rc1
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: decidim-participatory_processes
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: 0.28.5
111
+ version: 0.29.0.rc1
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.28.5
118
+ version: 0.29.0.rc1
119
119
  description: Organization administration to manage a single organization.
120
120
  email:
121
121
  - josepjaume@gmail.com
@@ -162,9 +162,6 @@ files:
162
162
  - app/commands/decidim/admin/destroy_newsletter.rb
163
163
  - app/commands/decidim/admin/destroy_participatory_space_private_user.rb
164
164
  - app/commands/decidim/admin/destroy_scope.rb
165
- - app/commands/decidim/admin/destroy_share_token.rb
166
- - app/commands/decidim/admin/destroy_static_page.rb
167
- - app/commands/decidim/admin/destroy_static_page_topic.rb
168
165
  - app/commands/decidim/admin/hide_resource.rb
169
166
  - app/commands/decidim/admin/impersonate_user.rb
170
167
  - app/commands/decidim/admin/invite_admin.rb
@@ -194,7 +191,7 @@ files:
194
191
  - app/commands/decidim/admin/update_category.rb
195
192
  - app/commands/decidim/admin/update_component.rb
196
193
  - app/commands/decidim/admin/update_component_permissions.rb
197
- - app/commands/decidim/admin/update_external_domain_whitelist.rb
194
+ - app/commands/decidim/admin/update_external_domain_allowlist.rb
198
195
  - app/commands/decidim/admin/update_help_sections.rb
199
196
  - app/commands/decidim/admin/update_newsletter.rb
200
197
  - app/commands/decidim/admin/update_organization.rb
@@ -215,12 +212,12 @@ files:
215
212
  - app/controllers/concerns/decidim/admin/logs/filterable.rb
216
213
  - app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb
217
214
  - app/controllers/concerns/decidim/admin/officializations/filterable.rb
215
+ - app/controllers/concerns/decidim/admin/paginable.rb
218
216
  - app/controllers/concerns/decidim/admin/participatory_space_admin_breadcrumb.rb
219
217
  - app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb
220
218
  - app/controllers/concerns/decidim/admin/participatory_space_export.rb
221
219
  - app/controllers/concerns/decidim/admin/user_groups.rb
222
220
  - app/controllers/concerns/decidim/admin/user_groups/filterable.rb
223
- - app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb
224
221
  - app/controllers/concerns/decidim/moderated_users/admin/filterable.rb
225
222
  - app/controllers/concerns/decidim/moderations/admin/filterable.rb
226
223
  - app/controllers/concerns/decidim/participatory_space_private_users/admin/filterable.rb
@@ -262,7 +259,7 @@ files:
262
259
  - app/controllers/decidim/admin/officializations_controller.rb
263
260
  - app/controllers/decidim/admin/organization_appearance_controller.rb
264
261
  - app/controllers/decidim/admin/organization_controller.rb
265
- - app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb
262
+ - app/controllers/decidim/admin/organization_external_domain_allowlist_controller.rb
266
263
  - app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb
267
264
  - app/controllers/decidim/admin/organization_homepage_controller.rb
268
265
  - app/controllers/decidim/admin/participatory_space/user_role_controller.rb
@@ -299,7 +296,7 @@ files:
299
296
  - app/forms/decidim/admin/newsletter_form.rb
300
297
  - app/forms/decidim/admin/officialization_form.rb
301
298
  - app/forms/decidim/admin/organization_appearance_form.rb
302
- - app/forms/decidim/admin/organization_external_domain_whitelist_form.rb
299
+ - app/forms/decidim/admin/organization_external_domain_allowlist_form.rb
303
300
  - app/forms/decidim/admin/organization_form.rb
304
301
  - app/forms/decidim/admin/participatory_space_admin_user_form.rb
305
302
  - app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb
@@ -331,6 +328,7 @@ files:
331
328
  - app/helpers/decidim/admin/moderations/reports_helper.rb
332
329
  - app/helpers/decidim/admin/moderations_helper.rb
333
330
  - app/helpers/decidim/admin/newsletters_helper.rb
331
+ - app/helpers/decidim/admin/paginable/per_page_helper.rb
334
332
  - app/helpers/decidim/admin/reminders_helper.rb
335
333
  - app/helpers/decidim/admin/resource_permissions_helper.rb
336
334
  - app/helpers/decidim/admin/resource_scope_helper.rb
@@ -357,9 +355,10 @@ files:
357
355
  - app/packs/src/decidim/admin/auto_label_by_position.component.js
358
356
  - app/packs/src/decidim/admin/budget_rule_toggler.component.js
359
357
  - app/packs/src/decidim/admin/choose_language.js
358
+ - app/packs/src/decidim/admin/css_preview.js
360
359
  - app/packs/src/decidim/admin/draggable-list.js
361
360
  - app/packs/src/decidim/admin/dynamic_fields.component.js
362
- - app/packs/src/decidim/admin/external_domain_whitelist.js
361
+ - app/packs/src/decidim/admin/external_domain_allowlist.js
363
362
  - app/packs/src/decidim/admin/field_dependent_inputs.component.js
364
363
  - app/packs/src/decidim/admin/form.js
365
364
  - app/packs/src/decidim/admin/managed_users.js
@@ -374,7 +373,9 @@ files:
374
373
  - app/packs/src/decidim/admin/sortable.js
375
374
  - app/packs/src/decidim/admin/subform_multi_toggler.component.js
376
375
  - app/packs/src/decidim/admin/subform_toggler.component.js
376
+ - app/packs/src/decidim/admin/sync_radio_buttons.js
377
377
  - app/packs/src/decidim/admin/tab_focus.js
378
+ - app/packs/src/decidim/admin/text_copy.js
378
379
  - app/packs/src/decidim/admin/toggle_nav.js
379
380
  - app/packs/src/decidim/admin/triadic_color_picker.js
380
381
  - app/packs/src/decidim/admin/welcome_notification.js
@@ -383,6 +384,7 @@ files:
383
384
  - app/packs/stylesheets/decidim/admin/_color_picker.scss
384
385
  - app/packs/stylesheets/decidim/admin/_component-show.scss
385
386
  - app/packs/stylesheets/decidim/admin/_data_picker.scss
387
+ - app/packs/stylesheets/decidim/admin/_datepicker.scss
386
388
  - app/packs/stylesheets/decidim/admin/_dropdown.scss
387
389
  - app/packs/stylesheets/decidim/admin/_filters.scss
388
390
  - app/packs/stylesheets/decidim/admin/_forms.scss
@@ -394,6 +396,7 @@ files:
394
396
  - app/packs/stylesheets/decidim/admin/_main-nav.scss
395
397
  - app/packs/stylesheets/decidim/admin/_minimap.scss
396
398
  - app/packs/stylesheets/decidim/admin/_moderations.scss
399
+ - app/packs/stylesheets/decidim/admin/_proposal_status.scss
397
400
  - app/packs/stylesheets/decidim/admin/_secondary-nav.scss
398
401
  - app/packs/stylesheets/decidim/admin/_show_email.scss
399
402
  - app/packs/stylesheets/decidim/admin/_sidebar-menu.scss
@@ -496,9 +499,9 @@ files:
496
499
  - app/views/decidim/admin/organization_appearance/form/_header_snippets.html.erb
497
500
  - app/views/decidim/admin/organization_appearance/form/_images.html.erb
498
501
  - app/views/decidim/admin/organization_appearance/form/_minimap.html.erb
499
- - app/views/decidim/admin/organization_external_domain_whitelist/_external_domain.html.erb
500
- - app/views/decidim/admin/organization_external_domain_whitelist/_form.html.erb
501
- - app/views/decidim/admin/organization_external_domain_whitelist/edit.html.erb
502
+ - app/views/decidim/admin/organization_external_domain_allowlist/_external_domain.html.erb
503
+ - app/views/decidim/admin/organization_external_domain_allowlist/_form.html.erb
504
+ - app/views/decidim/admin/organization_external_domain_allowlist/edit.html.erb
502
505
  - app/views/decidim/admin/participatory_space_private_users/_form.html.erb
503
506
  - app/views/decidim/admin/participatory_space_private_users/index.html.erb
504
507
  - app/views/decidim/admin/participatory_space_private_users/new.html.erb
@@ -515,6 +518,7 @@ files:
515
518
  - app/views/decidim/admin/scopes/index.html.erb
516
519
  - app/views/decidim/admin/scopes/new.html.erb
517
520
  - app/views/decidim/admin/share_tokens/_share_tokens.html.erb
521
+ - app/views/decidim/admin/shared/_adjacent_navigation.html.erb
518
522
  - app/views/decidim/admin/shared/_admin_confirm_modal.html.erb
519
523
  - app/views/decidim/admin/shared/_filters.html.erb
520
524
  - app/views/decidim/admin/shared/_gallery.html.erb
@@ -549,7 +553,6 @@ files:
549
553
  - app/views/layouts/decidim/admin/_title_bar_responsive.html.erb
550
554
  - app/views/layouts/decidim/admin/application.html.erb
551
555
  - app/views/layouts/decidim/admin/global_moderations.html.erb
552
- - app/views/layouts/decidim/admin/login.html.erb
553
556
  - app/views/layouts/decidim/admin/newsletters.erb
554
557
  - app/views/layouts/decidim/admin/settings.html.erb
555
558
  - app/views/layouts/decidim/admin/users.html.erb
@@ -560,8 +563,6 @@ files:
560
563
  - config/locales/ar.yml
561
564
  - config/locales/bg-BG.yml
562
565
  - config/locales/bg.yml
563
- - config/locales/bn-BD.yml
564
- - config/locales/bs-BA.yml
565
566
  - config/locales/ca.yml
566
567
  - config/locales/cs-CZ.yml
567
568
  - config/locales/cs.yml
@@ -692,7 +693,7 @@ files:
692
693
  - lib/decidim/admin/version.rb
693
694
  homepage: https://decidim.org
694
695
  licenses:
695
- - AGPL-3.0-or-later
696
+ - AGPL-3.0
696
697
  metadata:
697
698
  bug_tracker_uri: https://github.com/decidim/decidim/issues
698
699
  documentation_uri: https://docs.decidim.org/
@@ -707,14 +708,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
707
708
  requirements:
708
709
  - - "~>"
709
710
  - !ruby/object:Gem::Version
710
- version: 3.1.0
711
+ version: 3.2.0
711
712
  required_rubygems_version: !ruby/object:Gem::Requirement
712
713
  requirements:
713
- - - ">="
714
+ - - ">"
714
715
  - !ruby/object:Gem::Version
715
- version: '0'
716
+ version: 1.3.1
716
717
  requirements: []
717
- rubygems_version: 3.3.7
718
+ rubygems_version: 3.4.10
718
719
  signing_key:
719
720
  specification_version: 4
720
721
  summary: Decidim organization administration
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # A command with all the business logic to destroy a share token.
6
- class DestroyShareToken < Decidim::Command
7
- # Public: Initializes the command.
8
- #
9
- # share_token - The share_token to destroy
10
- # current_user - the user performing the action
11
- def initialize(share_token, current_user)
12
- @share_token = share_token
13
- @current_user = current_user
14
- end
15
-
16
- # Executes the command. Broadcasts these events:
17
- #
18
- # - :ok when everything is valid.
19
- # - :invalid if the form was not valid and we could not proceed.
20
- #
21
- # Returns nothing.
22
- def call
23
- begin
24
- destroy_share_token
25
- rescue StandardError
26
- broadcast(:invalid)
27
- end
28
- broadcast(:ok)
29
- end
30
-
31
- private
32
-
33
- attr_reader :current_user
34
-
35
- def destroy_share_token
36
- Decidim.traceability.perform_action!(
37
- "delete",
38
- @share_token,
39
- current_user
40
- ) do
41
- @share_token.destroy!
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # This command deals with destroying a StaticPage from the admin panel.
6
- class DestroyStaticPage < Decidim::Command
7
- # Public: Initializes the command.
8
- #
9
- # page - The StaticPage to be destroyed.
10
- def initialize(page, current_user)
11
- @page = page
12
- @current_user = current_user
13
- end
14
-
15
- # Public: Executes the command.
16
- #
17
- # Broadcasts :ok if it got destroyed
18
- def call
19
- destroy_page
20
- broadcast(:ok)
21
- end
22
-
23
- private
24
-
25
- attr_reader :page, :current_user
26
-
27
- def destroy_page
28
- transaction do
29
- Decidim.traceability.perform_action!(
30
- "delete",
31
- page,
32
- current_user
33
- ) do
34
- page.destroy!
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # This command deals with destroying a StaticPageTopic from the admin panel.
6
- class DestroyStaticPageTopic < Decidim::Command
7
- # Public: Initializes the command.
8
- #
9
- # page - The StaticPageTopic to be destroyed.
10
- def initialize(_topic, current_user)
11
- @topic = page
12
- @current_user = current_user
13
- end
14
-
15
- # Public: Executes the command.
16
- #
17
- # Broadcasts :ok if it got destroyed
18
- def call
19
- destroy_topic
20
- broadcast(:ok)
21
- end
22
-
23
- private
24
-
25
- attr_reader :page, :current_user
26
-
27
- def destroy_topic
28
- transaction do
29
- Decidim.traceability.perform_action!(
30
- "delete",
31
- topic,
32
- current_user
33
- ) do
34
- topic.destroy!
35
- end
36
- end
37
- end
38
- end
39
- end
40
- end