decidim-core 0.31.2 → 0.32.1
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.
- checksums.yaml +4 -4
- data/README.md +3 -13
- data/app/cells/decidim/amendable/amend_button_card/show.erb +2 -2
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +1 -1
- data/app/cells/decidim/author_cell.rb +0 -4
- data/app/cells/decidim/card_metadata_cell.rb +1 -1
- data/app/cells/decidim/comments_button_cell.rb +9 -1
- data/app/cells/decidim/content_blocks/announcement_settings_form/show.erb +5 -0
- data/app/cells/decidim/content_blocks/announcement_settings_form_cell.rb +17 -0
- data/app/cells/decidim/content_blocks/cta_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb +5 -1
- data/app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/how_to_participate/show.erb +1 -1
- data/app/cells/decidim/content_blocks/html_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_announcement_cell.rb +1 -3
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +1 -5
- data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +1 -1
- data/app/cells/decidim/content_blocks/static_page/section_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/static_page/section_settings_form/show.erb +3 -1
- data/app/cells/decidim/content_blocks/static_page/summary_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/static_page/summary_settings_form/show.erb +3 -1
- data/app/cells/decidim/content_blocks/static_page/two_pane_section_cell.rb +2 -2
- data/app/cells/decidim/content_blocks/static_page/two_pane_section_settings_form/show.erb +4 -2
- data/app/cells/decidim/data_consent/category.erb +25 -38
- data/app/cells/decidim/footer_topics/show.erb +5 -8
- data/app/cells/decidim/{participatory_space_private_user → member}/show.erb +6 -6
- data/app/cells/decidim/{participatory_space_private_user_cell.rb → member_cell.rb} +1 -5
- data/app/cells/decidim/nav_links/show.erb +3 -3
- data/app/cells/decidim/onboarding_action_message_cell.rb +1 -0
- data/app/cells/decidim/profile/details.erb +1 -1
- data/app/cells/decidim/profile_cell.rb +1 -0
- data/app/cells/decidim/profile_member_of/show.erb +13 -0
- data/app/cells/decidim/profile_member_of_cell.rb +35 -0
- data/app/cells/decidim/report_button/already_reported_modal.erb +1 -1
- data/app/cells/decidim/report_button/flag_modal.erb +1 -1
- data/app/cells/decidim/report_user_button/already_reported_modal.erb +1 -1
- data/app/cells/decidim/report_user_button/flag_modal.erb +1 -1
- data/app/cells/decidim/resource_types_filter/show.erb +2 -2
- data/app/cells/decidim/share_text_widget/modal.erb +1 -1
- data/app/cells/decidim/share_widget/qr_code_modal.erb +1 -1
- data/app/cells/decidim/tags_cell.rb +1 -1
- data/app/cells/decidim/upload_modal/files.erb +5 -1
- data/app/cells/decidim/upload_modal_cell.rb +15 -1
- data/app/cells/decidim/versions_list/show.erb +25 -0
- data/app/commands/decidim/create_follow.rb +3 -5
- data/app/commands/decidim/create_user_report.rb +1 -1
- data/app/commands/decidim/destroy_account.rb +15 -4
- data/app/commands/decidim/multiple_attachments_methods.rb +42 -24
- data/app/commands/decidim/search.rb +5 -5
- data/app/controllers/concerns/decidim/ajax_permission_handler.rb +1 -1
- data/app/controllers/concerns/decidim/devise_controllers.rb +9 -0
- data/app/controllers/concerns/decidim/direct_upload.rb +3 -2
- data/app/controllers/concerns/decidim/ephemeral_session_checker.rb +1 -1
- data/app/controllers/concerns/decidim/force_authentication.rb +10 -1
- data/app/controllers/concerns/decidim/impersonate_users.rb +4 -0
- data/app/controllers/concerns/decidim/locale_switcher.rb +52 -2
- data/app/controllers/concerns/decidim/needs_tos_accepted.rb +1 -1
- data/app/controllers/concerns/decidim/participatory_space/has_members_page.rb +27 -0
- data/app/controllers/concerns/decidim/participatory_space_context.rb +1 -5
- data/app/controllers/decidim/account_controller.rb +1 -1
- data/app/controllers/decidim/amendments_controller.rb +5 -4
- data/app/controllers/decidim/components/base_controller.rb +20 -3
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/passwords_controller.rb +1 -1
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -1
- data/app/controllers/decidim/download_your_data_controller.rb +2 -2
- data/app/controllers/decidim/editor_images_controller.rb +1 -1
- data/app/controllers/decidim/follows_controller.rb +4 -3
- data/app/controllers/decidim/geolocation_controller.rb +1 -1
- data/app/controllers/decidim/likes_controller.rb +2 -1
- data/app/controllers/decidim/locales_controller.rb +3 -11
- data/app/controllers/decidim/messaging/conversations_controller.rb +3 -3
- data/app/controllers/decidim/newsletters_controller.rb +1 -1
- data/app/controllers/decidim/notifications_settings_controller.rb +1 -1
- data/app/controllers/decidim/notifications_subscriptions_controller.rb +8 -0
- data/app/controllers/decidim/open_data_controller.rb +1 -1
- data/app/controllers/decidim/private_downloads_controller.rb +29 -0
- data/app/controllers/decidim/report_users_controller.rb +2 -2
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/controllers/decidim/user_activities_controller.rb +1 -2
- data/app/events/decidim/amendable/amendment_base_event.rb +7 -1
- data/app/events/decidim/welcome_notification_event.rb +1 -1
- data/app/forms/decidim/upload_validation_form.rb +1 -1
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +1 -0
- data/app/helpers/decidim/active_link_to_helper.rb +136 -0
- data/app/helpers/decidim/amendments_helper.rb +3 -3
- data/app/helpers/decidim/check_boxes_tree_helper.rb +2 -2
- data/app/helpers/decidim/component_path_helper.rb +9 -4
- data/app/helpers/decidim/filters_helper.rb +0 -2
- data/app/helpers/decidim/mailer_helper.rb +36 -0
- data/app/helpers/decidim/menu_helper.rb +4 -5
- data/app/helpers/decidim/meta_tags_helper.rb +0 -2
- data/app/helpers/decidim/newsletters_helper.rb +4 -22
- data/app/helpers/decidim/paginate_helper.rb +14 -1
- data/app/helpers/decidim/sanitize_helper.rb +1 -0
- data/app/helpers/decidim/short_link_helper.rb +5 -5
- data/app/helpers/decidim/translations_helper.rb +4 -4
- data/app/jobs/decidim/delete_inactive_participants_job.rb +2 -2
- data/app/jobs/decidim/find_and_update_descendants_job.rb +8 -2
- data/app/jobs/decidim/process_inactive_participant_job.rb +0 -7
- data/app/jobs/decidim/update_search_indexes_job.rb +2 -2
- data/app/mailers/decidim/application_mailer.rb +11 -2
- data/app/mailers/decidim/decidim_devise_mailer.rb +1 -0
- data/app/mailers/decidim/delete_user_mailer.rb +14 -0
- data/app/mailers/decidim/participants_account_mailer.rb +0 -16
- data/app/mailers/decidim/reported_mailer.rb +4 -1
- data/app/models/decidim/action_log.rb +1 -1
- data/app/models/decidim/attachment.rb +20 -2
- data/app/models/decidim/authorization.rb +7 -0
- data/app/models/decidim/authorization_transfer.rb +1 -1
- data/app/models/decidim/component.rb +6 -9
- data/app/models/decidim/content_block.rb +3 -3
- data/app/models/decidim/moderation.rb +1 -1
- data/app/models/decidim/newsletter.rb +2 -2
- data/app/models/decidim/participatory_space/member.rb +55 -0
- data/app/models/decidim/private_download.rb +61 -0
- data/app/models/decidim/private_export.rb +6 -0
- data/app/models/decidim/resource_link.rb +1 -1
- data/app/models/decidim/short_link.rb +1 -1
- data/app/models/decidim/user.rb +2 -2
- data/app/models/decidim/user_base_entity.rb +17 -2
- data/app/models/decidim/user_moderation.rb +1 -1
- data/app/packs/src/decidim/a11y.js +29 -0
- data/app/packs/src/decidim/a11y.test.js +81 -0
- data/app/packs/src/decidim/confirm.js +8 -1
- data/app/packs/src/decidim/confirm.test.js +225 -0
- data/app/packs/src/decidim/controllers/accordion/accordion.test.js +272 -0
- data/app/packs/src/decidim/controllers/accordion/controller.js +117 -17
- data/app/packs/src/decidim/controllers/assign_role/assign_role.test.js +80 -0
- data/app/packs/src/decidim/controllers/assign_role/controller.js +27 -0
- data/app/packs/src/decidim/controllers/breadcrumb_truncate/breadcrumb_truncate.test.js +230 -0
- data/app/packs/src/decidim/controllers/breadcrumb_truncate/controller.js +172 -0
- data/app/packs/src/decidim/controllers/dropdown/controller.js +32 -0
- data/app/packs/src/decidim/controllers/dropdown/dropdown.test.js +215 -0
- data/app/packs/src/decidim/controllers/form_validator/form_validator.js +9 -8
- data/app/packs/src/decidim/controllers/form_validator/form_validator.test.js +28 -1
- data/app/packs/src/decidim/controllers/language_change/controller.js +1 -0
- data/app/packs/src/decidim/controllers/language_change/language_change.test.js +13 -0
- data/app/packs/src/decidim/controllers/main_menu/controller.js +152 -0
- data/app/packs/src/decidim/controllers/main_menu/main_menu.test.js +285 -0
- data/app/packs/src/decidim/controllers/mention/controller.js +296 -140
- data/app/packs/src/decidim/controllers/mention/input_mentions.test.js +120 -457
- data/app/packs/src/decidim/controllers/multiple_mentions/controller.js +68 -32
- data/app/packs/src/decidim/controllers/multiple_mentions/input_multiple_mentions.test.js +30 -23
- data/app/packs/src/decidim/controllers/password_toggler/controller.js +22 -1
- data/app/packs/src/decidim/controllers/password_toggler/password_toggler.test.js +11 -20
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +26 -0
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +3 -14
- data/app/packs/src/decidim/datepicker/generate_timepicker.js +3 -2
- data/app/packs/src/decidim/datepicker/test/datepicker_functions_adjust_picker_position.test.js +234 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +4 -4
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +12 -7
- data/app/packs/src/decidim/editor/common/suggestion.js +4 -2
- data/app/packs/src/decidim/editor/extensions/decidim_kit/index.js +4 -1
- data/app/packs/src/decidim/editor/extensions/image/index.js +57 -16
- data/app/packs/src/decidim/editor/extensions/image/node_view.js +9 -1
- data/app/packs/src/decidim/editor/extensions/indent/index.js +9 -0
- data/app/packs/src/decidim/editor/extensions/link/bubble_menu.js +34 -6
- data/app/packs/src/decidim/editor/extensions/link/index.js +53 -12
- data/app/packs/src/decidim/editor/extensions/mention/index.js +18 -5
- data/app/packs/src/decidim/editor/extensions/mention_resource/index.js +16 -7
- data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +13 -4
- data/app/packs/src/decidim/editor/test/extensions/heading.test.js +1 -1
- data/app/packs/src/decidim/editor/test/extensions/image.test.js +26 -28
- data/app/packs/src/decidim/editor/test/extensions/image_links.test.js +161 -0
- data/app/packs/src/decidim/editor/test/extensions/mention.test.js +6 -2
- data/app/packs/src/decidim/editor/test/extensions/video_embed.test.js +27 -15
- data/app/packs/src/decidim/editor/test/helpers.js +8 -10
- data/app/packs/src/decidim/editor/test/toolbar/full.test.js +15 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_block.js +8 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting.js +5 -1
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent.js +9 -5
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_link.js +5 -1
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_list.js +8 -4
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling.js +13 -9
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content_styling.js +6 -2
- data/app/packs/src/decidim/geocoding/reverse_geocoding.js +15 -5
- data/app/packs/src/decidim/geocoding/reverse_geocoding.test.js +197 -0
- data/app/packs/src/decidim/index.js +4 -4
- data/app/packs/src/decidim/map/controller.js +10 -1
- data/app/packs/src/decidim/refactor/moved/focus_guard.js +16 -16
- data/app/packs/src/decidim/refactor/moved/focus_guard.test.js +136 -0
- data/app/packs/src/decidim/sw/push-permissions.js +48 -13
- data/app/packs/src/decidim/sw/sw.js +1 -1
- data/app/packs/src/decidim/utilities/text.js +6 -6
- data/app/packs/stylesheets/decidim/_cards.scss +15 -6
- data/app/packs/stylesheets/decidim/_conversations.scss +14 -0
- data/app/packs/stylesheets/decidim/_cookies.scss +13 -5
- data/app/packs/stylesheets/decidim/_datepicker.scss +0 -8
- data/app/packs/stylesheets/decidim/_documents.scss +1 -1
- data/app/packs/stylesheets/decidim/_dropdown.scss +22 -32
- data/app/packs/stylesheets/decidim/_editor_suggestions.scss +49 -0
- data/app/packs/stylesheets/decidim/_flash.scss +1 -1
- data/app/packs/stylesheets/decidim/_floating_help.scss +1 -1
- data/app/packs/stylesheets/decidim/_footer.scss +27 -31
- data/app/packs/stylesheets/decidim/_forms.scss +5 -1
- data/app/packs/stylesheets/decidim/_header.scss +183 -48
- data/app/packs/stylesheets/decidim/_language_chooser.scss +79 -0
- data/app/packs/stylesheets/decidim/_participatory_spaces.scss +1 -1
- data/app/packs/stylesheets/decidim/_rich_text.scss +17 -0
- data/app/packs/stylesheets/decidim/_tom_select.scss +23 -0
- data/app/packs/stylesheets/decidim/application.scss +3 -0
- data/app/packs/stylesheets/decidim/editor.scss +12 -33
- data/app/packs/stylesheets/decidim/geocoding_addons.scss +10 -2
- data/app/presenters/decidim/admin_log/participatory_space/member_presenter.rb +40 -0
- data/app/presenters/decidim/admin_log/static_page_resource_presenter.rb +1 -1
- data/app/presenters/decidim/authorization_transfer_presenter.rb +1 -1
- data/app/presenters/decidim/breadcrumb_root_menu_item_presenter.rb +3 -3
- data/app/presenters/decidim/footer_menu_presenter.rb +2 -4
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/log/value_types/access_mode_presenter.rb +45 -0
- data/app/presenters/decidim/menu_item_presenter.rb +15 -3
- data/app/presenters/decidim/participatory_space/member_presenter.rb +48 -0
- data/app/presenters/decidim/resource_locator_presenter.rb +22 -3
- data/app/presenters/decidim/stats_presenter.rb +1 -1
- data/app/queries/decidim/last_activity.rb +1 -1
- data/app/resolvers/decidim/meta_image_url_resolver.rb +7 -0
- data/app/serializers/decidim/exporters/participatory_space_serializer.rb +15 -1
- data/app/services/decidim/email_notification_generator.rb +2 -0
- data/app/services/decidim/notification_generator.rb +4 -0
- data/app/services/decidim/notifications_subscriptions_persistor.rb +6 -0
- data/app/services/decidim/push_subscription_endpoint_validator.rb +34 -0
- data/app/services/decidim/send_push_notification.rb +5 -1
- data/app/uploaders/decidim/image_uploader.rb +1 -1
- data/app/uploaders/decidim/organization_favicon_uploader.rb +4 -9
- data/app/validators/uploader_image_dimensions_validator.rb +13 -11
- data/app/views/decidim/delete_user_mailer/delete.html.erb +6 -0
- data/app/views/decidim/devise/invitations/edit.html.erb +3 -3
- data/app/views/decidim/devise/registrations/new.html.erb +1 -0
- data/app/views/decidim/devise/shared/_tos_fields.html.erb +3 -3
- data/app/views/decidim/gamification/badges/index.html.erb +1 -1
- data/app/views/decidim/homepage/show.html.erb +2 -2
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_error_modal.html.erb +11 -19
- data/app/views/decidim/messaging/conversations/_new_conversation_button.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_reply.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/error.js.erb +12 -7
- data/app/views/decidim/messaging/conversations/new.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/show.html.erb +2 -2
- data/app/views/decidim/newsletters/unsubscribe.html.erb +1 -1
- data/app/views/decidim/notification_mailer/event_received.html.erb +3 -3
- data/app/views/decidim/notifications_settings/show.html.erb +5 -5
- data/app/views/decidim/offline/show.html.erb +1 -1
- data/app/views/decidim/pages/_tabbed.html.erb +3 -3
- data/app/views/decidim/pages/index.html.erb +1 -1
- data/app/views/decidim/participatory_space/members/_member.html.erb +1 -0
- data/app/views/decidim/profiles/show.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +1 -1
- data/app/views/decidim/shared/_filters.html.erb +5 -5
- data/app/views/decidim/shared/_resource_actions.html.erb +4 -4
- data/app/views/decidim/shared/_results_per_page.html.erb +1 -1
- data/app/views/decidim/shared/filters/_check_boxes_tree.html.erb +2 -2
- data/app/views/decidim/shared/filters/_collection.html.erb +1 -1
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +4 -3
- data/app/views/decidim/user_activities/index.html.erb +1 -1
- data/app/views/devise/mailer/{invite_private_user.html.erb → invite_member.html.erb} +2 -2
- data/app/views/devise/mailer/{invite_private_user.text.erb → invite_member.text.erb} +2 -2
- data/app/views/layouts/decidim/_head.html.erb +2 -2
- data/app/views/layouts/decidim/_wrapper.html.erb +3 -3
- data/app/views/layouts/decidim/footer/_focus_mode_main.html.erb +0 -1
- data/app/views/layouts/decidim/footer/_main.html.erb +1 -2
- data/app/views/layouts/decidim/footer/_main_links.html.erb +56 -28
- data/app/views/layouts/decidim/header/_focus_mode_back_button.html.erb +4 -1
- data/app/views/layouts/decidim/header/_main.html.erb +17 -8
- data/app/views/layouts/decidim/header/_main_language_chooser.html.erb +24 -0
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +56 -56
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +2 -2
- data/app/views/layouts/decidim/header/_main_links_mobile_item_account.html.erb +3 -1
- data/app/views/layouts/decidim/header/_main_menu_mobile.html.erb +18 -5
- data/app/views/layouts/decidim/header/_main_search.html.erb +3 -3
- data/app/views/layouts/decidim/header/_menu.html.erb +5 -5
- data/app/views/layouts/decidim/header/_menu_breadcrumb_desktop.html.erb +40 -12
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile.html.erb +33 -0
- data/app/views/layouts/decidim/shared/_layout_center.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_item.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_two_col.html.erb +1 -1
- data/config/initializers/decidim_locale_aware_named_route_helper.rb +16 -0
- data/config/initializers/devise.rb +6 -0
- data/config/initializers/invisible_captcha.rb +1 -0
- data/config/locales/ar.yml +6 -38
- data/config/locales/bg.yml +3 -39
- data/config/locales/ca-IT.yml +91 -58
- data/config/locales/ca.yml +91 -58
- data/config/locales/cs.yml +54 -58
- data/config/locales/de.yml +45 -68
- data/config/locales/el.yml +3 -31
- data/config/locales/en.yml +88 -55
- data/config/locales/es-MX.yml +93 -60
- data/config/locales/es-PY.yml +93 -60
- data/config/locales/es.yml +95 -62
- data/config/locales/eu.yml +124 -92
- data/config/locales/fi-plain.yml +93 -55
- data/config/locales/fi.yml +96 -58
- data/config/locales/fr-CA.yml +70 -52
- data/config/locales/fr.yml +71 -54
- data/config/locales/ga-IE.yml +3 -1
- data/config/locales/gl.yml +3 -31
- data/config/locales/hu.yml +7 -40
- data/config/locales/id-ID.yml +3 -30
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/it.yml +15 -33
- data/config/locales/ja.yml +105 -71
- data/config/locales/lb.yml +3 -33
- data/config/locales/lt.yml +4 -37
- data/config/locales/lv.yml +3 -30
- data/config/locales/nl.yml +3 -33
- data/config/locales/no.yml +3 -33
- data/config/locales/pl.yml +7 -41
- data/config/locales/pt-BR.yml +24 -65
- data/config/locales/pt.yml +3 -33
- data/config/locales/ro-RO.yml +12 -55
- data/config/locales/ru.yml +0 -16
- data/config/locales/sk.yml +1417 -32
- data/config/locales/sv.yml +44 -62
- data/config/locales/tr-TR.yml +20 -37
- data/config/locales/uk.yml +0 -9
- data/config/locales/zh-CN.yml +3 -30
- data/config/locales/zh-TW.yml +4 -35
- data/config/routes.rb +140 -76
- data/db/data/20251213075429_rename_members_in_action_log.rb +22 -0
- data/db/data/20260319145808_rename_send_to_members_in_newsletter.rb +27 -0
- data/db/migrate/20200730142511_add_file_upload_settings_to_decidim_organizations.rb +13 -15
- data/db/migrate/20250217192438_convert_user_groups_into_users.rb +3 -2
- data/db/migrate/20250523104311_move_cta_to_hero_content_block.rb +1 -1
- data/db/migrate/20250527122040_move_highlighted_content_banner_settings_to_content_block.rb +1 -1
- data/db/migrate/20250819110800_convert_private_exports_id_to_uuid.rb +2 -2
- data/db/migrate/20251112132305_remove_legacy_images_from_core_module.rb +27 -0
- data/db/migrate/20251205122428_rename_participatory_space_private_users_to_members.rb +9 -0
- data/db/migrate/20251216185133_rename_privatable_to_to_participatory_space_in_members.rb +10 -0
- data/db/migrate/20260208201405_remove_user_group_core.rb +21 -0
- data/db/migrate/20260208201406_remove_user_group_memberships.rb +30 -0
- data/db/migrate/20260208201407_remove_user_group_organizations.rb +11 -0
- data/db/migrate/20260217152425_remove_enable_participatory_space_filters_from_decidim_organizations.rb +7 -0
- data/db/migrate/20260314081619_add_index_on_decidim_members.rb +25 -0
- data/decidim-core.gemspec +28 -28
- data/lib/decidim/acts_as_tree.rb +12 -12
- data/lib/decidim/admin_filters_registry.rb +1 -1
- data/lib/decidim/amendable.rb +5 -1
- data/lib/decidim/api/functions/category_list.rb +1 -0
- data/lib/decidim/api/functions/component_finder_base.rb +1 -1
- data/lib/decidim/api/functions/component_list.rb +3 -1
- data/lib/decidim/api/functions/component_list_base.rb +1 -0
- data/lib/decidim/api/functions/participatory_space_finder_base.rb +1 -1
- data/lib/decidim/api/functions/participatory_space_list_base.rb +1 -0
- data/lib/decidim/api/functions/user_entity_list.rb +2 -1
- data/lib/decidim/api/interfaces/amendable_entity_interface.rb +1 -0
- data/lib/decidim/api/interfaces/amendable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/attachable_collection_interface.rb +1 -0
- data/lib/decidim/api/interfaces/attachable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/author_interface.rb +2 -1
- data/lib/decidim/api/interfaces/authorable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/categories_container_interface.rb +1 -0
- data/lib/decidim/api/interfaces/categorizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/coauthorable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/component_interface.rb +9 -8
- data/lib/decidim/api/interfaces/fingerprint_interface.rb +1 -0
- data/lib/decidim/api/interfaces/followable_interface.rb +2 -0
- data/lib/decidim/api/interfaces/likeable_interface.rb +2 -2
- data/lib/decidim/api/interfaces/localizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +1 -0
- data/lib/decidim/api/interfaces/referable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/scopable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/taxonomizable_interface.rb +1 -0
- data/lib/decidim/api/interfaces/timestamps_interface.rb +1 -0
- data/lib/decidim/api/interfaces/traceable_interface.rb +1 -0
- data/lib/decidim/api/types/attachment_collection_type.rb +5 -3
- data/lib/decidim/api/types/attachment_type.rb +11 -4
- data/lib/decidim/api/types/badge_score_type.rb +28 -0
- data/lib/decidim/api/types/moderation_type.rb +25 -0
- data/lib/decidim/api/types/participant_details_type.rb +17 -0
- data/lib/decidim/api/types/reportable_type.rb +18 -0
- data/lib/decidim/api/types/reportable_user_type.rb +17 -0
- data/lib/decidim/api/types/static_page_topic_type.rb +16 -0
- data/lib/decidim/api/types/static_page_type.rb +22 -0
- data/lib/decidim/api/types/taxonomy_type.rb +2 -0
- data/lib/decidim/api/types/user_moderation_type.rb +36 -0
- data/lib/decidim/api/types/user_type.rb +13 -0
- data/lib/decidim/asset_router/pipeline.rb +1 -1
- data/lib/decidim/asset_router/storage.rb +9 -9
- data/lib/decidim/assets/tailwind/tailwind.config.js.erb +4 -1
- data/lib/decidim/attachment_attributes.rb +58 -9
- data/lib/decidim/attribute_encryptor.rb +51 -10
- data/lib/decidim/attribute_object/model.rb +0 -5
- data/lib/decidim/block_registry.rb +1 -1
- data/lib/decidim/coauthorable.rb +2 -1
- data/lib/decidim/command.rb +2 -1
- data/lib/decidim/content_parsers/blob_parser.rb +3 -3
- data/lib/decidim/content_processor.rb +1 -1
- data/lib/decidim/content_renderers/base_renderer.rb +112 -0
- data/lib/decidim/content_renderers/blob_renderer.rb +6 -9
- data/lib/decidim/content_renderers/mention_resource_renderer.rb +10 -6
- data/lib/decidim/content_renderers/resource_renderer.rb +16 -7
- data/lib/decidim/content_renderers/user_renderer.rb +11 -9
- data/lib/decidim/core/api.rb +8 -0
- data/lib/decidim/core/content_blocks/registry_manager.rb +4 -10
- data/lib/decidim/core/engine.rb +10 -34
- data/lib/decidim/core/menu.rb +0 -26
- data/lib/decidim/core/test/factories.rb +32 -18
- data/lib/decidim/core/test/shared_examples/access_mode_restricted_participatory_spaces.rb +175 -0
- data/lib/decidim/core/test/shared_examples/access_mode_transparent_participatory_spaces.rb +244 -0
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +10 -10
- data/lib/decidim/core/test/shared_examples/amendable/amendment_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +147 -117
- data/lib/decidim/core/test/shared_examples/fingerprint_examples.rb +2 -0
- data/lib/decidim/core/test/shared_examples/has_members.rb +63 -0
- data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +2 -1
- data/lib/decidim/core/test/shared_examples/manage_share_tokens_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/map_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/participant_details_examples.rb +16 -0
- data/lib/decidim/core/test/shared_examples/participatory_space_members_page_examples.rb +10 -10
- data/lib/decidim/core/test/shared_examples/participatory_space_members_shared_examples.rb +121 -0
- data/lib/decidim/core/test/shared_examples/resource_liked_event_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +7 -7
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/simple_event.rb +1 -0
- data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +1 -1
- data/lib/decidim/core/test.rb +2 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +222 -335
- data/lib/decidim/download_your_data_serializers/{download_your_data_participatory_space_private_user_serializer.rb → download_your_data_member_serializer.rb} +6 -6
- data/lib/decidim/download_your_data_serializers.rb +2 -2
- data/lib/decidim/engine_router.rb +31 -6
- data/lib/decidim/exporters/csv.rb +1 -1
- data/lib/decidim/filter_form_builder.rb +1 -1
- data/lib/decidim/form_builder.rb +58 -36
- data/{app/controllers/concerns → lib}/decidim/form_factory.rb +11 -1
- data/lib/decidim/has_settings.rb +2 -2
- data/lib/decidim/legacy_form_builder.rb +1 -0
- data/lib/decidim/locale_router_detector.rb +41 -0
- data/lib/decidim/maintenance/import_models/scope.rb +1 -1
- data/lib/decidim/maintenance/import_models.rb +0 -2
- data/lib/decidim/maintenance/taxonomy_importer.rb +1 -1
- data/lib/decidim/map/autocomplete.rb +4 -3
- data/lib/decidim/map/dynamic_map.rb +3 -1
- data/lib/decidim/map/frontend.rb +1 -1
- data/lib/decidim/map/geocoding.rb +2 -2
- data/lib/decidim/map/static_map.rb +10 -22
- data/lib/decidim/map/utility.rb +3 -6
- data/lib/decidim/map.rb +2 -2
- data/lib/decidim/menu.rb +1 -1
- data/lib/decidim/menu_item.rb +1 -0
- data/lib/decidim/menu_registry.rb +1 -1
- data/lib/decidim/moderation_tools.rb +1 -1
- data/lib/decidim/newsletter_encryptor.rb +5 -8
- data/lib/decidim/organization_settings.rb +2 -2
- data/lib/decidim/participable.rb +1 -0
- data/lib/decidim/participatory_space/has_members.rb +61 -0
- data/lib/decidim/participatory_space_manifest.rb +0 -4
- data/lib/decidim/participatory_space_resourceable.rb +10 -1
- data/lib/decidim/participatory_space_user.rb +1 -1
- data/lib/decidim/routes/locale_redirects.rb +47 -0
- data/lib/decidim/routes.rb +7 -0
- data/lib/decidim/search_resource_fields_mapper.rb +3 -4
- data/lib/decidim/searchable.rb +9 -4
- data/lib/decidim/seeds.rb +17 -0
- data/lib/decidim/shakapacker/runner.rb +4 -4
- data/lib/decidim/shakapacker/shakapacker.yml +28 -3
- data/lib/decidim/taxonomizable.rb +1 -1
- data/lib/decidim/translatable_attributes.rb +9 -3
- data/lib/decidim/view_model.rb +5 -1
- data/lib/devise/models/decidim_newsletterable.rb +1 -1
- data/lib/tasks/decidim_mailers_tasks.rake +31 -9
- data/lib/tasks/decidim_procfile.rake +1 -1
- data/lib/tasks/decidim_tasks.rake +0 -1
- data/lib/tasks/decidim_taxonomies.rake +1 -1
- data/lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake +0 -1
- data/lib/tasks/upgrade/decidim_encryption.rake +12 -0
- data/lib/tasks/upgrade/decidim_migrate_wysiwyg_content.rake +0 -1
- data/lib/tasks/upgrade/decidim_remove_deleted_users_left_data_tasks.rake +1 -1
- data/lib/tasks/upgrade/{fix_deleted_private_follows.rake → fix_deleted_members_follows.rake} +5 -5
- data/lib/tasks/upgrade/migrations.rake +0 -1
- data/lib/tasks/upgrade/user_groups_migration.rake +0 -1
- metadata +244 -132
- data/app/cells/decidim/content_blocks/global_menu/show.erb +0 -11
- data/app/cells/decidim/content_blocks/global_menu_cell.rb +0 -35
- data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity/show.erb +0 -10
- data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +0 -49
- data/app/cells/decidim/participatory_space_dropdown_metadata/links.erb +0 -9
- data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +0 -1
- data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +0 -11
- data/app/cells/decidim/participatory_space_dropdown_metadata_cell.rb +0 -26
- data/app/commands/decidim/gallery_methods.rb +0 -107
- data/app/controllers/concerns/decidim/has_members_page.rb +0 -25
- data/app/jobs/decidim/newsletters_opt_in_job.rb +0 -11
- data/app/jobs/decidim/user_report_job.rb +0 -11
- data/app/models/decidim/participatory_space_private_user.rb +0 -51
- data/app/packs/src/decidim/controllers/sticky_header/controller.js +0 -116
- data/app/packs/src/decidim/controllers/sticky_header/sticky_header.test.js +0 -320
- data/app/packs/src/decidim/dropdown_menu.js +0 -18
- data/app/packs/src/decidim/identity_selector_dialog.js +0 -33
- data/app/packs/src/decidim/vendor/tribute.js +0 -1890
- data/app/packs/stylesheets/decidim/_tribute.scss +0 -36
- data/app/presenters/decidim/admin_log/participatory_space_private_user_presenter.rb +0 -38
- data/app/presenters/decidim/participatory_space_private_user_presenter.rb +0 -46
- data/app/views/decidim/participants_account_mailer/removal_notification.html.erb +0 -11
- data/app/views/decidim/participatory_space_private_users/_participatory_space_private_user.html.erb +0 -1
- data/app/views/layouts/decidim/footer/_main_language_chooser.html.erb +0 -26
- data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +0 -34
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_desktop.html.erb +0 -10
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_mobile.html.erb +0 -17
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_top_left.html.erb +0 -2
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +0 -33
- data/app/views/layouts/decidim/header/_mobile_language_choose.html.erb +0 -25
- data/lib/decidim/core/test/shared_examples/has_private_users.rb +0 -63
- data/lib/decidim/core/test/shared_examples/participatory_space_dropdown_metadata_cell_examples.rb +0 -81
- data/lib/decidim/has_private_users.rb +0 -57
- data/lib/decidim/maintenance/import_models/assembly_type.rb +0 -49
- data/lib/decidim/maintenance/import_models/participatory_process_type.rb +0 -21
- data/lib/decidim/query_extensions.rb +0 -64
|
@@ -33,8 +33,8 @@ class ConvertUserGroupsIntoUsers < ActiveRecord::Migration[7.0]
|
|
|
33
33
|
def up
|
|
34
34
|
User.old_group.find_each do |group|
|
|
35
35
|
if group.email.blank? || another_user_with_same_email_in_organization?(group)
|
|
36
|
-
group.update_attribute(:email, "user_group_#{group.id}@#{group.organization.host}.invalid")
|
|
37
36
|
group.update_attribute(:extended_data, (group.extended_data || {}).merge("patched" => true, "previous_email" => group.email))
|
|
37
|
+
group.update_attribute(:email, "user_group_#{group.id}@#{group.organization.host}.invalid")
|
|
38
38
|
|
|
39
39
|
group.reload
|
|
40
40
|
end
|
|
@@ -49,7 +49,8 @@ class ConvertUserGroupsIntoUsers < ActiveRecord::Migration[7.0]
|
|
|
49
49
|
User.new_group.find_each do |group|
|
|
50
50
|
group.update_attribute(:officialized_at, nil)
|
|
51
51
|
group.update_attribute(:type, "Decidim::UserGroup")
|
|
52
|
-
group.update_attribute(:
|
|
52
|
+
group.update_attribute(:email, group.extended_data["previous_email"]) if group.extended_data["previous_email"].present?
|
|
53
|
+
group.update_attribute(:extended_data, (group.extended_data || {}).except("group", "patched", "previous_email"))
|
|
53
54
|
end
|
|
54
55
|
end
|
|
55
56
|
# rubocop:enable Rails/SkipsModelValidations
|
|
@@ -8,7 +8,7 @@ class MoveCtaToHeroContentBlock < ActiveRecord::Migration[7.0]
|
|
|
8
8
|
def up
|
|
9
9
|
Decidim::ContentBlock.reset_column_information
|
|
10
10
|
Organization.find_each do |organization|
|
|
11
|
-
content_block = Decidim::ContentBlock.find_by(organization
|
|
11
|
+
content_block = Decidim::ContentBlock.find_by(organization:, scope_name: :homepage, manifest_name: :hero)
|
|
12
12
|
settings = {}
|
|
13
13
|
cta_button_text = organization.cta_button_text || {}
|
|
14
14
|
settings = cta_button_text.inject(settings) { |acc, (k, v)| acc.update("cta_button_text_#{k}" => v) }
|
|
@@ -11,7 +11,7 @@ class MoveHighlightedContentBannerSettingsToContentBlock < ActiveRecord::Migrati
|
|
|
11
11
|
Decidim::ContentBlock.reset_column_information
|
|
12
12
|
|
|
13
13
|
Organization.find_each do |organization|
|
|
14
|
-
content_block = Decidim::ContentBlock.find_by(organization
|
|
14
|
+
content_block = Decidim::ContentBlock.find_by(organization:, scope_name: :homepage, manifest_name: :highlighted_content_banner)
|
|
15
15
|
settings = extract_settings(organization)
|
|
16
16
|
|
|
17
17
|
# We need to do a workaround for getting the image, as ActiveStorage is polymorphic and expects that the `record_type` is the class name of the model
|
|
@@ -18,7 +18,7 @@ class ConvertPrivateExportsIdToUuid < ActiveRecord::Migration[7.0]
|
|
|
18
18
|
t.index [:uuid], name: "index_decidim_private_exports_on_uuid", unique: true
|
|
19
19
|
end
|
|
20
20
|
# Copy data from old table to new table
|
|
21
|
-
execute
|
|
21
|
+
execute <<~SQL.squish
|
|
22
22
|
INSERT INTO decidim_private_exports_new (uuid, export_type, attached_to_type, attached_to_id, file, content_type, file_size, expires_at, metadata, created_at, updated_at)
|
|
23
23
|
SELECT id, export_type, attached_to_type, attached_to_id, file, content_type, file_size, NOW(), metadata, created_at, updated_at
|
|
24
24
|
FROM decidim_private_exports
|
|
@@ -43,7 +43,7 @@ class ConvertPrivateExportsIdToUuid < ActiveRecord::Migration[7.0]
|
|
|
43
43
|
t.timestamps
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
execute
|
|
46
|
+
execute <<~SQL.squish
|
|
47
47
|
INSERT INTO decidim_private_exports_new (id, export_type, attached_to_type, attached_to_id, file, content_type, file_size, expires_at, metadata, created_at, updated_at)
|
|
48
48
|
SELECT uuid, export_type, attached_to_type, attached_to_id, file, content_type, file_size, expires_at, metadata, created_at, updated_at
|
|
49
49
|
FROM decidim_private_exports
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveLegacyImagesFromCoreModule < ActiveRecord::Migration[7.2]
|
|
4
|
+
def change
|
|
5
|
+
remove_column :decidim_organizations, :logo, :string
|
|
6
|
+
remove_column :decidim_organizations, :official_img_footer, :string
|
|
7
|
+
remove_column :decidim_organizations, :favicon, :string
|
|
8
|
+
|
|
9
|
+
remove_column :oauth_applications, :organization_logo, :string
|
|
10
|
+
|
|
11
|
+
remove_column :decidim_authorizations, :verification_attachment, :string
|
|
12
|
+
|
|
13
|
+
# The original decidim_attachments table creation was in decidim-participatory_processes
|
|
14
|
+
# and then it was made polymorphic.
|
|
15
|
+
# We need to workaround this issue as when creating new application this table may not exist
|
|
16
|
+
# when this migration is run. To be in a consistent state for new apps, we also do this in decidim-participatory_processes
|
|
17
|
+
#
|
|
18
|
+
# @see decidim-participatory_processes/db/migrate/20161116115156_create_attachments.rb
|
|
19
|
+
# @see decidim-participatory_processes/db/migrate/20170123134023_make_attachments_polymorphic.rb
|
|
20
|
+
# @see decidim-participatory-processes/db/migrate/20251203071213_remove_legacy_file_column_from_attachments_table.rb
|
|
21
|
+
remove_column :decidim_attachments, :file, :string if table_exists?(:decidim_attachments) && column_exists?(:decidim_attachments, :file)
|
|
22
|
+
|
|
23
|
+
remove_column :decidim_users, :avatar, :string
|
|
24
|
+
|
|
25
|
+
remove_column :decidim_private_exports, :file, :string
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RenameParticipatorySpacePrivateUsersToMembers < ActiveRecord::Migration[7.0]
|
|
4
|
+
def change
|
|
5
|
+
rename_table :decidim_participatory_space_private_users, :decidim_members
|
|
6
|
+
|
|
7
|
+
rename_index :decidim_members, :index_decidim_spaces_users_on_private_user_id, :index_decidim_members_on_user_id
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RenamePrivatableToToParticipatorySpaceInMembers < ActiveRecord::Migration[7.2]
|
|
4
|
+
def change
|
|
5
|
+
rename_column :decidim_members, :privatable_to_id, :participatory_space_id
|
|
6
|
+
rename_column :decidim_members, :privatable_to_type, :participatory_space_type
|
|
7
|
+
|
|
8
|
+
rename_index :decidim_members, "space_privatable_to_privatable_id", "index_decidim_members_on_participatory_space"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveUserGroupCore < ActiveRecord::Migration[7.0]
|
|
4
|
+
def up
|
|
5
|
+
remove_index :decidim_coauthorships, :decidim_user_group_id
|
|
6
|
+
remove_column :decidim_coauthorships, :decidim_user_group_id
|
|
7
|
+
remove_index :decidim_likes, :decidim_user_group_id
|
|
8
|
+
remove_column :decidim_likes, :decidim_user_group_id
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def down
|
|
12
|
+
add_column :decidim_coauthorships, :decidim_user_group_id, :integer
|
|
13
|
+
add_index :decidim_coauthorships, :decidim_user_group_id
|
|
14
|
+
add_column :decidim_likes, :decidim_user_group_id, :integer
|
|
15
|
+
add_index :decidim_likes, :decidim_user_group_id
|
|
16
|
+
add_index :decidim_likes,
|
|
17
|
+
[:decidim_likable_id, :decidim_likable_type, :decidim_author_id, :decidim_author_type, :decidim_user_group_id],
|
|
18
|
+
name: "idx_likes_rsrcs_and_authors",
|
|
19
|
+
unique: true
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveUserGroupMemberships < ActiveRecord::Migration[7.0]
|
|
4
|
+
def up
|
|
5
|
+
drop_table :decidim_user_group_memberships
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def down
|
|
9
|
+
create_table :decidim_user_group_memberships do |t|
|
|
10
|
+
t.references :decidim_user, null: false, index: true, type: :integer
|
|
11
|
+
t.references :decidim_user_group, null: false, index: true, type: :integer
|
|
12
|
+
|
|
13
|
+
t.timestamps
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
add_index :decidim_user_group_memberships, [:decidim_user_id, :decidim_user_group_id], unique: true, name: "decidim_user_group_memberships_unique_user_and_group_ids"
|
|
17
|
+
add_column :decidim_user_group_memberships, :role, :string, default: "requested"
|
|
18
|
+
execute("UPDATE decidim_user_group_memberships SET role = 'creator'")
|
|
19
|
+
change_column_null :decidim_user_group_memberships, :role, false
|
|
20
|
+
add_index(
|
|
21
|
+
:decidim_user_group_memberships,
|
|
22
|
+
%w(role decidim_user_group_id),
|
|
23
|
+
where: "(role = 'creator')",
|
|
24
|
+
name: "decidim_group_membership_one_creator_per_group",
|
|
25
|
+
unique: true
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
add_index :decidim_user_group_memberships, [:decidim_user_group_id, :decidim_user_id], name: "index_user_group_memberships_group_id_user_id"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveUserGroupOrganizations < ActiveRecord::Migration[7.0]
|
|
4
|
+
def up
|
|
5
|
+
remove_column :decidim_organizations, :user_groups_enabled
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def down
|
|
9
|
+
add_column :decidim_organizations, :user_groups_enabled, :boolean, default: false, null: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AddIndexOnDecidimMembers < ActiveRecord::Migration[8.1]
|
|
4
|
+
class Member < ApplicationRecord
|
|
5
|
+
self.table_name = :decidim_members
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def up
|
|
9
|
+
Member.where(decidim_user_id: nil).delete_all
|
|
10
|
+
|
|
11
|
+
Member.find_each do |member|
|
|
12
|
+
member.delete if Member.where(
|
|
13
|
+
decidim_user_id: member.decidim_user_id,
|
|
14
|
+
participatory_space_type: member.participatory_space_type,
|
|
15
|
+
participatory_space_id: member.participatory_space_id
|
|
16
|
+
).count > 1
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
add_index(:decidim_members, [:decidim_user_id, :participatory_space_type, :participatory_space_id], name: "unique_space_members", unique: true)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def down
|
|
23
|
+
raise ActiveRecord::IrreversibleMigration
|
|
24
|
+
end
|
|
25
|
+
end
|
data/decidim-core.gemspec
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
|
4
4
|
|
|
5
|
-
# Maintain your gem's version:
|
|
6
|
-
require "decidim/core/version"
|
|
7
|
-
|
|
8
|
-
# Describe your gem and declare its dependencies:
|
|
9
5
|
Gem::Specification.new do |s|
|
|
10
6
|
s.name = "decidim-core"
|
|
11
|
-
|
|
7
|
+
version = "0.32.1"
|
|
8
|
+
s.version = version
|
|
12
9
|
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
|
13
10
|
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
|
14
11
|
s.homepage = "https://decidim.org"
|
|
@@ -22,7 +19,7 @@ Gem::Specification.new do |s|
|
|
|
22
19
|
s.summary = "The core of the Decidim framework."
|
|
23
20
|
s.description = "Adds core features so other engines can hook into the framework."
|
|
24
21
|
s.license = "AGPL-3.0-or-later"
|
|
25
|
-
s.required_ruby_version = "~> 3.
|
|
22
|
+
s.required_ruby_version = "~> 3.4.0"
|
|
26
23
|
|
|
27
24
|
s.files = Dir.chdir(__dir__) do
|
|
28
25
|
`git ls-files -z`.split("\x0").select do |f|
|
|
@@ -40,53 +37,56 @@ Gem::Specification.new do |s|
|
|
|
40
37
|
s.add_dependency "cells-erb", "~> 0.1.0"
|
|
41
38
|
s.add_dependency "cells-rails", "~> 0.1.3"
|
|
42
39
|
s.add_dependency "charlock_holmes", "~> 0.7"
|
|
43
|
-
s.add_dependency "chartkick", "
|
|
44
|
-
s.add_dependency "connection_pool", "<
|
|
40
|
+
s.add_dependency "chartkick", ">= 5.1.2", "< 5.3.0"
|
|
41
|
+
s.add_dependency "connection_pool", "< 4"
|
|
45
42
|
s.add_dependency "data_migrate", "~> 11.3"
|
|
46
43
|
s.add_dependency "date_validator", "~> 0.12.0"
|
|
47
|
-
s.add_dependency "devise", "
|
|
44
|
+
s.add_dependency "devise", ">= 4.7", "< 6.0"
|
|
48
45
|
s.add_dependency "devise-i18n", "~> 1.2"
|
|
49
46
|
s.add_dependency "diffy", "~> 3.3"
|
|
50
47
|
s.add_dependency "doorkeeper", "~> 5.6", ">= 5.6.6"
|
|
51
|
-
s.add_dependency "doorkeeper-i18n", "
|
|
48
|
+
s.add_dependency "doorkeeper-i18n", ">= 4", "< 6"
|
|
52
49
|
s.add_dependency "file_validators", "~> 3.0"
|
|
53
50
|
s.add_dependency "fog-local", "~> 0.6"
|
|
54
51
|
s.add_dependency "geocoder", "~> 1.8"
|
|
55
52
|
s.add_dependency "hashdiff", ">= 0.4.0", "< 2.0.0"
|
|
56
|
-
s.add_dependency "hexapdf", "
|
|
53
|
+
s.add_dependency "hexapdf", ">= 1.1", "< 1.7"
|
|
57
54
|
s.add_dependency "image_processing", "~> 1.2"
|
|
58
|
-
s.add_dependency "invisible_captcha", "
|
|
55
|
+
s.add_dependency "invisible_captcha", ">= 0.12", "< 3.0"
|
|
59
56
|
s.add_dependency "kaminari", "~> 1.2", ">= 1.2.1"
|
|
60
57
|
s.add_dependency "loofah", "~> 2.19", ">= 2.19.1"
|
|
61
58
|
s.add_dependency "mime-types", ">= 1.16", "< 4.0"
|
|
62
|
-
s.add_dependency "mini_magick", "~> 4.9"
|
|
63
59
|
s.add_dependency "net-smtp", "~> 0.5.0"
|
|
64
60
|
s.add_dependency "nokogiri", "~> 1.16", ">= 1.16.2"
|
|
65
61
|
s.add_dependency "omniauth", "~> 2.0"
|
|
66
|
-
s.add_dependency "omniauth-facebook", "
|
|
62
|
+
s.add_dependency "omniauth-facebook", ">= 5", "< 11"
|
|
67
63
|
s.add_dependency "omniauth-google-oauth2", "~> 1.0"
|
|
68
|
-
s.add_dependency "omniauth-rails_csrf_protection", "
|
|
64
|
+
s.add_dependency "omniauth-rails_csrf_protection", ">= 1", "< 3"
|
|
69
65
|
s.add_dependency "omniauth-twitter", "~> 1.4"
|
|
70
|
-
s.add_dependency "paper_trail", "~>
|
|
71
|
-
s.add_dependency "paranoia", "~> 3.
|
|
72
|
-
s.add_dependency "pg", "
|
|
66
|
+
s.add_dependency "paper_trail", "~> 17.0"
|
|
67
|
+
s.add_dependency "paranoia", "~> 3.1.0"
|
|
68
|
+
s.add_dependency "pg", ">= 1.5", "< 1.7"
|
|
73
69
|
s.add_dependency "pg_search", "~> 2.2"
|
|
74
70
|
s.add_dependency "premailer-rails", "~> 1.10"
|
|
75
|
-
s.add_dependency "rack", "
|
|
76
|
-
s.add_dependency "rack-attack", "
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
s.add_dependency "
|
|
80
|
-
s.add_dependency "
|
|
71
|
+
s.add_dependency "rack", ">= 3.2.4", "< 4.0"
|
|
72
|
+
s.add_dependency "rack-attack", ">= 6.7", "< 6.9"
|
|
73
|
+
# Workaround until shakapacker releases a new version compatible with rack-proxy v1.0
|
|
74
|
+
# @see https://github.com/shakacode/shakapacker/issues/1220
|
|
75
|
+
s.add_dependency "rack-proxy", "~> 0.8.3", "< 1.0"
|
|
76
|
+
s.add_dependency "rails", "~> 8.1.0"
|
|
77
|
+
s.add_dependency "rails-i18n", "~> 8.1.0", "< 8.2"
|
|
78
|
+
s.add_dependency "ransack", ">= 4.2", "< 4.5"
|
|
79
|
+
s.add_dependency "redis", ">= 4.1", "< 6.0"
|
|
81
80
|
s.add_dependency "request_store", "~> 1.7.0"
|
|
82
|
-
s.add_dependency "rqrcode", "
|
|
81
|
+
s.add_dependency "rqrcode", ">= 2.2", "< 3.3"
|
|
82
|
+
s.add_dependency "ruby-vips", "~> 2.2"
|
|
83
83
|
s.add_dependency "rubyXL", "~> 3.4"
|
|
84
84
|
s.add_dependency "rubyzip", "~> 2.0"
|
|
85
|
-
s.add_dependency "shakapacker", "~>
|
|
85
|
+
s.add_dependency "shakapacker", "~> 9.7.0"
|
|
86
86
|
s.add_dependency "valid_email2", "~> 7.0"
|
|
87
87
|
s.add_dependency "web-push", "~> 3.0"
|
|
88
88
|
s.add_dependency "wisper", "~> 3.0"
|
|
89
89
|
|
|
90
|
-
s.add_development_dependency "decidim-api",
|
|
91
|
-
s.add_development_dependency "decidim-dev",
|
|
90
|
+
s.add_development_dependency "decidim-api", version
|
|
91
|
+
s.add_development_dependency "decidim-dev", version
|
|
92
92
|
end
|
data/lib/decidim/acts_as_tree.rb
CHANGED
|
@@ -33,18 +33,18 @@ module Decidim
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def tree_sql_for(item)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
<<~SQL.squish
|
|
37
|
+
WITH RECURSIVE search_tree(id, path) AS (
|
|
38
|
+
SELECT id, ARRAY[id]
|
|
39
|
+
FROM #{table_name}
|
|
40
|
+
WHERE id = #{item.id}
|
|
41
|
+
UNION ALL
|
|
42
|
+
SELECT #{table_name}.id, path || #{table_name}.id
|
|
43
|
+
FROM search_tree
|
|
44
|
+
JOIN #{table_name} ON #{table_name}.#{parent_item_foreign_key} = search_tree.id #{polymorphic_condition(item)}
|
|
45
|
+
WHERE NOT #{table_name}.id = ANY(path)
|
|
46
|
+
)
|
|
47
|
+
SELECT id FROM search_tree ORDER BY path
|
|
48
48
|
SQL
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -10,7 +10,7 @@ module Decidim
|
|
|
10
10
|
# Finds a filter by name or creates it if it does not exist.
|
|
11
11
|
#
|
|
12
12
|
# @param name [Symbol] Name of the filter
|
|
13
|
-
# @param
|
|
13
|
+
# @param block [Filter] Registration body of the filter. It is stored to
|
|
14
14
|
# be evaluated at rendering time
|
|
15
15
|
#
|
|
16
16
|
def register(name, &block)
|
data/lib/decidim/amendable.rb
CHANGED
|
@@ -155,7 +155,11 @@ module Decidim
|
|
|
155
155
|
self.author = author
|
|
156
156
|
end
|
|
157
157
|
else # Assume is_a?(Decidim::Coauthorable)
|
|
158
|
-
|
|
158
|
+
if persisted?
|
|
159
|
+
coauthorships.clear
|
|
160
|
+
else
|
|
161
|
+
coauthorships.target.clear
|
|
162
|
+
end
|
|
159
163
|
add_coauthor(author)
|
|
160
164
|
end
|
|
161
165
|
end
|
|
@@ -17,17 +17,19 @@ module Decidim
|
|
|
17
17
|
class ComponentList
|
|
18
18
|
include NeedsApiFilterAndOrder
|
|
19
19
|
include NeedsApiDefaultOrder
|
|
20
|
+
|
|
20
21
|
attr_reader :model_class
|
|
21
22
|
|
|
22
23
|
def initialize
|
|
23
24
|
@model_class = Component
|
|
24
25
|
end
|
|
25
26
|
|
|
26
|
-
def call(participatory_space, args,
|
|
27
|
+
def call(participatory_space, args, ctx)
|
|
27
28
|
@query = Decidim::Component
|
|
28
29
|
# remove default ordering if custom order required
|
|
29
30
|
@query = @query.unscoped if args[:order]
|
|
30
31
|
@query = @query.where(participatory_space:)
|
|
32
|
+
@query = @query.published unless ctx[:current_user]&.admin?
|
|
31
33
|
add_filter_keys(args[:filter])
|
|
32
34
|
add_order_keys(args[:order].to_h)
|
|
33
35
|
add_default_order
|
|
@@ -11,6 +11,7 @@ module Decidim
|
|
|
11
11
|
#
|
|
12
12
|
class UserEntityList
|
|
13
13
|
include NeedsApiFilterAndOrder
|
|
14
|
+
include NeedsApiDefaultOrder
|
|
14
15
|
|
|
15
16
|
def initialize
|
|
16
17
|
@model_class = Decidim::UserBaseEntity
|
|
@@ -21,9 +22,9 @@ module Decidim
|
|
|
21
22
|
.where(organization: ctx[:current_organization])
|
|
22
23
|
.confirmed
|
|
23
24
|
.not_blocked
|
|
24
|
-
.includes(avatar_attachment: :blob)
|
|
25
25
|
add_filter_keys(args[:filter])
|
|
26
26
|
add_order_keys(args[:order].to_h)
|
|
27
|
+
add_default_order
|
|
27
28
|
@query
|
|
28
29
|
end
|
|
29
30
|
end
|
|
@@ -6,6 +6,7 @@ module Decidim
|
|
|
6
6
|
# The only requirement is to have an ID and the Type name be the class.name + Type
|
|
7
7
|
module AmendableEntityInterface
|
|
8
8
|
include Decidim::Api::Types::BaseInterface
|
|
9
|
+
|
|
9
10
|
description "An interface that can be used in objects with amendments"
|
|
10
11
|
|
|
11
12
|
field :id, ID, "ID of this entity", null: false
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents an amendable object.
|
|
6
6
|
module AmendableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in objects with amendments"
|
|
9
10
|
|
|
10
11
|
field :amendments, [Decidim::Core::AmendmentType, { null: true }], description: "This object's amendments", null: false
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents an attachable object.
|
|
6
6
|
module AttachableCollectionInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in objects with attachments"
|
|
9
10
|
|
|
10
11
|
field :attachment_collections, [Decidim::Core::AttachmentCollectionType, { null: true }], "This object's attachment collections", null: false
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a attachable object.
|
|
6
6
|
module AttachableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in objects with attachments"
|
|
9
10
|
|
|
10
11
|
field :attachments, [Decidim::Core::AttachmentType, { null: true }], "This object's attachments", null: false
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents an author who owns a resource.
|
|
6
6
|
module AuthorInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
graphql_name "Author"
|
|
9
10
|
description "An author"
|
|
10
11
|
|
|
@@ -25,7 +26,7 @@ module Decidim
|
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def self.resolve_type(obj, _ctx)
|
|
28
|
-
return Decidim::Core::UserType if obj.is_a? Decidim::
|
|
29
|
+
return Decidim::Core::UserType if obj.is_a? Decidim::UserBaseEntity
|
|
29
30
|
end
|
|
30
31
|
end
|
|
31
32
|
end
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a commentable object.
|
|
6
6
|
module AuthorableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in authorable objects."
|
|
9
10
|
|
|
10
11
|
field :author, Decidim::Core::AuthorInterface, "The resource author", null: true do
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a resource that contains categories.
|
|
6
6
|
module CategoriesContainerInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in objects that contain categories."
|
|
9
10
|
|
|
10
11
|
field :categories, [Decidim::Core::CategoryType, { null: true }], "Categories for this space", null: false do
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a categorizable object.
|
|
6
6
|
module CategorizableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in categorizable objects."
|
|
9
10
|
|
|
10
11
|
field :category, Decidim::Core::CategoryType, "The object's category", null: true
|
|
@@ -4,17 +4,18 @@ module Decidim
|
|
|
4
4
|
module Core
|
|
5
5
|
module ComponentInterface
|
|
6
6
|
include Decidim::Api::Types::BaseInterface
|
|
7
|
-
description "This interface is implemented by all components that belong into a Participatory Space"
|
|
8
|
-
|
|
9
|
-
field :id, ID, "The Component's unique ID", null: false
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
field :weight, Integer, "The weight of the component", null: false
|
|
8
|
+
description "This interface is implemented by all components that belong into a Participatory Space"
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
implements Decidim::Core::TimestampsInterface
|
|
16
11
|
|
|
17
|
-
field :
|
|
12
|
+
field :id, ID, "The unique id of this component", null: false
|
|
13
|
+
field :name, TranslatedFieldType, "The name of this component", null: false
|
|
14
|
+
field :participatory_space, ParticipatorySpaceType, "The participatory space of this component", null: false
|
|
15
|
+
field :published_at, Decidim::Core::DateTimeType, "The date and time this object was published", null: false
|
|
16
|
+
field :url, String, "The URL of this component", null: false
|
|
17
|
+
field :visible, GraphQL::Types::Boolean, "the visibility status of this component", null: true, method: :visible?
|
|
18
|
+
field :weight, Integer, "The weight of this component", null: false
|
|
18
19
|
|
|
19
20
|
def url
|
|
20
21
|
Decidim::EngineRouter.main_proxy(object).root_url
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a fingerprintable object.
|
|
6
6
|
module FingerprintInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in fingerprintable objects."
|
|
9
10
|
|
|
10
11
|
field :fingerprint, Decidim::Core::FingerprintType, "This object's fingerprint", null: false
|
|
@@ -5,8 +5,10 @@ module Decidim
|
|
|
5
5
|
# This interface represents a followable object.
|
|
6
6
|
module FollowableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in followable objects."
|
|
9
10
|
|
|
11
|
+
field :followers, [Decidim::Core::AuthorInterface, { null: true }], "The followers of this resource", null: false
|
|
10
12
|
field :follows_count, GraphQL::Types::Int, "The number of followers of the resource", null: true
|
|
11
13
|
end
|
|
12
14
|
end
|
|
@@ -5,10 +5,10 @@ module Decidim
|
|
|
5
5
|
# This interface represents an object capable of likes.
|
|
6
6
|
module LikeableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
-
description "An interface that can be used in objects with likes"
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
description "An interface that can be used in objects with likes"
|
|
11
10
|
|
|
11
|
+
field :likes, [Decidim::Core::AuthorInterface, { null: true }], "The likes of this object", null: false
|
|
12
12
|
field :likes_count, Integer, description: "The total amount of likes the object has received", null: true
|
|
13
13
|
|
|
14
14
|
def likes
|
|
@@ -5,6 +5,7 @@ module Decidim
|
|
|
5
5
|
# This interface represents a localizable (that has address, latitude and longitude) object.
|
|
6
6
|
module LocalizableInterface
|
|
7
7
|
include Decidim::Api::Types::BaseInterface
|
|
8
|
+
|
|
8
9
|
description "An interface that can be used in localizable objects."
|
|
9
10
|
|
|
10
11
|
field :address, GraphQL::Types::String, "The physical address (location) of this result", null: true
|