decidim-core 0.26.5 → 0.27.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/cells/decidim/amendable/announcement_cell.rb +4 -9
- data/app/cells/decidim/announcement_cell.rb +1 -1
- data/app/cells/decidim/author_cell.rb +1 -1
- data/app/cells/decidim/card_m_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/cta/show.erb +1 -1
- data/app/cells/decidim/content_blocks/footer_sub_hero/show.erb +1 -1
- data/app/cells/decidim/content_blocks/hero/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +4 -4
- data/app/cells/decidim/content_blocks/highlighted_elements_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/how_to_participate/show.erb +1 -1
- data/app/cells/decidim/content_blocks/last_activity/show.erb +1 -1
- data/app/cells/decidim/content_blocks/last_activity_cell.rb +3 -3
- data/app/cells/decidim/content_blocks/stats_cell.rb +4 -5
- data/app/cells/decidim/content_blocks/sub_hero/show.erb +1 -1
- data/app/cells/decidim/data_consent/category.erb +64 -0
- data/app/cells/decidim/data_consent/dialog.erb +29 -0
- data/app/cells/decidim/data_consent/modal.erb +39 -0
- data/app/cells/decidim/data_consent/show.erb +3 -0
- data/app/cells/decidim/data_consent_cell.rb +21 -0
- data/app/cells/decidim/follow_button_cell.rb +5 -7
- data/app/cells/decidim/newsletter_templates/base_cell.rb +0 -8
- data/app/cells/decidim/newsletter_templates/basic_only_text/show.erb +4 -4
- data/app/cells/decidim/newsletter_templates/image_text_cta/show.erb +4 -4
- data/app/cells/decidim/profile_sidebar_cell.rb +1 -1
- data/app/cells/decidim/search_results_cell.rb +1 -1
- data/app/cells/decidim/tos_page/refuse_btn_modal.erb +1 -1
- data/app/cells/decidim/upload_modal/files.erb +52 -0
- data/app/cells/decidim/upload_modal/modal.erb +49 -0
- data/app/cells/decidim/upload_modal/show.erb +3 -0
- data/app/cells/decidim/upload_modal_cell.rb +205 -0
- data/app/cells/decidim/user_conversation/reply.erb +1 -1
- data/app/cells/decidim/user_conversations/add_conversation_users.erb +5 -3
- data/app/cells/decidim/version_cell.rb +2 -13
- data/app/cells/decidim/versions_list_cell.rb +2 -13
- data/app/cells/decidim/versions_list_item_cell.rb +2 -13
- data/app/commands/decidim/accept_group_invitation.rb +1 -1
- data/app/commands/decidim/accept_user_group_join_request.rb +1 -1
- data/app/commands/decidim/amendable/accept.rb +1 -1
- data/app/commands/decidim/amendable/create_draft.rb +1 -1
- data/app/commands/decidim/amendable/destroy_draft.rb +1 -1
- data/app/commands/decidim/amendable/promote.rb +1 -1
- data/app/commands/decidim/amendable/publish_draft.rb +1 -1
- data/app/commands/decidim/amendable/reject.rb +1 -1
- data/app/commands/decidim/amendable/update_draft.rb +1 -1
- data/app/commands/decidim/amendable/withdraw.rb +1 -1
- data/app/commands/decidim/attachment_methods.rb +3 -2
- data/app/commands/decidim/create_editor_image.rb +1 -1
- data/app/commands/decidim/create_follow.rb +1 -1
- data/app/commands/decidim/create_omniauth_registration.rb +2 -3
- data/app/commands/decidim/create_registration.rb +1 -2
- data/app/commands/decidim/create_report.rb +1 -1
- data/app/commands/decidim/create_user_group.rb +2 -2
- data/app/commands/decidim/create_user_report.rb +5 -3
- data/app/commands/decidim/delete_follow.rb +1 -1
- data/app/commands/decidim/demote_membership.rb +1 -1
- data/app/commands/decidim/destroy_account.rb +1 -1
- data/app/commands/decidim/endorse_resource.rb +1 -1
- data/app/commands/decidim/gallery_methods.rb +45 -10
- data/app/commands/decidim/invite_user.rb +1 -3
- data/app/commands/decidim/invite_user_again.rb +1 -1
- data/app/commands/decidim/invite_user_to_group.rb +1 -1
- data/app/commands/decidim/join_user_group.rb +1 -1
- data/app/commands/decidim/leave_user_group.rb +8 -2
- data/app/commands/decidim/messaging/reply_to_conversation.rb +2 -2
- data/app/commands/decidim/messaging/start_conversation.rb +2 -2
- data/app/commands/decidim/multiple_attachments_methods.rb +44 -5
- data/app/commands/decidim/promote_membership.rb +1 -1
- data/app/commands/decidim/reject_group_invitation.rb +1 -1
- data/app/commands/decidim/reject_user_group_join_request.rb +1 -1
- data/app/commands/decidim/remove_user_from_group.rb +1 -1
- data/app/commands/decidim/resend_confirmation_instructions.rb +18 -0
- data/app/commands/decidim/search.rb +10 -9
- data/app/commands/decidim/unendorse_resource.rb +2 -2
- data/app/commands/decidim/unsubscribe_settings.rb +1 -1
- data/app/commands/decidim/update_account.rb +2 -2
- data/app/commands/decidim/update_notifications_settings.rb +3 -2
- data/app/commands/decidim/update_password.rb +31 -0
- data/app/commands/decidim/update_user_group.rb +2 -2
- data/app/commands/decidim/update_user_interests.rb +1 -1
- data/app/commands/decidim/validate_upload.rb +15 -0
- data/app/controllers/concerns/decidim/devise_controllers.rb +0 -1
- data/app/controllers/concerns/decidim/filter_resource.rb +23 -24
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -2
- data/app/controllers/concerns/decidim/http_caching_disabler.rb +1 -1
- data/app/controllers/concerns/decidim/needs_password_change.rb +43 -0
- data/app/controllers/concerns/decidim/needs_tos_accepted.rb +3 -3
- data/app/controllers/concerns/decidim/orderable.rb +1 -1
- data/app/controllers/concerns/decidim/participatory_space_context.rb +2 -2
- data/app/controllers/concerns/decidim/resource_versions_concern.rb +0 -4
- data/app/controllers/decidim/account_controller.rb +45 -0
- data/app/controllers/decidim/application_controller.rb +1 -1
- data/app/controllers/decidim/devise/invitations_controller.rb +4 -9
- data/app/controllers/decidim/devise/passwords_controller.rb +33 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +3 -5
- data/app/controllers/decidim/devise/sessions_controller.rb +2 -0
- data/app/controllers/decidim/{data_portability_controller.rb → download_your_data_controller.rb} +8 -8
- data/app/controllers/decidim/groups_controller.rb +5 -5
- data/app/controllers/decidim/last_activities_controller.rb +7 -9
- data/app/controllers/decidim/links_controller.rb +2 -4
- data/app/controllers/decidim/manifests_controller.rb +11 -0
- data/app/controllers/decidim/newsletters_controller.rb +1 -1
- data/app/controllers/decidim/notifications_subscriptions_controller.rb +16 -0
- data/app/controllers/decidim/offline_controller.rb +7 -0
- data/app/controllers/decidim/profiles_controller.rb +2 -2
- data/app/controllers/decidim/searches_controller.rb +4 -3
- data/app/controllers/decidim/short_links_controller.rb +35 -0
- data/app/controllers/decidim/upload_validations_controller.rb +44 -0
- data/app/controllers/decidim/user_activities_controller.rb +32 -16
- data/app/controllers/decidim/user_interests_controller.rb +0 -2
- data/app/controllers/decidim/user_timeline_controller.rb +6 -8
- data/app/events/decidim/change_nickname_event.rb +21 -0
- data/app/events/decidim/resource_endorsed_event.rb +1 -2
- data/app/forms/decidim/account_form.rb +3 -3
- data/app/forms/decidim/amendable/form.rb +1 -2
- data/app/forms/decidim/form.rb +1 -1
- data/app/forms/decidim/messaging/conversation_form.rb +1 -1
- data/app/forms/decidim/notifications_settings_form.rb +8 -2
- data/app/forms/decidim/password_form.rb +10 -0
- data/app/forms/decidim/registration_form.rb +2 -2
- data/app/forms/decidim/upload_validation_form.rb +54 -0
- data/app/forms/decidim/user_group_form.rb +1 -1
- data/app/forms/decidim/user_interest_scope_form.rb +1 -1
- data/app/forms/decidim/user_interests_form.rb +1 -1
- data/app/forms/translatable_presence_validator.rb +2 -2
- data/app/forms/url_validator.rb +1 -1
- data/app/helpers/decidim/application_helper.rb +2 -2
- data/app/helpers/decidim/attachments_helper.rb +1 -1
- data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
- data/app/helpers/decidim/datalist_select_helper.rb +40 -0
- data/app/helpers/decidim/decidim_form_helper.rb +1 -1
- data/app/helpers/decidim/filters_helper.rb +1 -5
- data/app/helpers/decidim/followable_helper.rb +1 -1
- data/app/helpers/decidim/icon_helper.rb +4 -4
- data/app/helpers/decidim/layout_helper.rb +15 -1
- data/app/helpers/decidim/map_helper.rb +12 -8
- data/app/helpers/decidim/meta_tags_helper.rb +0 -2
- data/app/helpers/decidim/newsletters_helper.rb +0 -1
- data/app/helpers/decidim/notifications_settings_helper.rb +15 -0
- data/app/helpers/decidim/passwords_helper.rb +41 -0
- data/app/helpers/decidim/sanitize_helper.rb +1 -0
- data/app/helpers/decidim/searches_helper.rb +6 -6
- data/app/helpers/decidim/short_link_helper.rb +28 -0
- data/app/helpers/decidim/translations_helper.rb +2 -2
- data/app/jobs/decidim/{data_portability_export_job.rb → download_your_data_export_job.rb} +5 -5
- data/app/jobs/decidim/email_notifications_digest_generator_job.rb +21 -0
- data/app/jobs/decidim/notification_generator_for_recipient_job.rb +5 -3
- data/app/jobs/decidim/reminder_generator_job.rb +12 -0
- data/app/jobs/decidim/resend_confirmation_instructions_job.rb +11 -0
- data/app/jobs/decidim/user_report_job.rb +2 -2
- data/app/mailers/concerns/decidim/multitenant_asset_host.rb +11 -3
- data/app/mailers/decidim/application_mailer.rb +1 -1
- data/app/mailers/decidim/block_user_mailer.rb +8 -7
- data/app/mailers/decidim/export_mailer.rb +2 -2
- data/app/mailers/decidim/newsletter_mailer.rb +5 -12
- data/app/mailers/decidim/newsletters_opt_in_mailer.rb +7 -5
- data/app/mailers/decidim/notification_mailer.rb +0 -1
- data/app/mailers/decidim/notifications_digest_mailer.rb +23 -0
- data/app/mailers/decidim/user_report_mailer.rb +10 -11
- data/app/models/decidim/action_log.rb +95 -11
- data/app/models/decidim/amendment.rb +0 -1
- data/app/models/decidim/area.rb +1 -2
- data/app/models/decidim/area_type.rb +5 -0
- data/app/models/decidim/attachment.rb +6 -0
- data/app/models/decidim/attachment_collection.rb +5 -0
- data/app/models/decidim/category.rb +9 -4
- data/app/models/decidim/coauthorship.rb +0 -2
- data/app/models/decidim/contextual_help_section.rb +5 -1
- data/app/models/decidim/follow.rb +2 -2
- data/app/models/decidim/gamification/badge_score.rb +0 -1
- data/app/models/decidim/identity.rb +2 -2
- data/app/models/decidim/messaging/conversation.rb +4 -4
- data/app/models/decidim/messaging/message.rb +1 -2
- data/app/models/decidim/messaging/participation.rb +0 -2
- data/app/models/decidim/messaging/receipt.rb +0 -2
- data/app/models/decidim/newsletter.rb +0 -28
- data/app/models/decidim/notification.rb +5 -2
- data/app/models/decidim/oauth_application.rb +12 -1
- data/app/models/decidim/organization.rb +7 -7
- data/app/models/decidim/participatory_space_private_user.rb +4 -2
- data/app/models/decidim/permission_action.rb +1 -0
- data/app/models/decidim/reminder.rb +10 -0
- data/app/models/decidim/reminder_delivery.rb +7 -0
- data/app/models/decidim/reminder_record.rb +29 -0
- data/app/models/decidim/report.rb +2 -2
- data/app/models/decidim/scope.rb +3 -4
- data/app/models/decidim/scope_type.rb +5 -0
- data/app/models/decidim/share_token.rb +0 -2
- data/app/models/decidim/short_link.rb +162 -0
- data/app/models/decidim/user.rb +36 -6
- data/app/models/decidim/user_base_entity.rb +1 -4
- data/app/models/decidim/user_block.rb +2 -2
- data/app/models/decidim/user_group.rb +4 -4
- data/app/models/decidim/user_moderation.rb +0 -2
- data/app/models/decidim/user_report.rb +2 -2
- data/app/packs/entrypoints/decidim_core.js +2 -2
- data/app/packs/entrypoints/decidim_sw.js +1 -0
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_invitations.svg +1 -0
- data/app/packs/src/decidim/autocomplete.js +298 -0
- data/app/packs/src/decidim/cookie_consent/consent_manager.js +133 -0
- data/app/packs/src/decidim/cookie_consent/cookie_consent.js +103 -0
- data/app/packs/src/decidim/datalist_select.js +36 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +117 -0
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +264 -0
- data/app/packs/src/decidim/direct_uploads/upload_utility.js +49 -0
- data/app/packs/src/decidim/direct_uploads/uploader.js +89 -0
- data/app/packs/src/decidim/editor/linebreak_module.js +8 -0
- data/app/packs/src/decidim/editor.js +2 -9
- data/app/packs/src/decidim/external_domain_warning.js +1 -1
- data/app/packs/src/decidim/external_link.js +14 -3
- data/app/packs/src/decidim/external_link.test.js +64 -0
- data/app/packs/src/decidim/form_filter.component.test.js +5 -148
- data/app/packs/src/decidim/form_filter.js +4 -26
- data/app/packs/src/decidim/geocoding.js +10 -35
- data/app/packs/src/decidim/identity_selector_dialog.js +1 -1
- data/app/packs/src/decidim/impersonation.js +3 -3
- data/app/packs/src/decidim/input_character_counter.js +177 -7
- data/app/packs/src/decidim/input_multiple_mentions.js +87 -187
- data/app/packs/src/decidim/map/icon.js +2 -1
- data/app/packs/src/decidim/map/svg-icon.js +248 -0
- data/app/packs/src/decidim/security/selfxss_warning.js +5 -1
- data/app/packs/src/decidim/session_timeouter.js +15 -15
- data/app/packs/src/decidim/sw/a2hs.js +28 -0
- data/app/packs/src/decidim/sw/index.js +3 -0
- data/app/packs/src/decidim/sw/loader.js +18 -0
- data/app/packs/src/decidim/sw/push-permissions.js +87 -0
- data/app/packs/src/decidim/sw/sw.js +80 -0
- data/app/packs/src/decidim/vizzs/areachart.js +33 -28
- data/app/packs/src/decidim/vizzs/linechart.js +23 -18
- data/app/packs/src/decidim/vizzs/rowchart.js +15 -11
- data/app/packs/stylesheets/decidim/email.scss +66 -7
- data/app/packs/stylesheets/decidim/layouts/_user.scss +8 -0
- data/app/packs/stylesheets/decidim/modules/_autocomplete.scss +99 -0
- data/app/packs/stylesheets/decidim/modules/_cards.scss +0 -2
- data/app/packs/stylesheets/decidim/modules/_comments.scss +0 -2
- data/app/packs/stylesheets/decidim/modules/_cookie-consent.scss +115 -0
- data/app/packs/stylesheets/decidim/modules/_footer.scss +4 -0
- data/app/packs/stylesheets/decidim/modules/_forms.scss +0 -5
- data/app/packs/stylesheets/decidim/modules/_input-multiple-mentions.scss +29 -2
- data/app/packs/stylesheets/decidim/modules/_modules.scss +3 -1
- data/app/packs/stylesheets/decidim/modules/_reveal.scss +15 -0
- data/app/packs/stylesheets/decidim/modules/_upload_modal.scss +143 -0
- data/app/packs/stylesheets/decidim/utils/_fontface.scss +3 -0
- data/app/permissions/decidim/permissions.rb +4 -8
- data/app/presenters/decidim/admin_log/area_type_presenter.rb +34 -0
- data/app/presenters/decidim/admin_log/attachment_collection_presenter.rb +35 -0
- data/app/presenters/decidim/admin_log/attachment_presenter.rb +27 -0
- data/app/presenters/decidim/admin_log/category_presenter.rb +36 -0
- data/app/presenters/decidim/admin_log/component_presenter.rb +35 -3
- data/app/presenters/decidim/admin_log/contextual_help_section_presenter.rb +33 -0
- data/app/presenters/decidim/admin_log/organization_presenter.rb +9 -4
- data/app/presenters/decidim/admin_log/scope_type_presenter.rb +34 -0
- data/app/presenters/decidim/admin_log/user_group_presenter.rb +1 -1
- data/app/presenters/decidim/admin_log/user_moderation_presenter.rb +1 -1
- data/app/presenters/decidim/home_stats_presenter.rb +8 -13
- data/app/presenters/decidim/log/base_presenter.rb +1 -1
- data/app/presenters/decidim/menu_item_presenter.rb +1 -1
- data/app/presenters/decidim/metric_charts_presenter.rb +7 -1
- data/app/presenters/decidim/nil_presenter.rb +3 -1
- data/app/presenters/decidim/notification_to_mailer_presenter.rb +39 -0
- data/app/presenters/decidim/notifications_digest_presenter.rb +42 -0
- data/app/presenters/decidim/official_author_presenter.rb +4 -0
- data/app/presenters/decidim/organization_presenter.rb +22 -0
- data/app/presenters/decidim/push_notification_presenter.rb +24 -0
- data/app/presenters/decidim/stats_presenter.rb +9 -8
- data/app/presenters/decidim/user_presenter.rb +4 -12
- data/app/presenters/decidim/validation_errors_presenter.rb +1 -1
- data/app/queries/decidim/messaging/user_conversations.rb +1 -1
- data/app/queries/decidim/metric_manage.rb +1 -1
- data/app/queries/decidim/own_activities.rb +11 -0
- data/app/queries/decidim/participatory_processes_with_user_role.rb +1 -1
- data/app/{services/decidim/activity_search.rb → queries/decidim/public_activities.rb} +35 -78
- data/app/queries/decidim/public_components.rb +1 -1
- data/app/queries/decidim/similar_emendations.rb +1 -1
- data/app/queries/decidim/stats_users_count.rb +1 -1
- data/app/queries/decidim/user_groups/accepted_memberships.rb +1 -1
- data/app/queries/decidim/user_groups/accepted_user_groups.rb +1 -1
- data/app/queries/decidim/user_groups/accepted_users.rb +1 -1
- data/app/queries/decidim/user_groups/admin_memberships.rb +1 -1
- data/app/queries/decidim/user_groups/invited_memberships.rb +1 -1
- data/app/queries/decidim/user_groups/manageable_user_groups.rb +1 -1
- data/app/queries/decidim/user_groups/member_memberships.rb +1 -1
- data/app/services/decidim/{data_portability_exporter.rb → download_your_data_exporter.rb} +6 -6
- data/app/services/decidim/email_notification_generator.rb +2 -2
- data/app/services/decidim/engine_resolver.rb +66 -0
- data/app/services/decidim/events_manager.rb +1 -1
- data/app/services/decidim/iframe_disabler.rb +31 -0
- data/app/services/decidim/notification_generator_for_recipient.rb +1 -1
- data/app/services/decidim/notifications_digest_sending_decider.rb +18 -0
- data/app/services/decidim/notifications_subscriptions_persistor.rb +37 -0
- data/app/services/decidim/open_data_exporter.rb +1 -1
- data/app/services/decidim/resource_search.rb +17 -164
- data/app/services/decidim/send_push_notification.rb +59 -0
- data/app/services/decidim/traceability.rb +1 -1
- data/app/uploaders/decidim/application_uploader.rb +2 -12
- data/app/uploaders/decidim/cw/attachment_uploader.rb +1 -1
- data/app/uploaders/decidim/cw/{data_portability_uploader.rb → download_your_data_uploader.rb} +3 -3
- data/app/uploaders/decidim/cw/image_uploader.rb +2 -2
- data/app/uploaders/decidim/organization_favicon_uploader.rb +3 -2
- data/app/validators/etiquette_validator.rb +3 -7
- data/app/validators/passthru_validator.rb +29 -21
- data/app/validators/password_validator.rb +25 -4
- data/app/validators/uploader_image_dimensions_validator.rb +1 -1
- data/app/views/decidim/account/_account_notification.js.erb +20 -0
- data/app/views/decidim/account/_password_fields.html.erb +2 -2
- data/app/views/decidim/account/cancel_email_change.js.erb +6 -0
- data/app/views/decidim/account/resend_confirmation_instructions.erb +1 -0
- data/app/views/decidim/account/show.html.erb +19 -6
- data/app/views/decidim/application/{_attachments.html.erb → _attachments.erb} +2 -2
- data/app/views/decidim/application/_collection.html.erb +1 -1
- data/app/views/decidim/application/{_documents.html.erb → _documents.erb} +2 -2
- data/app/views/decidim/devise/confirmations/new.html.erb +1 -1
- data/app/views/decidim/devise/invitations/edit.html.erb +3 -4
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +3 -3
- data/app/views/decidim/devise/passwords/edit.html.erb +7 -5
- data/app/views/decidim/devise/passwords/new.html.erb +1 -1
- data/app/views/decidim/devise/registrations/edit.html.erb +41 -0
- data/app/views/decidim/devise/registrations/new.html.erb +5 -5
- data/app/views/decidim/devise/sessions/new.html.erb +2 -2
- data/app/views/decidim/{data_portability → download_your_data}/show.html.erb +2 -2
- data/app/views/decidim/export_mailer/download_your_data_export.html.erb +7 -0
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/manifests/show.json.erb +31 -0
- data/app/views/decidim/messaging/conversations/_add_conversation_users.html.erb +5 -3
- data/app/views/decidim/messaging/conversations/_reply.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_start.html.erb +1 -3
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -0
- data/app/views/decidim/newsletter_mailer/newsletter.html.erb +3 -3
- data/app/views/decidim/newsletters/show.html.erb +1 -1
- data/app/views/decidim/notification_mailer/event_received.html.erb +1 -1
- data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +11 -0
- data/app/views/decidim/notifications_digest_mailer/digest_mail.erb +27 -0
- data/app/views/decidim/notifications_settings/show.html.erb +79 -52
- data/app/views/decidim/offline/show.html.erb +9 -0
- data/app/views/decidim/pages/_standalone.html.erb +1 -1
- data/app/views/decidim/reported_mailer/hide.html.erb +1 -1
- data/app/views/decidim/reported_mailer/report.html.erb +1 -1
- data/app/views/decidim/scopes/picker.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +2 -2
- data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +3 -3
- data/app/views/decidim/user_interests/show.html.erb +13 -11
- data/app/views/decidim/user_report_mailer/notify.html.erb +10 -3
- data/app/views/devise/mailer/confirmation_instructions.html.erb +3 -1
- data/app/views/layouts/decidim/_application.html.erb +6 -3
- data/app/views/layouts/decidim/_cookie_warning.html.erb +8 -8
- data/app/views/layouts/decidim/_decidim_javascript.html.erb +12 -0
- data/app/views/layouts/decidim/_head.html.erb +4 -2
- data/app/views/layouts/decidim/_js_configuration.html.erb +5 -1
- data/app/views/layouts/decidim/_mailer_logo.html.erb +2 -2
- data/app/views/layouts/decidim/_main_footer.html.erb +1 -0
- data/app/views/layouts/decidim/_offline_banner.html.erb +11 -0
- data/app/views/layouts/decidim/newsletter_base.html.erb +2 -2
- data/app/views/layouts/decidim/widget.html.erb +2 -2
- data/config/assets.rb +1 -0
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +76 -41
- data/config/locales/bg.yml +42 -36
- data/config/locales/ca.yml +222 -55
- data/config/locales/cs.yml +221 -51
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +53 -100
- data/config/locales/el.yml +42 -34
- data/config/locales/en.yml +207 -40
- data/config/locales/eo.yml +4 -6
- data/config/locales/es-MX.yml +212 -45
- data/config/locales/es-PY.yml +212 -45
- data/config/locales/es.yml +222 -55
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +63 -62
- data/config/locales/fi-plain.yml +208 -41
- data/config/locales/fi.yml +209 -42
- data/config/locales/fr-CA.yml +199 -43
- data/config/locales/fr.yml +206 -50
- data/config/locales/ga-IE.yml +10 -8
- data/config/locales/gl.yml +75 -32
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +90 -209
- data/config/locales/id-ID.yml +43 -34
- data/config/locales/is-IS.yml +8 -17
- data/config/locales/it.yml +52 -42
- data/config/locales/ja.yml +213 -58
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +42 -32
- data/config/locales/lt.yml +1 -1776
- data/config/locales/lv.yml +41 -33
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +54 -36
- data/config/locales/no.yml +53 -38
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +94 -37
- data/config/locales/pt-BR.yml +46 -35
- data/config/locales/pt.yml +43 -33
- data/config/locales/ro-RO.yml +45 -41
- data/config/locales/ru.yml +20 -31
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +44 -35
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +95 -36
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +44 -35
- data/config/locales/uk.yml +18 -32
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +43 -33
- data/config/locales/zh-TW.yml +1 -0
- data/config/routes.rb +19 -22
- data/db/migrate/20180508111710_add_accepted_tos_version_field_to_users.rb +1 -0
- data/db/migrate/20181030090144_destroy_deleted_users_follows.rb +1 -0
- data/db/migrate/20190412131728_fix_user_names.rb +4 -4
- data/db/migrate/20210831181634_add_service_name_to_active_storage_blobs.active_storage.rb +22 -0
- data/db/migrate/20210831181635_create_active_storage_variant_records.active_storage.rb +14 -0
- data/db/migrate/20211208155453_create_decidim_reminders.rb +11 -0
- data/db/migrate/20211209121025_create_decidim_reminder_records.rb +11 -0
- data/db/migrate/20211209121040_create_decidim_reminder_deliveries.rb +10 -0
- data/db/migrate/20220118121921_change_required_description_categories.rb +7 -0
- data/db/migrate/20220127113419_add_notification_settings_to_users.rb +7 -0
- data/db/migrate/20220203121137_add_notifications_sending_frequency_to_users.rb +7 -0
- data/db/migrate/20220215172439_add_digest_sent_at_to_users.rb +7 -0
- data/db/migrate/20220323195258_add_index_to_decidim_users_notifications_sending_frequency.rb +7 -0
- data/db/migrate/20220427142214_drop_emails_on_notifications_flag_from_user.rb +15 -0
- data/db/migrate/20220518094535_add_previous_passwords_to_users.rb +20 -0
- data/db/migrate/20220524195530_create_decidim_short_links.rb +23 -0
- data/db/seeds.rb +17 -18
- data/lib/decidim/acts_as_tree.rb +47 -0
- data/lib/decidim/api/input_sorts/component_input_sort.rb +2 -1
- data/lib/decidim/api/interfaces/authorable_interface.rb +6 -5
- data/lib/decidim/api/types/localized_string_type.rb +0 -9
- data/lib/decidim/api/types/translated_field_type.rb +5 -20
- data/lib/decidim/asset_router.rb +80 -0
- data/lib/decidim/attachment_attributes.rb +8 -8
- data/lib/decidim/attribute_object/form.rb +174 -0
- data/lib/decidim/attribute_object/model.rb +148 -0
- data/lib/decidim/attribute_object/nested_validator.rb +22 -0
- data/lib/decidim/attribute_object/type_map.rb +14 -0
- data/lib/decidim/attribute_object/type_resolver.rb +91 -0
- data/lib/decidim/attribute_object.rb +26 -0
- data/lib/decidim/attributes/array.rb +62 -0
- data/lib/decidim/attributes/blob.rb +20 -0
- data/lib/decidim/attributes/clean_string.rb +12 -6
- data/lib/decidim/attributes/hash.rb +36 -0
- data/lib/decidim/attributes/integer.rb +17 -0
- data/lib/decidim/attributes/localized_date.rb +8 -14
- data/lib/decidim/attributes/model.rb +24 -0
- data/lib/decidim/attributes/object.rb +28 -0
- data/lib/decidim/attributes/symbol.rb +23 -0
- data/lib/decidim/attributes/time_with_zone.rb +7 -17
- data/lib/decidim/attributes.rb +29 -0
- data/lib/decidim/authorable.rb +21 -6
- data/lib/decidim/authorization_form_builder.rb +9 -11
- data/lib/decidim/carrier_wave_migrator_service.rb +15 -15
- data/lib/decidim/coauthorable.rb +22 -4
- data/lib/decidim/command.rb +44 -0
- data/lib/decidim/common_passwords.rb +1 -1
- data/lib/decidim/component_manifest.rb +5 -5
- data/lib/decidim/component_validator.rb +2 -2
- data/lib/decidim/content_block_manifest.rb +1 -1
- data/lib/decidim/content_parsers/hashtag_parser.rb +2 -2
- data/lib/decidim/content_parsers/resource_parser.rb +1 -1
- data/lib/decidim/content_parsers/user_group_parser.rb +1 -1
- data/lib/decidim/content_parsers/user_parser.rb +4 -4
- data/lib/decidim/content_renderers/hashtag_renderer.rb +1 -1
- data/lib/decidim/content_renderers/link_renderer.rb +2 -2
- data/lib/decidim/content_renderers/user_group_renderer.rb +1 -1
- data/lib/decidim/content_renderers/user_renderer.rb +1 -1
- data/lib/decidim/controller_helpers.rb +41 -0
- data/lib/decidim/core/engine.rb +35 -19
- data/lib/decidim/core/test/factories.rb +54 -21
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +16 -4
- data/lib/decidim/core/test/shared_examples/amendable/amendment_form_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +15 -2
- data/lib/decidim/core/test/shared_examples/coauthorable_interface_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +203 -0
- data/lib/decidim/core/test/shared_examples/localised_email.rb +1 -1
- data/lib/decidim/core/test/shared_examples/logo_email.rb +1 -1
- data/lib/decidim/core/test/shared_examples/map_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +0 -6
- data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +120 -40
- data/lib/decidim/core/test/shared_examples/resourceable.rb +0 -6
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/searchable_resources_shared_context.rb +1 -1
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
- data/lib/decidim/core/test.rb +0 -3
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +108 -14
- data/lib/decidim/{data_portability.rb → download_your_data.rb} +3 -3
- data/lib/decidim/{data_portability_serializers/data_portability_conversation_serializer.rb → download_your_data_serializers/download_your_data_conversation_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_follow_serializer.rb → download_your_data_serializers/download_your_data_follow_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_identity_serializer.rb → download_your_data_serializers/download_your_data_identity_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_notification_serializer.rb → download_your_data_serializers/download_your_data_notification_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_participatory_space_private_user_serializer.rb → download_your_data_serializers/download_your_data_participatory_space_private_user_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_report_serializer.rb → download_your_data_serializers/download_your_data_report_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_user_group_serializer.rb → download_your_data_serializers/download_your_data_user_group_serializer.rb} +2 -2
- data/lib/decidim/{data_portability_serializers/data_portability_user_serializer.rb → download_your_data_serializers/download_your_data_user_serializer.rb} +3 -3
- data/lib/decidim/download_your_data_serializers.rb +23 -0
- data/lib/decidim/engine_router.rb +7 -1
- data/lib/decidim/env.rb +56 -0
- data/lib/decidim/event_recorder.rb +25 -0
- data/lib/decidim/events/base_event.rb +10 -14
- data/lib/decidim/events/simple_event.rb +6 -5
- data/lib/decidim/exporters/export_data.rb +1 -1
- data/lib/decidim/exporters/export_manifest.rb +2 -1
- data/lib/decidim/file_validator_humanizer.rb +24 -1
- data/lib/decidim/filterable_resource.rb +55 -0
- data/lib/decidim/fingerprint_calculator.rb +2 -4
- data/lib/decidim/form_builder.rb +160 -139
- data/lib/decidim/gamification/badge.rb +2 -3
- data/lib/decidim/gamification/badge_scorer.rb +1 -0
- data/lib/decidim/has_area.rb +27 -0
- data/lib/decidim/has_attachments.rb +2 -2
- data/lib/decidim/has_category.rb +36 -0
- data/lib/decidim/has_resource_permission.rb +2 -0
- data/lib/decidim/importers/import_manifest.rb +3 -21
- data/lib/decidim/jsonb_attributes.rb +6 -4
- data/lib/decidim/manifest_messages.rb +23 -0
- data/lib/decidim/map/autocomplete.rb +6 -4
- data/lib/decidim/map/frontend.rb +2 -2
- data/lib/decidim/map/provider/dynamic_map/here.rb +1 -46
- data/lib/decidim/map/provider/geocoding/here.rb +5 -5
- data/lib/decidim/map/provider/here.rb +3 -0
- data/lib/decidim/map/provider/osm.rb +3 -0
- data/lib/decidim/map.rb +4 -4
- data/lib/decidim/menu.rb +1 -1
- data/lib/decidim/metric_manifest.rb +2 -2
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/decidim/notification_setting_manifest.rb +19 -0
- data/lib/decidim/organization_settings.rb +8 -7
- data/lib/decidim/participatory_space_context_manifest.rb +2 -2
- data/lib/decidim/participatory_space_manifest.rb +2 -2
- data/lib/decidim/participatory_space_resourceable.rb +1 -7
- data/lib/decidim/processes_file_locally.rb +31 -0
- data/lib/decidim/query.rb +84 -0
- data/lib/decidim/record_encryptor.rb +29 -8
- data/lib/decidim/reminder_manifest.rb +75 -0
- data/lib/decidim/reminder_registry.rb +67 -0
- data/lib/decidim/resource_manifest.rb +1 -1
- data/lib/decidim/resourceable.rb +15 -5
- data/lib/decidim/scopable.rb +15 -0
- data/lib/decidim/settings_manifest.rb +4 -4
- data/lib/decidim/spring.rb +16 -0
- data/lib/decidim/translatable_attributes.rb +13 -16
- data/lib/decidim/url_option_resolver.rb +50 -0
- data/lib/decidim/view_hooks.rb +1 -1
- data/lib/decidim/view_model.rb +5 -1
- data/lib/decidim/webpacker/thread_safe_compiler.rb +30 -0
- data/lib/decidim/webpacker/webpack/custom.js +15 -3
- data/lib/decidim/webpacker/webpacker.yml +1 -1
- data/lib/decidim/webpacker.rb +2 -0
- data/lib/devise/models/decidim_validatable.rb +1 -1
- data/lib/tasks/decidim_active_storage_migration_tasks.rake +1 -3
- data/lib/tasks/{decidim_data_portability_tasks.rake → decidim_download_your_data_tasks.rake} +9 -9
- data/lib/tasks/decidim_mailers_tasks.rake +23 -0
- data/lib/tasks/decidim_metrics_tasks.rake +1 -1
- data/lib/tasks/decidim_pwa_tasks.rake +18 -0
- data/lib/tasks/decidim_reminders_tasks.rake +17 -0
- data/lib/tasks/decidim_tasks.rake +6 -1
- data/lib/tasks/decidim_webpacker_tasks.rake +1 -1
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +51 -0
- metadata +186 -92
- data/app/controllers/decidim/cookie_policy_controller.rb +0 -24
- data/app/helpers/decidim/cookies_helper.rb +0 -11
- data/app/packs/src/decidim/editor/clipboard_override.js +0 -143
- data/app/packs/src/decidim/editor/clipboard_utilities.js +0 -119
- data/app/packs/src/decidim/vizzs/renders.js +0 -9
- data/app/packs/src/decidim/vizzs.js +0 -1
- data/app/packs/stylesheets/decidim/modules/_cookie-bar.scss +0 -26
- data/app/services/decidim/home_activity_search.rb +0 -80
- data/app/services/decidim/participatory_space_search.rb +0 -54
- data/app/views/decidim/cookie_policy/accept.js.erb +0 -3
- data/app/views/decidim/export_mailer/data_portability_export.html.erb +0 -7
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
- data/lib/decidim/core/test/shared_examples/mcell_examples.rb +0 -17
- data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +0 -60
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +0 -40
- data/lib/decidim/data_portability_serializers.rb +0 -23
- data/lib/decidim/middleware/rails_cookies.rb +0 -23
- /data/app/packs/src/decidim/vizzs/{metrics.js → index.js} +0 -0
- /data/app/views/decidim/application/{_document.html.erb → _document.erb} +0 -0
- /data/app/views/decidim/application/{_photos.html.erb → _photos.erb} +0 -0
- /data/app/views/decidim/{data_portability → download_your_data}/export.html.erb +0 -0
@@ -10,7 +10,7 @@ module Decidim
|
|
10
10
|
# @see BaseRenderer Examples of how to use a content renderer
|
11
11
|
class UserRenderer < BaseRenderer
|
12
12
|
# Matches a global id representing a Decidim::User
|
13
|
-
GLOBAL_ID_REGEX = %r{gid://[\w-]+/Decidim::User/\d+}
|
13
|
+
GLOBAL_ID_REGEX = %r{gid://[\w-]+/Decidim::User/\d+}
|
14
14
|
|
15
15
|
# Replaces found Global IDs matching an existing user with
|
16
16
|
# a link to their profile. The Global IDs representing an
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2016 Andy Pike - The MIT license
|
4
|
+
#
|
5
|
+
# This file has been copied from https://github.com/andypike/rectify/blob/master/lib/rectify/controller_helpers.rb
|
6
|
+
# We have done this so we can decouple Decidim from any Virtus dependency, which is a dead project
|
7
|
+
# Please follow Decidim discussion to understand more https://github.com/decidim/decidim/discussions/7234
|
8
|
+
module Decidim
|
9
|
+
module ControllerHelpers
|
10
|
+
def self.included(base_class)
|
11
|
+
base_class.helper_method(:presenter)
|
12
|
+
end
|
13
|
+
|
14
|
+
def present(presenter, options = {})
|
15
|
+
presenter_type = options.fetch(:for, :template)
|
16
|
+
|
17
|
+
presenter.attach_controller(self)
|
18
|
+
rectify_presenters[presenter_type] = presenter
|
19
|
+
end
|
20
|
+
|
21
|
+
def presenter(presenter_type = :template)
|
22
|
+
rectify_presenters[presenter_type]
|
23
|
+
end
|
24
|
+
|
25
|
+
def expose(presentation_data)
|
26
|
+
presentation_data.each do |attribute, value|
|
27
|
+
if presenter.respond_to?("#{attribute}=")
|
28
|
+
presenter.public_send("#{attribute}=", value)
|
29
|
+
else
|
30
|
+
instance_variable_set("@#{attribute}", value)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def rectify_presenters
|
38
|
+
@rectify_presenters ||= {}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "rails"
|
3
|
+
require "decidim/rails"
|
4
4
|
require "active_support/all"
|
5
5
|
require "action_view/railtie"
|
6
6
|
|
@@ -13,7 +13,6 @@ require "devise-i18n"
|
|
13
13
|
require "devise_invitable"
|
14
14
|
require "foundation_rails_helper"
|
15
15
|
require "active_link_to"
|
16
|
-
require "rectify"
|
17
16
|
require "carrierwave"
|
18
17
|
require "rails-i18n"
|
19
18
|
require "date_validator"
|
@@ -39,7 +38,7 @@ require "mime-types"
|
|
39
38
|
require "diffy"
|
40
39
|
require "social-share-button"
|
41
40
|
require "ransack"
|
42
|
-
require "
|
41
|
+
require "wisper"
|
43
42
|
require "webpacker"
|
44
43
|
|
45
44
|
# Needed for the assets:precompile task, for configuring webpacker instance
|
@@ -49,9 +48,6 @@ require "decidim/api"
|
|
49
48
|
require "decidim/middleware/strip_x_forwarded_host"
|
50
49
|
require "decidim/middleware/current_organization"
|
51
50
|
|
52
|
-
# Backport cookie handling extensions for Rails 6.0
|
53
|
-
require "decidim/middleware/rails_cookies"
|
54
|
-
|
55
51
|
module Decidim
|
56
52
|
module Core
|
57
53
|
# Decidim's core Rails Engine.
|
@@ -67,6 +63,10 @@ module Decidim
|
|
67
63
|
end
|
68
64
|
end
|
69
65
|
|
66
|
+
initializer "decidim.action_mailer" do |app|
|
67
|
+
app.config.action_mailer.deliver_later_queue_name = :mailers
|
68
|
+
end
|
69
|
+
|
70
70
|
initializer "decidim.middleware" do |app|
|
71
71
|
app.config.middleware.insert_before Warden::Manager, Decidim::Middleware::CurrentOrganization
|
72
72
|
app.config.middleware.insert_before Warden::Manager, Decidim::Middleware::StripXForwardedHost
|
@@ -92,6 +92,17 @@ module Decidim
|
|
92
92
|
Decidim::Api.add_orphan_type Decidim::Core::UserGroupType
|
93
93
|
end
|
94
94
|
|
95
|
+
initializer "decidim.ransack" do
|
96
|
+
Ransack.configure do |config|
|
97
|
+
# Avoid turning parameter values such as user_id[]=1&user_id[]=2 into
|
98
|
+
# { user_id: [true, "2"] }. This option allows us to handle the type
|
99
|
+
# convertions manually instead for each case.
|
100
|
+
# See: https://github.com/activerecord-hackery/ransack/issues/593
|
101
|
+
# See: https://github.com/activerecord-hackery/ransack/pull/742
|
102
|
+
config.sanitize_custom_scope_booleans = false
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
95
106
|
initializer "decidim.i18n_exceptions" do
|
96
107
|
ActionView::Base.raise_on_missing_translations = true unless Rails.env.production?
|
97
108
|
end
|
@@ -122,16 +133,15 @@ module Decidim
|
|
122
133
|
next if Decidim.maps.present?
|
123
134
|
next if Decidim.geocoder.blank?
|
124
135
|
|
125
|
-
legacy_api_key ||=
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
end
|
136
|
+
legacy_api_key ||= if Decidim.geocoder[:here_api_key].present?
|
137
|
+
Decidim.geocoder.fetch(:here_api_key)
|
138
|
+
elsif Decidim.geocoder[:here_app_id].present?
|
139
|
+
[
|
140
|
+
Decidim.geocoder.fetch(:here_app_id),
|
141
|
+
Decidim.geocoder.fetch(:here_app_code)
|
142
|
+
]
|
143
|
+
end
|
144
|
+
|
135
145
|
next unless legacy_api_key
|
136
146
|
|
137
147
|
ActiveSupport::Deprecation.warn(
|
@@ -167,6 +177,7 @@ module Decidim
|
|
167
177
|
|
168
178
|
Decidim.stats.register :processes_count, priority: StatsRegistry::HIGH_PRIORITY do |organization, start_at, end_at|
|
169
179
|
processes = ParticipatoryProcesses::OrganizationPrioritizedParticipatoryProcesses.new(organization)
|
180
|
+
|
170
181
|
processes = processes.where("created_at >= ?", start_at) if start_at.present?
|
171
182
|
processes = processes.where("created_at <= ?", end_at) if end_at.present?
|
172
183
|
processes.count
|
@@ -221,9 +232,9 @@ module Decidim
|
|
221
232
|
decidim.user_interests_path,
|
222
233
|
position: 1.4
|
223
234
|
|
224
|
-
menu.add_item :
|
235
|
+
menu.add_item :download_your_data,
|
225
236
|
t("my_data", scope: "layouts.decidim.user_profile"),
|
226
|
-
decidim.
|
237
|
+
decidim.download_your_data_path,
|
227
238
|
position: 1.5
|
228
239
|
|
229
240
|
menu.add_item :delete_account,
|
@@ -254,7 +265,7 @@ module Decidim
|
|
254
265
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Core::Engine.root}/app/views") # for partials
|
255
266
|
end
|
256
267
|
|
257
|
-
initializer "doorkeeper"
|
268
|
+
initializer "doorkeeper" do
|
258
269
|
Doorkeeper.configure do
|
259
270
|
orm :active_record
|
260
271
|
|
@@ -531,6 +542,11 @@ module Decidim
|
|
531
542
|
end
|
532
543
|
|
533
544
|
initializer "decidim.core.add_badges" do
|
545
|
+
Decidim::Gamification.register_badge(:invitations) do |badge|
|
546
|
+
badge.levels = [1, 5, 10, 30, 50]
|
547
|
+
badge.reset = ->(user) { Decidim::User.where(invited_by: user.id).count }
|
548
|
+
end
|
549
|
+
|
534
550
|
Decidim::Gamification.register_badge(:followers) do |badge|
|
535
551
|
badge.levels = [1, 15, 30, 60, 100]
|
536
552
|
badge.reset = ->(user) { user.followers.count }
|
@@ -17,8 +17,8 @@ FactoryBot.define do
|
|
17
17
|
"#{Faker::Lorem.sentence(word_count: 3)} #{n}".delete("'")
|
18
18
|
end
|
19
19
|
|
20
|
-
sequence(:name) do |
|
21
|
-
|
20
|
+
sequence(:name) do |_|
|
21
|
+
Faker::Name.name.delete("'")
|
22
22
|
end
|
23
23
|
|
24
24
|
sequence(:nickname) do |n|
|
@@ -125,8 +125,6 @@ FactoryBot.define do
|
|
125
125
|
|
126
126
|
factory :user, class: "Decidim::User" do
|
127
127
|
email { generate(:email) }
|
128
|
-
password { "decidim123456" }
|
129
|
-
password_confirmation { password }
|
130
128
|
name { generate(:name) }
|
131
129
|
nickname { generate(:nickname) }
|
132
130
|
organization
|
@@ -137,8 +135,10 @@ FactoryBot.define do
|
|
137
135
|
about { "<script>alert(\"ABOUT\");</script>#{Faker::Lorem.paragraph(sentence_count: 2)}" }
|
138
136
|
confirmation_sent_at { Time.current }
|
139
137
|
accepted_tos_version { organization.tos_version }
|
140
|
-
|
138
|
+
notifications_sending_frequency { "real_time" }
|
141
139
|
email_on_moderations { true }
|
140
|
+
password_updated_at { Time.current }
|
141
|
+
previous_passwords { [] }
|
142
142
|
extended_data { {} }
|
143
143
|
|
144
144
|
trait :confirmed do
|
@@ -148,7 +148,7 @@ FactoryBot.define do
|
|
148
148
|
trait :blocked do
|
149
149
|
blocked { true }
|
150
150
|
blocked_at { Time.current }
|
151
|
-
extended_data { {
|
151
|
+
extended_data { { user_name: generate(:name) } }
|
152
152
|
name { "Blocked user" }
|
153
153
|
end
|
154
154
|
|
@@ -183,6 +183,14 @@ FactoryBot.define do
|
|
183
183
|
officialized_at { Time.current }
|
184
184
|
officialized_as { generate_localized_title }
|
185
185
|
end
|
186
|
+
|
187
|
+
after(:build) do |user, evaluator|
|
188
|
+
# We have specs that call e.g. `create(:user, admin: true)` where we need
|
189
|
+
# to do this to ensure the user creation does not fail due to the short
|
190
|
+
# password.
|
191
|
+
user.password ||= evaluator.password || "decidim123456789"
|
192
|
+
user.password_confirmation ||= evaluator.password_confirmation || user.password
|
193
|
+
end
|
186
194
|
end
|
187
195
|
|
188
196
|
factory :participatory_space_private_user, class: "Decidim::ParticipatorySpacePrivateUser" do
|
@@ -226,20 +234,13 @@ FactoryBot.define do
|
|
226
234
|
confirmed_at { Time.current }
|
227
235
|
end
|
228
236
|
|
229
|
-
trait :blocked do
|
230
|
-
blocked { true }
|
231
|
-
blocked_at { Time.current }
|
232
|
-
extended_data { { user_name: generate(:name) } }
|
233
|
-
name { "Blocked user group" }
|
234
|
-
end
|
235
|
-
|
236
237
|
after(:build) do |user_group, evaluator|
|
237
|
-
user_group.extended_data =
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
238
|
+
user_group.extended_data = {
|
239
|
+
document_number: evaluator.document_number,
|
240
|
+
phone: evaluator.phone,
|
241
|
+
rejected_at: evaluator.rejected_at,
|
242
|
+
verified_at: evaluator.verified_at
|
243
|
+
}
|
243
244
|
end
|
244
245
|
|
245
246
|
after(:create) do |user_group, evaluator|
|
@@ -721,8 +722,8 @@ FactoryBot.define do
|
|
721
722
|
|
722
723
|
factory :user_report, class: "Decidim::UserReport" do
|
723
724
|
reason { "spam" }
|
724
|
-
moderation {
|
725
|
-
user { build(:user
|
725
|
+
moderation { create(:user_moderation, user: user) }
|
726
|
+
user { build(:user) }
|
726
727
|
end
|
727
728
|
|
728
729
|
factory :user_moderation, class: "Decidim::UserModeration" do
|
@@ -763,4 +764,36 @@ FactoryBot.define do
|
|
763
764
|
author { create(:user, :admin, :confirmed, organization: organization) }
|
764
765
|
file { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
|
765
766
|
end
|
767
|
+
|
768
|
+
factory :reminder, class: "Decidim::Reminder" do
|
769
|
+
user { build(:user) }
|
770
|
+
component { build(:dummy_component, organization: user.organization) }
|
771
|
+
end
|
772
|
+
|
773
|
+
factory :reminder_record, class: "Decidim::ReminderRecord" do
|
774
|
+
reminder { create(:reminder) }
|
775
|
+
remindable { build(:dummy_resource) }
|
776
|
+
end
|
777
|
+
|
778
|
+
factory :reminder_delivery, class: "Decidim::ReminderDelivery" do
|
779
|
+
reminder { create(:reminder) }
|
780
|
+
end
|
781
|
+
|
782
|
+
factory :short_link, class: "Decidim::ShortLink" do
|
783
|
+
target { create(:component, manifest_name: "dummy") }
|
784
|
+
route_name { nil }
|
785
|
+
params { {} }
|
786
|
+
|
787
|
+
before(:create) do |object|
|
788
|
+
object.organization ||= object.target if object.target.is_a?(Decidim::Organization)
|
789
|
+
object.organization ||= object.target.try(:organization) || create(:organization)
|
790
|
+
object.identifier ||= Decidim::ShortLink.unique_identifier_within(object.organization)
|
791
|
+
object.mounted_engine_name ||=
|
792
|
+
if object.target.respond_to?(:participatory_space)
|
793
|
+
"decidim_#{object.target.participatory_space.underscored_name}_dummy"
|
794
|
+
else
|
795
|
+
"decidim"
|
796
|
+
end
|
797
|
+
end
|
798
|
+
end
|
766
799
|
end
|
@@ -4,8 +4,14 @@ shared_examples "admin creates resource gallery" do
|
|
4
4
|
context "when uploading images" do
|
5
5
|
let(:uploaded_photos) do
|
6
6
|
[
|
7
|
-
|
8
|
-
|
7
|
+
{
|
8
|
+
title: "Picture of the city",
|
9
|
+
file: ActiveStorage::Blob.create_and_upload!(io: Decidim::Dev.test_file("city.jpeg", "image/jpeg"), filename: "city.jpeg").signed_id
|
10
|
+
},
|
11
|
+
{
|
12
|
+
title: "Picture of another city",
|
13
|
+
file: ActiveStorage::Blob.create_and_upload!(io: Decidim::Dev.test_file("city2.jpeg", "image/jpeg"), filename: "city2.jpeg").signed_id
|
14
|
+
}
|
9
15
|
]
|
10
16
|
end
|
11
17
|
let(:photos) { [] }
|
@@ -33,8 +39,14 @@ shared_examples "admin manages resource gallery" do
|
|
33
39
|
context "when managing images" do
|
34
40
|
let(:uploaded_photos) do
|
35
41
|
[
|
36
|
-
|
37
|
-
|
42
|
+
{
|
43
|
+
title: "Picture of the city",
|
44
|
+
file: ActiveStorage::Blob.create_and_upload!(io: Decidim::Dev.test_file("city.jpeg", "image/jpeg"), filename: "city.jpeg").signed_id
|
45
|
+
},
|
46
|
+
{
|
47
|
+
title: "Picture of another city",
|
48
|
+
file: ActiveStorage::Blob.create_and_upload!(io: Decidim::Dev.test_file("city2.jpeg", "image/jpeg"), filename: "city2.jpeg").signed_id
|
49
|
+
}
|
38
50
|
]
|
39
51
|
end
|
40
52
|
let(:photos) { [] }
|
@@ -25,7 +25,7 @@ shared_examples_for "authorable interface" do
|
|
25
25
|
model.update(author: author, user_group: nil)
|
26
26
|
end
|
27
27
|
|
28
|
-
it "includes the user's
|
28
|
+
it "includes the user's name" do
|
29
29
|
expect(response["author"]["name"]).to eq(author.name)
|
30
30
|
end
|
31
31
|
end
|
@@ -38,9 +38,22 @@ shared_examples_for "authorable interface" do
|
|
38
38
|
model.update(user_group: user_group, author: nil)
|
39
39
|
end
|
40
40
|
|
41
|
-
it "includes the user's
|
41
|
+
it "includes the user group's name" do
|
42
42
|
expect(response["author"]["name"]).to eq(user_group.name)
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
describe "with an organization" do
|
47
|
+
let(:organization) { model.participatory_space.organization }
|
48
|
+
let(:query) { "{ author { name } }" }
|
49
|
+
|
50
|
+
before do
|
51
|
+
model.update(author: organization, user_group: nil)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "does not return a main author" do
|
55
|
+
expect(response["author"]).to eq(nil)
|
56
|
+
end
|
57
|
+
end
|
45
58
|
end
|
46
59
|
end
|
@@ -65,7 +65,7 @@ shared_examples_for "coauthorable interface" do
|
|
65
65
|
expect(response["authors"]).to include("name" => coauthor.name)
|
66
66
|
end
|
67
67
|
|
68
|
-
it "
|
68
|
+
it "does not return a main author" do
|
69
69
|
expect(response["author"]).to eq(nil)
|
70
70
|
end
|
71
71
|
end
|
@@ -82,7 +82,7 @@ shared_examples_for "coauthorable interface" do
|
|
82
82
|
expect(response["authors"]).to include("name" => coauthor.name)
|
83
83
|
end
|
84
84
|
|
85
|
-
it "
|
85
|
+
it "does not return a main author" do
|
86
86
|
expect(response["author"]).to eq(nil)
|
87
87
|
end
|
88
88
|
end
|
@@ -121,6 +121,209 @@ shared_examples "comments" do
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
+
it "updates the numbers of characters left correctly" do
|
125
|
+
within ".add-comment form" do
|
126
|
+
fill_in "add-comment-#{commentable.commentable_type.demodulize}-#{commentable.id}", with: "This is a new comment."
|
127
|
+
expect(page).to have_content("1978 characters left")
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
context "when working with the screen reader character counter" do
|
132
|
+
let(:field_id) { "add-comment-#{commentable.commentable_type.demodulize}-#{commentable.id}" }
|
133
|
+
let(:field) { page.find("##{field_id}") }
|
134
|
+
|
135
|
+
before do
|
136
|
+
# Make sure the focus stays in the comment form during these tests
|
137
|
+
# because only then the screen reader
|
138
|
+
page.execute_script("document.getElementById('#{field_id}').focus()")
|
139
|
+
end
|
140
|
+
|
141
|
+
it "updates the numbers of characters left correctly for screen reader" do
|
142
|
+
within ".add-comment form" do
|
143
|
+
fill_in field_id, with: "This is a new comment."
|
144
|
+
|
145
|
+
# The screen reader character counter should update only when the user
|
146
|
+
# reaches 10% interval of the total characters available not to
|
147
|
+
# announce the remaining characters after every keystroke.
|
148
|
+
field.native.send_keys " Sending some new text."
|
149
|
+
within ".remaining-character-count" do
|
150
|
+
expect(page).to have_content("1955 characters left") # Normal
|
151
|
+
end
|
152
|
+
within ".remaining-character-count-sr" do
|
153
|
+
expect(page).to have_content("2000 characters left") # Screen reader
|
154
|
+
end
|
155
|
+
|
156
|
+
# After 10% of the total characters is reached, it should be updated
|
157
|
+
# to the screen reader section to announce it.
|
158
|
+
field.native.send_keys "a" * 155
|
159
|
+
within ".remaining-character-count" do
|
160
|
+
expect(page).to have_content("1800 characters left") # Normal
|
161
|
+
end
|
162
|
+
within ".remaining-character-count-sr" do
|
163
|
+
expect(page).to have_content("1800 characters left") # Screen reader
|
164
|
+
end
|
165
|
+
|
166
|
+
# After continuing typing after the announcement, the screen reader
|
167
|
+
# characters should stay the same (announced on the next 10%
|
168
|
+
# interval).
|
169
|
+
field.native.send_keys "b"
|
170
|
+
within ".remaining-character-count" do
|
171
|
+
expect(page).to have_content("1799 characters left") # Normal
|
172
|
+
end
|
173
|
+
within ".remaining-character-count-sr" do
|
174
|
+
expect(page).to have_content("1800 characters left") # Screen reader
|
175
|
+
end
|
176
|
+
|
177
|
+
# When text is removed at the interval, the screen reader should
|
178
|
+
# update back to the previous interval.
|
179
|
+
field.native.send_keys [:backspace, :backspace, :backspace, :backspace]
|
180
|
+
within ".remaining-character-count" do
|
181
|
+
expect(page).to have_content("1803 characters left") # Normal
|
182
|
+
end
|
183
|
+
within ".remaining-character-count-sr" do
|
184
|
+
expect(page).to have_content("1800 characters left") # Screen reader
|
185
|
+
end
|
186
|
+
|
187
|
+
# After continuing typing after the removal of characters, we should
|
188
|
+
# stay in the "latest announcement" not to confuse the user as
|
189
|
+
# - "1800 characters left" (actual 1803)
|
190
|
+
# - Type in one character
|
191
|
+
# - "1900 characters left" (actual 1802)
|
192
|
+
field.native.send_keys "b"
|
193
|
+
within ".remaining-character-count" do
|
194
|
+
expect(page).to have_content("1802 characters left") # Normal
|
195
|
+
end
|
196
|
+
within ".remaining-character-count-sr" do
|
197
|
+
expect(page).to have_content("1800 characters left") # Screen reader
|
198
|
+
end
|
199
|
+
|
200
|
+
# After the input is blurred, the screen reader character counter
|
201
|
+
# should show the actual amount of characters left.
|
202
|
+
page.execute_script("document.getElementById('#{field_id}').blur()")
|
203
|
+
within ".remaining-character-count" do
|
204
|
+
expect(page).to have_content("1802 characters left") # Normal
|
205
|
+
end
|
206
|
+
within ".remaining-character-count-sr" do
|
207
|
+
expect(page).to have_content("1802 characters left") # Screen reader
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
context "when reaching the announce after every threshold" do
|
213
|
+
it "updates the numbers of characters left correctly for screen reader" do
|
214
|
+
within ".add-comment form" do
|
215
|
+
# Test that when reaching the "announce after every" threshold, the
|
216
|
+
# characters are announced after every keystroke.
|
217
|
+
fill_in field_id, with: "a" * 1989
|
218
|
+
within ".remaining-character-count" do
|
219
|
+
expect(page).to have_content("11 characters left") # Normal
|
220
|
+
end
|
221
|
+
within ".remaining-character-count-sr" do
|
222
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
223
|
+
end
|
224
|
+
|
225
|
+
(2..10).reverse_each do |remaining|
|
226
|
+
field.native.send_keys "b"
|
227
|
+
within ".remaining-character-count-sr" do
|
228
|
+
expect(page).to have_content("#{remaining} characters left")
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
field.native.send_keys "b"
|
233
|
+
within ".remaining-character-count-sr" do
|
234
|
+
expect(page).to have_content("1 character left")
|
235
|
+
end
|
236
|
+
|
237
|
+
field.native.send_keys "c"
|
238
|
+
within ".remaining-character-count-sr" do
|
239
|
+
expect(page).to have_content("0 characters left")
|
240
|
+
end
|
241
|
+
|
242
|
+
# Test that the SR counter will stick at the last announced
|
243
|
+
# threshold if the next threshold is not hit and text is removed.
|
244
|
+
# This prevents weird announcements such as:
|
245
|
+
# - 0 characters left
|
246
|
+
# - Remove 10 characters
|
247
|
+
# - 10 characters left
|
248
|
+
# - Remove 1 character
|
249
|
+
# - 200 characters left
|
250
|
+
page.execute_script("document.getElementById('#{field_id}').setSelectionRange(1850, 2000)")
|
251
|
+
field.native.send_keys [:backspace]
|
252
|
+
within ".remaining-character-count" do
|
253
|
+
expect(page).to have_content("150 characters left") # Normal
|
254
|
+
end
|
255
|
+
within ".remaining-character-count-sr" do
|
256
|
+
expect(page).to have_content("0 characters left") # Screen reader
|
257
|
+
end
|
258
|
+
|
259
|
+
field.native.send_keys "d"
|
260
|
+
within ".remaining-character-count-sr" do
|
261
|
+
expect(page).to have_content("0 characters left")
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
context "when deleting text the announce after every threshold" do
|
268
|
+
it "updates the numbers of characters left correctly for screen reader" do
|
269
|
+
within ".add-comment form" do
|
270
|
+
fill_in field_id, with: "a" * 2000
|
271
|
+
within ".remaining-character-count" do
|
272
|
+
expect(page).to have_content("0 characters left") # Normal
|
273
|
+
end
|
274
|
+
within ".remaining-character-count-sr" do
|
275
|
+
expect(page).to have_content("0 characters left") # Screen reader
|
276
|
+
end
|
277
|
+
|
278
|
+
# Test that the SR counter updates correctly after hitting the
|
279
|
+
# next threshold.
|
280
|
+
page.execute_script("document.getElementById('#{field_id}').setSelectionRange(1800, 2000)")
|
281
|
+
field.native.send_keys [:backspace]
|
282
|
+
within ".remaining-character-count" do
|
283
|
+
expect(page).to have_content("200 characters left") # Normal
|
284
|
+
end
|
285
|
+
within ".remaining-character-count-sr" do
|
286
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
287
|
+
end
|
288
|
+
|
289
|
+
# The SR counter should stay at the correct boundary.
|
290
|
+
field.native.send_keys [:backspace, :backspace]
|
291
|
+
within ".remaining-character-count" do
|
292
|
+
expect(page).to have_content("202 characters left") # Normal
|
293
|
+
end
|
294
|
+
within ".remaining-character-count-sr" do
|
295
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
296
|
+
end
|
297
|
+
|
298
|
+
# It stays at the correct boundary when starting to type again.
|
299
|
+
field.native.send_keys "b"
|
300
|
+
within ".remaining-character-count" do
|
301
|
+
expect(page).to have_content("201 characters left") # Normal
|
302
|
+
end
|
303
|
+
within ".remaining-character-count-sr" do
|
304
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
305
|
+
end
|
306
|
+
|
307
|
+
field.native.send_keys "c"
|
308
|
+
within ".remaining-character-count" do
|
309
|
+
expect(page).to have_content("200 characters left") # Normal
|
310
|
+
end
|
311
|
+
within ".remaining-character-count-sr" do
|
312
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
313
|
+
end
|
314
|
+
|
315
|
+
field.native.send_keys "d"
|
316
|
+
within ".remaining-character-count" do
|
317
|
+
expect(page).to have_content("199 characters left") # Normal
|
318
|
+
end
|
319
|
+
within ".remaining-character-count-sr" do
|
320
|
+
expect(page).to have_content("200 characters left") # Screen reader
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
124
327
|
context "when component is present and has a default comments length params" do
|
125
328
|
it "displays the numbers of characters left" do
|
126
329
|
if component.present?
|
@@ -15,7 +15,7 @@ shared_examples "email with logo" do
|
|
15
15
|
|
16
16
|
it "includes organization logo with full link" do
|
17
17
|
expect(mail.body).to include("alt=\"#{organization.name}\"")
|
18
|
-
expect(mail.body).to match(%r{https{0,1}://#{organization.host}#{logo_path}})
|
18
|
+
expect(mail.body).to match(%r{https{0,1}://#{organization.host}:#{Capybara.server_port}#{logo_path}})
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -24,7 +24,7 @@ shared_context "with frontend map builder" do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
let(:organization) { create(:organization) }
|
27
|
-
let(:template) { template_class.new(ActionView::LookupContext.new(
|
27
|
+
let(:template) { template_class.new(ActionView::LookupContext.new(ActionController::Base.view_paths), {}, []) }
|
28
28
|
let(:options) { {} }
|
29
29
|
let(:js_options) { options.transform_keys { |k| k.to_s.camelize(:lower) }.to_h }
|
30
30
|
|
@@ -103,6 +103,7 @@ shared_context "with frontend map elements" do
|
|
103
103
|
final_html = html_document
|
104
104
|
Rails.application.routes.draw do
|
105
105
|
get "test_dynamic_map", to: ->(_) { [200, {}, [final_html]] }
|
106
|
+
get "offline", to: ->(_) { [200, {}, [""]] }
|
106
107
|
end
|
107
108
|
|
108
109
|
visit "/test_dynamic_map"
|
@@ -180,7 +181,6 @@ shared_examples "a record with front-end geocoding address field" do |geocoded_m
|
|
180
181
|
it "calls the front-end geocoder when an address is written", :slow do
|
181
182
|
within view_options[:within_selector] do
|
182
183
|
fill_in_geocoding view_options[:address_field], with: geocoded_address_value
|
183
|
-
find(".tribute-container ul#results li", match: :first).click
|
184
184
|
find("*[type=submit]").click
|
185
185
|
end
|
186
186
|
|