decidim-admin 0.26.2 → 0.27.0.rc2

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 (192) 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 +1 -1
  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 +1 -1
  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 +1 -1
  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/decidim/admin/application_controller.rb +1 -0
  72. data/app/controllers/decidim/admin/area_types_controller.rb +6 -3
  73. data/app/controllers/decidim/admin/categories_controller.rb +3 -3
  74. data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
  75. data/app/controllers/decidim/admin/components/base_controller.rb +1 -0
  76. data/app/controllers/decidim/admin/components_controller.rb +1 -1
  77. data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +6 -3
  78. data/app/controllers/decidim/admin/concerns/has_attachments.rb +6 -3
  79. data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +7 -0
  80. data/app/controllers/decidim/admin/dashboard_controller.rb +4 -3
  81. data/app/controllers/decidim/admin/exports_controller.rb +4 -1
  82. data/app/controllers/decidim/admin/help_sections_controller.rb +1 -1
  83. data/app/controllers/decidim/admin/metrics_controller.rb +2 -1
  84. data/app/controllers/decidim/admin/moderations_controller.rb +9 -7
  85. data/app/controllers/decidim/admin/organization_controller.rb +3 -3
  86. data/app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb +1 -1
  87. data/app/controllers/decidim/admin/reminders_controller.rb +61 -0
  88. data/app/controllers/decidim/admin/resource_permissions_controller.rb +3 -3
  89. data/app/controllers/decidim/admin/scope_types_controller.rb +6 -3
  90. data/app/controllers/decidim/admin/static_pages_controller.rb +1 -7
  91. data/app/forms/decidim/admin/category_form.rb +1 -2
  92. data/app/forms/decidim/admin/component_form.rb +16 -7
  93. data/app/forms/decidim/admin/import_example_form.rb +1 -5
  94. data/app/forms/decidim/admin/import_form.rb +7 -10
  95. data/app/forms/decidim/admin/managed_user_promotion_form.rb +1 -1
  96. data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +7 -4
  97. data/app/forms/decidim/admin/permission_form.rb +9 -8
  98. data/app/forms/decidim/admin/permissions_form.rb +1 -10
  99. data/app/forms/decidim/admin/user_group_csv_verification_form.rb +2 -2
  100. data/app/helpers/decidim/admin/bulk_actions_helper.rb +0 -4
  101. data/app/helpers/decidim/admin/moderations/reports_helper.rb +11 -2
  102. data/app/helpers/decidim/admin/reminders_helper.rb +12 -0
  103. data/app/helpers/decidim/admin/settings_helper.rb +57 -11
  104. data/app/packs/entrypoints/decidim_admin.js +7 -2
  105. data/app/packs/src/decidim/admin/admin_autocomplete.js +86 -0
  106. data/app/packs/src/decidim/admin/application.js +0 -16
  107. data/app/packs/src/decidim/admin/choose_language.js +11 -9
  108. data/app/packs/src/decidim/admin/dynamic_fields.component.js +1 -0
  109. data/app/packs/stylesheets/decidim/admin/_decidim.scss +0 -1
  110. data/app/packs/stylesheets/decidim/admin/modules/_autocomplete.scss +5 -0
  111. data/app/packs/stylesheets/decidim/admin/modules/_forms.scss +6 -0
  112. data/app/packs/stylesheets/decidim/admin/modules/_modules.scss +2 -0
  113. data/app/packs/stylesheets/decidim/admin/modules/_upload_modal.scss +42 -0
  114. data/app/permissions/decidim/admin/permissions.rb +1 -0
  115. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +3 -1
  116. data/app/queries/decidim/admin/active_users_counter.rb +1 -1
  117. data/app/queries/decidim/admin/newsletter_recipients.rb +2 -2
  118. data/app/queries/decidim/admin/user_filter.rb +1 -1
  119. data/app/queries/decidim/admin/user_groups_evaluation.rb +1 -1
  120. data/app/views/decidim/admin/attachments/index.html.erb +1 -0
  121. data/app/views/decidim/admin/categories/_form.html.erb +0 -4
  122. data/app/views/decidim/admin/categories/show.html.erb +1 -2
  123. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +5 -4
  124. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
  125. data/app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb +20 -1
  126. data/app/views/decidim/admin/reminders/new.html.erb +21 -0
  127. data/app/views/decidim/admin/resource_permissions/edit.html.erb +1 -1
  128. data/app/views/decidim/admin/shared/_gallery.html.erb +6 -1
  129. data/app/views/decidim/admin/shared/_js-callout.html.erb +6 -0
  130. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +2 -2
  131. data/app/views/layouts/decidim/admin/_application.html.erb +2 -0
  132. data/config/locales/ar.yml +15 -4
  133. data/config/locales/bg.yml +1 -0
  134. data/config/locales/ca.yml +22 -4
  135. data/config/locales/cs.yml +24 -4
  136. data/config/locales/de.yml +22 -4
  137. data/config/locales/el.yml +1 -5
  138. data/config/locales/en.yml +21 -4
  139. data/config/locales/eo.yml +1 -0
  140. data/config/locales/es-MX.yml +22 -4
  141. data/config/locales/es-PY.yml +22 -4
  142. data/config/locales/es.yml +22 -4
  143. data/config/locales/eu.yml +1 -5
  144. data/config/locales/fi-plain.yml +22 -4
  145. data/config/locales/fi.yml +22 -4
  146. data/config/locales/fr-CA.yml +22 -4
  147. data/config/locales/fr.yml +36 -18
  148. data/config/locales/ga-IE.yml +1 -0
  149. data/config/locales/gl.yml +16 -4
  150. data/config/locales/hu.yml +196 -3
  151. data/config/locales/id-ID.yml +1 -3
  152. data/config/locales/is-IS.yml +2 -4
  153. data/config/locales/it.yml +6 -5
  154. data/config/locales/ja.yml +21 -4
  155. data/config/locales/lb.yml +1 -5
  156. data/config/locales/lt.yml +994 -0
  157. data/config/locales/lv.yml +1 -3
  158. data/config/locales/nl.yml +83 -5
  159. data/config/locales/no.yml +27 -4
  160. data/config/locales/pl.yml +77 -5
  161. data/config/locales/pt-BR.yml +1 -5
  162. data/config/locales/pt.yml +1 -5
  163. data/config/locales/ro-RO.yml +7 -5
  164. data/config/locales/ru.yml +1 -3
  165. data/config/locales/sk.yml +1 -3
  166. data/config/locales/sl.yml +1 -0
  167. data/config/locales/sr-CS.yml +1 -2
  168. data/config/locales/sv.yml +22 -3
  169. data/config/locales/tr-TR.yml +1 -3
  170. data/config/locales/uk.yml +1 -2
  171. data/config/locales/val-ES.yml +1 -0
  172. data/config/locales/zh-CN.yml +1 -3
  173. data/lib/decidim/admin/engine.rb +0 -1
  174. data/lib/decidim/admin/import/importer.rb +9 -7
  175. data/lib/decidim/admin/import/readers/json.rb +1 -1
  176. data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +15 -2
  177. data/lib/decidim/admin/test/commands/create_category_examples.rb +16 -6
  178. data/lib/decidim/admin/test/commands/destroy_category_examples.rb +29 -1
  179. data/lib/decidim/admin/test/commands/update_attachment_collection_examples.rb +15 -2
  180. data/lib/decidim/admin/test/commands/update_category_examples.rb +16 -6
  181. data/lib/decidim/admin/test/filters_participatory_space_user_roles_examples.rb +4 -4
  182. data/lib/decidim/admin/test/filters_participatory_space_users_examples.rb +4 -4
  183. data/lib/decidim/admin/test/forms/category_form_examples.rb +1 -21
  184. data/lib/decidim/admin/test/manage_attachments_examples.rb +9 -2
  185. data/lib/decidim/admin/test/manage_categories_examples.rb +0 -10
  186. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +0 -2
  187. data/lib/decidim/admin/test/manage_moderations_examples.rb +26 -0
  188. data/lib/decidim/admin/version.rb +1 -1
  189. metadata +21 -15
  190. data/app/packs/src/decidim/admin/autocomplete.component.js +0 -146
  191. data/app/packs/src/decidim/admin/autocomplete.component.test.js +0 -19
  192. data/app/packs/stylesheets/decidim/admin/components/_autocomplete_select.component.scss +0 -19
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ro:
2
3
  activemodel:
3
4
  attributes:
@@ -172,8 +173,6 @@ ro:
172
173
  permissions: Drepturi
173
174
  reject: Respinge
174
175
  share: Distribuie
175
- user:
176
- new: Utilizator nou
177
176
  verify: Verifică
178
177
  admin_terms_of_use:
179
178
  accept:
@@ -256,6 +255,8 @@ ro:
256
255
  update:
257
256
  error: A apărut o eroare la actualizarea acestui atașament.
258
257
  success: Atașamentul a fost actualizat cu succes.
258
+ attachments_privacy_warning:
259
+ message: Fiți precaut atunci când lucrați cu atașamente într-un spațiu privat. Orice participant poate distribui acest document altora.
259
260
  autocomplete:
260
261
  no_results: Nu a fost găsit niciun rezultat
261
262
  search_prompt: Tastați cel puțin trei caractere pentru a căuta
@@ -338,7 +339,7 @@ ro:
338
339
  dashboard:
339
340
  show:
340
341
  view_more_logs: Afișează mai multe înregistrări
341
- welcome: Bine ați venit în Panoul de administrare Decidim.
342
+ welcome: Bine ați venit în Panoul de administrare.
342
343
  domain_whitelist:
343
344
  form:
344
345
  domain_too_short: Domeniul e prea scurt
@@ -838,6 +839,9 @@ ro:
838
839
  explanation: 'Încărcă fişierul tău CSV. Trebuie să aibă două coloane cu e-mail în prima coloană a fișierului și numele în ultima coloană (e-mail, numele) pentru utilizatorii pe care doriţi să îi adăugaţi în spaţiul participativ, fără antet. Evită folosirea caracterelor invalide, cum ar fi `<>?%&^*#@()[]=+:;"{}\<unk> ` în numele utilizatorului.'
839
840
  title: Încarcă fișierul tău CSV
840
841
  upload: Încarcă
842
+ reminders:
843
+ new:
844
+ submit: Trimite
841
845
  resource_permissions:
842
846
  edit:
843
847
  submit: Trimite
@@ -955,7 +959,6 @@ ro:
955
959
  static_pages: Pagini
956
960
  statistics: Activitate
957
961
  user_groups: Grupuri
958
- users: Participanți
959
962
  user_group:
960
963
  csv_verify:
961
964
  invalid: A apărut o problemă la citirea fișierului CSV.
@@ -991,7 +994,6 @@ ro:
991
994
  role: Rol
992
995
  new:
993
996
  create: Invită
994
- title: Invită participantul ca administrator
995
997
  users_statistics:
996
998
  users_count:
997
999
  admins: Administratori
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ru:
2
3
  activemodel:
3
4
  attributes:
@@ -249,7 +250,6 @@ ru:
249
250
  dashboard:
250
251
  show:
251
252
  view_more_logs: Просмотреть другие журналы
252
- welcome: Добро пожаловать в админ-панель Десидим!
253
253
  exports:
254
254
  export_as: "%{name} как %{export_format}"
255
255
  notice: Идет сохранение в виде файла. Вы получите электронное письмо, когда оно будет завершено.
@@ -575,7 +575,6 @@ ru:
575
575
  scopes: Охваты
576
576
  static_pages: Страницы
577
577
  user_groups: Группы участников
578
- users: Участники
579
578
  user_group:
580
579
  reject:
581
580
  invalid: При отказе от этой группы участников произошла ошибка.
@@ -606,7 +605,6 @@ ru:
606
605
  role: Роль
607
606
  new:
608
607
  create: Пригласить
609
- title: Пригласить участника в качестве администратора
610
608
  users_statistics:
611
609
  users_count:
612
610
  admins: Администраторы
@@ -1,3 +1,4 @@
1
+ ---
1
2
  sk:
2
3
  activemodel:
3
4
  attributes:
@@ -264,7 +265,6 @@ sk:
264
265
  dashboard:
265
266
  show:
266
267
  view_more_logs: Zobraziť viac logov
267
- welcome: Vitajte v Administrátorskom Paneli Decidim.
268
268
  exports:
269
269
  export_as: "%{name} ako %{export_format}"
270
270
  notice: Váš export práve prebieha. Obdržíte e-mail po dokončení.
@@ -688,7 +688,6 @@ sk:
688
688
  static_pages: Stránky
689
689
  statistics: Aktivita
690
690
  user_groups: Skupiny
691
- users: Účastníci
692
691
  user_group:
693
692
  csv_verify:
694
693
  invalid: Vyskytol sa problém s čítaním súboru CSV.
@@ -724,7 +723,6 @@ sk:
724
723
  role: Rola
725
724
  new:
726
725
  create: Pozvať
727
- title: Pozvať účastníka ako administrátora
728
726
  users_statistics:
729
727
  users_count:
730
728
  admins: Administrátori
@@ -1,3 +1,4 @@
1
+ ---
1
2
  sl:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  sr:
2
3
  activemodel:
3
4
  attributes:
@@ -264,7 +265,6 @@ sr:
264
265
  dashboard:
265
266
  show:
266
267
  view_more_logs: Pogledaj još zapisa iz evidencije
267
- welcome: Dobrošli u Decidim Admin Panel.
268
268
  exports:
269
269
  export_as: "%{name} kao %{export_format}"
270
270
  notice: Vaš prenos podataka je u toku. Dobićete e-mail poruku kada bude završen.
@@ -564,7 +564,6 @@ sr:
564
564
  titles:
565
565
  metrics: Metrika
566
566
  statistics: Aktivnost
567
- users: Učesnici
568
567
  users_statistics:
569
568
  users_count:
570
569
  last_day: Poslednji dan
@@ -1,3 +1,4 @@
1
+ ---
1
2
  sv:
2
3
  activemodel:
3
4
  attributes:
@@ -260,6 +261,8 @@ sv:
260
261
  update:
261
262
  error: Det gick inte att uppdatera bilagan.
262
263
  success: Bilagan har uppdaterats.
264
+ attachments_privacy_warning:
265
+ message: Var försiktig när du arbetar med bilagor i ett privat utrymme. En deltagare skulle kunna dela detta dokument utanför plattformen.
263
266
  autocomplete:
264
267
  no_results: Hittade inga resultat
265
268
  search_prompt: Sök genom att skriva minst tre tecken
@@ -342,7 +345,7 @@ sv:
342
345
  dashboard:
343
346
  show:
344
347
  view_more_logs: Visa fler loggar
345
- welcome: Välkommen till Decidims adminpanel.
348
+ welcome: Välkommen till Adminpanelen.
346
349
  domain_whitelist:
347
350
  form:
348
351
  domain_too_short: Domänen är för kort
@@ -835,9 +838,23 @@ sv:
835
838
  invalid: Det gick inte att läsa CSV-filen.
836
839
  success: CSV-filen har skickats in och vi skickar inbjudningar via e-brev till deltagarna. Det kan ta en stund.
837
840
  new:
841
+ destroy:
842
+ button: Radera alla privata deltagare
843
+ confirm: Är du säker på att du vill radera alla privata deltagare? Den här åtgärden kan inte ångras.
844
+ empty: Det finns inga privata deltagare.
845
+ explanation: Det finns %{count} privata deltagare.
846
+ title: Radera privata deltagare
838
847
  explanation: 'Skicka in din CSV-fil. Den måste ha två kolumner över de användare som du vill lägga till deltagarutrymmet, utan rubriker, med e-postadressen i den första kolumnen i filen och namnet i den sista kolumnen i filen (e-post, namn). Undvik olämpliga karaktärer som `<>?%&^*#@()[]=+:;"{}\|` i användarnamn.'
839
848
  title: Skicka CSV-fil
840
849
  upload: Skicka
850
+ reminders:
851
+ create:
852
+ error: Det gick inte att skapa påminnelser.
853
+ success:
854
+ one: "%{count} användare kommer påminnas."
855
+ other: "%{count} användare kommer påminnas."
856
+ new:
857
+ submit: Skicka
841
858
  resource_permissions:
842
859
  edit:
843
860
  submit: Skicka in
@@ -895,6 +912,7 @@ sv:
895
912
  gallery:
896
913
  add_images: Lägg till bilder
897
914
  delete_image: Ta bort bild
915
+ edit_images: Redigera bilder
898
916
  gallery_legend: Lägg till ett bildgalleri (Frivilligt)
899
917
  static_page_topics:
900
918
  create:
@@ -955,7 +973,7 @@ sv:
955
973
  static_pages: Sidor
956
974
  statistics: Aktivitet
957
975
  user_groups: Grupper
958
- users: Deltagare
976
+ users: Administratörer
959
977
  user_group:
960
978
  csv_verify:
961
979
  invalid: Det gick inte att läsa CSV-filen.
@@ -991,7 +1009,7 @@ sv:
991
1009
  role: Roll
992
1010
  new:
993
1011
  create: Bjud in
994
- title: Bjud in användaren som administratör
1012
+ title: Bjud in ny administratör
995
1013
  users_statistics:
996
1014
  users_count:
997
1015
  admins: Administratörer
@@ -1042,6 +1060,7 @@ sv:
1042
1060
  hidden_at: Dold
1043
1061
  participatory_space: Deltagarutrymme
1044
1062
  report_count: Antal
1063
+ reportable_id: ID
1045
1064
  reportable_type: Typ
1046
1065
  reported_content_url: Rapporterad innehållsadress
1047
1066
  reports: Rapporter
@@ -1,3 +1,4 @@
1
+ ---
1
2
  tr:
2
3
  activemodel:
3
4
  attributes:
@@ -296,7 +297,6 @@ tr:
296
297
  dashboard:
297
298
  show:
298
299
  view_more_logs: Daha fazla günlükleri görüntüle
299
- welcome: Decidim Yönetici Paneline hoş geldiniz.
300
300
  exports:
301
301
  export_as: "%{name} olarak %{export_format}"
302
302
  formats:
@@ -801,7 +801,6 @@ tr:
801
801
  static_pages: Sayfalar
802
802
  statistics: Aktivite
803
803
  user_groups: Kullanıcı Grupları
804
- users: Katılımcılar
805
804
  user_group:
806
805
  csv_verify:
807
806
  invalid: CSV dosyasını okurken bir hata oluştu.
@@ -837,7 +836,6 @@ tr:
837
836
  role: Rol
838
837
  new:
839
838
  create: Davet et
840
- title: Kullanıcıyı yönetici olarak davet et
841
839
  users_statistics:
842
840
  users_count:
843
841
  admins: Yöneticiler
@@ -1,3 +1,4 @@
1
+ ---
1
2
  uk:
2
3
  activemodel:
3
4
  attributes:
@@ -223,7 +224,6 @@ uk:
223
224
  dashboard:
224
225
  show:
225
226
  view_more_logs: Переглянути інші журнали
226
- welcome: Ласкаво просимо до адмін-панелі Десідім!
227
227
  exports:
228
228
  export_as: "%{name} як %{export_format}"
229
229
  notice: Зараз відбувається збереження у вигляді файлу. Ви отримаєте електронного листа після його завершення.
@@ -557,7 +557,6 @@ uk:
557
557
  role: Роль
558
558
  new:
559
559
  create: Запросити
560
- title: Запросити учасника в якості адміністратора
561
560
  users_statistics:
562
561
  users_count:
563
562
  admins: Адміністратори
@@ -1,3 +1,4 @@
1
+ ---
1
2
  val:
2
3
  decidim:
3
4
  admin:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  zh-CN:
2
3
  activemodel:
3
4
  attributes:
@@ -273,7 +274,6 @@ zh-CN:
273
274
  dashboard:
274
275
  show:
275
276
  view_more_logs: 查看更多日志
276
- welcome: 欢迎来到Decidim管理面板
277
277
  exports:
278
278
  export_as: "%{name} 为 %{export_format}"
279
279
  formats:
@@ -731,7 +731,6 @@ zh-CN:
731
731
  static_pages: 页 次
732
732
  statistics: 活动
733
733
  user_groups: 群組
734
- users: 参加者
735
734
  user_group:
736
735
  csv_verify:
737
736
  invalid: 读取CSV文件时出现问题。
@@ -767,7 +766,6 @@ zh-CN:
767
766
  role: 作用
768
767
  new:
769
768
  create: 邀请
770
- title: 邀请参与者作为管理员
771
769
  users_statistics:
772
770
  users_count:
773
771
  admins: 管理员
@@ -7,7 +7,6 @@ require "devise"
7
7
  require "devise-i18n"
8
8
  require "decidim/core"
9
9
  require "foundation_rails_helper"
10
- require "rectify"
11
10
  require "doorkeeper"
12
11
  require "doorkeeper-i18n"
13
12
  require "hashdiff"
@@ -10,6 +10,8 @@ module Decidim
10
10
  # You can also use the ImporterFactory class to create an Importer
11
11
  # instance.
12
12
  class Importer
13
+ include Decidim::ProcessesFileLocally
14
+
13
15
  delegate :errors, to: :verifier
14
16
 
15
17
  # Public: Initializes an Importer.
@@ -72,15 +74,15 @@ module Decidim
72
74
  return @collection_data if @collection_data
73
75
 
74
76
  @collection_data = []
75
- reader.new(file).read_rows do |rowdata, index|
76
- if index.zero?
77
- @data_headers = rowdata.map { |d| d.to_s.to_sym }
78
- else
79
- @collection_data << Hash[
80
- rowdata.each_with_index.map do |val, ind|
77
+ process_file_locally(file) do |file_path|
78
+ reader.new(file_path).read_rows do |rowdata, index|
79
+ if index.zero?
80
+ @data_headers = rowdata.map { |d| d.to_s.to_sym }
81
+ else
82
+ @collection_data << rowdata.each_with_index.to_h do |val, ind|
81
83
  [@data_headers[ind], val]
82
84
  end
83
- ]
85
+ end
84
86
  end
85
87
  end
86
88
 
@@ -39,7 +39,7 @@ module Decidim
39
39
  columns = data.shift
40
40
  json_data = data.map do |row|
41
41
  deep_hash(
42
- columns.each_with_index.map { |col, ind| [col, row[ind]] }.to_h
42
+ columns.each_with_index.to_h { |col, ind| [col, row[ind]] }
43
43
  )
44
44
  end
45
45
 
@@ -7,6 +7,7 @@ module Decidim
7
7
  shared_examples_for "CreateAttachmentCollection command" do
8
8
  describe "call" do
9
9
  let(:organization) { create(:organization) }
10
+ let(:user) { create(:user, organization: organization) }
10
11
  let(:form_params) do
11
12
  {
12
13
  "attachment_collection" => {
@@ -27,11 +28,11 @@ module Decidim
27
28
  current_organization: organization
28
29
  )
29
30
  end
30
- let(:command) { described_class.new(form, collection_for) }
31
+ let(:command) { described_class.new(form, collection_for, user) }
31
32
 
32
33
  describe "when the form is not valid" do
33
34
  before do
34
- expect(form).to receive(:invalid?).and_return(true)
35
+ allow(form).to receive(:invalid?).and_return(true)
35
36
  end
36
37
 
37
38
  it "broadcasts invalid" do
@@ -55,6 +56,18 @@ module Decidim
55
56
  command.call
56
57
  end.to change(collection_for.attachment_collections, :count).by(1)
57
58
  end
59
+
60
+ it "traces the action", versioning: true do
61
+ expect(Decidim.traceability)
62
+ .to receive(:perform_action!)
63
+ .with(:create, Decidim::AttachmentCollection, user, {})
64
+ .and_call_original
65
+
66
+ expect { command.call }.to change(Decidim::ActionLog, :count)
67
+ action_log = Decidim::ActionLog.last
68
+ expect(action_log.action).to eq("create")
69
+ expect(action_log.version).to be_present
70
+ end
58
71
  end
59
72
  end
60
73
  end
@@ -7,15 +7,13 @@ module Decidim
7
7
  shared_examples_for "CreateCategory command" do
8
8
  describe "call" do
9
9
  let(:organization) { create(:organization) }
10
+ let(:user) { create(:user, organization: organization) }
10
11
  let(:form_params) do
11
12
  {
12
13
  "category" => {
13
14
  "name_en" => Decidim::Faker::Localized.paragraph(sentence_count: 3),
14
15
  "name_es" => Decidim::Faker::Localized.paragraph(sentence_count: 3),
15
- "name_ca" => Decidim::Faker::Localized.paragraph(sentence_count: 3),
16
- "description_en" => Decidim::Faker::Localized.paragraph(sentence_count: 3),
17
- "description_es" => Decidim::Faker::Localized.paragraph(sentence_count: 3),
18
- "description_ca" => Decidim::Faker::Localized.paragraph(sentence_count: 3)
16
+ "name_ca" => Decidim::Faker::Localized.paragraph(sentence_count: 3)
19
17
  }
20
18
  }
21
19
  end
@@ -27,11 +25,11 @@ module Decidim
27
25
  current_organization: organization
28
26
  )
29
27
  end
30
- let(:command) { described_class.new(form, participatory_space) }
28
+ let(:command) { described_class.new(form, participatory_space, user) }
31
29
 
32
30
  describe "when the form is not valid" do
33
31
  before do
34
- expect(form).to receive(:invalid?).and_return(true)
32
+ allow(form).to receive(:invalid?).and_return(true)
35
33
  end
36
34
 
37
35
  it "broadcasts invalid" do
@@ -55,6 +53,18 @@ module Decidim
55
53
  command.call
56
54
  end.to change(participatory_space.categories, :count).by(1)
57
55
  end
56
+
57
+ it "traces the action", versioning: true do
58
+ expect(Decidim.traceability)
59
+ .to receive(:perform_action!)
60
+ .with(:create, Decidim::Category, user, {})
61
+ .and_call_original
62
+
63
+ expect { command.call }.to change(Decidim::ActionLog, :count)
64
+ action_log = Decidim::ActionLog.last
65
+ expect(action_log.action).to eq("create")
66
+ expect(action_log.version).to be_present
67
+ end
58
68
  end
59
69
  end
60
70
  end
@@ -7,8 +7,9 @@ module Decidim
7
7
  shared_examples_for "DestroyCategory command" do
8
8
  describe "call" do
9
9
  let(:organization) { create(:organization) }
10
+ let(:user) { create(:user, organization: organization) }
10
11
  let(:category) { create(:category, participatory_space: participatory_space) }
11
- let(:command) { described_class.new(category) }
12
+ let(:command) { described_class.new(category, user) }
12
13
 
13
14
  describe "when the category is not present" do
14
15
  let(:category) { nil }
@@ -28,6 +29,21 @@ module Decidim
28
29
  end
29
30
  end
30
31
 
32
+ context "when the category is a subcategory" do
33
+ let!(:parent_category) { create :category, participatory_space: participatory_space }
34
+
35
+ before do
36
+ category.parent = parent_category
37
+ end
38
+
39
+ it "destroy the category" do
40
+ category
41
+ expect do
42
+ command.call
43
+ end.to change(Category, :count).by(-1)
44
+ end
45
+ end
46
+
31
47
  describe "when the data is valid" do
32
48
  it "broadcasts ok" do
33
49
  expect { command.call }.to broadcast(:ok)
@@ -39,6 +55,18 @@ module Decidim
39
55
  command.call
40
56
  end.to change(Category, :count).by(-1)
41
57
  end
58
+
59
+ it "traces the action", versioning: true do
60
+ expect(Decidim.traceability)
61
+ .to receive(:perform_action!)
62
+ .with(:delete, category, user)
63
+ .and_call_original
64
+
65
+ expect { command.call }.to change(Decidim::ActionLog, :count)
66
+ action_log = Decidim::ActionLog.last
67
+ expect(action_log.action).to eq("delete")
68
+ expect(action_log.version).to be_present
69
+ end
42
70
  end
43
71
  end
44
72
  end
@@ -7,6 +7,7 @@ module Decidim
7
7
  shared_examples_for "UpdateAttachmentCollection command" do
8
8
  describe "call" do
9
9
  let(:organization) { create(:organization) }
10
+ let(:user) { create(:user, organization: organization) }
10
11
  let(:attachment_collection) { create(:attachment_collection, collection_for: collection_for) }
11
12
  let(:form_params) do
12
13
  {
@@ -28,11 +29,11 @@ module Decidim
28
29
  current_organization: organization
29
30
  )
30
31
  end
31
- let(:command) { described_class.new(attachment_collection, form) }
32
+ let(:command) { described_class.new(attachment_collection, form, user) }
32
33
 
33
34
  describe "when the form is not valid" do
34
35
  before do
35
- expect(form).to receive(:invalid?).and_return(true)
36
+ allow(form).to receive(:invalid?).and_return(true)
36
37
  end
37
38
 
38
39
  it "broadcasts invalid" do
@@ -58,6 +59,18 @@ module Decidim
58
59
 
59
60
  expect(translated(attachment_collection.name)).to eq("New title")
60
61
  end
62
+
63
+ it "traces the action", versioning: true do
64
+ expect(Decidim.traceability)
65
+ .to receive(:perform_action!)
66
+ .with(:update, Decidim::AttachmentCollection, user, {})
67
+ .and_call_original
68
+
69
+ expect { command.call }.to change(Decidim::ActionLog, :count)
70
+ action_log = Decidim::ActionLog.last
71
+ expect(action_log.action).to eq("update")
72
+ expect(action_log.version).to be_present
73
+ end
61
74
  end
62
75
  end
63
76
  end
@@ -7,16 +7,14 @@ module Decidim
7
7
  shared_examples_for "UpdateCategory command" do
8
8
  describe "call" do
9
9
  let(:organization) { create(:organization) }
10
+ let(:user) { create(:user, organization: organization) }
10
11
  let(:category) { create(:category, participatory_space: participatory_space) }
11
12
  let(:form_params) do
12
13
  {
13
14
  "category" => {
14
15
  "name_en" => "New title",
15
16
  "name_es" => "Title",
16
- "name_ca" => "Title",
17
- "description_en" => "Description",
18
- "description_es" => "Description",
19
- "description_ca" => "Description"
17
+ "name_ca" => "Title"
20
18
  }
21
19
  }
22
20
  end
@@ -28,11 +26,11 @@ module Decidim
28
26
  current_organization: organization
29
27
  )
30
28
  end
31
- let(:command) { described_class.new(category, form) }
29
+ let(:command) { described_class.new(category, form, user) }
32
30
 
33
31
  describe "when the form is not valid" do
34
32
  before do
35
- expect(form).to receive(:invalid?).and_return(true)
33
+ allow(form).to receive(:invalid?).and_return(true)
36
34
  end
37
35
 
38
36
  it "broadcasts invalid" do
@@ -58,6 +56,18 @@ module Decidim
58
56
 
59
57
  expect(translated(category.name)).to eq("New title")
60
58
  end
59
+
60
+ it "traces the action", versioning: true do
61
+ expect(Decidim.traceability)
62
+ .to receive(:perform_action!)
63
+ .with(:update, Decidim::Category, user, {})
64
+ .and_call_original
65
+
66
+ expect { command.call }.to change(Decidim::ActionLog, :count)
67
+ action_log = Decidim::ActionLog.last
68
+ expect(action_log.action).to eq("update")
69
+ expect(action_log.version).to be_present
70
+ end
61
71
  end
62
72
  end
63
73
  end
@@ -99,7 +99,7 @@ shared_examples "filterable participatory space user roles" do
99
99
  apply_filter("Invite accepted", "Yes")
100
100
 
101
101
  within ".stack tbody" do
102
- expect(page).to have_content(invited_user_2.name)
102
+ expect(page).to have_content(invited_user2.name)
103
103
  expect(page).to have_css("tr", count: 1)
104
104
  end
105
105
  end
@@ -110,7 +110,7 @@ shared_examples "filterable participatory space user roles" do
110
110
  apply_filter("Invite accepted", "No")
111
111
 
112
112
  within ".stack tbody" do
113
- expect(page).to have_content(invited_user_1.name)
113
+ expect(page).to have_content(invited_user1.name)
114
114
  expect(page).to have_css("tr", count: 1)
115
115
  end
116
116
  end
@@ -123,7 +123,7 @@ shared_examples "filterable participatory space user roles" do
123
123
  apply_filter("Ever logged in", "Yes")
124
124
 
125
125
  within ".stack tbody" do
126
- expect(page).to have_content(invited_user_2.name)
126
+ expect(page).to have_content(invited_user2.name)
127
127
  expect(page).to have_css("tr", count: 1)
128
128
  end
129
129
  end
@@ -134,7 +134,7 @@ shared_examples "filterable participatory space user roles" do
134
134
  apply_filter("Ever logged in", "No")
135
135
 
136
136
  within ".stack tbody" do
137
- expect(page).to have_content(invited_user_1.name)
137
+ expect(page).to have_content(invited_user1.name)
138
138
  expect(page).to have_css("tr", count: 1)
139
139
  end
140
140
  end
@@ -7,7 +7,7 @@ shared_examples "filterable participatory space users" do
7
7
  apply_filter("Invitation sent", "Not sent")
8
8
 
9
9
  within ".stack tbody" do
10
- expect(page).to have_content(invited_user_2.name)
10
+ expect(page).to have_content(invited_user2.name)
11
11
  expect(page).to have_css("tr", count: 1)
12
12
  end
13
13
  end
@@ -18,7 +18,7 @@ shared_examples "filterable participatory space users" do
18
18
  apply_filter("Invitation sent", "Sent")
19
19
 
20
20
  within ".stack tbody" do
21
- expect(page).to have_content(invited_user_1.name)
21
+ expect(page).to have_content(invited_user1.name)
22
22
  expect(page).to have_css("tr", count: 1)
23
23
  end
24
24
  end
@@ -31,7 +31,7 @@ shared_examples "filterable participatory space users" do
31
31
  apply_filter("Invitation accepted", "Not accepted")
32
32
 
33
33
  within ".stack tbody" do
34
- expect(page).to have_content(invited_user_2.name)
34
+ expect(page).to have_content(invited_user2.name)
35
35
  expect(page).to have_css("tr", count: 1)
36
36
  end
37
37
  end
@@ -42,7 +42,7 @@ shared_examples "filterable participatory space users" do
42
42
  apply_filter("Invitation accepted", "Accepted")
43
43
 
44
44
  within ".stack tbody" do
45
- expect(page).to have_content(invited_user_1.name)
45
+ expect(page).to have_content(invited_user1.name)
46
46
  expect(page).to have_css("tr", count: 1)
47
47
  end
48
48
  end