decidim-core 0.30.1 → 0.31.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 (795) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -4
  3. data/app/cells/decidim/activity/show.erb +6 -6
  4. data/app/cells/decidim/activity_cell.rb +0 -3
  5. data/app/cells/decidim/address/show.erb +1 -0
  6. data/app/cells/decidim/address_cell.rb +7 -1
  7. data/app/cells/decidim/amendable/amend_button_card/show.erb +2 -2
  8. data/app/cells/decidim/author/likes.erb +4 -0
  9. data/app/cells/decidim/author/show.erb +1 -3
  10. data/app/cells/decidim/author_cell.rb +5 -28
  11. data/app/cells/decidim/badge_cell.rb +1 -7
  12. data/app/cells/decidim/card_cell.rb +2 -12
  13. data/app/cells/decidim/card_metadata_cell.rb +4 -4
  14. data/app/cells/decidim/coauthorships_cell.rb +1 -1
  15. data/app/cells/decidim/collapsible_authors/show.erb +1 -1
  16. data/app/cells/decidim/content_blocks/hero_cell.rb +23 -4
  17. data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +16 -2
  18. data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +6 -6
  19. data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +28 -1
  20. data/app/cells/decidim/content_blocks/highlighted_content_banner_settings_form/show.erb +27 -0
  21. data/app/cells/decidim/content_blocks/highlighted_content_banner_settings_form_cell.rb +13 -0
  22. data/app/cells/decidim/content_blocks/highlighted_elements_for_component_settings_form/show.erb +9 -2
  23. data/app/cells/decidim/content_blocks/html_settings_form/show.erb +3 -1
  24. data/app/cells/decidim/content_blocks/last_activity_cell.rb +1 -1
  25. data/app/cells/decidim/content_blocks/last_activity_settings_form/show.erb +3 -1
  26. data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +1 -1
  27. data/app/cells/decidim/content_blocks/participatory_space_extra_data/recent_users.erb +1 -1
  28. data/app/cells/decidim/content_blocks/participatory_space_hero/show.erb +0 -5
  29. data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +1 -13
  30. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +10 -3
  31. data/app/cells/decidim/content_blocks/participatory_space_last_activity/content.erb +1 -1
  32. data/app/cells/decidim/content_blocks/participatory_space_last_activity/recent_avatars.erb +1 -1
  33. data/app/cells/decidim/content_blocks/participatory_space_last_activity_cell.rb +3 -3
  34. data/app/cells/decidim/content_blocks/participatory_space_main_data/title.erb +27 -6
  35. data/app/cells/decidim/content_blocks/participatory_space_main_data_cell.rb +4 -0
  36. data/app/cells/decidim/content_blocks/stats/show.erb +2 -3
  37. data/app/cells/decidim/data_consent/modal.erb +1 -1
  38. data/app/cells/decidim/footer_topics/show.erb +2 -2
  39. data/app/cells/decidim/images_panel/show.erb +5 -2
  40. data/app/cells/decidim/like_block/show.erb +3 -0
  41. data/app/cells/decidim/{endorsement_block_cell.rb → like_block_cell.rb} +2 -2
  42. data/app/cells/decidim/like_buttons/button_content.erb +2 -0
  43. data/app/cells/decidim/like_buttons/show.erb +17 -0
  44. data/app/cells/decidim/{endorsement_buttons → like_buttons}/verification_modal.erb +3 -3
  45. data/app/cells/decidim/like_buttons_cell.rb +77 -0
  46. data/app/cells/decidim/likers_list/empty.erb +3 -0
  47. data/app/cells/decidim/{endorsers_list → likers_list}/full.erb +3 -3
  48. data/app/cells/decidim/likers_list/show.erb +20 -0
  49. data/app/cells/decidim/likers_list_cell.rb +64 -0
  50. data/app/cells/decidim/nav_links/show.erb +1 -1
  51. data/app/cells/decidim/notification_actions/buttons_cell.rb +1 -1
  52. data/app/cells/decidim/onboarding_action_message_cell.rb +1 -1
  53. data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +0 -8
  54. data/app/cells/decidim/participatory_space_dropdown_metadata_cell.rb +0 -8
  55. data/app/cells/decidim/profile/details.erb +1 -1
  56. data/app/cells/decidim/profile/tabs.erb +1 -1
  57. data/app/cells/decidim/profile_actions/show.erb +0 -1
  58. data/app/cells/decidim/profile_actions_cell.rb +5 -91
  59. data/app/cells/decidim/profile_cell.rb +4 -39
  60. data/app/cells/decidim/report_button/content.erb +2 -0
  61. data/app/cells/decidim/report_button/flag_modal.erb +12 -10
  62. data/app/cells/decidim/report_button_cell.rb +1 -1
  63. data/app/cells/decidim/report_user_button/flag_modal.erb +12 -11
  64. data/app/cells/decidim/resource_history_cell.rb +2 -1
  65. data/app/cells/decidim/resource_types_filter/show.erb +1 -1
  66. data/app/cells/decidim/share_button_cell.rb +1 -1
  67. data/app/cells/decidim/share_text_widget/modal.erb +16 -0
  68. data/app/cells/decidim/share_text_widget/show.erb +2 -0
  69. data/app/cells/decidim/share_text_widget_cell.rb +27 -0
  70. data/app/cells/decidim/share_widget/modal.erb +19 -8
  71. data/app/cells/decidim/share_widget/qr_code_modal.erb +26 -0
  72. data/app/cells/decidim/share_widget/show.erb +1 -0
  73. data/app/cells/decidim/share_widget_cell.rb +10 -6
  74. data/app/cells/decidim/statistic/show.erb +23 -5
  75. data/app/cells/decidim/statistic_cell.rb +28 -3
  76. data/app/cells/decidim/tab_panels/show.erb +1 -1
  77. data/app/cells/decidim/upload_modal/files.erb +4 -4
  78. data/app/cells/decidim/upload_modal_cell.rb +5 -3
  79. data/app/cells/decidim/user_profile/show.erb +1 -1
  80. data/app/cells/decidim/user_profile_cell.rb +1 -9
  81. data/app/cells/decidim/version_author_cell.rb +0 -7
  82. data/app/commands/decidim/amendable/accept.rb +1 -2
  83. data/app/commands/decidim/amendable/create_draft.rb +2 -3
  84. data/app/commands/decidim/amendable/update_draft.rb +2 -3
  85. data/app/commands/decidim/create_ephemeral_user.rb +7 -1
  86. data/app/commands/decidim/create_omniauth_registration.rb +9 -8
  87. data/app/commands/decidim/create_report.rb +9 -1
  88. data/app/commands/decidim/destroy_account.rb +0 -5
  89. data/app/commands/decidim/like_resource.rb +52 -0
  90. data/app/commands/decidim/messaging/reply_to_conversation.rb +2 -21
  91. data/app/commands/decidim/messaging/start_conversation.rb +2 -21
  92. data/app/commands/decidim/unlike_resource.rb +34 -0
  93. data/app/commands/decidim/update_account.rb +1 -1
  94. data/app/controllers/concerns/decidim/ephemeral_session_checker.rb +6 -2
  95. data/app/controllers/concerns/decidim/user_profile.rb +0 -1
  96. data/app/controllers/decidim/account_controller.rb +1 -1
  97. data/app/controllers/decidim/amendments_controller.rb +7 -8
  98. data/app/controllers/decidim/application_controller.rb +2 -1
  99. data/app/controllers/decidim/devise/confirmations_controller.rb +0 -5
  100. data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -1
  101. data/app/controllers/decidim/devise/passwords_controller.rb +1 -1
  102. data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
  103. data/app/controllers/decidim/doorkeeper/authorizations_controller.rb +19 -1
  104. data/app/controllers/decidim/download_your_data_controller.rb +2 -2
  105. data/app/controllers/decidim/likes_controller.rb +57 -0
  106. data/app/controllers/decidim/links_controller.rb +1 -0
  107. data/app/controllers/decidim/messaging/conversations_controller.rb +1 -8
  108. data/app/controllers/decidim/newsletters_controller.rb +1 -1
  109. data/app/controllers/decidim/notifications_settings_controller.rb +2 -2
  110. data/app/controllers/decidim/pages_controller.rb +0 -1
  111. data/app/controllers/decidim/profiles_controller.rb +2 -57
  112. data/app/controllers/decidim/qr_controller.rb +73 -0
  113. data/app/controllers/decidim/resource_autocomplete_controller.rb +56 -0
  114. data/app/controllers/decidim/user_activities_controller.rb +0 -1
  115. data/app/events/decidim/resource_liked_event.rb +36 -0
  116. data/app/forms/decidim/amendable/create_form.rb +0 -1
  117. data/app/forms/decidim/amendable/edit_form.rb +0 -1
  118. data/app/forms/decidim/amendable/form.rb +4 -4
  119. data/app/forms/decidim/ephemeral_user_form.rb +1 -0
  120. data/app/forms/decidim/notifications_settings_form.rb +1 -1
  121. data/app/forms/decidim/omniauth_registration_form.rb +1 -1
  122. data/app/forms/decidim/upload_validation_form.rb +9 -1
  123. data/app/helpers/decidim/amendments_helper.rb +3 -3
  124. data/app/helpers/decidim/animations_helper.rb +14 -0
  125. data/app/helpers/decidim/decidim_form_helper.rb +17 -6
  126. data/app/helpers/decidim/filters_helper.rb +25 -0
  127. data/app/helpers/decidim/layout_helper.rb +6 -14
  128. data/app/helpers/decidim/likeable_helper.rb +46 -0
  129. data/app/helpers/decidim/messaging/conversation_helper.rb +1 -1
  130. data/app/helpers/decidim/omniauth_helper.rb +1 -1
  131. data/app/helpers/decidim/qr_code_helper.rb +37 -0
  132. data/app/helpers/decidim/rich_text_editor_helper.rb +0 -1
  133. data/app/helpers/decidim/sanitize_helper.rb +5 -5
  134. data/app/helpers/decidim/social_share_button_helper.rb +11 -10
  135. data/app/jobs/decidim/delete_inactive_participants_job.rb +41 -0
  136. data/app/jobs/decidim/process_inactive_participant_job.rb +48 -0
  137. data/app/mailers/decidim/participants_account_mailer.rb +38 -0
  138. data/app/mailers/decidim/user_group_mailer.rb +28 -0
  139. data/app/models/decidim/action_log.rb +3 -5
  140. data/app/models/decidim/amendment.rb +1 -1
  141. data/app/models/decidim/attachment_collection.rb +2 -0
  142. data/app/models/decidim/authorization_transfer.rb +0 -1
  143. data/app/models/decidim/coauthorship.rb +1 -1
  144. data/app/models/decidim/component.rb +4 -1
  145. data/app/models/decidim/{endorsement.rb → like.rb} +4 -4
  146. data/app/models/decidim/messaging/conversation.rb +3 -5
  147. data/app/models/decidim/messaging/message.rb +3 -15
  148. data/app/models/decidim/omniauth_provider.rb +1 -1
  149. data/app/models/decidim/organization.rb +3 -8
  150. data/app/models/decidim/participatory_space_role_config/{valuator.rb → evaluator.rb} +1 -1
  151. data/app/models/decidim/reminder_record.rb +1 -1
  152. data/app/models/decidim/searchable_resource.rb +16 -0
  153. data/app/models/decidim/taxonomy.rb +6 -1
  154. data/app/models/decidim/user.rb +32 -15
  155. data/app/models/decidim/user_base_entity.rb +2 -2
  156. data/app/packs/entrypoints/decidim_conference_diploma.scss +2 -2
  157. data/app/packs/entrypoints/decidim_core.scss +2 -2
  158. data/app/packs/entrypoints/decidim_editor.js +0 -4
  159. data/app/packs/entrypoints/decidim_map.scss +2 -2
  160. data/app/packs/entrypoints/decidim_overrides.scss +1 -1
  161. data/app/packs/entrypoints/decidim_qr.js +1 -0
  162. data/app/packs/images/decidim/default-avatar.svg +1 -1
  163. data/app/packs/images/decidim/remixicon.symbol.svg +3 -3
  164. data/app/packs/src/decidim/a11y.js +1 -120
  165. data/app/packs/src/decidim/append_redirect_url_to_modals.js +1 -1
  166. data/app/packs/src/decidim/attachments/file_or_link_tabs.js +1 -1
  167. data/app/packs/src/decidim/callout.js +13 -8
  168. data/app/packs/src/decidim/confirm.js +25 -6
  169. data/app/packs/src/decidim/controllers/.keep +0 -0
  170. data/app/packs/src/decidim/controllers/accordion/controller.js +100 -0
  171. data/app/packs/src/decidim/controllers/account_form/account_form.test.js +423 -0
  172. data/app/packs/src/decidim/controllers/account_form/controller.js +69 -0
  173. data/app/packs/src/decidim/{input_character_counter.js → controllers/character_counter/controller.js} +90 -106
  174. data/app/packs/src/decidim/controllers/clipboard_copy/clipboard_copy.test.js +305 -0
  175. data/app/packs/src/decidim/controllers/clipboard_copy/controller.js +403 -0
  176. data/app/packs/src/decidim/controllers/date_picker/controller.js +12 -0
  177. data/app/packs/src/decidim/controllers/delete_account_form/controller.js +45 -0
  178. data/app/packs/src/decidim/controllers/delete_account_form/delete_account_form.test.js +216 -0
  179. data/app/packs/src/decidim/controllers/dropdown/controller.js +125 -0
  180. data/app/packs/src/decidim/controllers/editor/controller.js +8 -0
  181. data/app/packs/src/decidim/controllers/emoji/controller.js +26 -0
  182. data/app/packs/src/decidim/{input_emoji.js → controllers/emoji/emoji.js} +1 -15
  183. data/app/packs/src/decidim/{form_filter.js → controllers/form_filter/controller.js} +68 -51
  184. data/app/packs/src/decidim/controllers/form_filter/form_filter.test.js +648 -0
  185. data/app/packs/src/decidim/controllers/form_validator/controller.js +23 -0
  186. data/app/packs/src/decidim/controllers/form_validator/form_validator.js +789 -0
  187. data/app/packs/src/decidim/controllers/form_validator/form_validator.test.js +685 -0
  188. data/app/packs/src/decidim/controllers/impersonation_warning/controller.js +137 -0
  189. data/app/packs/src/decidim/controllers/impersonation_warning/impersonation.test.js +382 -0
  190. data/app/packs/src/decidim/controllers/input_tags/controller.js +28 -0
  191. data/app/packs/src/decidim/controllers/mention/controller.js +243 -0
  192. data/app/packs/src/decidim/controllers/mention/input_mentions.test.js +562 -0
  193. data/app/packs/src/decidim/controllers/multiple_mentions/controller.js +215 -0
  194. data/app/packs/src/decidim/controllers/multiple_mentions/input_multiple_mentions.test.js +645 -0
  195. data/app/packs/src/decidim/controllers/notification_action/controller.js +210 -0
  196. data/app/packs/src/decidim/controllers/notification_action/notification_action.test.js +388 -0
  197. data/app/packs/src/decidim/controllers/password_toggler/controller.js +232 -0
  198. data/app/packs/src/decidim/controllers/password_toggler/password_toggler.test.js +229 -0
  199. data/app/packs/src/decidim/controllers/report_form/controller.js +184 -0
  200. data/app/packs/src/decidim/controllers/report_form/report_form_manager.test.js +511 -0
  201. data/app/packs/src/decidim/controllers/scroll_to_last/controller.js +9 -0
  202. data/app/packs/src/decidim/controllers/scroll_to_last/scroll_to_last_child.test.js +225 -0
  203. data/app/packs/src/decidim/controllers/sticky_buttons/controller.js +55 -0
  204. data/app/packs/src/decidim/controllers/sticky_buttons/sticky_buttons.test.js +334 -0
  205. data/app/packs/src/decidim/controllers/sticky_header/controller.js +116 -0
  206. data/app/packs/src/decidim/controllers/sticky_header/sticky_header.test.js +320 -0
  207. data/app/packs/src/decidim/controllers/toggle/controller.js +111 -0
  208. data/app/packs/src/decidim/controllers/toggle/toggle.test.js +260 -0
  209. data/app/packs/src/decidim/controllers/tooltip/controller.js +287 -0
  210. data/app/packs/src/decidim/controllers/tooltip/tooltip.test.js +380 -0
  211. data/app/packs/src/decidim/controllers/user_registration_form/controller.js +160 -0
  212. data/app/packs/src/decidim/controllers/user_registration_form/omniauth_registration_form.test.js +441 -0
  213. data/app/packs/src/decidim/controllers/user_registration_form/user_registration_form.test.js +386 -0
  214. data/app/packs/src/decidim/data_consent/index.js +1 -1
  215. data/app/packs/src/decidim/datalist_select.js +1 -1
  216. data/app/packs/src/decidim/datepicker/form_datepicker.js +1 -1
  217. data/app/packs/src/decidim/datepicker/generate_datepicker.js +4 -2
  218. data/app/packs/src/decidim/datepicker/generate_timepicker.js +4 -2
  219. data/app/packs/src/decidim/direct_uploads/upload_field.js +6 -9
  220. data/app/packs/src/decidim/direct_uploads/upload_modal.js +9 -10
  221. data/app/packs/src/decidim/dropdown_menu.js +18 -0
  222. data/app/packs/src/decidim/editor/common/input_dialog.js +1 -1
  223. data/app/packs/src/decidim/editor/common/suggestion.js +21 -3
  224. data/app/packs/src/decidim/editor/common/upload_dialog.js +1 -1
  225. data/app/packs/src/decidim/editor/extensions/decidim_kit/index.js +7 -7
  226. data/app/packs/src/decidim/editor/extensions/emoji/index.js +2 -3
  227. data/app/packs/src/decidim/editor/extensions/image/index.js +1 -1
  228. data/app/packs/src/decidim/editor/extensions/image/node_view.js +1 -1
  229. data/app/packs/src/decidim/editor/extensions/link/bubble_menu.js +1 -1
  230. data/app/packs/src/decidim/editor/extensions/link/index.js +1 -1
  231. data/app/packs/src/decidim/editor/extensions/mention/index.js +1 -2
  232. data/app/packs/src/decidim/editor/extensions/mention_resource/index.js +69 -0
  233. data/app/packs/src/decidim/editor/extensions/video_embed/index.js +1 -1
  234. data/app/packs/src/decidim/editor/index.js +6 -5
  235. data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +1 -2
  236. data/app/packs/src/decidim/editor/test/extensions/emoji.test.js +17 -0
  237. data/app/packs/src/decidim/editor/test/extensions/heading.test.js +2 -2
  238. data/app/packs/src/decidim/editor/toolbar.js +1 -1
  239. data/app/packs/src/decidim/form_attachments.js +1 -1
  240. data/app/packs/src/decidim/geocoding/attach_input.js +3 -0
  241. data/app/packs/src/decidim/geocoding/provider/here.js +1 -1
  242. data/app/packs/src/decidim/geocoding/provider/photon.js +1 -1
  243. data/app/packs/src/decidim/geocoding/reverse_geocoding.js +2 -2
  244. data/app/packs/src/decidim/geocoding.js +2 -2
  245. data/app/packs/src/decidim/index.js +128 -95
  246. data/app/packs/src/decidim/map/integration/forms.js +1 -1
  247. data/app/packs/src/decidim/map/legacy.js +1 -1
  248. data/app/packs/src/decidim/map/provider/default.js +1 -1
  249. data/app/packs/src/decidim/map/provider/here.js +1 -1
  250. data/app/packs/src/decidim/map.js +1 -1
  251. data/app/packs/src/decidim/{external_link.js → refactor/implementation/external_link.js} +1 -1
  252. data/app/packs/src/decidim/{onboarding_pending_action.js → refactor/integration/onboarding_pending_action.js} +4 -4
  253. data/app/packs/src/decidim/{check_boxes_tree.js → refactor/moved/check_boxes_tree.js} +24 -9
  254. data/app/packs/src/decidim/{i18n.test.js → refactor/moved/i18n.test.js} +1 -1
  255. data/app/packs/src/decidim/{icon.js → refactor/moved/icon.js} +2 -0
  256. data/app/packs/src/decidim/refactor/support/stimulus.js +39 -0
  257. data/app/packs/src/decidim/refactor/test/configuration.test.js +360 -0
  258. data/app/packs/src/decidim/{external_domain_warning.test.js → refactor/test/external_domain_warning.test.js} +1 -1
  259. data/app/packs/src/decidim/{external_link.test.js → refactor/test/external_link.test.js} +1 -1
  260. data/app/packs/src/decidim/results_listing.js +2 -2
  261. data/app/packs/src/decidim/security/selfxss_warning.js +1 -1
  262. data/app/packs/src/decidim/session_timeouter.js +1 -1
  263. data/app/packs/src/decidim/sw/push-permissions.js +1 -1
  264. data/app/packs/src/decidim/utilities/dom.js +1 -1
  265. data/app/packs/stylesheets/decidim/_accordion.scss +37 -3
  266. data/app/packs/stylesheets/decidim/_activity.scss +4 -4
  267. data/app/packs/stylesheets/decidim/_author.scss +0 -21
  268. data/app/packs/stylesheets/decidim/_buttons.scss +4 -0
  269. data/app/packs/stylesheets/decidim/_callout.scss +1 -1
  270. data/app/packs/stylesheets/decidim/_cards.scss +6 -2
  271. data/app/packs/stylesheets/decidim/_content_blocks.scss +1 -1
  272. data/app/packs/stylesheets/decidim/_cookies.scss +1 -1
  273. data/app/packs/stylesheets/decidim/_datepicker.scss +0 -4
  274. data/app/packs/stylesheets/decidim/_dropdown.scss +56 -19
  275. data/app/packs/stylesheets/decidim/_filters.scss +1 -1
  276. data/app/packs/stylesheets/decidim/_forms.scss +6 -6
  277. data/app/packs/stylesheets/decidim/_header.scss +28 -4
  278. data/app/packs/stylesheets/decidim/_labels.scss +1 -1
  279. data/app/packs/stylesheets/decidim/_layout.scss +14 -4
  280. data/app/packs/stylesheets/decidim/{_endorsers_list.scss → _likes_list.scss} +1 -1
  281. data/app/packs/stylesheets/decidim/_modal_share.scss +83 -9
  282. data/app/packs/stylesheets/decidim/_modal_update.scss +6 -6
  283. data/app/packs/stylesheets/decidim/_participatory_spaces.scss +1 -1
  284. data/app/packs/stylesheets/decidim/_rich_text.scss +13 -0
  285. data/app/packs/stylesheets/decidim/_statistics.scss +35 -3
  286. data/app/packs/stylesheets/decidim/_tooltip.scss +1 -1
  287. data/app/packs/stylesheets/decidim/_typography.scss +6 -0
  288. data/app/packs/stylesheets/decidim/_wizard_steps.scss +1 -1
  289. data/app/packs/stylesheets/decidim/application.scss +76 -76
  290. data/app/packs/stylesheets/decidim/editor.scss +11 -12
  291. data/app/packs/stylesheets/decidim/legacy/email.scss +6 -5
  292. data/app/packs/stylesheets/decidim/map.scss +5 -3
  293. data/app/packs/stylesheets/decidim/qr.scss +65 -0
  294. data/app/permissions/decidim/default_permissions.rb +16 -0
  295. data/app/permissions/decidim/permissions.rb +18 -27
  296. data/app/presenters/decidim/admin_log/base_user_presenter.rb +2 -2
  297. data/app/presenters/decidim/admin_log/organization_presenter.rb +0 -15
  298. data/app/presenters/decidim/home_stats_presenter.rb +4 -54
  299. data/app/presenters/decidim/log/base_presenter.rb +1 -1
  300. data/app/presenters/decidim/menu_item_presenter.rb +10 -3
  301. data/app/presenters/decidim/official_author_presenter.rb +0 -4
  302. data/app/presenters/decidim/participatory_space_private_user_presenter.rb +0 -4
  303. data/app/presenters/decidim/resource_locator_presenter.rb +15 -4
  304. data/app/presenters/decidim/resource_presenter.rb +8 -8
  305. data/app/presenters/decidim/stats_presenter.rb +39 -60
  306. data/app/presenters/decidim/taxonomy_presenter.rb +5 -1
  307. data/app/presenters/decidim/user_presenter.rb +0 -6
  308. data/app/queries/decidim/authorized_users.rb +26 -0
  309. data/app/queries/decidim/inactive_users_query.rb +31 -0
  310. data/app/queries/decidim/public_activities.rb +2 -2
  311. data/app/queries/decidim/stats_followers_count.rb +43 -0
  312. data/app/queries/decidim/stats_participants_count.rb +102 -0
  313. data/app/serializers/decidim/exporters/open_data_user_serializer.rb +1 -5
  314. data/app/serializers/decidim/exporters/participatory_space_serializer.rb +0 -1
  315. data/app/services/decidim/action_logger.rb +2 -1
  316. data/app/services/decidim/base_diff_renderer.rb +0 -17
  317. data/app/services/decidim/onboarding_manager.rb +4 -0
  318. data/app/services/decidim/open_data_exporter.rb +19 -11
  319. data/app/services/decidim/send_push_notification.rb +4 -3
  320. data/app/services/decidim/traceability.rb +1 -1
  321. data/app/validators/etiquette_validator.rb +7 -0
  322. data/app/validators/translated_etiquette_validator.rb +3 -0
  323. data/app/views/decidim/account/_old_password_field.html.erb +1 -1
  324. data/app/views/decidim/account/_password_fields.html.erb +1 -1
  325. data/app/views/decidim/account/delete.html.erb +1 -1
  326. data/app/views/decidim/account/show.html.erb +3 -3
  327. data/app/views/decidim/amendments/edit_draft.html.erb +0 -4
  328. data/app/views/decidim/amendments/new.html.erb +0 -4
  329. data/app/views/decidim/amendments/preview_draft.html.erb +1 -1
  330. data/app/views/decidim/application/_accordion_section.html.erb +1 -1
  331. data/app/views/decidim/application/_collection.html.erb +1 -1
  332. data/app/views/decidim/application/_radio_accordion.html.erb +30 -0
  333. data/app/views/decidim/devise/omniauth_registrations/new.html.erb +1 -1
  334. data/app/views/decidim/devise/omniauth_registrations/new_tos_fields.html.erb +1 -1
  335. data/app/views/decidim/devise/registrations/new.html.erb +1 -1
  336. data/app/views/decidim/devise/shared/_links.html.erb +1 -1
  337. data/app/views/decidim/doorkeeper/authorizations/new.html.erb +39 -8
  338. data/app/views/decidim/errors/internal_server_error.html.erb +2 -1
  339. data/app/views/decidim/errors/not_found.html.erb +1 -1
  340. data/app/views/decidim/likes/update_buttons_and_counters.js.erb +21 -0
  341. data/app/views/decidim/messaging/conversations/_add_conversation_users.html.erb +2 -2
  342. data/app/views/decidim/messaging/conversations/_reply_form.html.erb +1 -1
  343. data/app/views/decidim/messaging/conversations/_start.html.erb +1 -1
  344. data/app/views/decidim/messaging/conversations/create.js.erb +0 -1
  345. data/app/views/decidim/messaging/conversations/new.html.erb +1 -1
  346. data/app/views/decidim/messaging/conversations/show.html.erb +1 -1
  347. data/app/views/decidim/newsletters/unsubscribe.html.erb +16 -4
  348. data/app/views/decidim/notifications_settings/show.html.erb +3 -3
  349. data/app/views/decidim/pages/_tabbed.html.erb +1 -1
  350. data/app/views/decidim/pages/index.html.erb +1 -1
  351. data/app/views/decidim/participants_account_mailer/inactivity_notification.html.erb +13 -0
  352. data/app/views/decidim/participants_account_mailer/removal_notification.html.erb +11 -0
  353. data/app/views/decidim/profiles/show.html.erb +1 -1
  354. data/app/views/decidim/qr/show.html.erb +28 -0
  355. data/app/views/decidim/searches/_filters.html.erb +66 -15
  356. data/app/views/decidim/searches/index.html.erb +5 -2
  357. data/app/views/decidim/shared/_component_announcement.html.erb +1 -1
  358. data/app/views/decidim/shared/_confirm_modal.html.erb +1 -1
  359. data/app/views/decidim/shared/_filters.html.erb +8 -6
  360. data/app/views/decidim/shared/_orders.html.erb +1 -1
  361. data/app/views/decidim/shared/_resource_actions.html.erb +8 -5
  362. data/app/views/decidim/user_activities/index.html.erb +1 -1
  363. data/app/views/decidim/user_group_mailer/notify_deprecation_to_member.html.erb +15 -0
  364. data/app/views/decidim/user_group_mailer/notify_deprecation_to_owner.html.erb +22 -0
  365. data/app/views/layouts/decidim/_head.html.erb +15 -12
  366. data/app/views/layouts/decidim/_impersonation_warning.html.erb +1 -1
  367. data/app/views/layouts/decidim/_js_configuration.html.erb +17 -19
  368. data/app/views/layouts/decidim/_meta_tags_context.html.erb +3 -0
  369. data/app/views/layouts/decidim/_offline_banner.html.erb +1 -1
  370. data/app/views/layouts/decidim/_wrapper.html.erb +8 -6
  371. data/app/views/layouts/decidim/footer/_focus_mode_main.html.erb +7 -0
  372. data/app/views/layouts/decidim/footer/_main.html.erb +1 -1
  373. data/app/views/layouts/decidim/footer/_main_intro.html.erb +1 -1
  374. data/app/views/layouts/decidim/footer/_main_language_chooser.html.erb +1 -1
  375. data/app/views/layouts/decidim/footer/_mini.html.erb +2 -2
  376. data/app/views/layouts/decidim/header/_close_ephemeral_session.html.erb +12 -2
  377. data/app/views/layouts/decidim/header/_focus_mode_back_button.html.erb +24 -0
  378. data/app/views/layouts/decidim/header/_main.html.erb +28 -22
  379. data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +7 -1
  380. data/app/views/layouts/decidim/header/_main_links_dropdown.html.erb +20 -18
  381. data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +1 -1
  382. data/app/views/layouts/decidim/header/_main_links_mobile_item_account.html.erb +1 -1
  383. data/app/views/layouts/decidim/header/_main_menu_mobile.html.erb +1 -1
  384. data/app/views/layouts/decidim/header/_menu_breadcrumb_desktop.html.erb +1 -1
  385. data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +1 -1
  386. data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
  387. data/app/views/layouts/decidim/header/_mobile_language_choose.html.erb +2 -2
  388. data/app/views/layouts/decidim/mailer.html.erb +2 -2
  389. data/app/views/layouts/decidim/newsletter_base.html.erb +2 -2
  390. data/app/views/layouts/decidim/shared/_layout_two_col.html.erb +3 -1
  391. data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +7 -3
  392. data/config/assets.rb +3 -3
  393. data/config/initializers/devise.rb +8 -0
  394. data/config/initializers/omniauth.rb +1 -1
  395. data/config/locales/ar.yml +0 -212
  396. data/config/locales/bg-BG.yml +2 -2
  397. data/config/locales/bg.yml +0 -243
  398. data/config/locales/bs-BA.yml +0 -30
  399. data/config/locales/ca-IT.yml +129 -280
  400. data/config/locales/ca.yml +129 -280
  401. data/config/locales/cs.yml +99 -284
  402. data/config/locales/de.yml +144 -285
  403. data/config/locales/el.yml +0 -228
  404. data/config/locales/en.yml +129 -280
  405. data/config/locales/eo.yml +0 -2
  406. data/config/locales/es-MX.yml +129 -280
  407. data/config/locales/es-PY.yml +129 -280
  408. data/config/locales/es.yml +129 -280
  409. data/config/locales/eu.yml +175 -326
  410. data/config/locales/fi-plain.yml +167 -270
  411. data/config/locales/fi.yml +168 -271
  412. data/config/locales/fr-CA.yml +102 -269
  413. data/config/locales/fr-LU.yml +3 -3
  414. data/config/locales/fr.yml +102 -269
  415. data/config/locales/ga-IE.yml +0 -28
  416. data/config/locales/gl.yml +0 -143
  417. data/config/locales/hu.yml +0 -242
  418. data/config/locales/id-ID.yml +0 -139
  419. data/config/locales/is-IS.yml +0 -15
  420. data/config/locales/it.yml +122 -193
  421. data/config/locales/ja.yml +124 -267
  422. data/config/locales/lb-LU.yml +2 -2
  423. data/config/locales/lb.yml +0 -192
  424. data/config/locales/lt.yml +0 -245
  425. data/config/locales/lv.yml +0 -189
  426. data/config/locales/nl.yml +0 -192
  427. data/config/locales/no.yml +0 -192
  428. data/config/locales/pl.yml +0 -249
  429. data/config/locales/pt-BR.yml +0 -217
  430. data/config/locales/pt.yml +0 -192
  431. data/config/locales/ro-RO.yml +54 -222
  432. data/config/locales/ru.yml +0 -65
  433. data/config/locales/sk-SK.yml +3 -3
  434. data/config/locales/sk.yml +2 -167
  435. data/config/locales/sr-CS.yml +0 -31
  436. data/config/locales/sv.yml +96 -256
  437. data/config/locales/tr-TR.yml +0 -192
  438. data/config/locales/uk.yml +0 -25
  439. data/config/locales/zh-CN.yml +0 -183
  440. data/config/locales/zh-TW.yml +0 -234
  441. data/config/routes.rb +3 -36
  442. data/db/migrate/20250217192438_convert_user_groups_into_users.rb +38 -0
  443. data/db/migrate/20250221085317_add_user_type_to_action_logs.rb +12 -0
  444. data/db/migrate/20250221090905_create_decidim_api_jwt_denylist.rb +11 -0
  445. data/db/migrate/20250221091348_add_api_key_to_decidim_api_user.rb +7 -0
  446. data/db/migrate/20250327143657_remove_metrics_content_blocks.rb +9 -0
  447. data/db/migrate/20250401153444_enable_pkce.rb +8 -0
  448. data/db/migrate/20250416130426_rename_doorkeeper_scopes.rb +25 -0
  449. data/db/migrate/20250515105231_rename_endorsements_to_likes.rb +62 -0
  450. data/db/migrate/20250523104311_move_cta_to_hero_content_block.rb +34 -0
  451. data/db/migrate/20250527122040_move_highlighted_content_banner_settings_to_content_block.rb +69 -0
  452. data/db/migrate/20250603103953_add_refresh_tokens_enabled_to_doorkeeper_applications.rb +7 -0
  453. data/db/migrate/20250609073104_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +10 -0
  454. data/db/migrate/20250613122148_remove_hashtag_table_from_core.rb +7 -0
  455. data/decidim-core.gemspec +4 -4
  456. data/{app/helpers → lib}/decidim/action_authorization_helper.rb +5 -4
  457. data/lib/decidim/amendable.rb +4 -4
  458. data/lib/decidim/api/functions/user_entity_finder.rb +1 -1
  459. data/lib/decidim/api/input_filters/component_input_filter.rb +3 -3
  460. data/lib/decidim/api/input_filters/user_entity_input_filter.rb +0 -21
  461. data/lib/decidim/api/input_sorts/has_likeable_input_sort.rb +15 -0
  462. data/lib/decidim/api/interfaces/attachable_collection_interface.rb +13 -0
  463. data/lib/decidim/api/interfaces/author_interface.rb +1 -2
  464. data/lib/decidim/api/interfaces/authorable_interface.rb +2 -2
  465. data/lib/decidim/api/interfaces/coauthorable_interface.rb +1 -1
  466. data/lib/decidim/api/interfaces/component_interface.rb +6 -0
  467. data/lib/decidim/api/interfaces/followable_interface.rb +13 -0
  468. data/lib/decidim/api/interfaces/likeable_interface.rb +19 -0
  469. data/lib/decidim/api/interfaces/localizable_interface.rb +18 -0
  470. data/lib/decidim/api/interfaces/participatory_space_interface.rb +6 -8
  471. data/lib/decidim/api/interfaces/referable_interface.rb +13 -0
  472. data/lib/decidim/api/interfaces/timestamps_interface.rb +0 -1
  473. data/lib/decidim/api/interfaces/traceable_interface.rb +1 -1
  474. data/lib/decidim/api/types/attachment_collection_type.rb +14 -0
  475. data/lib/decidim/api/types/organization_type.rb +3 -1
  476. data/lib/decidim/api/types/session_type.rb +0 -5
  477. data/lib/decidim/api/types/statistic_type.rb +29 -3
  478. data/lib/decidim/api/types/trace_version_type.rb +1 -1
  479. data/lib/decidim/api/types/user_type.rb +1 -2
  480. data/lib/decidim/api_response_helper.rb +12 -0
  481. data/lib/decidim/asset_router/storage.rb +2 -4
  482. data/lib/decidim/assets/tailwind/instance.rb +1 -1
  483. data/lib/decidim/assets/tailwind/tailwind.config.js.erb +5 -3
  484. data/lib/decidim/attribute_encryptor.rb +1 -1
  485. data/lib/decidim/attributes/time_with_zone.rb +1 -1
  486. data/lib/decidim/authorable.rb +5 -34
  487. data/lib/decidim/coauthorable.rb +13 -31
  488. data/lib/decidim/content_parsers/blob_parser.rb +1 -1
  489. data/lib/decidim/content_parsers/mention_resource_parser.rb +23 -0
  490. data/lib/decidim/content_parsers/tag_parser.rb +2 -2
  491. data/lib/decidim/content_parsers/user_parser.rb +2 -2
  492. data/lib/decidim/content_parsers.rb +14 -2
  493. data/lib/decidim/content_processor.rb +1 -1
  494. data/lib/decidim/content_renderers/mention_resource_renderer.rb +77 -0
  495. data/lib/decidim/content_renderers.rb +1 -2
  496. data/lib/decidim/core/api.rb +7 -8
  497. data/lib/decidim/core/content_blocks/registry_manager.rb +19 -5
  498. data/lib/decidim/core/engine.rb +72 -104
  499. data/lib/decidim/core/menu.rb +0 -7
  500. data/lib/decidim/core/seeds.rb +11 -39
  501. data/lib/decidim/core/test/factories.rb +24 -123
  502. data/lib/decidim/core/test/shared_examples/announcements_examples.rb +4 -0
  503. data/lib/decidim/core/test/shared_examples/authorable.rb +0 -17
  504. data/lib/decidim/core/test/shared_examples/coauthorable.rb +5 -48
  505. data/lib/decidim/core/test/shared_examples/comments_examples.rb +14 -61
  506. data/lib/decidim/core/test/shared_examples/likeable.rb +22 -0
  507. data/lib/decidim/core/test/shared_examples/manage_share_tokens_examples.rb +16 -3
  508. data/lib/decidim/core/test/shared_examples/map_examples.rb +1 -1
  509. data/lib/decidim/core/test/shared_examples/oauth_application_examples.rb +137 -0
  510. data/lib/decidim/core/test/shared_examples/participatory_space_dropdown_metadata_cell_examples.rb +0 -18
  511. data/lib/decidim/core/test/shared_examples/permissions.rb +0 -46
  512. data/lib/decidim/core/test/shared_examples/reports_examples.rb +2 -2
  513. data/lib/decidim/core/test/shared_examples/{resource_endorsed_event_examples.rb → resource_liked_event_examples.rb} +7 -7
  514. data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +0 -14
  515. data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +8 -34
  516. data/lib/decidim/core/test/shared_examples/social_share_examples.rb +79 -0
  517. data/lib/decidim/core/test/shared_examples/system_like_resource_examples.rb +192 -0
  518. data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +2 -2
  519. data/lib/decidim/core/test/shared_examples/{with_endorsable_permissions_examples.rb → with_likeable_permissions_examples.rb} +22 -22
  520. data/lib/decidim/core/test.rb +6 -9
  521. data/lib/decidim/core/version.rb +1 -1
  522. data/lib/decidim/core.rb +237 -88
  523. data/lib/decidim/deprecations.rb +1 -1
  524. data/lib/decidim/download_your_data_serializers.rb +6 -3
  525. data/lib/decidim/env.rb +3 -1
  526. data/lib/decidim/events.rb +0 -1
  527. data/lib/decidim/form_builder.rb +40 -43
  528. data/lib/decidim/gamification/badge_scorer.rb +0 -2
  529. data/lib/decidim/gamification.rb +1 -1
  530. data/lib/decidim/has_conversations.rb +0 -44
  531. data/lib/decidim/has_workflows.rb +42 -0
  532. data/lib/decidim/icon_registry.rb +4 -4
  533. data/lib/decidim/legacy_form_builder.rb +17 -2
  534. data/lib/decidim/likeable.rb +24 -0
  535. data/lib/decidim/manifest_registry.rb +1 -1
  536. data/lib/decidim/map/provider/dynamic_map/here.rb +0 -19
  537. data/lib/decidim/map/provider/static_map/here.rb +2 -10
  538. data/lib/decidim/menu.rb +1 -1
  539. data/lib/decidim/moderation_tools.rb +1 -1
  540. data/lib/decidim/mutation_registry.rb +17 -0
  541. data/lib/decidim/newsletter_encryptor.rb +1 -1
  542. data/lib/decidim/oauth/token_generator.rb +35 -0
  543. data/lib/decidim/oauth.rb +7 -0
  544. data/lib/decidim/organization_settings.rb +2 -10
  545. data/lib/decidim/paddable.rb +1 -1
  546. data/lib/decidim/participatory_space_resourceable.rb +2 -2
  547. data/lib/decidim/participatory_space_user.rb +1 -1
  548. data/lib/decidim/pdf_signature_example.rb +108 -0
  549. data/lib/decidim/query.rb +1 -1
  550. data/lib/decidim/query_extensions.rb +0 -33
  551. data/lib/decidim/reportable.rb +1 -1
  552. data/lib/decidim/searchable.rb +4 -2
  553. data/lib/decidim/seeds.rb +8 -0
  554. data/lib/decidim/settings_manifest.rb +3 -2
  555. data/lib/decidim/{webpacker → shakapacker}/configuration.rb +4 -4
  556. data/lib/decidim/{webpacker → shakapacker}/runner.rb +3 -3
  557. data/lib/decidim/shakapacker/shakapacker.rb +8 -0
  558. data/lib/decidim/{webpacker → shakapacker}/shakapacker.yml +3 -1
  559. data/lib/decidim/{webpacker → shakapacker}/webpack/custom.js +1 -1
  560. data/lib/decidim/shakapacker.rb +34 -0
  561. data/lib/decidim/social_share_service_manifest.rb +7 -12
  562. data/lib/decidim/stats_registry.rb +15 -3
  563. data/{app/helpers → lib}/decidim/tooltip_helper.rb +3 -3
  564. data/lib/decidim/url_option_resolver.rb +1 -1
  565. data/lib/decidim/view_model.rb +0 -3
  566. data/lib/decidim/webpacker.rb +11 -20
  567. data/lib/decidim/workflow_registry.rb +61 -0
  568. data/lib/tasks/decidim_participants_tasks.rake +22 -0
  569. data/lib/tasks/{decidim_webpacker_tasks.rake → decidim_shakapacker_tasks.rake} +35 -33
  570. data/lib/tasks/decidim_tasks.rake +4 -1
  571. data/lib/tasks/decidim_taxonomies.rake +0 -34
  572. data/lib/tasks/upgrade/clean.rake +1 -1
  573. data/lib/tasks/upgrade/decidim_action_log_valuation_assignment.rake +13 -0
  574. data/lib/tasks/upgrade/decidim_change_valuator_tasks.rake +12 -0
  575. data/lib/tasks/upgrade/{decidim_deduplicate_endorsements.rake → decidim_deduplicate_likes.rake} +10 -10
  576. data/lib/tasks/upgrade/decidim_migrate_wysiwyg_content.rake +2 -2
  577. data/lib/tasks/upgrade/decidim_paper_trail_valuation_assignment.rake +13 -0
  578. data/lib/tasks/upgrade/user_groups_migration.rake +155 -0
  579. metadata +205 -256
  580. data/app/cells/decidim/author/endorsements.erb +0 -4
  581. data/app/cells/decidim/author/profile_minicard.erb +0 -30
  582. data/app/cells/decidim/content_blocks/organization_metrics_cell.rb +0 -21
  583. data/app/cells/decidim/content_blocks/participatory_space_metrics/content.erb +0 -18
  584. data/app/cells/decidim/content_blocks/participatory_space_metrics_cell.rb +0 -43
  585. data/app/cells/decidim/endorsement_block/show.erb +0 -3
  586. data/app/cells/decidim/endorsement_buttons/button_content.erb +0 -2
  587. data/app/cells/decidim/endorsement_buttons/select_identity_button.erb +0 -7
  588. data/app/cells/decidim/endorsement_buttons/show.erb +0 -17
  589. data/app/cells/decidim/endorsement_buttons_cell.rb +0 -87
  590. data/app/cells/decidim/endorsers_list/empty.erb +0 -3
  591. data/app/cells/decidim/endorsers_list/show.erb +0 -20
  592. data/app/cells/decidim/endorsers_list_cell.rb +0 -64
  593. data/app/cells/decidim/group_admins/show.erb +0 -32
  594. data/app/cells/decidim/group_admins_cell.rb +0 -8
  595. data/app/cells/decidim/group_members/show.erb +0 -42
  596. data/app/cells/decidim/group_members_cell.rb +0 -8
  597. data/app/cells/decidim/groups/show.erb +0 -14
  598. data/app/cells/decidim/groups_cell.rb +0 -22
  599. data/app/cells/decidim/members/show.erb +0 -12
  600. data/app/cells/decidim/members_cell.rb +0 -34
  601. data/app/cells/decidim/profile_actions/dropdown_actions.erb +0 -21
  602. data/app/cells/decidim/represent_user_group/show.erb +0 -11
  603. data/app/cells/decidim/represent_user_group_cell.rb +0 -46
  604. data/app/cells/decidim/user_conversation/conversation_header.erb +0 -14
  605. data/app/cells/decidim/user_conversation/messages.erb +0 -1
  606. data/app/cells/decidim/user_conversation/new.erb +0 -6
  607. data/app/cells/decidim/user_conversation/reply.erb +0 -9
  608. data/app/cells/decidim/user_conversation/show.erb +0 -19
  609. data/app/cells/decidim/user_conversation/start.erb +0 -12
  610. data/app/cells/decidim/user_conversation_cell.rb +0 -62
  611. data/app/cells/decidim/user_conversations/new_conversation_button.erb +0 -20
  612. data/app/cells/decidim/user_conversations/show.erb +0 -13
  613. data/app/cells/decidim/user_conversations_cell.rb +0 -28
  614. data/app/cells/decidim/user_group_pending_invitations_list/show.erb +0 -28
  615. data/app/cells/decidim/user_group_pending_invitations_list_cell.rb +0 -26
  616. data/app/cells/decidim/user_group_pending_requests_list/show.erb +0 -27
  617. data/app/cells/decidim/user_group_pending_requests_list_cell.rb +0 -26
  618. data/app/commands/decidim/accept_group_invitation.rb +0 -43
  619. data/app/commands/decidim/accept_user_group_join_request.rb +0 -53
  620. data/app/commands/decidim/create_user_group.rb +0 -73
  621. data/app/commands/decidim/demote_membership.rb +0 -57
  622. data/app/commands/decidim/endorse_resource.rb +0 -66
  623. data/app/commands/decidim/invite_user_to_group.rb +0 -63
  624. data/app/commands/decidim/join_user_group.rb +0 -57
  625. data/app/commands/decidim/leave_user_group.rb +0 -47
  626. data/app/commands/decidim/promote_membership.rb +0 -55
  627. data/app/commands/decidim/reject_group_invitation.rb +0 -42
  628. data/app/commands/decidim/reject_user_group_join_request.rb +0 -53
  629. data/app/commands/decidim/remove_user_from_group.rb +0 -53
  630. data/app/commands/decidim/unendorse_resource.rb +0 -39
  631. data/app/commands/decidim/update_user_group.rb +0 -72
  632. data/app/controllers/concerns/decidim/user_groups.rb +0 -23
  633. data/app/controllers/decidim/endorsements_controller.rb +0 -71
  634. data/app/controllers/decidim/group_email_confirmations_controller.rb +0 -32
  635. data/app/controllers/decidim/group_invites_controller.rb +0 -104
  636. data/app/controllers/decidim/group_members_controller.rb +0 -75
  637. data/app/controllers/decidim/groups_controller.rb +0 -99
  638. data/app/controllers/decidim/own_user_groups_controller.rb +0 -15
  639. data/app/controllers/decidim/user_conversations_controller.rb +0 -133
  640. data/app/controllers/decidim/user_group_join_requests_controller.rb +0 -72
  641. data/app/events/decidim/demoted_membership_event.rb +0 -28
  642. data/app/events/decidim/invited_to_group_event.rb +0 -62
  643. data/app/events/decidim/join_request_accepted_event.rb +0 -28
  644. data/app/events/decidim/join_request_created_event.rb +0 -28
  645. data/app/events/decidim/join_request_rejected_event.rb +0 -28
  646. data/app/events/decidim/promoted_to_admin_event.rb +0 -28
  647. data/app/events/decidim/removed_from_group_event.rb +0 -28
  648. data/app/events/decidim/resource_endorsed_event.rb +0 -36
  649. data/app/events/decidim/user_group_admin_event.rb +0 -37
  650. data/app/events/decidim/user_group_created_event.rb +0 -6
  651. data/app/events/decidim/user_group_updated_event.rb +0 -6
  652. data/app/forms/decidim/invite_user_to_group_form.rb +0 -29
  653. data/app/forms/decidim/user_group_form.rb +0 -85
  654. data/app/helpers/decidim/cta_button_helper.rb +0 -31
  655. data/app/helpers/decidim/endorsable_helper.rb +0 -84
  656. data/app/helpers/decidim/twitter_search_helper.rb +0 -14
  657. data/app/helpers/decidim/user_group_helper.rb +0 -22
  658. data/app/jobs/decidim/metric_job.rb +0 -15
  659. data/app/models/decidim/metric.rb +0 -25
  660. data/app/models/decidim/user_group.rb +0 -217
  661. data/app/models/decidim/user_group_membership.rb +0 -17
  662. data/app/packs/entrypoints/decidim_widget.js +0 -1
  663. data/app/packs/src/decidim/abide_form_validator_fixer.js +0 -44
  664. data/app/packs/src/decidim/account_form.js +0 -96
  665. data/app/packs/src/decidim/append_elements.js +0 -6
  666. data/app/packs/src/decidim/back_to_list.js +0 -26
  667. data/app/packs/src/decidim/change_report_form_behavior.js +0 -45
  668. data/app/packs/src/decidim/clipboard.js +0 -128
  669. data/app/packs/src/decidim/editor/extensions/hashtag/index.js +0 -66
  670. data/app/packs/src/decidim/editor/extensions/heading/index.js +0 -33
  671. data/app/packs/src/decidim/editor/test/extensions/hashtag.test.js +0 -105
  672. data/app/packs/src/decidim/form_filter.component_for_testing.js +0 -7
  673. data/app/packs/src/decidim/form_validator.js +0 -56
  674. data/app/packs/src/decidim/gallery.js +0 -5
  675. data/app/packs/src/decidim/impersonation.js +0 -23
  676. data/app/packs/src/decidim/input_autojump.js +0 -38
  677. data/app/packs/src/decidim/input_hashtags.js +0 -91
  678. data/app/packs/src/decidim/input_mentions.js +0 -143
  679. data/app/packs/src/decidim/input_multiple_mentions.js +0 -115
  680. data/app/packs/src/decidim/input_tags.js +0 -16
  681. data/app/packs/src/decidim/notifications_actions.js +0 -40
  682. data/app/packs/src/decidim/password_toggler.js +0 -104
  683. data/app/packs/src/decidim/remote_tooltips.js +0 -38
  684. data/app/packs/src/decidim/responsive_horizontal_tabs.js +0 -12
  685. data/app/packs/src/decidim/scroll_to_last_child.js +0 -14
  686. data/app/packs/src/decidim/slug_form.js +0 -9
  687. data/app/packs/src/decidim/sticky_footer.js +0 -48
  688. data/app/packs/src/decidim/sticky_header.js +0 -62
  689. data/app/packs/src/decidim/toggle.js +0 -37
  690. data/app/packs/src/decidim/tooltips.js +0 -152
  691. data/app/packs/src/decidim/user_registrations.js +0 -65
  692. data/app/packs/src/decidim/vizzs/areachart.js +0 -251
  693. data/app/packs/src/decidim/vizzs/index.js +0 -82
  694. data/app/packs/src/decidim/widget.js +0 -14
  695. data/app/packs/stylesheets/decidim/_hashtags.scss +0 -5
  696. data/app/packs/stylesheets/decidim/_metrics.scss +0 -70
  697. data/app/packs/stylesheets/decidim/_modal_identities.scss +0 -23
  698. data/app/presenters/decidim/admin_log/user_group_presenter.rb +0 -31
  699. data/app/presenters/decidim/hashtag_presenter.rb +0 -37
  700. data/app/presenters/decidim/metric_charts_presenter.rb +0 -92
  701. data/app/presenters/decidim/metric_object_presenter.rb +0 -32
  702. data/app/presenters/decidim/user_group_presenter.rb +0 -38
  703. data/app/queries/decidim/metric_manage.rb +0 -81
  704. data/app/queries/decidim/metric_measure.rb +0 -36
  705. data/app/queries/decidim/metrics/blocked_users_metric_manage.rb +0 -26
  706. data/app/queries/decidim/metrics/followers_metric_manage.rb +0 -65
  707. data/app/queries/decidim/metrics/participants_metric_manage.rb +0 -79
  708. data/app/queries/decidim/metrics/reported_users_metric_manage.rb +0 -26
  709. data/app/queries/decidim/metrics/user_reports_metric_manage.rb +0 -26
  710. data/app/queries/decidim/metrics/users_metric_manage.rb +0 -26
  711. data/app/queries/decidim/user_groups/accepted_memberships.rb +0 -36
  712. data/app/queries/decidim/user_groups/accepted_user_groups.rb +0 -38
  713. data/app/queries/decidim/user_groups/accepted_users.rb +0 -36
  714. data/app/queries/decidim/user_groups/admin_memberships.rb +0 -37
  715. data/app/queries/decidim/user_groups/invited_memberships.rb +0 -36
  716. data/app/queries/decidim/user_groups/manageable_user_groups.rb +0 -39
  717. data/app/queries/decidim/user_groups/member_memberships.rb +0 -37
  718. data/app/resolvers/decidim/core/metric_resolver.rb +0 -71
  719. data/app/resolvers/decidim/hashtags_resolver.rb +0 -15
  720. data/app/serializers/decidim/exporters/open_data_metric_serializer.rb +0 -22
  721. data/app/serializers/decidim/exporters/open_data_user_group_serializer.rb +0 -38
  722. data/app/views/decidim/endorsements/_identity.html.erb +0 -4
  723. data/app/views/decidim/endorsements/identities.html.erb +0 -18
  724. data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +0 -25
  725. data/app/views/decidim/group_invites/index.html.erb +0 -26
  726. data/app/views/decidim/groups/_form.html.erb +0 -17
  727. data/app/views/decidim/groups/edit.html.erb +0 -19
  728. data/app/views/decidim/groups/new.html.erb +0 -23
  729. data/app/views/decidim/messaging/conversation_mailer/comanagers_new_conversation.html.erb +0 -17
  730. data/app/views/decidim/messaging/conversation_mailer/comanagers_new_message.html.erb +0 -17
  731. data/app/views/decidim/messaging/conversation_mailer/new_group_conversation.html.erb +0 -17
  732. data/app/views/decidim/messaging/conversation_mailer/new_group_message.html.erb +0 -17
  733. data/app/views/decidim/own_user_groups/index.html.erb +0 -10
  734. data/app/views/decidim/shared/_extended_navigation_bar.html.erb +0 -50
  735. data/app/views/decidim/user_conversations/index.html.erb +0 -4
  736. data/app/views/decidim/user_conversations/show.html.erb +0 -4
  737. data/app/views/decidim/user_conversations/update.js.erb +0 -8
  738. data/config/initializers/new_framework_defaults_7_0.rb +0 -145
  739. data/lib/decidim/api/input_filters/has_hastaggable_input_filter.rb +0 -15
  740. data/lib/decidim/api/input_sorts/has_endorsable_input_sort.rb +0 -15
  741. data/lib/decidim/api/interfaces/endorsable_interface.rb +0 -19
  742. data/lib/decidim/api/types/hashtag_type.rb +0 -13
  743. data/lib/decidim/api/types/metric_history_type.rb +0 -20
  744. data/lib/decidim/api/types/metric_type.rb +0 -13
  745. data/lib/decidim/api/types/user_group_type.rb +0 -55
  746. data/lib/decidim/content_parsers/hashtag_parser.rb +0 -66
  747. data/lib/decidim/content_parsers/user_group_parser.rb +0 -33
  748. data/lib/decidim/content_renderers/hashtag_renderer.rb +0 -78
  749. data/lib/decidim/content_renderers/user_group_renderer.rb +0 -31
  750. data/lib/decidim/core/test/shared_examples/amendable_interface_examples.rb +0 -14
  751. data/lib/decidim/core/test/shared_examples/amendable_proposals_interface_examples.rb +0 -50
  752. data/lib/decidim/core/test/shared_examples/assembly_announcements_examples.rb +0 -38
  753. data/lib/decidim/core/test/shared_examples/attachable_interface_examples.rb +0 -16
  754. data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +0 -59
  755. data/lib/decidim/core/test/shared_examples/categories_container_examples.rb +0 -22
  756. data/lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb +0 -27
  757. data/lib/decidim/core/test/shared_examples/coauthorable_interface_examples.rb +0 -91
  758. data/lib/decidim/core/test/shared_examples/endorsable.rb +0 -69
  759. data/lib/decidim/core/test/shared_examples/endorsable_interface_examples.rb +0 -22
  760. data/lib/decidim/core/test/shared_examples/fingerprintable_interface_examples.rb +0 -17
  761. data/lib/decidim/core/test/shared_examples/input_filter_examples.rb +0 -118
  762. data/lib/decidim/core/test/shared_examples/input_sort_examples.rb +0 -126
  763. data/lib/decidim/core/test/shared_examples/metric_manage_shared_context.rb +0 -9
  764. data/lib/decidim/core/test/shared_examples/participatory_space_resourcable_interface_examples.rb +0 -43
  765. data/lib/decidim/core/test/shared_examples/process_announcements_examples.rb +0 -37
  766. data/lib/decidim/core/test/shared_examples/scopable_interface_examples.rb +0 -19
  767. data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +0 -298
  768. data/lib/decidim/core/test/shared_examples/taxonomizable_interface_examples.rb +0 -20
  769. data/lib/decidim/core/test/shared_examples/timestamps_interface_examples.rb +0 -21
  770. data/lib/decidim/core/test/shared_examples/traceable_interface_examples.rb +0 -47
  771. data/lib/decidim/download_your_data_serializers/download_your_data_user_group_serializer.rb +0 -21
  772. data/lib/decidim/endorsable.rb +0 -29
  773. data/lib/decidim/events/user_group_event.rb +0 -43
  774. data/lib/decidim/hashtag.rb +0 -13
  775. data/lib/decidim/metric_manifest.rb +0 -35
  776. data/lib/decidim/metric_operation.rb +0 -58
  777. data/lib/decidim/metric_operation_manifest.rb +0 -21
  778. data/lib/decidim/metric_registry.rb +0 -109
  779. data/lib/gem_overrides/shakapacker/runner.rb +0 -9
  780. data/lib/tasks/decidim_metrics_tasks.rake +0 -89
  781. /data/app/cells/decidim/{endorsement_buttons/disabled_endorsements.erb → like_buttons/disabled_likes.erb} +0 -0
  782. /data/app/packs/src/decidim/{configuration.js → refactor/implementation/configuration.js} +0 -0
  783. /data/app/packs/src/decidim/{external_domain_warning.js → refactor/implementation/external_domain_warning.js} +0 -0
  784. /data/app/packs/src/decidim/{autocomplete.js → refactor/moved/autocomplete.js} +0 -0
  785. /data/app/packs/src/decidim/{delayed.js → refactor/moved/delayed.js} +0 -0
  786. /data/app/packs/src/decidim/{focus_guard.js → refactor/moved/focus_guard.js} +0 -0
  787. /data/app/packs/src/decidim/{history.js → refactor/moved/history.js} +0 -0
  788. /data/app/packs/src/decidim/{i18n.js → refactor/moved/i18n.js} +0 -0
  789. /data/lib/decidim/core/test/shared_examples/{endorsements_controller_shared_context.rb → likes_controller_shared_context.rb} +0 -0
  790. /data/{app/helpers → lib}/decidim/resource_helper.rb +0 -0
  791. /data/lib/decidim/{webpacker → shakapacker}/esbuild.config.js +0 -0
  792. /data/lib/decidim/{webpacker → shakapacker}/postcss.config.js +0 -0
  793. /data/lib/decidim/{webpacker → shakapacker}/tsconfig.json +0 -0
  794. /data/lib/decidim/{webpacker → shakapacker}/webpack/.modernizrrc +0 -0
  795. /data/lib/decidim/{webpacker → shakapacker}/webpack/webpack.config.js +0 -0
@@ -1,26 +0,0 @@
1
- /**
2
- * Changes "Back to list" links to the one saved in sessionStorage API
3
- * To apply this to a link, at least one element must have the class "js-back-to-list".
4
- * For this to work it needs the filteredParams in SessionStorage, that is saved on FormFilterComponent.
5
- * @param {NodeList} links - Hyperlinks elements that point to the filters page that will use the filtered params
6
- * @returns {void}
7
- */
8
- export default function backToListLink(links) {
9
-
10
- if (!links) {
11
- return;
12
- }
13
-
14
- if (!window.sessionStorage) {
15
- return;
16
- }
17
-
18
- const filteredParams = JSON.parse(sessionStorage.getItem("filteredParams")) || {};
19
- links.forEach((link) => {
20
- const href = link.getAttribute("href");
21
- if (filteredParams[href]) {
22
- link.setAttribute("href", filteredParams[href]);
23
- }
24
- });
25
-
26
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * These set of functions aims to change the behavior of the report modal forms
3
- * so that when checking various checkboxes, to change the label of the button
4
- * to either report or hide.
5
- * Given the behavior is similar for report content and report user, we have the
6
- * functionality grouped in one single function.
7
- * It is important to note that the report user modal has a checkbox that allows
8
- * the admin to block the user in the report user modal.
9
- */
10
-
11
- /**
12
- * @param {DomElement} input The checkbox that is being checked
13
- * @return {Void} Nothing
14
- */
15
- const changeLabel = function (input) {
16
- let submit = input.closest("form").querySelector("button[type=submit]");
17
-
18
- if (submit.querySelector("span") !== null) {
19
- submit = submit.querySelector("span");
20
- }
21
- if (input.checked === true) {
22
- submit.innerHTML = input.dataset.labelAction;
23
- } else {
24
- submit.innerHTML = input.dataset.labelReport;
25
- }
26
- }
27
-
28
- /**
29
- * @param {Object} container The form handling the report.
30
- * @return {Void} Nothing
31
- */
32
- export default function changeReportFormBehavior(container) {
33
- container.querySelectorAll("[data-hide=true]").forEach((checkbox) => {
34
- checkbox.addEventListener("change", (event) => {
35
- changeLabel(event.target);
36
- });
37
- });
38
- container.querySelectorAll("[data-block=true]").forEach((checkbox) => {
39
- checkbox.addEventListener("change", (event) => {
40
- changeLabel(event.target);
41
- let blockAndHide = event.target.closest("form").querySelector("#block_and_hide");
42
- blockAndHide.classList.toggle("invisible");
43
- });
44
- });
45
- }
@@ -1,128 +0,0 @@
1
- import select from "select";
2
-
3
- /**
4
- * This provides functionality to add clipboard copy functionality to buttons
5
- * on the page. The element to be copied from has to be defined for the button
6
- * using a `data` attribute and the target element has to be a form input.
7
- *
8
- * Usage:
9
- * 1. Create the button:
10
- * <button class="button"
11
- * data-clipboard-copy="#target-input-element"
12
- * data-clipboard-copy-label="Copied!"
13
- * data-clipboard-copy-message="The text was successfully copied to clipboard."
14
- * aria-label="Copy the text to clipboard">
15
- * <%= icon "clipboard", role: "presentation", "aria-hidden": true %>
16
- * Copy to clipboard
17
- * </button>
18
- *
19
- * 2. Make sure the target element exists on the page:
20
- * <input id="target-input-element" type="text" value="This text will be copied.">
21
- *
22
- * Options through data attributes:
23
- * - `data-clipboard-copy` = The jQuery selector for the target input element
24
- * where text will be copied from. If this element does not contain any visible text (for instance is an image),
25
- * the selector indicated in here will be used to place the confirmation message.
26
- * - `data-clipboard-content` = The text that will be copied. If empty or not present, the target input element will be used.
27
- * - `data-clipboard-copy-label` = The label that will be shown in the button
28
- * after a succesful copy.
29
- * - `data-clipboard-copy-message` = The text that will be announced to screen
30
- * readers after a successful copy.
31
- */
32
-
33
- // How long the "copied" text is shown in the copy element after successful
34
- // copy.
35
- const CLIPBOARD_COPY_TIMEOUT = 5000;
36
-
37
- $(() => {
38
- $(document).on("click", "[data-clipboard-copy]", (ev) => {
39
- const $el = $(ev.currentTarget);
40
- if (!$el.data("clipboard-copy") || $el.data("clipboard-copy").length < 1) {
41
- return;
42
- }
43
-
44
- const $input = $($el.data("clipboard-copy"));
45
-
46
- let selectedText = $el.data("clipboard-content") || "";
47
- if (selectedText === "" && $input.is("input, textarea, select")) {
48
- selectedText = select($input[0]);
49
- }
50
-
51
- let $msgEl = $el;
52
- if ($msgEl.text() === "") {
53
- $msgEl = $input;
54
- }
55
- // Get the available text to clipboard.
56
- if (!selectedText || selectedText.length < 1) {
57
- return;
58
- }
59
-
60
- // Move the selected text to clipboard.
61
- const $temp = $(`<textarea>${selectedText}</textarea>`).css({
62
- width: 1,
63
- height: 1
64
- });
65
- $el.after($temp);
66
- $temp.select();
67
-
68
- const copyDone = () => {
69
- $temp.remove();
70
- $el.focus();
71
- };
72
- try {
73
- // document.execCommand is deprecated but the Clipboard API is not
74
- // supported by IE (which unfortunately is still a thing).
75
- if (!document.execCommand("copy")) {
76
- return;
77
- }
78
- } catch (err) {
79
- copyDone();
80
- return;
81
- }
82
- copyDone();
83
-
84
- // Change the label to indicate the copying was successful.
85
- const label = $el.data("clipboard-copy-label");
86
- if (label) {
87
- let to = $el.data("clipboard-copy-label-timeout");
88
- if (to) {
89
- clearTimeout(to);
90
- }
91
-
92
- if (!$el.data("clipboard-copy-label-original")) {
93
- $el.data("clipboard-copy-label-original", $msgEl.html());
94
- }
95
-
96
- $msgEl.html(label);
97
-
98
- to = setTimeout(() => {
99
- $msgEl.html($el.data("clipboard-copy-label-original"));
100
- $el.removeData("clipboard-copy-label-original");
101
- $el.removeData("clipboard-copy-label-timeout");
102
- }, CLIPBOARD_COPY_TIMEOUT);
103
-
104
- $el.data("clipboard-copy-label-timeout", to);
105
- }
106
-
107
- // Alert the screen reader what just happened (the link was copied).
108
- let message = $el.data("clipboard-copy-message");
109
- if (message) {
110
- let $msg = $el.data("clipboard-message-element");
111
- if ($msg) {
112
- if ($msg.html() === message) {
113
- // Try to hint the screen reader to re-read the text in the message
114
- // element.
115
- message += "&nbsp;";
116
- }
117
- } else {
118
- $msg = $('<div aria-role="alert" aria-live="assertive" aria-atomic="true" class="sr-only"></div>');
119
- $msgEl.append($msg);
120
- $el.data("clipboard-message-element", $msg);
121
- }
122
-
123
- // Add the non breaking space always to content to try to force the
124
- // screen reader to reannounce the added text.
125
- $msg.html(message);
126
- }
127
- });
128
- });
@@ -1,66 +0,0 @@
1
- import Mention from "@tiptap/extension-mention";
2
- import { PluginKey } from "prosemirror-state";
3
-
4
- import { createSuggestionRenderer, createNodeView } from "src/decidim/editor/common/suggestion";
5
-
6
- export const HashtagPluginKey = new PluginKey("hashtag");
7
-
8
- const searchHashtags = async (queryText) => {
9
- return fetch(window.Decidim.config.get("api_path"), {
10
- method: "POST",
11
- cache: "no-cache",
12
- headers: { "Content-Type": "application/json" },
13
- body: JSON.stringify({ query: `{ hashtags(name:"${queryText}") {name} }` })
14
- }).then((response) => {
15
- if (response.ok) {
16
- return response.json();
17
- }
18
- throw new Error("Could not retrieve data");
19
- }).then((json) => (json.data.hashtags || []));
20
- };
21
-
22
- /**
23
- * The hashtag extension does not yet exist in the TipTap public repository and
24
- * also the documentation page shows it as
25
- * https://tiptap.dev/api/nodes/hashtag
26
- */
27
- export default Mention.extend({
28
- name: "hashtag",
29
-
30
- addOptions() {
31
- const options = this.parent?.();
32
- const suggestion = options?.suggestion;
33
-
34
- return {
35
- ...options,
36
- renderLabel({ node }) {
37
- // The labels already have the suggestion character in front of them
38
- // which is why we do not want to add it twice.
39
- return `${node.attrs.label ?? node.attrs.id}`
40
- },
41
- suggestion: {
42
- ...suggestion,
43
- char: "#",
44
- pluginKey: HashtagPluginKey,
45
- items: async ({ query }) => {
46
- if (query.length < 2) {
47
- return [];
48
- }
49
-
50
- const data = await searchHashtags(query);
51
- const sorted = data.sort((tag) => tag.name);
52
- return sorted.slice(0, 5);
53
- },
54
- render: createSuggestionRenderer(this, {
55
- itemConverter: (tag) => {
56
- return { label: `#${tag.name}` }
57
- }
58
- })
59
- }
60
- };
61
- },
62
-
63
- addNodeView() {
64
- return createNodeView(this);
65
- }
66
- });
@@ -1,33 +0,0 @@
1
- import { textblockTypeInputRule } from "@tiptap/core";
2
-
3
- import Heading from "@tiptap/extension-heading";
4
-
5
- /**
6
- * Customized version of the Heading extension in order to fix compatibility
7
- * issue with the Hashtag extension. The default input rule of the Heading
8
- * extension would also match any paragraphs that have only one hashtag in them
9
- * and nothing else because that indicates the first level of heading.
10
- *
11
- * E.g.
12
- * - If you have the following paragraph: `<p>#apples</p>`
13
- * - This would be converted to a paragraph containing the hashtag node markup
14
- * in the editor.
15
- * - If you come back to edit this content and try to enter a space right after
16
- * the hashtag, the hashtag would disappear and the active text block would
17
- * get the second heading level applied to it
18
- *
19
- * Since we do not allow the user to enter the first level of headings through
20
- * the editor, we can fix this by limiting the markdown shortcut to the second
21
- * level headings and above.
22
- */
23
- export default Heading.extend({
24
- addInputRules() {
25
- return this.options.levels.map((level) => {
26
- return textblockTypeInputRule({
27
- find: new RegExp(`^(#{2,${level}})\\s$`),
28
- type: this.type,
29
- getAttributes: { level }
30
- })
31
- })
32
- }
33
- });
@@ -1,105 +0,0 @@
1
- /* global jest, global */
2
-
3
- import { createBasicEditor, updateContent } from "src/decidim/editor/test/helpers";
4
-
5
- import Hashtag from "src/decidim/editor/extensions/hashtag";
6
-
7
- const hashtagsResponse = [
8
- { name: "apples" },
9
- { name: "bananas" },
10
- { name: "lemons" },
11
- { name: "limes" },
12
- { name: "loganberries" },
13
- { name: "longans" },
14
- { name: "loquats" },
15
- { name: "mangosteens" },
16
- { name: "oranges" },
17
- { name: "peaches" },
18
- { name: "pineapples" },
19
- { name: "pomelos" }
20
- ];
21
-
22
- global.fetch = jest.fn(
23
- (url, options) => Promise.resolve({
24
- ok: true,
25
- json: () => {
26
- const { query } = JSON.parse(options.body);
27
- const queryMatch = query.match(/\{\s+hashtags\(name:"([^"]+)"\) \{name\}\s+\}/);
28
-
29
- let filteredData = [];
30
- if (queryMatch) {
31
- filteredData = hashtagsResponse.filter((val) => val.name.match(new RegExp(`^${queryMatch[1]}`)));
32
- }
33
-
34
- return Promise.resolve({ data: { hashtags: filteredData } });
35
- }
36
- })
37
- );
38
-
39
- describe("Hashtag", () => {
40
- let editor = null;
41
- let editorElement = null;
42
-
43
- beforeEach(() => {
44
- document.body.innerHTML = "";
45
-
46
- editor = createBasicEditor({ extensions: [Hashtag] })
47
- editorElement = editor.view.dom;
48
- });
49
-
50
- it("creates the hashtag suggestions when suggestion key is entered", async () => {
51
- editorElement.focus();
52
- await updateContent(editorElement, "#lo");
53
-
54
- const suggestions = document.querySelector(".editor-suggestions");
55
- expect(suggestions).toBeInstanceOf(HTMLDivElement);
56
-
57
- const expectedTags = ["#loganberries", "#longans", "#loquats"];
58
-
59
- const items = suggestions.querySelectorAll(".editor-suggestions-item");
60
- expect(items.length).toEqual(expectedTags.length);
61
- for (const item of items) {
62
- expect(expectedTags.includes(item.textContent)).toBe(true);
63
- }
64
- });
65
-
66
- it("does not display the suggestions when less than two characters are entered", async () => {
67
- editorElement.focus();
68
- await updateContent(editorElement, "#l");
69
-
70
- const suggestions = document.querySelector(".editor-suggestions");
71
- expect(suggestions).toBeInstanceOf(HTMLDivElement);
72
- expect(suggestions.childNodes.length).toBe(0);
73
- expect(suggestions.classList.contains("hidden")).toBe(true);
74
- expect(suggestions.classList.contains("hide")).toBe(true);
75
- });
76
-
77
- it("allows selecting a hashtag from the list by clicking it", async () => {
78
- editorElement.focus();
79
- await updateContent(editorElement, "#log");
80
-
81
- const suggestions = document.querySelector(".editor-suggestions");
82
- suggestions.querySelector(".editor-suggestions-item").click();
83
-
84
- expect(editorElement.innerHTML).toEqual(
85
- '<p><span data-suggestion="hashtag" data-label="#loganberries">#loganberries</span> </p>'
86
- );
87
- expect(editor.getHTML()).toEqual(
88
- '<p><span data-type="hashtag" data-label="#loganberries">#loganberries</span> </p>'
89
- );
90
- });
91
-
92
- it("allows selecting a hashtag from the list by clicking the Enter key", async () => {
93
- editorElement.focus();
94
- await updateContent(editorElement, "#log");
95
-
96
- editorElement.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" }));
97
-
98
- expect(editorElement.innerHTML).toEqual(
99
- '<p><span data-suggestion="hashtag" data-label="#loganberries">#loganberries</span> </p>'
100
- );
101
- expect(editor.getHTML()).toEqual(
102
- '<p><span data-type="hashtag" data-label="#loganberries">#loganberries</span> </p>'
103
- );
104
- });
105
- });
@@ -1,7 +0,0 @@
1
- /* eslint no-undef: 0 */
2
-
3
- import FormFilterComponent from "src/decidim/form_filter"
4
-
5
- // This module.exports is necessary for the tests to load
6
- // does not conflict with import/export
7
- module.exports = FormFilterComponent;
@@ -1,56 +0,0 @@
1
- const DEFAULT_MESSAGES = {
2
- correctErrors: "There are errors on the form, please correct them."
3
- };
4
- let MESSAGES = DEFAULT_MESSAGES;
5
-
6
- export default class FormValidator {
7
- static configureMessages(messages) {
8
- MESSAGES = $.extend(DEFAULT_MESSAGES, messages);
9
- }
10
-
11
- constructor(form) {
12
- this.$form = form;
13
-
14
- this.$form.on("form-error.decidim", () => {
15
- this.handleError();
16
- });
17
- }
18
-
19
- handleError() {
20
- this.announceFormError();
21
-
22
- $(".is-invalid-input:first", this.$form).focus();
23
- }
24
-
25
- /**
26
- * This announces immediately to the screen reader that there are errors on
27
- * the form that need to be fixed. Does not work on all screen readers but
28
- * works e.g. in Windows+Firefox+NVDA and macOS+Safari+VoiceOver
29
- * combinations.
30
- *
31
- * @returns {undefined}
32
- */
33
- announceFormError() {
34
- let $announce = $(".sr-announce", this.$form);
35
- if ($announce.length > 0) {
36
- $announce.remove();
37
- }
38
- $announce = $("<div />");
39
- $announce.attr("class", "sr-announce sr-only");
40
- $announce.attr("aria-live", "assertive");
41
- this.$form.prepend($announce);
42
-
43
- setTimeout(() => {
44
- $announce.text(MESSAGES.correctErrors);
45
- }, 100);
46
- }
47
- }
48
-
49
- $(() => {
50
- $("form").each((_i, el) => {
51
- $(el).data("form-validator", new FormValidator($(el)));
52
- });
53
- $(document).on("forminvalid.zf.abide", function(_ev, form) {
54
- form.trigger("form-error.decidim");
55
- })
56
- });
@@ -1,5 +0,0 @@
1
- $(() => {
2
- $(".gallery__container").on("closed.zf.callout", (event) => {
3
- $(event.target).remove();
4
- });
5
- });
@@ -1,23 +0,0 @@
1
- import dayjs from "dayjs"
2
-
3
- $(() => {
4
- const $impersonationWarning = $("[data-impersonation-warning]");
5
- if ($impersonationWarning.length) {
6
- const endsAt = dayjs($impersonationWarning.data("session-ends-at"));
7
- const exitInterval = setInterval(() => {
8
- const diff = (endsAt - dayjs()) / 60000;
9
- const diffInMinutes = Math.round(diff);
10
- $impersonationWarning.find(".minutes").html(diffInMinutes);
11
-
12
- if (diff <= 0) {
13
- window.location.reload();
14
- }
15
- }, 1000);
16
-
17
- // Prevent reload when page is already unloading, otherwise it may cause infinite reloads.
18
- window.addEventListener("pagehide", () => {
19
- clearInterval(exitInterval);
20
- return;
21
- });
22
- }
23
- });
@@ -1,38 +0,0 @@
1
- $(() => {
2
- const $inputs = $("input[data-autojump]");
3
- const DELETE_KEY_CODE = 8;
4
-
5
- // Initialize
6
- $inputs.on("keydown", (event) => {
7
- // Do not do anything if there is selected text
8
- if (event.target.selectionStart !== event.target.selectionEnd) {
9
- return;
10
- }
11
-
12
- if (event.originalEvent.key.length === 1 && event.target.dataset.jumpNext) {
13
- if (
14
- event.target.value.length ===
15
- parseInt(event.target.dataset.maxLength, 10)
16
- ) {
17
- event.preventDefault();
18
- setTimeout(() => {
19
- const next = $(event.target.dataset.jumpNext);
20
- next.val(event.originalEvent.key);
21
- next.trigger("focus");
22
- }, 1);
23
- }
24
- } else if (
25
- event.originalEvent.keyCode === DELETE_KEY_CODE &&
26
- event.target.dataset.jumpPrev
27
- ) {
28
- if (event.target.value.length === 0) {
29
- event.preventDefault();
30
- setTimeout(() => {
31
- const prev = $(event.target.dataset.jumpPrev);
32
- prev.val(prev.val().slice(0, -1));
33
- prev.trigger("focus");
34
- }, 1);
35
- }
36
- }
37
- });
38
- });
@@ -1,91 +0,0 @@
1
- /* eslint no-unused-vars: 0 */
2
- import Tribute from "src/decidim/vendor/tribute"
3
-
4
- $(() => {
5
- const $hashtagContainer = $(".js-hashtags");
6
- const nodatafound = $hashtagContainer.attr("data-noresults");
7
-
8
- // The editor implements hashtags functionality by itself so it is not needed
9
- // to attach tribute to the rich text editor.
10
- if ($hashtagContainer.parent().hasClass("editor")) {
11
- return;
12
- }
13
-
14
- let noMatchTemplate = null
15
- if (nodatafound) {
16
- noMatchTemplate = () => `<li>${nodatafound}</li>`;
17
- }
18
-
19
- /* eslint no-use-before-define: ["error", { "variables": false }]*/
20
- let remoteSearch = function(text, cb) {
21
- $.post(window.Decidim.config.get("api_path"), {query: `{hashtags(name:"${text}") {name}}`}).
22
-
23
- then((response) => {
24
- let data = response.data.hashtags || {};
25
- cb(data)
26
- }).fail(function() {
27
- cb([])
28
- }).always(() => {
29
- // This function runs Tribute every single time you type something
30
- // So we must evaluate DOM properties after each
31
- const $parent = $(tribute.current.element).parent()
32
- $parent.addClass("is-active")
33
-
34
- // We need to move the container to the wrapper selected
35
- const $tribute = $parent.find(".tribute-container");
36
- // Remove the inline styles, relative to absolute positioning
37
- $tribute.removeAttr("style");
38
- })
39
- };
40
-
41
- // tribute.js docs - http://github.com/zurb/tribute
42
- /* global Tribute*/
43
- let tribute = new Tribute({
44
- trigger: "#",
45
- values: function (text, cb) {
46
- remoteSearch(text, (hashtags) => cb(hashtags));
47
- },
48
- positionMenu: true,
49
- menuContainer: null,
50
- fillAttr: "name",
51
- noMatchTemplate: noMatchTemplate,
52
- lookup: (item) => item.name,
53
- selectTemplate: function(item) {
54
- if (typeof item === "undefined") {
55
- return null;
56
- }
57
- return `#${item.original.name}`;
58
- },
59
- menuItemTemplate: function(item) {
60
- let tpl = `<strong>${item.original.name}</strong>`;
61
- return tpl;
62
- }
63
- });
64
-
65
- // DOM manipulation
66
- $hashtagContainer.on("focusin", (event) => {
67
- // Set the parent container relative to the current element
68
-
69
- tribute.menuContainer = event.target.parentNode;
70
- });
71
- $hashtagContainer.on("focusout", (event) => {
72
- let $parent = $(event.target).parent();
73
-
74
- if ($parent.hasClass("is-active")) {
75
- $parent.removeClass("is-active");
76
- }
77
- });
78
- $hashtagContainer.on("input", (event) => {
79
- let $parent = $(event.target).parent();
80
-
81
- if (tribute.isActive) {
82
- // We need to move the container to the wrapper selected
83
- let $tribute = $(".tribute-container");
84
- $tribute.appendTo($parent);
85
- // Parent adaptation
86
- $parent.addClass("is-active");
87
- } else {
88
- $parent.removeClass("is-active");
89
- }
90
- });
91
- });