decidim-admin 0.26.10 → 0.27.0.rc1

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

Potentially problematic release.


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

Files changed (289) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/admin/attachments_privacy_warning/show.erb +3 -0
  3. data/app/cells/decidim/admin/attachments_privacy_warning_cell.rb +19 -0
  4. data/app/commands/decidim/admin/block_user.rb +3 -8
  5. data/app/commands/decidim/admin/close_session_managed_user.rb +1 -1
  6. data/app/commands/decidim/admin/create_area.rb +1 -1
  7. data/app/commands/decidim/admin/create_area_type.rb +6 -3
  8. data/app/commands/decidim/admin/create_attachment.rb +14 -6
  9. data/app/commands/decidim/admin/create_attachment_collection.rb +13 -4
  10. data/app/commands/decidim/admin/create_category.rb +6 -4
  11. data/app/commands/decidim/admin/create_component.rb +1 -1
  12. data/app/commands/decidim/admin/create_import.rb +4 -5
  13. data/app/commands/decidim/admin/create_import_example.rb +1 -1
  14. data/app/commands/decidim/admin/create_newsletter.rb +1 -1
  15. data/app/commands/decidim/admin/create_participatory_space_private_user.rb +1 -1
  16. data/app/commands/decidim/admin/create_scope.rb +1 -1
  17. data/app/commands/decidim/admin/create_scope_type.rb +6 -3
  18. data/app/commands/decidim/admin/create_static_page.rb +1 -1
  19. data/app/commands/decidim/admin/create_static_page_topic.rb +1 -1
  20. data/app/commands/decidim/admin/deliver_newsletter.rb +6 -6
  21. data/app/commands/decidim/admin/destroy_area.rb +1 -1
  22. data/app/commands/decidim/admin/destroy_category.rb +6 -3
  23. data/app/commands/decidim/admin/destroy_component.rb +1 -1
  24. data/app/commands/decidim/admin/destroy_newsletter.rb +1 -1
  25. data/app/commands/decidim/admin/destroy_participatory_space_private_user.rb +1 -1
  26. data/app/commands/decidim/admin/destroy_scope.rb +1 -1
  27. data/app/commands/decidim/admin/destroy_share_token.rb +1 -1
  28. data/app/commands/decidim/admin/destroy_static_page.rb +1 -1
  29. data/app/commands/decidim/admin/destroy_static_page_topic.rb +1 -1
  30. data/app/commands/decidim/admin/hide_resource.rb +2 -2
  31. data/app/commands/decidim/admin/impersonate_user.rb +1 -1
  32. data/app/commands/decidim/admin/invite_admin.rb +1 -1
  33. data/app/commands/decidim/admin/officialize_user.rb +1 -1
  34. data/app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb +7 -3
  35. data/app/commands/decidim/admin/process_user_group_verification_csv.rb +8 -4
  36. data/app/commands/decidim/admin/promote_managed_user.rb +1 -1
  37. data/app/commands/decidim/admin/publish_component.rb +2 -2
  38. data/app/commands/decidim/admin/reject_user_group.rb +1 -1
  39. data/app/commands/decidim/admin/remove_admin.rb +1 -1
  40. data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
  41. data/app/commands/decidim/admin/transfer_user.rb +1 -1
  42. data/app/commands/decidim/admin/unblock_user.rb +2 -2
  43. data/app/commands/decidim/admin/unhide_resource.rb +1 -1
  44. data/app/commands/decidim/admin/unofficialize_user.rb +1 -1
  45. data/app/commands/decidim/admin/unpublish_component.rb +1 -1
  46. data/app/commands/decidim/admin/unreport_resource.rb +1 -1
  47. data/app/commands/decidim/admin/unreport_user.rb +1 -1
  48. data/app/commands/decidim/admin/update_area.rb +1 -1
  49. data/app/commands/decidim/admin/update_area_type.rb +8 -3
  50. data/app/commands/decidim/admin/update_attachment.rb +4 -3
  51. data/app/commands/decidim/admin/update_attachment_collection.rb +8 -3
  52. data/app/commands/decidim/admin/update_category.rb +9 -5
  53. data/app/commands/decidim/admin/update_component.rb +8 -5
  54. data/app/commands/decidim/admin/update_component_permissions.rb +9 -6
  55. data/app/commands/decidim/admin/update_content_block.rb +1 -1
  56. data/app/commands/decidim/admin/update_external_domain_whitelist.rb +6 -3
  57. data/app/commands/decidim/admin/update_help_sections.rb +17 -3
  58. data/app/commands/decidim/admin/update_newsletter.rb +1 -1
  59. data/app/commands/decidim/admin/update_organization.rb +1 -1
  60. data/app/commands/decidim/admin/update_organization_appearance.rb +1 -1
  61. data/app/commands/decidim/admin/update_organization_tos_version.rb +1 -1
  62. data/app/commands/decidim/admin/update_resource_permissions.rb +2 -2
  63. data/app/commands/decidim/admin/update_scope.rb +1 -1
  64. data/app/commands/decidim/admin/update_scope_type.rb +8 -3
  65. data/app/commands/decidim/admin/update_static_page.rb +1 -1
  66. data/app/commands/decidim/admin/update_static_page_topic.rb +1 -1
  67. data/app/commands/decidim/admin/update_user_groups.rb +1 -1
  68. data/app/commands/decidim/admin/verify_user_group.rb +1 -1
  69. data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
  70. data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +3 -1
  71. data/app/controllers/concerns/decidim/moderations/admin/filterable.rb +0 -4
  72. data/app/controllers/decidim/admin/admin_terms_controller.rb +1 -1
  73. data/app/controllers/decidim/admin/application_controller.rb +1 -2
  74. data/app/controllers/decidim/admin/area_types_controller.rb +6 -3
  75. data/app/controllers/decidim/admin/block_user_controller.rb +3 -3
  76. data/app/controllers/decidim/admin/categories_controller.rb +3 -3
  77. data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
  78. data/app/controllers/decidim/admin/components/base_controller.rb +1 -0
  79. data/app/controllers/decidim/admin/components_controller.rb +1 -1
  80. data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +6 -3
  81. data/app/controllers/decidim/admin/concerns/has_attachments.rb +6 -3
  82. data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +7 -0
  83. data/app/controllers/decidim/admin/dashboard_controller.rb +4 -3
  84. data/app/controllers/decidim/admin/exports_controller.rb +4 -1
  85. data/app/controllers/decidim/admin/help_sections_controller.rb +1 -1
  86. data/app/controllers/decidim/admin/metrics_controller.rb +2 -1
  87. data/app/controllers/decidim/admin/moderations_controller.rb +9 -7
  88. data/app/controllers/decidim/admin/newsletter_templates_controller.rb +1 -1
  89. data/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
  90. data/app/controllers/decidim/admin/organization_controller.rb +3 -4
  91. data/app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb +1 -1
  92. data/app/controllers/decidim/admin/reminders_controller.rb +61 -0
  93. data/app/controllers/decidim/admin/resource_permissions_controller.rb +3 -3
  94. data/app/controllers/decidim/admin/scope_types_controller.rb +6 -3
  95. data/app/controllers/decidim/admin/static_page_topics_controller.rb +3 -1
  96. data/app/controllers/decidim/admin/static_pages_controller.rb +1 -7
  97. data/app/forms/decidim/admin/block_user_form.rb +2 -2
  98. data/app/forms/decidim/admin/category_form.rb +1 -2
  99. data/app/forms/decidim/admin/component_form.rb +16 -7
  100. data/app/forms/decidim/admin/import_example_form.rb +1 -5
  101. data/app/forms/decidim/admin/import_form.rb +7 -10
  102. data/app/forms/decidim/admin/managed_user_promotion_form.rb +1 -1
  103. data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +7 -4
  104. data/app/forms/decidim/admin/permission_form.rb +9 -8
  105. data/app/forms/decidim/admin/permissions_form.rb +1 -10
  106. data/app/forms/decidim/admin/user_group_csv_verification_form.rb +2 -2
  107. data/app/helpers/decidim/admin/bulk_actions_helper.rb +6 -5
  108. data/app/helpers/decidim/admin/moderations/reports_helper.rb +11 -2
  109. data/app/helpers/decidim/admin/reminders_helper.rb +12 -0
  110. data/app/helpers/decidim/admin/settings_helper.rb +11 -57
  111. data/app/models/decidim/admin/fake_newsletter.rb +0 -20
  112. data/app/packs/entrypoints/decidim_admin.js +3 -6
  113. data/app/packs/src/decidim/admin/admin_autocomplete.js +82 -0
  114. data/app/packs/src/decidim/admin/application.js +0 -16
  115. data/app/packs/src/decidim/admin/choose_language.js +9 -11
  116. data/app/packs/src/decidim/admin/draggable-list.js +1 -1
  117. data/app/packs/src/decidim/admin/dynamic_fields.component.js +0 -1
  118. data/app/packs/stylesheets/decidim/admin/_decidim.scss +0 -1
  119. data/app/packs/stylesheets/decidim/admin/extra/_quill.scss +0 -7
  120. data/app/packs/stylesheets/decidim/admin/modules/_autocomplete.scss +5 -0
  121. data/app/packs/stylesheets/decidim/admin/modules/_forms.scss +0 -6
  122. data/app/packs/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
  123. data/app/packs/stylesheets/decidim/admin/modules/_modules.scss +3 -0
  124. data/app/packs/stylesheets/decidim/admin/modules/_upload_modal.scss +42 -0
  125. data/app/permissions/decidim/admin/permissions.rb +4 -46
  126. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +3 -1
  127. data/app/queries/decidim/admin/active_users_counter.rb +1 -1
  128. data/app/queries/decidim/admin/newsletter_recipients.rb +2 -2
  129. data/app/queries/decidim/admin/user_filter.rb +1 -1
  130. data/app/queries/decidim/admin/user_groups_evaluation.rb +1 -1
  131. data/app/views/decidim/admin/area_types/edit.html.erb +0 -1
  132. data/app/views/decidim/admin/area_types/index.html.erb +0 -1
  133. data/app/views/decidim/admin/area_types/new.html.erb +0 -1
  134. data/app/views/decidim/admin/areas/edit.html.erb +0 -1
  135. data/app/views/decidim/admin/areas/index.html.erb +0 -1
  136. data/app/views/decidim/admin/areas/new.html.erb +0 -1
  137. data/app/views/decidim/admin/attachment_collections/edit.html.erb +0 -1
  138. data/app/views/decidim/admin/attachment_collections/index.html.erb +0 -1
  139. data/app/views/decidim/admin/attachment_collections/new.html.erb +0 -1
  140. data/app/views/decidim/admin/attachments/edit.html.erb +0 -1
  141. data/app/views/decidim/admin/attachments/index.html.erb +1 -1
  142. data/app/views/decidim/admin/attachments/new.html.erb +0 -1
  143. data/app/views/decidim/admin/authorization_workflows/index.html.erb +0 -1
  144. data/app/views/decidim/admin/categories/_form.html.erb +0 -4
  145. data/app/views/decidim/admin/categories/edit.html.erb +0 -1
  146. data/app/views/decidim/admin/categories/index.html.erb +0 -1
  147. data/app/views/decidim/admin/categories/new.html.erb +0 -1
  148. data/app/views/decidim/admin/categories/show.html.erb +1 -2
  149. data/app/views/decidim/admin/components/_component.html.erb +41 -3
  150. data/app/views/decidim/admin/components/edit.html.erb +0 -1
  151. data/app/views/decidim/admin/components/index.html.erb +0 -1
  152. data/app/views/decidim/admin/components/new.html.erb +1 -1
  153. data/app/views/decidim/admin/conflicts/index.html.erb +0 -1
  154. data/app/views/decidim/admin/dashboard/show.html.erb +1 -1
  155. data/app/views/decidim/admin/help_sections/show.erb +0 -1
  156. data/app/views/decidim/admin/impersonatable_users/index.html.erb +0 -1
  157. data/app/views/decidim/admin/impersonations/new.html.erb +0 -1
  158. data/app/views/decidim/admin/imports/new.html.erb +1 -1
  159. data/app/views/decidim/admin/logs/index.html.erb +0 -1
  160. data/app/views/decidim/admin/moderated_users/index.html.erb +1 -2
  161. data/app/views/decidim/admin/moderations/index.html.erb +4 -9
  162. data/app/views/decidim/admin/moderations/reports/index.html.erb +1 -5
  163. data/app/views/decidim/admin/newsletter_templates/index.html.erb +0 -1
  164. data/app/views/decidim/admin/newsletter_templates/show.html.erb +0 -1
  165. data/app/views/decidim/admin/newsletters/index.html.erb +0 -1
  166. data/app/views/decidim/admin/newsletters/new.html.erb +0 -1
  167. data/app/views/decidim/admin/newsletters/show.html.erb +0 -1
  168. data/app/views/decidim/admin/officializations/index.html.erb +10 -15
  169. data/app/views/decidim/admin/officializations/new.html.erb +0 -1
  170. data/app/views/decidim/admin/organization/edit.html.erb +0 -1
  171. data/app/views/decidim/admin/organization_appearance/edit.html.erb +0 -1
  172. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +5 -4
  173. data/app/views/decidim/admin/organization_external_domain_whitelist/edit.html.erb +0 -1
  174. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
  175. data/app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb +20 -1
  176. data/app/views/decidim/admin/reminders/new.html.erb +21 -0
  177. data/app/views/decidim/admin/resource_permissions/edit.html.erb +1 -1
  178. data/app/views/decidim/admin/scope_types/edit.html.erb +0 -1
  179. data/app/views/decidim/admin/scope_types/index.html.erb +0 -1
  180. data/app/views/decidim/admin/scope_types/new.html.erb +0 -1
  181. data/app/views/decidim/admin/scopes/edit.html.erb +0 -1
  182. data/app/views/decidim/admin/scopes/index.html.erb +0 -1
  183. data/app/views/decidim/admin/scopes/new.html.erb +0 -1
  184. data/app/views/decidim/admin/shared/_gallery.html.erb +6 -1
  185. data/app/views/decidim/admin/shared/_js-callout.html.erb +6 -0
  186. data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +0 -1
  187. data/app/views/decidim/admin/static_page_topics/edit.html.erb +0 -1
  188. data/app/views/decidim/admin/static_page_topics/new.html.erb +0 -1
  189. data/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
  190. data/app/views/decidim/admin/static_pages/edit.html.erb +0 -1
  191. data/app/views/decidim/admin/static_pages/index.html.erb +0 -1
  192. data/app/views/decidim/admin/static_pages/new.html.erb +0 -1
  193. data/app/views/decidim/admin/user_groups/index.html.erb +0 -1
  194. data/app/views/decidim/admin/user_groups_csv_verifications/new.html.erb +0 -1
  195. data/app/views/decidim/admin/users/index.html.erb +0 -1
  196. data/app/views/decidim/admin/users/new.html.erb +0 -1
  197. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +2 -2
  198. data/app/views/layouts/decidim/admin/_application.html.erb +2 -0
  199. data/app/views/layouts/decidim/admin/global_moderations.html.erb +0 -1
  200. data/config/locales/am-ET.yml +1 -0
  201. data/config/locales/ar.yml +44 -38
  202. data/config/locales/bg.yml +1 -0
  203. data/config/locales/ca.yml +39 -36
  204. data/config/locales/cs.yml +47 -42
  205. data/config/locales/da.yml +1 -0
  206. data/config/locales/de.yml +52 -52
  207. data/config/locales/el.yml +14 -65
  208. data/config/locales/en.yml +25 -23
  209. data/config/locales/eo.yml +1 -0
  210. data/config/locales/es-MX.yml +36 -33
  211. data/config/locales/es-PY.yml +36 -33
  212. data/config/locales/es.yml +39 -36
  213. data/config/locales/et.yml +1 -0
  214. data/config/locales/eu.yml +291 -324
  215. data/config/locales/fi-plain.yml +31 -28
  216. data/config/locales/fi.yml +36 -33
  217. data/config/locales/fr-CA.yml +35 -32
  218. data/config/locales/fr.yml +52 -49
  219. data/config/locales/ga-IE.yml +1 -0
  220. data/config/locales/gl.yml +33 -6
  221. data/config/locales/hr.yml +1 -0
  222. data/config/locales/hu.yml +44 -222
  223. data/config/locales/id-ID.yml +10 -10
  224. data/config/locales/is-IS.yml +6 -9
  225. data/config/locales/it.yml +22 -6
  226. data/config/locales/ja.yml +39 -37
  227. data/config/locales/ko.yml +1 -0
  228. data/config/locales/lb.yml +18 -7
  229. data/config/locales/lt.yml +21 -156
  230. data/config/locales/lv.yml +15 -4
  231. data/config/locales/mt.yml +1 -0
  232. data/config/locales/nl.yml +19 -68
  233. data/config/locales/no.yml +27 -10
  234. data/config/locales/om-ET.yml +1 -0
  235. data/config/locales/pl.yml +29 -25
  236. data/config/locales/pt-BR.yml +16 -85
  237. data/config/locales/pt.yml +19 -8
  238. data/config/locales/ro-RO.yml +32 -38
  239. data/config/locales/ru.yml +10 -9
  240. data/config/locales/si-LK.yml +1 -0
  241. data/config/locales/sk.yml +15 -4
  242. data/config/locales/sl.yml +1 -0
  243. data/config/locales/so-SO.yml +1 -0
  244. data/config/locales/sr-CS.yml +9 -20
  245. data/config/locales/sv.yml +39 -19
  246. data/config/locales/sw-KE.yml +1 -0
  247. data/config/locales/ti-ER.yml +1 -0
  248. data/config/locales/tr-TR.yml +19 -11
  249. data/config/locales/uk.yml +10 -6
  250. data/config/locales/val-ES.yml +1 -0
  251. data/config/locales/vi.yml +1 -0
  252. data/config/locales/zh-CN.yml +15 -4
  253. data/config/locales/zh-TW.yml +1 -1066
  254. data/config/routes.rb +0 -2
  255. data/lib/decidim/admin/engine.rb +1 -12
  256. data/lib/decidim/admin/form_builder.rb +2 -1
  257. data/lib/decidim/admin/import/importer.rb +9 -7
  258. data/lib/decidim/admin/import/readers/json.rb +1 -1
  259. data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +15 -2
  260. data/lib/decidim/admin/test/commands/create_category_examples.rb +16 -6
  261. data/lib/decidim/admin/test/commands/destroy_category_examples.rb +29 -1
  262. data/lib/decidim/admin/test/commands/update_attachment_collection_examples.rb +15 -2
  263. data/lib/decidim/admin/test/commands/update_category_examples.rb +16 -6
  264. data/lib/decidim/admin/test/filters_participatory_space_user_roles_examples.rb +4 -4
  265. data/lib/decidim/admin/test/filters_participatory_space_users_examples.rb +4 -4
  266. data/lib/decidim/admin/test/forms/category_form_examples.rb +1 -21
  267. data/lib/decidim/admin/test/manage_attachments_examples.rb +9 -2
  268. data/lib/decidim/admin/test/manage_categories_examples.rb +0 -10
  269. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +0 -2
  270. data/lib/decidim/admin/test/manage_moderations_examples.rb +27 -79
  271. data/lib/decidim/admin/test.rb +0 -1
  272. data/lib/decidim/admin/version.rb +1 -1
  273. metadata +22 -34
  274. data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +0 -78
  275. data/app/packs/src/decidim/admin/autocomplete.component.js +0 -144
  276. data/app/packs/src/decidim/admin/autocomplete.component.test.js +0 -19
  277. data/app/packs/stylesheets/decidim/admin/components/_autocomplete_select.component.scss +0 -19
  278. data/app/views/decidim/admin/components/_actions.html.erb +0 -43
  279. data/config/environment.rb +0 -3
  280. data/config/locales/fa-IR.yml +0 -1
  281. data/config/locales/gn-PY.yml +0 -1
  282. data/config/locales/ka-GE.yml +0 -1
  283. data/config/locales/kaa.yml +0 -214
  284. data/config/locales/lo-LA.yml +0 -1
  285. data/config/locales/oc-FR.yml +0 -1
  286. data/config/locales/sq-AL.yml +0 -65
  287. data/config/locales/th-TH.yml +0 -1
  288. data/lib/decidim/admin/test/admin_participatory_space_access_examples.rb +0 -49
  289. data/lib/decidim/admin/test/needs_admin_tos_accepted_examples.rb +0 -9
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command to remove the admin privilege to an user.
6
- class RemoveAdmin < Rectify::Command
6
+ class RemoveAdmin < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # user - the user that will no longer be an admin
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # A command that reorders a collection of content blocks. It also creates
6
6
  # the ones that might be missing.
7
- class ReorderContentBlocks < Rectify::Command
7
+ class ReorderContentBlocks < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # organization - the Organization where the content blocks reside
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic to transfer a managed user.
6
- class TransferUser < Rectify::Command
6
+ class TransferUser < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # form
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Admin
5
- class UnblockUser < Rectify::Command
5
+ class UnblockUser < Decidim::Command
6
6
  # Public: Initializes the command.
7
7
  #
8
8
  # blocked_user - the user that is unblocked
@@ -39,7 +39,7 @@ module Decidim
39
39
  @blocked_user.blocked = false
40
40
  @blocked_user.blocked_at = nil
41
41
  @blocked_user.block_id = nil
42
- @blocked_user.name = @blocked_user.extended_data["user_name"]
42
+ @blocked_user.name = @blocked_user.user_name
43
43
  @blocked_user.save!
44
44
  end
45
45
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when a user hides a resource.
6
- class UnhideResource < Rectify::Command
6
+ class UnhideResource < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # reportable - A Decidim::Reportable
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when unofficializing a user.
6
- class UnofficializeUser < Rectify::Command
6
+ class UnofficializeUser < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # user - The user to be unofficialized.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # This command gets called when a component is unpublished from the admin panel.
6
- class UnpublishComponent < Rectify::Command
6
+ class UnpublishComponent < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # component - The component to unpublish.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when a user unreports a resource.
6
- class UnreportResource < Rectify::Command
6
+ class UnreportResource < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # reportable - A Decidim::Reportable
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Admin
5
- class UnreportUser < Rectify::Command
5
+ class UnreportUser < Decidim::Command
6
6
  # Public: Initializes the command.
7
7
  #
8
8
  # reportable - A Decidim::User - The user reported
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating an area.
6
- class UpdateArea < Rectify::Command
6
+ class UpdateArea < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # area - The Area to update
@@ -3,14 +3,15 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating an area type.
6
- class UpdateAreaType < Rectify::Command
6
+ class UpdateAreaType < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # area_type - The AreaType to update
10
10
  # form - A form object with the params.
11
- def initialize(area_type, form)
11
+ def initialize(area_type, form, user)
12
12
  @area_type = area_type
13
13
  @form = form
14
+ @user = user
14
15
  end
15
16
 
16
17
  # Executes the command. Broadcasts these events:
@@ -31,7 +32,11 @@ module Decidim
31
32
  attr_reader :form
32
33
 
33
34
  def update_area_type
34
- @area_type.update!(attributes)
35
+ Decidim.traceability.update!(
36
+ @area_type,
37
+ @user,
38
+ attributes
39
+ )
35
40
  end
36
41
 
37
42
  def attributes
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic to update an attachment from a
6
6
  # participatory process.
7
- class UpdateAttachment < Rectify::Command
7
+ class UpdateAttachment < Decidim::Command
8
8
  include ::Decidim::AttachmentAttributesMethods
9
9
 
10
10
  attr_reader :attachment
@@ -13,9 +13,10 @@ module Decidim
13
13
  #
14
14
  # attachment - the Attachment to update
15
15
  # form - A form object with the params.
16
- def initialize(attachment, form)
16
+ def initialize(attachment, form, user)
17
17
  @attachment = attachment
18
18
  @form = form
19
+ @user = user
19
20
  end
20
21
 
21
22
  # Executes the command. Broadcasts these events:
@@ -36,7 +37,7 @@ module Decidim
36
37
  attr_reader :form
37
38
 
38
39
  def update_attachment
39
- attachment.update!(attributes)
40
+ Decidim.traceability.update!(@attachment, @user, attributes)
40
41
  end
41
42
 
42
43
  def attributes
@@ -3,14 +3,15 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating an attachment collection.
6
- class UpdateAttachmentCollection < Rectify::Command
6
+ class UpdateAttachmentCollection < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # attachment_collection - The AttachmentCollection to update
10
10
  # form - A form object with the params.
11
- def initialize(attachment_collection, form)
11
+ def initialize(attachment_collection, form, user)
12
12
  @attachment_collection = attachment_collection
13
13
  @form = form
14
+ @user = user
14
15
  end
15
16
 
16
17
  # Executes the command. Broadcasts these events:
@@ -31,7 +32,11 @@ module Decidim
31
32
  attr_reader :form
32
33
 
33
34
  def update_attachment_collection
34
- @attachment_collection.update!(attributes)
35
+ Decidim.traceability.update!(
36
+ @attachment_collection,
37
+ @user,
38
+ attributes
39
+ )
35
40
  end
36
41
 
37
42
  def attributes
@@ -4,16 +4,17 @@ module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a category in the
6
6
  # system.
7
- class UpdateCategory < Rectify::Command
7
+ class UpdateCategory < Decidim::Command
8
8
  attr_reader :category
9
9
 
10
10
  # Public: Initializes the command.
11
11
  #
12
12
  # category - the Category to update
13
13
  # form - A form object with the params.
14
- def initialize(category, form)
14
+ def initialize(category, form, user)
15
15
  @category = category
16
16
  @form = form
17
+ @user = user
17
18
  end
18
19
 
19
20
  # Executes the command. Broadcasts these events:
@@ -34,15 +35,18 @@ module Decidim
34
35
  attr_reader :form
35
36
 
36
37
  def update_category
37
- category.update!(attributes)
38
+ Decidim.traceability.update!(
39
+ category,
40
+ @user,
41
+ attributes
42
+ )
38
43
  end
39
44
 
40
45
  def attributes
41
46
  {
42
47
  name: form.name,
43
48
  weight: form.weight,
44
- parent_id: form.parent_id,
45
- description: form.description
49
+ parent_id: form.parent_id
46
50
  }
47
51
  end
48
52
  end
@@ -3,17 +3,18 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # This command gets called when a component is created from the admin panel.
6
- class UpdateComponent < Rectify::Command
6
+ class UpdateComponent < Decidim::Command
7
7
  attr_reader :form, :component, :previous_settings
8
8
 
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - The form from which the data in this component comes from.
12
12
  # component - The component to update.
13
- def initialize(form, component)
13
+ def initialize(form, component, user)
14
14
  @manifest = component.manifest
15
15
  @form = form
16
16
  @component = component
17
+ @user = user
17
18
  end
18
19
 
19
20
  # Public: Creates the Component.
@@ -22,9 +23,11 @@ module Decidim
22
23
  def call
23
24
  return broadcast(:invalid) if form.invalid?
24
25
 
25
- transaction do
26
- update_component
27
- run_hooks
26
+ Decidim.traceability.perform_action!("update", @component, @user) do
27
+ transaction do
28
+ update_component
29
+ run_hooks
30
+ end
28
31
  end
29
32
 
30
33
  broadcast(:ok, settings_changed?, previous_settings, current_settings)
@@ -4,16 +4,17 @@ module Decidim
4
4
  module Admin
5
5
  # This command gets called when permissions for a component are updated
6
6
  # in the admin panel.
7
- class UpdateComponentPermissions < Rectify::Command
7
+ class UpdateComponentPermissions < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - The form from which the data in this component comes from.
11
11
  # component - The component to update.
12
12
  # resource - The resource to update.
13
- def initialize(form, component, resource)
13
+ def initialize(form, component, resource, user)
14
14
  @form = form
15
15
  @component = component
16
16
  @resource = resource
17
+ @user = user
17
18
  end
18
19
 
19
20
  # Public: Sets the permissions for a component.
@@ -22,9 +23,11 @@ module Decidim
22
23
  def call
23
24
  return broadcast(:invalid) unless form.valid?
24
25
 
25
- transaction do
26
- update_permissions
27
- run_hooks
26
+ Decidim.traceability.perform_action!("update_permissions", @component, @user) do
27
+ transaction do
28
+ update_permissions
29
+ run_hooks
30
+ end
28
31
  end
29
32
 
30
33
  broadcast(:ok)
@@ -45,7 +48,7 @@ module Decidim
45
48
  handlers_content = {}
46
49
 
47
50
  selected_handlers(value).each do |handler_key|
48
- opts = value.authorization_handlers_options[handler_key.to_sym]
51
+ opts = value.authorization_handlers_options[handler_key.to_s]
49
52
  handlers_content[handler_key] = opts ? { options: opts } : {}
50
53
  end
51
54
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # This command gets called when a content block is updated from the admin
6
6
  # panel.
7
- class UpdateContentBlock < Rectify::Command
7
+ class UpdateContentBlock < Decidim::Command
8
8
  attr_reader :form, :content_block, :scope
9
9
 
10
10
  # Public: Initializes the command.
@@ -2,18 +2,21 @@
2
2
 
3
3
  module Decidim
4
4
  module Admin
5
- class UpdateExternalDomainWhitelist < Rectify::Command
5
+ class UpdateExternalDomainWhitelist < Decidim::Command
6
6
  attr_reader :form, :organization
7
7
 
8
- def initialize(form, organization)
8
+ def initialize(form, organization, user)
9
9
  @form = form
10
10
  @organization = organization
11
+ @user = user
11
12
  end
12
13
 
13
14
  def call
14
15
  return broadcast(:invalid) if form.invalid?
15
16
 
16
- save_domains!
17
+ Decidim.traceability.perform_action!("update_external_domain", @organization, @user) do
18
+ save_domains!
19
+ end
17
20
 
18
21
  broadcast(:ok)
19
22
  end
@@ -4,10 +4,11 @@ module Decidim
4
4
  module Admin
5
5
  # This command gets called when a content block is updated from the admin
6
6
  # panel.
7
- class UpdateHelpSections < Rectify::Command
8
- def initialize(form, organization)
7
+ class UpdateHelpSections < Decidim::Command
8
+ def initialize(form, organization, user)
9
9
  @form = form
10
10
  @organization = organization
11
+ @user = user
11
12
  end
12
13
 
13
14
  def call
@@ -15,12 +16,25 @@ module Decidim
15
16
 
16
17
  ActiveRecord::Base.transaction do
17
18
  @form.sections.each do |section|
18
- ContextualHelpSection.set_content(@organization, section.id, section.content)
19
+ next unless content_has_changed?(section)
20
+
21
+ Decidim.traceability.perform_action!("update", ContextualHelpSection, @user, { "resource" => { "title" => section.id.humanize } }) do
22
+ ContextualHelpSection.set_content(@organization, section.id, section.content)
23
+ ContextualHelpSection.find_by(organization: @organization, section_id: section.id)
24
+ end
19
25
  end
20
26
  end
21
27
 
22
28
  broadcast(:ok)
23
29
  end
30
+
31
+ private
32
+
33
+ def content_has_changed?(section)
34
+ return if ContextualHelpSection.find_by(organization: @organization, section_id: section.id).nil? && section.content.compact_blank.blank?
35
+
36
+ section.content != ContextualHelpSection.find_content(@organization, section.id).except("machine_translations")
37
+ end
24
38
  end
25
39
  end
26
40
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # Updates the newsletter given form data.
6
- class UpdateNewsletter < Rectify::Command
6
+ class UpdateNewsletter < Decidim::Command
7
7
  # Initializes the command.
8
8
  #
9
9
  # newsletter - The Newsletter to update.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic for updating the current
6
6
  # organization.
7
- class UpdateOrganization < Rectify::Command
7
+ class UpdateOrganization < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # organization - The Organization that will be updated.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic for updating the current
6
6
  # organization appearance.
7
- class UpdateOrganizationAppearance < Rectify::Command
7
+ class UpdateOrganizationAppearance < Decidim::Command
8
8
  include ::Decidim::AttachmentAttributesMethods
9
9
 
10
10
  # Public: Initializes the command.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # A command with the business logic for updating the current
6
6
  # organization tos_version attribute.
7
- class UpdateOrganizationTosVersion < Rectify::Command
7
+ class UpdateOrganizationTosVersion < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # organization - The Organization that will be updated.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Admin
5
5
  # This command gets called when permissions for a resource not related with
6
6
  # a component are updated in the admin panel.
7
- class UpdateResourcePermissions < Rectify::Command
7
+ class UpdateResourcePermissions < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - The form from which the data in this resource comes from.
@@ -40,7 +40,7 @@ module Decidim
40
40
  def update_permissions
41
41
  permissions = configured_permissions.inject({}) do |result, (key, value)|
42
42
  handlers_content = selected_handlers(value).inject({}) do |handlers_content_result, handler_key|
43
- opts = value.authorization_handlers_options[handler_key.to_sym]
43
+ opts = value.authorization_handlers_options[handler_key.to_s]
44
44
 
45
45
  handlers_content_result.update(handler_key => opts ? { options: opts } : {})
46
46
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a scope.
6
- class UpdateScope < Rectify::Command
6
+ class UpdateScope < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # scope - The Scope to update
@@ -3,14 +3,15 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a scope type.
6
- class UpdateScopeType < Rectify::Command
6
+ class UpdateScopeType < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # scope_type - The ScopeType to update
10
10
  # form - A form object with the params.
11
- def initialize(scope_type, form)
11
+ def initialize(scope_type, form, user)
12
12
  @scope_type = scope_type
13
13
  @form = form
14
+ @user = user
14
15
  end
15
16
 
16
17
  # Executes the command. Broadcasts these events:
@@ -31,7 +32,11 @@ module Decidim
31
32
  attr_reader :form
32
33
 
33
34
  def update_scope_type
34
- @scope_type.update!(attributes)
35
+ Decidim.traceability.update!(
36
+ @scope_type,
37
+ @user,
38
+ attributes
39
+ )
35
40
  end
36
41
 
37
42
  def attributes
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a static page.
6
- class UpdateStaticPage < Rectify::Command
6
+ class UpdateStaticPage < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # page - The StaticPage to update
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a static page topic.
6
- class UpdateStaticPageTopic < Rectify::Command
6
+ class UpdateStaticPageTopic < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # page - The StaticPageTopic to update
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when updating a usergroup.
6
- class UpdateUserGroups < Rectify::Command
6
+ class UpdateUserGroups < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # scope - The Scope to update
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Admin
5
5
  # A command with all the business logic when verifying a user_group.
6
- class VerifyUserGroup < Rectify::Command
6
+ class VerifyUserGroup < Decidim::Command
7
7
  # Public: Initializes the command.
8
8
  #
9
9
  # user_group - The user_group to verify
@@ -31,7 +31,7 @@ module Decidim
31
31
  delegate :scopes, to: :current_organization
32
32
 
33
33
  def query
34
- @query ||= base_query.ransack(ransack_params)
34
+ @query ||= base_query.ransack(ransack_params, search_context: :admin, auth_object: current_user)
35
35
  end
36
36
 
37
37
  private
@@ -11,7 +11,9 @@ module Decidim
11
11
  def create
12
12
  enforce_permission_to :create, :export_space, participatory_space: exportable_space
13
13
 
14
- ExportParticipatorySpaceJob.perform_later(current_user, exportable_space, manifest_name, default_format)
14
+ Decidim.traceability.perform_action!("export", exportable_space, current_user) do
15
+ ExportParticipatorySpaceJob.perform_later(current_user, exportable_space, manifest_name, default_format)
16
+ end
15
17
 
16
18
  flash[:notice] = t("decidim.admin.exports.notice")
17
19
 
@@ -47,10 +47,6 @@ module Decidim
47
47
  def reportable_types
48
48
  collection.pluck(:decidim_reportable_type).uniq.sort
49
49
  end
50
-
51
- def extra_allowed_params
52
- [:hidden]
53
- end
54
50
  end
55
51
  end
56
52
  end
@@ -9,7 +9,7 @@ module Decidim
9
9
  current_user.admin_terms_accepted_at = Time.current
10
10
  if current_user.save!
11
11
  flash[:notice] = t("accept.success", scope: "decidim.admin.admin_terms_of_use")
12
- redirect_to stored_location_for(current_user) || decidim_admin.root_path
12
+ redirect_to decidim_admin.root_path
13
13
  else
14
14
  flash[:alert] = t("accept.error", scope: "decidim.admin.admin_terms_of_use")
15
15
  redirect_to decidim_admin.admin_terms_show_path
@@ -6,8 +6,8 @@ module Decidim
6
6
  class ApplicationController < ::DecidimController
7
7
  include NeedsOrganization
8
8
  include NeedsPermission
9
+ include NeedsPasswordChange
9
10
  include NeedsSnippets
10
- include NeedsAdminTosAccepted
11
11
  include FormFactory
12
12
  include LocaleSwitcher
13
13
  include UseOrganizationTimeZone
@@ -29,7 +29,6 @@ module Decidim
29
29
  helper Decidim::LanguageChooserHelper
30
30
  helper Decidim::ComponentPathHelper
31
31
  helper Decidim::SanitizeHelper
32
- helper Decidim::Templates::Admin::ApplicationHelper if Decidim.module_installed?(:templates) && defined?(Decidim::Templates::Admin::ApplicationHelper)
33
32
 
34
33
  default_form_builder Decidim::Admin::FormBuilder
35
34
 
@@ -21,7 +21,7 @@ module Decidim
21
21
  enforce_permission_to :create, :area_type
22
22
  @form = form(AreaTypeForm).from_params(params)
23
23
 
24
- CreateAreaType.call(@form) do
24
+ CreateAreaType.call(@form, current_user) do
25
25
  on(:ok) do
26
26
  flash[:notice] = I18n.t("area_types.create.success", scope: "decidim.admin")
27
27
  redirect_to area_types_path
@@ -43,7 +43,7 @@ module Decidim
43
43
  enforce_permission_to :update, :area_type, area_type: area_type
44
44
  @form = form(AreaTypeForm).from_params(params)
45
45
 
46
- UpdateAreaType.call(area_type, @form) do
46
+ UpdateAreaType.call(area_type, @form, current_user) do
47
47
  on(:ok) do
48
48
  flash[:notice] = I18n.t("area_types.update.success", scope: "decidim.admin")
49
49
  redirect_to area_types_path
@@ -58,7 +58,10 @@ module Decidim
58
58
 
59
59
  def destroy
60
60
  enforce_permission_to :destroy, :area_type, area_type: area_type
61
- area_type.destroy!
61
+
62
+ Decidim.traceability.perform_action!("delete", area_type, current_user) do
63
+ area_type.destroy!
64
+ end
62
65
 
63
66
  flash[:notice] = I18n.t("area_types.destroy.success", scope: "decidim.admin")
64
67