decidim-core 0.28.4 → 0.29.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/cells/decidim/activities_cell.rb +0 -1
- data/app/cells/decidim/activity_cell.rb +5 -7
- data/app/cells/decidim/address/online.erb +2 -2
- data/app/cells/decidim/address_cell.rb +3 -9
- data/app/cells/decidim/amendable/amend_button_card_cell.rb +0 -2
- data/app/cells/decidim/amendable/amendments_cell.rb +0 -2
- data/app/cells/decidim/amendable/announcement_cell.rb +10 -14
- data/app/cells/decidim/amendable/emendation_actions_cell.rb +0 -2
- data/app/cells/decidim/amendable/promote_button_card_cell.rb +0 -2
- data/app/cells/decidim/amendable/wizard_step_form_cell.rb +6 -19
- data/app/cells/decidim/announcement/show.erb +1 -1
- data/app/cells/decidim/announcement_cell.rb +6 -2
- data/app/cells/decidim/attachments_file_tab/show.erb +3 -0
- data/app/cells/decidim/attachments_file_tab_cell.rb +11 -0
- data/app/cells/decidim/attachments_link_tab/show.erb +12 -0
- data/app/cells/decidim/attachments_link_tab_cell.rb +21 -0
- data/app/cells/decidim/author/flag.erb +2 -2
- data/app/cells/decidim/author_cell.rb +0 -2
- data/app/cells/decidim/authorization_modal_cell.rb +0 -3
- data/app/cells/decidim/badge_cell.rb +0 -4
- data/app/cells/decidim/badges_cell.rb +0 -2
- data/app/cells/decidim/button_cell.rb +0 -3
- data/app/cells/decidim/card_cell.rb +1 -5
- data/app/cells/decidim/card_g/show.erb +1 -1
- data/app/cells/decidim/card_g_cell.rb +4 -7
- data/app/cells/decidim/card_l/image.erb +2 -2
- data/app/cells/decidim/card_l/space.erb +1 -1
- data/app/cells/decidim/card_l_cell.rb +3 -8
- data/app/cells/decidim/card_metadata_cell.rb +1 -5
- data/app/cells/decidim/card_s_cell.rb +1 -4
- data/app/cells/decidim/coauthorships_cell.rb +0 -2
- data/app/cells/decidim/comments_button_cell.rb +0 -2
- data/app/cells/decidim/content_blocks/footer_sub_hero/show.erb +1 -1
- data/app/cells/decidim/content_blocks/footer_sub_hero_cell.rb +0 -3
- data/app/cells/decidim/content_blocks/hero/show.erb +1 -1
- data/app/cells/decidim/content_blocks/hero_cell.rb +1 -2
- data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +0 -2
- data/app/cells/decidim/content_blocks/how_to_participate/show.erb +1 -1
- data/app/cells/decidim/content_blocks/how_to_participate_cell.rb +0 -1
- data/app/cells/decidim/content_blocks/participatory_space_documents/content.erb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_documents_cell.rb +17 -1
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +2 -4
- data/app/cells/decidim/content_blocks/participatory_space_last_activity_cell.rb +1 -3
- data/app/cells/decidim/content_blocks/stats/show.erb +1 -1
- data/app/cells/decidim/content_blocks/stats_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/sub_hero_cell.rb +0 -3
- data/app/cells/decidim/date_range/show.erb +10 -10
- data/app/cells/decidim/date_range_cell.rb +0 -2
- data/app/cells/decidim/diff_cell.rb +0 -1
- data/app/cells/decidim/documents_panel/show.erb +4 -0
- data/app/cells/decidim/documents_panel_cell.rb +9 -1
- data/app/cells/decidim/endorsement_buttons_cell.rb +6 -14
- data/app/cells/decidim/flag_modal/flag_user.erb +3 -3
- data/app/cells/decidim/followers_cell.rb +0 -1
- data/app/cells/decidim/following_cell.rb +0 -1
- data/app/cells/decidim/footer_topics/show.erb +8 -0
- data/app/cells/decidim/footer_topics_cell.rb +39 -0
- data/app/cells/decidim/groups_cell.rb +0 -3
- data/app/cells/decidim/linked_resources_for_cell.rb +0 -3
- data/app/cells/decidim/members_cell.rb +0 -1
- data/app/cells/decidim/nav_links/show.erb +3 -3
- data/app/cells/decidim/navbar_admin_link_cell.rb +0 -2
- data/app/cells/decidim/newsletter_templates/base_cell.rb +0 -1
- data/app/cells/decidim/newsletter_templates/basic_only_text/show.erb +2 -2
- data/app/cells/decidim/newsletter_templates/image_text_cta/show.erb +2 -2
- data/app/cells/decidim/notification/show.erb +5 -0
- data/app/cells/decidim/notification_actions/base_cell.rb +13 -0
- data/app/cells/decidim/notification_actions/buttons/show.erb +5 -0
- data/app/cells/decidim/notification_actions/buttons_cell.rb +41 -0
- data/app/cells/decidim/notification_cell.rb +9 -3
- data/app/cells/decidim/notifications_cell.rb +0 -1
- data/app/cells/decidim/pad_iframe/show.erb +2 -2
- data/app/cells/decidim/pad_iframe_cell.rb +0 -1
- data/app/cells/decidim/participatory_space_dropdown_metadata_cell.rb +1 -2
- data/app/cells/decidim/photo_cell.rb +1 -5
- data/app/cells/decidim/photos_list_cell.rb +0 -2
- data/app/cells/decidim/profile_cell.rb +0 -2
- data/app/cells/decidim/profile_sidebar/show.erb +20 -20
- data/app/cells/decidim/profile_sidebar_cell.rb +1 -10
- data/app/cells/decidim/progress_bar/show.erb +8 -6
- data/app/cells/decidim/public_participation/show.erb +1 -1
- data/app/cells/decidim/report_button/flag_modal.erb +1 -1
- data/app/cells/decidim/resource_types_filter/show.erb +12 -11
- data/app/cells/decidim/resource_types_filter_cell.rb +0 -2
- data/app/cells/decidim/scopes_picker/show.erb +1 -1
- data/app/cells/decidim/scopes_picker_cell.rb +0 -1
- data/app/cells/decidim/search_results_cell.rb +1 -1
- data/app/cells/decidim/statistic_cell.rb +0 -2
- data/app/cells/decidim/tab_panels/show.erb +1 -1
- data/app/cells/decidim/tab_panels_cell.rb +12 -2
- data/app/cells/decidim/tags_cell.rb +0 -2
- data/app/cells/decidim/tos_page_cell.rb +0 -3
- data/app/cells/decidim/translation_bar/show.erb +1 -1
- data/app/cells/decidim/translation_bar_cell.rb +0 -2
- data/app/cells/decidim/upload_modal/files.erb +1 -1
- data/app/cells/decidim/upload_modal_cell.rb +1 -3
- data/app/cells/decidim/user_conversation/new.erb +1 -1
- data/app/cells/decidim/user_conversation/show.erb +1 -1
- data/app/cells/decidim/user_conversation_cell.rb +0 -1
- data/app/cells/decidim/user_conversations/show.erb +1 -1
- data/app/cells/decidim/user_conversations_cell.rb +0 -1
- data/app/cells/decidim/user_group_pending_invitations_list_cell.rb +0 -1
- data/app/cells/decidim/user_group_pending_requests_list_cell.rb +0 -1
- data/app/cells/decidim/user_timeline/show.erb +1 -1
- data/app/cells/decidim/version_cell.rb +3 -5
- data/app/cells/decidim/versions_list_cell.rb +1 -3
- data/app/cells/decidim/versions_list_item_cell.rb +2 -4
- data/app/cells/decidim/wizard_step_form/wizard_aside.erb +2 -2
- data/app/cells/decidim/wizard_step_form/wizard_header.erb +2 -3
- data/app/cells/decidim/wizard_step_form_cell.rb +0 -8
- data/app/commands/decidim/amendable/create_draft.rb +4 -4
- data/app/commands/decidim/amendable/promote.rb +3 -2
- data/app/commands/decidim/amendable/publish_draft.rb +3 -2
- data/app/commands/decidim/amendable/update_draft.rb +4 -3
- data/app/commands/decidim/amendable/withdraw.rb +1 -1
- data/app/commands/decidim/create_follow.rb +4 -4
- data/app/commands/decidim/create_omniauth_registration.rb +4 -10
- data/app/commands/decidim/create_report.rb +3 -3
- data/app/commands/decidim/create_user_report.rb +5 -5
- data/app/commands/decidim/delete_follow.rb +4 -4
- data/app/commands/decidim/demote_membership.rb +2 -2
- data/app/commands/decidim/destroy_account.rb +21 -19
- data/app/commands/decidim/endorse_resource.rb +1 -1
- data/app/commands/decidim/invite_user_to_group.rb +5 -4
- data/app/commands/decidim/update_account.rb +24 -22
- data/app/commands/decidim/update_notifications_settings.rb +13 -11
- data/app/commands/decidim/update_password.rb +7 -7
- data/app/commands/decidim/update_user_interests.rb +9 -7
- data/app/controllers/concerns/decidim/devise_authentication_methods.rb +1 -1
- data/app/controllers/concerns/decidim/devise_controllers.rb +2 -1
- data/app/controllers/concerns/decidim/filter_resource.rb +1 -1
- data/app/controllers/concerns/decidim/needs_rtl_direction.rb +23 -0
- data/app/controllers/concerns/decidim/paginable.rb +1 -1
- data/app/controllers/concerns/decidim/participatory_space_context.rb +1 -23
- data/app/controllers/concerns/decidim/payload_info.rb +2 -1
- data/app/controllers/concerns/decidim/registers_permissions.rb +4 -4
- data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
- data/app/controllers/concerns/decidim/withdrawable.rb +1 -1
- data/app/controllers/decidim/account_controller.rb +2 -2
- data/app/controllers/{concerns/decidim → decidim}/amendments_controller.rb +3 -16
- data/app/controllers/decidim/application_controller.rb +1 -1
- data/app/controllers/decidim/components/base_controller.rb +1 -1
- data/app/controllers/decidim/devise/invitations_controller.rb +1 -1
- data/app/controllers/decidim/devise/passwords_controller.rb +2 -2
- data/app/controllers/decidim/endorsements_controller.rb +1 -1
- data/app/controllers/decidim/favicon_controller.rb +1 -1
- data/app/controllers/decidim/follows_controller.rb +2 -2
- data/app/controllers/decidim/group_invites_controller.rb +36 -9
- data/app/controllers/decidim/newsletters_opt_in_controller.rb +1 -1
- data/app/controllers/decidim/notifications_settings_controller.rb +1 -1
- data/app/controllers/decidim/report_users_controller.rb +1 -1
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/controllers/decidim/user_interests_controller.rb +1 -1
- data/app/events/decidim/change_nickname_event.rb +0 -1
- data/app/events/decidim/invited_to_group_event.rb +29 -0
- data/app/events/decidim/welcome_notification_event.rb +2 -4
- data/app/forms/decidim/form.rb +4 -0
- data/app/forms/decidim/omniauth_registration_form.rb +1 -1
- data/app/forms/decidim/upload_validation_form.rb +2 -2
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +1 -1
- data/app/helpers/decidim/amendments_helper.rb +4 -14
- data/app/helpers/decidim/application_helper.rb +8 -0
- data/app/helpers/decidim/authorization_form_helper.rb +2 -2
- data/app/helpers/decidim/breadcrumb_helper.rb +1 -1
- data/app/helpers/decidim/cells_helper.rb +1 -1
- data/app/helpers/decidim/check_boxes_tree_helper.rb +1 -1
- data/app/helpers/decidim/datalist_select_helper.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +3 -3
- data/app/helpers/decidim/filters_helper.rb +1 -1
- data/app/helpers/decidim/layout_helper.rb +1 -64
- data/app/helpers/decidim/localized_locales_helper.rb +1 -1
- data/app/helpers/decidim/menu_helper.rb +9 -1
- data/app/helpers/decidim/meta_tags_helper.rb +26 -23
- data/app/helpers/decidim/modal_helper.rb +1 -1
- data/app/helpers/decidim/orders_helper.rb +1 -1
- data/app/helpers/decidim/organization_helper.rb +55 -0
- data/app/helpers/decidim/paginate_helper.rb +5 -3
- data/app/helpers/decidim/resource_helper.rb +0 -7
- data/app/helpers/decidim/scopes_helper.rb +3 -4
- data/app/helpers/decidim/searches_helper.rb +1 -1
- data/app/helpers/decidim/short_link_helper.rb +2 -2
- data/app/helpers/decidim/translations_helper.rb +2 -2
- data/app/helpers/decidim/twitter_search_helper.rb +1 -1
- data/app/helpers/decidim/user_profile_helper.rb +0 -1
- data/app/jobs/decidim/email_notifications_digest_generator_job.rb +2 -2
- data/app/mailers/decidim/application_mailer.rb +6 -2
- data/app/mailers/decidim/block_user_mailer.rb +1 -1
- data/app/mailers/decidim/decidim_devise_mailer.rb +7 -1
- data/app/mailers/decidim/newsletter_mailer.rb +1 -4
- data/app/mailers/decidim/newsletters_opt_in_mailer.rb +2 -2
- data/app/mailers/decidim/notification_mailer.rb +0 -1
- data/app/mailers/decidim/notifications_digest_mailer.rb +0 -1
- data/app/mailers/decidim/reported_mailer.rb +6 -3
- data/app/mailers/decidim/user_report_mailer.rb +1 -1
- data/app/models/decidim/action_log.rb +2 -12
- data/app/models/decidim/area_type.rb +1 -1
- data/app/models/decidim/attachment.rb +28 -4
- data/app/models/decidim/authorization.rb +1 -1
- data/app/models/decidim/authorization_transfer.rb +1 -0
- data/app/models/decidim/component.rb +3 -6
- data/app/models/decidim/content_block.rb +3 -3
- data/app/models/decidim/messaging/message.rb +2 -2
- data/app/models/decidim/newsletter.rb +9 -9
- data/app/models/decidim/notification.rb +2 -2
- data/app/models/decidim/organization.rb +23 -2
- data/app/models/decidim/push_notification_message.rb +1 -1
- data/app/models/decidim/resource_link.rb +1 -1
- data/app/models/decidim/user.rb +14 -14
- data/app/models/decidim/user_group.rb +2 -2
- data/app/packs/src/decidim/a11y.js +61 -11
- data/app/packs/src/decidim/append_redirect_url_to_modals.js +12 -14
- data/app/packs/src/decidim/attachments/file_or_link_tabs.js +55 -0
- data/app/packs/src/decidim/attachments/index.js +1 -0
- data/app/packs/src/decidim/back_to_list.js +1 -1
- data/app/packs/src/decidim/check_boxes_tree.js +1 -1
- data/app/packs/src/decidim/data_consent/consent_manager.js +1 -1
- data/app/packs/src/decidim/data_consent/consent_manager.test.js +6 -6
- data/app/packs/src/decidim/data_consent/index.js +1 -1
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +243 -0
- data/app/packs/src/decidim/datepicker/datepicker_listeners.js +78 -0
- data/app/packs/src/decidim/datepicker/form_datepicker.js +91 -0
- data/app/packs/src/decidim/datepicker/generate_datepicker.js +148 -0
- data/app/packs/src/decidim/datepicker/generate_timepicker.js +298 -0
- data/app/packs/src/decidim/datepicker/test/date.test.js +118 -0
- data/app/packs/src/decidim/datepicker/test/time.test.js +227 -0
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +0 -3
- data/app/packs/src/decidim/editor/extensions/indent/index.js +1 -1
- data/app/packs/src/decidim/editor/extensions/video_embed/index.js +4 -4
- data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +0 -15
- data/app/packs/src/decidim/editor/test/extensions/indent.test.js +1 -1
- data/app/packs/src/decidim/editor/test/fixtures/upload_templates.js +1 -1
- data/app/packs/src/decidim/editor/test/helpers.js +1 -14
- data/app/packs/src/decidim/editor/utilities/paste_transform.js +2 -2
- data/app/packs/src/decidim/external_domain_warning.js +2 -2
- data/app/packs/src/decidim/external_domain_warning.test.js +4 -4
- data/app/packs/src/decidim/form_filter.js +4 -4
- data/app/packs/src/decidim/impersonation.js +1 -1
- data/app/packs/src/decidim/index.js +11 -5
- data/app/packs/src/decidim/input_character_counter.js +2 -2
- data/app/packs/src/decidim/input_emoji.js +171 -72
- data/app/packs/src/decidim/input_hashtags.js +1 -1
- data/app/packs/src/decidim/input_mentions.js +1 -1
- data/app/packs/src/decidim/notifications_actions.js +40 -0
- data/app/packs/src/decidim/sticky_header.js +87 -0
- data/app/packs/src/decidim/sw/sw.js +8 -6
- data/app/packs/src/decidim/tooltips.js +1 -1
- data/app/packs/stylesheets/decidim/_buttons.scss +1 -1
- data/app/packs/stylesheets/decidim/_datepicker.scss +193 -0
- data/app/packs/stylesheets/decidim/_dropdown.scss +45 -9
- data/app/packs/stylesheets/decidim/_emoji.scss +36 -0
- data/app/packs/stylesheets/decidim/_filters.scss +4 -2
- data/app/packs/stylesheets/decidim/_flash.scss +2 -2
- data/app/packs/stylesheets/decidim/_footer.scss +1 -3
- data/app/packs/stylesheets/decidim/_forms.scss +13 -5
- data/app/packs/stylesheets/decidim/_header.scss +70 -50
- data/app/packs/stylesheets/decidim/_home.scss +1 -1
- data/app/packs/stylesheets/decidim/_layout.scss +13 -0
- data/app/packs/stylesheets/decidim/_modal.scss +1 -1
- data/app/packs/stylesheets/decidim/_modal_update.scss +1 -5
- data/app/packs/stylesheets/decidim/_notifications.scss +4 -0
- data/app/packs/stylesheets/decidim/_tabs_x.scss +5 -1
- data/app/packs/stylesheets/decidim/_tooltip.scss +10 -10
- data/app/packs/stylesheets/decidim/application.scss +4 -0
- data/app/packs/stylesheets/decidim/editor.scss +1 -1
- data/app/packs/stylesheets/decidim/legacy/leaflet.scss +1 -1
- data/app/packs/stylesheets/decidim/vendor/_datepicker_light.scss +228 -0
- data/app/permissions/decidim/default_permissions.rb +2 -2
- data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
- data/app/presenters/decidim/admin_log/static_page_presenter.rb +1 -1
- data/app/presenters/decidim/authorization_transfer_presenter.rb +1 -1
- data/app/presenters/decidim/component_attachment_collection_presenter.rb +81 -0
- data/app/presenters/decidim/footer_menu_presenter.rb +1 -1
- data/app/presenters/decidim/home_stats_presenter.rb +1 -1
- data/app/presenters/decidim/menu_item_presenter.rb +1 -1
- data/app/presenters/decidim/organization_presenter.rb +1 -1
- data/app/queries/decidim/last_activity.rb +5 -16
- data/app/queries/decidim/metric_measure.rb +1 -1
- data/app/queries/decidim/public_activities.rb +1 -1
- data/app/queries/decidim/user_groups/admin_memberships.rb +1 -1
- data/app/queries/decidim/user_groups/member_memberships.rb +1 -1
- data/app/services/decidim/action_logger.rb +3 -3
- data/app/services/decidim/download_your_data_exporter.rb +25 -36
- data/app/services/decidim/log/diff_changeset_calculator.rb +2 -2
- data/app/services/decidim/notifications_digest_sending_decider.rb +1 -1
- data/app/services/decidim/open_data_exporter.rb +7 -8
- data/app/services/decidim/zip_stream/writer.rb +39 -0
- data/app/uploaders/decidim/organization_favicon_uploader.rb +1 -1
- data/app/uploaders/decidim/record_image_uploader.rb +2 -2
- data/app/validators/organization_present_validator.rb +1 -1
- data/app/validators/passthru_validator.rb +1 -1
- data/app/validators/uploader_image_dimensions_validator.rb +2 -2
- data/app/views/decidim/account/show.html.erb +1 -1
- data/app/views/decidim/amendments/_wizard_header.html.erb +1 -2
- data/app/views/decidim/application/_collection.html.erb +3 -1
- data/app/views/decidim/application/_component_documents.html.erb +4 -0
- data/app/views/decidim/application/_document.html.erb +23 -9
- data/app/views/decidim/block_user_mailer/notify.html.erb +2 -2
- data/app/views/decidim/devise/invitations/edit.html.erb +2 -2
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +2 -2
- data/app/views/decidim/devise/registrations/new.html.erb +1 -1
- data/app/views/decidim/devise/shared/_login_boxes.html.erb +1 -1
- data/app/views/decidim/doorkeeper/authorizations/new.html.erb +1 -1
- data/app/views/decidim/endorsements/_identity.html.erb +1 -1
- data/app/views/decidim/gamification/badges/index.html.erb +1 -1
- data/app/views/decidim/manifests/show.json.erb +4 -4
- data/app/views/decidim/messaging/conversations/_add_conversation_users.html.erb +2 -2
- data/app/views/decidim/messaging/conversations/_error_modal.html.erb +5 -5
- data/app/views/decidim/newsletter_mailer/newsletter.html.erb +1 -1
- data/app/views/decidim/newsletters/show.html.erb +1 -1
- data/app/views/decidim/newsletters_opt_in_mailer/notify.html.erb +2 -2
- 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 -2
- data/app/views/decidim/reported_mailer/report.html.erb +4 -2
- data/app/views/decidim/scopes/picker.html.erb +5 -5
- data/app/views/decidim/searches/_resources_filter_block.html.erb +6 -6
- data/app/views/decidim/shared/_extended_navigation_bar.html.erb +8 -8
- data/app/views/decidim/shared/_filters.html.erb +5 -5
- data/app/views/decidim/shared/_login_modal.html.erb +1 -1
- data/app/views/decidim/shared/_orders.html.erb +2 -3
- data/app/views/decidim/shared/filters/_check_boxes_tree.html.erb +1 -1
- data/app/views/decidim/shared/filters/_collection.html.erb +1 -1
- data/app/views/decidim/user_interests/_areas.html.erb +2 -2
- data/app/views/decidim/user_report_mailer/notify.html.erb +2 -2
- data/app/views/decidim/user_update_mailer/notify.html.erb +1 -1
- data/app/views/decidim/widgets/_data_picker.html.erb +1 -1
- data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
- data/app/views/devise/mailer/invite_admin.html.erb +2 -2
- data/app/views/devise/mailer/invite_admin.text.erb +2 -2
- data/app/views/devise/mailer/invite_collaborator.html.erb +2 -2
- data/app/views/devise/mailer/invite_collaborator.text.erb +2 -2
- data/app/views/devise/mailer/invite_private_user.html.erb +2 -2
- data/app/views/devise/mailer/invite_private_user.text.erb +2 -2
- data/app/views/devise/mailer/organization_admin_invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/organization_admin_invitation_instructions.text.erb +1 -1
- data/app/views/layouts/decidim/_application.html.erb +3 -6
- data/app/views/layouts/decidim/_data_consent_warning.html.erb +2 -2
- data/app/views/layouts/decidim/_decidim_javascript.html.erb +1 -1
- data/app/views/layouts/decidim/_head.html.erb +1 -1
- data/app/views/layouts/decidim/_head_extra.html.erb +2 -2
- data/app/views/layouts/decidim/_impersonation_warning.html.erb +1 -1
- data/app/views/layouts/decidim/_js_configuration.html.erb +7 -2
- data/app/views/layouts/decidim/_logo.html.erb +2 -2
- data/app/views/layouts/decidim/_logo_mobile.html.erb +11 -0
- data/app/views/layouts/decidim/_mailer_logo.html.erb +2 -2
- data/app/views/layouts/decidim/_meta_tags_config.html.erb +1 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +16 -9
- data/app/views/layouts/decidim/footer/_main.html.erb +2 -3
- data/app/views/layouts/decidim/footer/_main_intro.html.erb +2 -2
- data/app/views/layouts/decidim/footer/_main_legal.html.erb +2 -3
- data/app/views/layouts/decidim/footer/_main_links.html.erb +13 -11
- data/app/views/layouts/decidim/footer/_main_social_media_links.html.erb +8 -8
- data/app/views/layouts/decidim/header/_main.html.erb +9 -22
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +4 -5
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +11 -4
- data/app/views/layouts/decidim/header/_main_links_mobile_item_account.html.erb +24 -0
- data/app/views/layouts/decidim/header/_main_links_mobile_search.html.erb +0 -21
- data/app/views/layouts/decidim/header/_main_menu_mobile.html.erb +12 -0
- data/app/views/layouts/decidim/header/_menu_breadcrumb_desktop.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_mobile.html.erb +17 -0
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_top_left.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_form_search_mobile.html.erb +16 -0
- data/app/views/layouts/decidim/header/_mobile_language_choose.html.erb +25 -0
- data/app/views/layouts/decidim/mailer.html.erb +2 -2
- data/app/views/layouts/decidim/shared/_layout_center.html.erb +1 -1
- data/app/views/layouts/decidim/shared/_layout_item.html.erb +0 -14
- data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +2 -2
- data/config/initializers/active_storage.rb +3 -0
- data/config/initializers/devise.rb +1 -1
- data/config/initializers/new_framework_defaults_7_0.rb +145 -0
- data/config/locales/ar.yml +3 -42
- data/config/locales/bg.yml +56 -57
- data/config/locales/ca.yml +69 -58
- data/config/locales/cs.yml +54 -58
- data/config/locales/de.yml +65 -54
- data/config/locales/el.yml +1 -29
- data/config/locales/en.yml +69 -58
- data/config/locales/es-MX.yml +68 -57
- data/config/locales/es-PY.yml +68 -57
- data/config/locales/es.yml +67 -56
- data/config/locales/eu.yml +71 -60
- data/config/locales/fi-plain.yml +70 -59
- data/config/locales/fi.yml +94 -83
- data/config/locales/fr-CA.yml +61 -56
- data/config/locales/fr.yml +56 -51
- data/config/locales/ga-IE.yml +0 -11
- data/config/locales/gl.yml +1 -18
- data/config/locales/hu.yml +37 -56
- data/config/locales/id-ID.yml +0 -14
- data/config/locales/is-IS.yml +0 -13
- data/config/locales/it.yml +0 -25
- data/config/locales/ja.yml +70 -59
- data/config/locales/lb.yml +0 -25
- data/config/locales/lt.yml +1 -48
- data/config/locales/lv.yml +0 -21
- data/config/locales/nl.yml +0 -24
- data/config/locales/no.yml +0 -25
- data/config/locales/pl.yml +68 -56
- data/config/locales/pt-BR.yml +5 -250
- data/config/locales/pt.yml +0 -25
- data/config/locales/ro-RO.yml +49 -89
- data/config/locales/ru.yml +0 -15
- data/config/locales/sk.yml +0 -21
- data/config/locales/sl.yml +0 -8
- data/config/locales/sv.yml +159 -600
- data/config/locales/tr-TR.yml +4 -27
- data/config/locales/uk.yml +0 -10
- data/config/locales/zh-CN.yml +0 -22
- data/config/locales/zh-TW.yml +1 -47
- data/config/routes.rb +0 -1
- data/db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb +1 -1
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +1 -5
- data/db/migrate/20240110150230_rename_external_domain_whitelist_to_external_domain_allowlist.rb +7 -0
- data/db/migrate/20240326104215_remove_show_in_footer_in_static_pages.rb +7 -0
- data/db/migrate/20240401192628_change_name_on_decidim_organizations.rb +31 -0
- data/db/seeds/avatars/001.jpg +0 -0
- data/db/seeds/avatars/002.jpg +0 -0
- data/db/seeds/avatars/003.jpg +0 -0
- data/db/seeds/avatars/004.jpg +0 -0
- data/db/seeds/avatars/005.jpg +0 -0
- data/db/seeds/avatars/006.jpg +0 -0
- data/db/seeds/avatars/007.jpg +0 -0
- data/db/seeds/avatars/008.jpg +0 -0
- data/db/seeds/avatars/009.jpg +0 -0
- data/db/seeds/avatars/010.jpg +0 -0
- data/db/seeds/avatars/011.jpg +0 -0
- data/db/seeds/avatars/012.jpg +0 -0
- data/db/seeds/avatars/013.jpg +0 -0
- data/db/seeds/avatars/014.jpg +0 -0
- data/db/seeds/avatars/015.jpg +0 -0
- data/db/seeds/avatars/016.jpg +0 -0
- data/db/seeds/avatars/017.jpg +0 -0
- data/db/seeds/avatars/018.jpg +0 -0
- data/db/seeds/avatars/019.jpg +0 -0
- data/db/seeds/avatars/020.jpg +0 -0
- data/db/seeds/avatars/021.jpg +0 -0
- data/db/seeds/avatars/022.jpg +0 -0
- data/db/seeds/avatars/023.jpg +0 -0
- data/db/seeds/avatars/024.jpg +0 -0
- data/db/seeds/avatars/025.jpg +0 -0
- data/db/seeds/avatars/026.jpg +0 -0
- data/db/seeds/avatars/027.jpg +0 -0
- data/db/seeds/avatars/028.jpg +0 -0
- data/db/seeds/avatars/029.jpg +0 -0
- data/db/seeds/avatars/030.jpg +0 -0
- data/db/seeds/avatars/031.jpg +0 -0
- data/db/seeds/avatars/032.jpg +0 -0
- data/db/seeds/avatars/033.jpg +0 -0
- data/db/seeds/avatars/034.jpg +0 -0
- data/db/seeds/avatars/035.jpg +0 -0
- data/db/seeds/avatars/036.jpg +0 -0
- data/db/seeds/avatars/037.jpg +0 -0
- data/db/seeds/avatars/038.jpg +0 -0
- data/db/seeds/avatars/039.jpg +0 -0
- data/db/seeds/avatars/040.jpg +0 -0
- data/db/seeds/avatars/041.jpg +0 -0
- data/db/seeds/avatars/042.jpg +0 -0
- data/db/seeds/avatars/043.jpg +0 -0
- data/db/seeds/avatars/044.jpg +0 -0
- data/db/seeds/avatars/045.jpg +0 -0
- data/db/seeds/avatars/046.jpg +0 -0
- data/db/seeds/avatars/047.jpg +0 -0
- data/db/seeds/avatars/048.jpg +0 -0
- data/db/seeds/avatars/049.jpg +0 -0
- data/db/seeds/avatars/050.jpg +0 -0
- data/db/seeds/avatars/051.jpg +0 -0
- data/db/seeds/avatars/052.jpg +0 -0
- data/db/seeds/avatars/053.jpg +0 -0
- data/db/seeds/avatars/054.jpg +0 -0
- data/db/seeds/avatars/055.jpg +0 -0
- data/db/seeds/avatars/056.jpg +0 -0
- data/db/seeds/avatars/057.jpg +0 -0
- data/db/seeds/avatars/058.jpg +0 -0
- data/db/seeds/avatars/059.jpg +0 -0
- data/db/seeds/avatars/060.jpg +0 -0
- data/db/seeds/avatars/061.jpg +0 -0
- data/db/seeds/avatars/062.jpg +0 -0
- data/db/seeds/avatars/063.jpg +0 -0
- data/db/seeds/avatars/064.jpg +0 -0
- data/db/seeds/avatars/065.jpg +0 -0
- data/db/seeds/avatars/066.jpg +0 -0
- data/db/seeds/avatars/067.jpg +0 -0
- data/db/seeds/avatars/068.jpg +0 -0
- data/db/seeds/avatars/069.jpg +0 -0
- data/db/seeds/avatars/070.jpg +0 -0
- data/db/seeds/avatars/071.jpg +0 -0
- data/db/seeds/avatars/072.jpg +0 -0
- data/db/seeds/avatars/073.jpg +0 -0
- data/db/seeds/avatars/074.jpg +0 -0
- data/db/seeds/avatars/075.jpg +0 -0
- data/db/seeds/avatars/076.jpg +0 -0
- data/db/seeds/avatars/077.jpg +0 -0
- data/db/seeds/avatars/078.jpg +0 -0
- data/db/seeds/avatars/079.jpg +0 -0
- data/db/seeds/avatars/080.jpg +0 -0
- data/db/seeds/avatars/081.jpg +0 -0
- data/db/seeds/avatars/082.jpg +0 -0
- data/db/seeds/avatars/083.jpg +0 -0
- data/db/seeds/avatars/084.jpg +0 -0
- data/db/seeds/avatars/085.jpg +0 -0
- data/db/seeds/avatars/086.jpg +0 -0
- data/db/seeds/avatars/087.jpg +0 -0
- data/db/seeds/avatars/088.jpg +0 -0
- data/db/seeds/avatars/089.jpg +0 -0
- data/db/seeds/avatars/090.jpg +0 -0
- data/db/seeds/avatars/091.jpg +0 -0
- data/db/seeds/avatars/092.jpg +0 -0
- data/db/seeds/avatars/093.jpg +0 -0
- data/db/seeds/avatars/094.jpg +0 -0
- data/db/seeds/avatars/095.jpg +0 -0
- data/db/seeds/avatars/096.jpg +0 -0
- data/db/seeds/avatars/097.jpg +0 -0
- data/db/seeds/avatars/098.jpg +0 -0
- data/db/seeds/avatars/099.jpg +0 -0
- data/db/seeds/avatars/100.jpg +0 -0
- data/db/seeds/avatars/CREDITS.md +114 -0
- data/db/seeds/avatars/README.md +25 -0
- data/decidim-core.gemspec +7 -5
- data/lib/decidim/acts_as_author.rb +1 -1
- data/lib/decidim/admin_filter.rb +44 -0
- data/lib/decidim/admin_filters_registry.rb +55 -0
- data/lib/decidim/amendable.rb +1 -2
- data/lib/decidim/api/functions/component_finder_base.rb +1 -1
- data/lib/decidim/api/functions/needs_api_filter_and_order.rb +3 -3
- data/lib/decidim/api/functions/participatory_space_finder_base.rb +1 -1
- data/lib/decidim/api/functions/participatory_space_list_base.rb +1 -1
- data/lib/decidim/api/input_filters/user_entity_input_filter.rb +3 -3
- data/lib/decidim/api/interfaces/author_interface.rb +1 -1
- data/lib/decidim/api/types/organization_type.rb +1 -1
- data/lib/decidim/api/types/user_group_type.rb +1 -1
- data/lib/decidim/api/types/user_type.rb +1 -1
- data/lib/decidim/asset_router/pipeline.rb +2 -2
- data/lib/decidim/asset_router/storage.rb +11 -214
- data/lib/decidim/assets/tailwind/instance.rb +1 -1
- data/lib/decidim/assets/tailwind/tailwind.config.js.erb +8 -3
- data/lib/decidim/attribute_object/model.rb +2 -2
- data/lib/decidim/attribute_object/type_resolver.rb +1 -3
- data/lib/decidim/attribute_object.rb +2 -2
- data/lib/decidim/attributes.rb +0 -4
- data/lib/decidim/authorable.rb +5 -0
- data/lib/decidim/command.rb +2 -2
- data/lib/decidim/commands/create_resource.rb +63 -0
- data/lib/decidim/commands/destroy_resource.rb +74 -0
- data/lib/decidim/commands/hook_error.rb +8 -0
- data/lib/decidim/commands/resource_handler.rb +85 -0
- data/lib/decidim/commands/update_resource.rb +64 -0
- data/lib/decidim/component_manifest.rb +3 -1
- data/lib/decidim/component_validator.rb +1 -1
- data/lib/decidim/content_blocks/has_related_components.rb +1 -1
- data/lib/decidim/content_parsers/resource_parser.rb +2 -2
- data/lib/decidim/content_processor.rb +1 -1
- data/lib/decidim/content_security_policy.rb +1 -1
- data/lib/decidim/core/engine.rb +12 -29
- data/lib/decidim/core/menu.rb +13 -3
- data/lib/decidim/core/seeds.rb +120 -147
- data/lib/decidim/core/test/factories.rb +24 -3
- data/lib/decidim/core/test/shared_examples/acts_as_author_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/amendable/withdraw_amendment_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/announcements_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/assembly_announcements_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/attachable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +88 -92
- data/lib/decidim/core/test/shared_examples/comments_reports_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/digest_mail_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/edit_link_shared_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/editor_shared_examples.rb +7 -7
- data/lib/decidim/core/test/shared_examples/fingerprint_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +6 -11
- data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +4 -2
- data/lib/decidim/core/test/shared_examples/has_attachments.rb +3 -2
- data/lib/decidim/core/test/shared_examples/has_contextual_help.rb +4 -4
- data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -1
- data/lib/decidim/core/test/shared_examples/logo_email.rb +1 -1
- data/lib/decidim/core/test/shared_examples/manage_component_share_tokens.rb +9 -9
- data/lib/decidim/core/test/shared_examples/map_examples.rb +5 -5
- data/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb +7 -7
- data/lib/decidim/core/test/shared_examples/participatory_space_dropdown_metadata_cell_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +3 -3
- data/lib/decidim/core/test/shared_examples/process_announcements_examples.rb +4 -4
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +5 -5
- data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +10 -10
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +8 -8
- data/lib/decidim/core/test/shared_examples/share_link_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/simple_event.rb +1 -1
- data/lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb +3 -3
- data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +15 -113
- data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +2 -2
- data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +24 -17
- data/lib/decidim/dependency_resolver.rb +3 -3
- data/lib/decidim/diffy_extension.rb +1 -1
- data/lib/decidim/download_your_data_serializers/download_your_data_user_serializer.rb +2 -1
- data/lib/decidim/engine_router.rb +2 -2
- data/lib/decidim/events/base_event.rb +19 -0
- data/lib/decidim/events/simple_event.rb +1 -0
- data/lib/decidim/exporters/export_manifest.rb +1 -1
- data/lib/decidim/faker/localized.rb +3 -3
- data/lib/decidim/form_builder.rb +4 -4
- data/lib/decidim/hashtag.rb +1 -1
- data/lib/decidim/jsonb_attributes.rb +4 -4
- data/lib/decidim/manifest_messages.rb +2 -2
- data/lib/decidim/organization_settings.rb +5 -8
- data/lib/decidim/paddable.rb +1 -1
- data/lib/decidim/participable.rb +1 -1
- data/lib/decidim/participatory_space_manifest.rb +1 -1
- data/lib/decidim/resourceable.rb +1 -1
- data/lib/decidim/search_resource_fields_mapper.rb +2 -2
- data/lib/decidim/searchable.rb +3 -3
- data/lib/decidim/seeds.rb +62 -0
- data/lib/decidim/stats_registry.rb +2 -2
- data/lib/decidim/translatable_attributes.rb +3 -3
- data/lib/decidim/translatable_resource.rb +1 -1
- data/lib/decidim/view_hooks.rb +1 -1
- data/lib/decidim/view_model.rb +5 -1
- data/lib/decidim/webpacker/esbuild.config.js +14 -0
- data/lib/decidim/webpacker/shakapacker.yml +2 -2
- data/lib/decidim/webpacker/tsconfig.json +11 -0
- data/lib/decidim/webpacker/webpack/custom.js +13 -35
- data/lib/devise/models/decidim_newsletterable.rb +1 -1
- data/lib/tasks/decidim_download_your_data_tasks.rake +2 -2
- data/lib/tasks/decidim_locales_tasks.rake +1 -1
- data/lib/tasks/decidim_mailers_tasks.rake +2 -2
- data/lib/tasks/decidim_metrics_tasks.rake +6 -6
- data/lib/tasks/decidim_procfile.rake +9 -3
- data/lib/tasks/decidim_tasks.rake +5 -4
- data/lib/tasks/decidim_webpacker_tasks.rake +126 -117
- data/lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake +80 -0
- data/lib/tasks/upgrade/decidim_content_blocks_tasks.rake +50 -0
- data/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake +1 -1
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +0 -100
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +1 -1
- data/lib/tasks/upgrade/decidim_fix_short_url_resolver.rake +1 -1
- data/lib/tasks/upgrade/decidim_moderation_tasks.rake +1 -1
- data/lib/tasks/upgrade/decidim_user_moderation.rake +1 -1
- metadata +218 -79
- data/app/cells/decidim/content_blocks/cta/show.erb +0 -12
- data/app/cells/decidim/content_blocks/cta_cell.rb +0 -31
- data/app/cells/decidim/footer_pages/pages.erb +0 -3
- data/app/cells/decidim/footer_pages/topics.erb +0 -12
- data/app/cells/decidim/footer_pages_cell.rb +0 -68
- data/app/controllers/concerns/decidim/direct_upload.rb +0 -82
- data/app/packs/src/decidim/vendor/modernizr.js +0 -5
- data/app/queries/decidim/similar_emendations.rb +0 -56
- data/app/uploaders/decidim/cw/application_uploader.rb +0 -77
- data/app/uploaders/decidim/cw/attachment_uploader.rb +0 -56
- data/app/uploaders/decidim/cw/avatar_uploader.rb +0 -24
- data/app/uploaders/decidim/cw/banner_image_uploader.rb +0 -7
- data/app/uploaders/decidim/cw/download_your_data_uploader.rb +0 -15
- data/app/uploaders/decidim/cw/downloader.rb +0 -9
- data/app/uploaders/decidim/cw/hero_image_uploader.rb +0 -10
- data/app/uploaders/decidim/cw/homepage_image_uploader.rb +0 -14
- data/app/uploaders/decidim/cw/image_uploader.rb +0 -78
- data/app/uploaders/decidim/cw/newsletter_template_image_uploader.rb +0 -38
- data/app/uploaders/decidim/cw/oauth_application_logo_uploader.rb +0 -10
- data/app/uploaders/decidim/cw/official_image_footer_uploader.rb +0 -10
- data/app/uploaders/decidim/cw/official_image_header_uploader.rb +0 -10
- data/app/uploaders/decidim/cw/open_data_uploader.rb +0 -23
- data/app/uploaders/decidim/cw/organization_favicon_uploader.rb +0 -18
- data/app/uploaders/decidim/cw/organization_logo_uploader.rb +0 -10
- data/app/uploaders/decidim/cw/record_image_uploader.rb +0 -15
- data/app/uploaders/decidim/downloader.rb +0 -9
- data/app/views/decidim/amendments/compare_draft.html.erb +0 -18
- data/app/views/layouts/decidim/_edit_link.html.erb +0 -0
- data/app/views/layouts/decidim/header/_main_links_mobile.html.erb +0 -36
- data/config/initializers/carrierwave.rb +0 -15
- data/lib/decidim/carrier_wave_migrator_service.rb +0 -287
- data/lib/decidim/seven_zip_wrapper.rb +0 -29
- data/lib/tasks/decidim_active_storage_migration_tasks.rake +0 -114
- data/lib/tasks/decidim_content_blocks_tasks.rake +0 -48
- data/lib/tasks/upgrade/decidim_attachments.rake +0 -14
- /data/app/views/layouts/decidim/header/{_menu_breadcrumb_main_dropdown.html.erb → _menu_breadcrumb_main_dropdown_desktop.html.erb} +0 -0
@@ -136,7 +136,9 @@ module Decidim
|
|
136
136
|
#
|
137
137
|
# Returns nothing.
|
138
138
|
def seed!(participatory_space)
|
139
|
+
# rubocop:disable Rails/Output
|
139
140
|
print "-- Creating #{name} component seeds for the participatory space with ID: #{participatory_space.id}...\n" unless Rails.env.test?
|
141
|
+
# rubocop:enable Rails/Output
|
140
142
|
@seeds&.call(participatory_space)
|
141
143
|
end
|
142
144
|
|
@@ -259,7 +261,7 @@ module Decidim
|
|
259
261
|
end
|
260
262
|
|
261
263
|
# Public: Finds the specific data importer class from its name, using the
|
262
|
-
# `
|
264
|
+
# `specific_data_importer_class_name` attribute. If the class does not exist,
|
263
265
|
# it raises an exception. If the class name is not set, it returns nil.
|
264
266
|
#
|
265
267
|
# Returns a Decidim::Importers::Importer subclass or nil.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# Adds a presence validation and checks that the manifest is the correct one.
|
6
6
|
class ComponentValidator < ActiveModel::EachValidator
|
7
|
-
# Validates the
|
7
|
+
# Validates the arguments passed to the validator.
|
8
8
|
def check_validity!
|
9
9
|
raise ArgumentError, "You must include a `manifest` option with the name of the manifest to validate when validating a component" if options[:manifest].blank?
|
10
10
|
end
|
@@ -6,7 +6,7 @@ module Decidim
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
-
# This method allows us to detect the components related
|
9
|
+
# This method allows us to detect the components related with a
|
10
10
|
# content block. The content block can have different components
|
11
11
|
# associated depending on the scope_name. The scope names and their
|
12
12
|
# associated models are configured in Decidim::ContentBlocks::BaseCell
|
@@ -19,8 +19,8 @@ module Decidim
|
|
19
19
|
#
|
20
20
|
# @return [String] the content with the valid mentions replaced by a global id.
|
21
21
|
def rewrite
|
22
|
-
|
23
|
-
parse_for_ids(
|
22
|
+
rewritten_content = parse_for_urls(content)
|
23
|
+
parse_for_ids(rewritten_content)
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
@@ -127,7 +127,7 @@ module Decidim
|
|
127
127
|
#
|
128
128
|
# @return [String] sanitized content.
|
129
129
|
def self.sanitize(text, options = {})
|
130
|
-
Rails::Html::
|
130
|
+
Rails::Html::SafeListSanitizer.new.sanitize(
|
131
131
|
text,
|
132
132
|
{ scrubber: Decidim::UserInputScrubber.new }.merge(options)
|
133
133
|
).try(:html_safe)
|
@@ -122,7 +122,7 @@ module Decidim
|
|
122
122
|
"style-src" => %w('self' 'unsafe-inline'),
|
123
123
|
"img-src" => %w('self' *.hereapi.com data:),
|
124
124
|
"font-src" => %w('self'),
|
125
|
-
"connect-src" => %w('self' *.hereapi.com
|
125
|
+
"connect-src" => %w('self' *.hereapi.com data:),
|
126
126
|
"frame-src" => %w('self' www.youtube-nocookie.com player.vimeo.com),
|
127
127
|
"media-src" => %w('self')
|
128
128
|
}
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -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 "carrierwave"
|
17
16
|
require "rails-i18n"
|
18
17
|
require "date_validator"
|
19
18
|
require "file_validators"
|
@@ -40,15 +39,13 @@ require "ransack"
|
|
40
39
|
require "wisper"
|
41
40
|
require "shakapacker"
|
42
41
|
|
43
|
-
# Needed for the assets:precompile task, for configuring webpacker instance
|
44
|
-
require "decidim/webpacker"
|
45
|
-
|
46
42
|
require "decidim/api"
|
47
43
|
require "decidim/core/content_blocks/registry_manager"
|
48
44
|
require "decidim/core/menu"
|
49
45
|
require "decidim/middleware/strip_x_forwarded_host"
|
50
46
|
require "decidim/middleware/static_dispatcher"
|
51
47
|
require "decidim/middleware/current_organization"
|
48
|
+
require "decidim/webpacker"
|
52
49
|
|
53
50
|
module Decidim
|
54
51
|
module Core
|
@@ -159,6 +156,7 @@ module Decidim
|
|
159
156
|
|
160
157
|
# Attachments
|
161
158
|
Decidim.icons.register(name: "file-text-line", icon: "file-text-line", category: "system", description: "", engine: :core)
|
159
|
+
Decidim.icons.register(name: "file-upload-line", icon: "file-upload-line", category: "documents", description: "File upload", engine: :core)
|
162
160
|
Decidim.icons.register(name: "scales-2-line", icon: "scales-2-line", category: "system", description: "", engine: :core)
|
163
161
|
Decidim.icons.register(name: "image-line", icon: "image-line", category: "system", description: "", engine: :core)
|
164
162
|
Decidim.icons.register(name: "error-warning-line", icon: "error-warning-line", category: "system", description: "", engine: :core)
|
@@ -225,6 +223,10 @@ module Decidim
|
|
225
223
|
ENV["SHAKAPACKER_CONFIG"] = Decidim::Webpacker.configuration.configuration_file
|
226
224
|
end
|
227
225
|
|
226
|
+
initializer "decidim_core.active_storage_variant_processor" do |app|
|
227
|
+
app.config.active_storage.variant_processor = :mini_magick
|
228
|
+
end
|
229
|
+
|
228
230
|
initializer "decidim_core.action_controller" do |_app|
|
229
231
|
config.to_prepare do
|
230
232
|
ActiveSupport.on_load :action_controller do
|
@@ -237,14 +239,6 @@ module Decidim
|
|
237
239
|
app.config.action_mailer.deliver_later_queue_name = :mailers
|
238
240
|
end
|
239
241
|
|
240
|
-
initializer "decidim_core.signed_global_id", after: "global_id" do |app|
|
241
|
-
next if app.config.global_id.fetch(:expires_in, nil).present?
|
242
|
-
|
243
|
-
config.after_initialize do
|
244
|
-
SignedGlobalID.expires_in = nil
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
242
|
initializer "decidim_core.middleware" do |app|
|
249
243
|
if app.config.public_file_server.enabled
|
250
244
|
headers = app.config.public_file_server.headers || {}
|
@@ -275,12 +269,6 @@ module Decidim
|
|
275
269
|
app.config.exceptions_app = Decidim::Core::Engine.routes
|
276
270
|
end
|
277
271
|
|
278
|
-
initializer "decidim_core.direct_uploader_paths", after: "decidim_core.exceptions_app" do |_app|
|
279
|
-
config.to_prepare do
|
280
|
-
ActiveStorage::DirectUploadsController.include Decidim::DirectUpload
|
281
|
-
end
|
282
|
-
end
|
283
|
-
|
284
272
|
initializer "decidim_core.locales" do |app|
|
285
273
|
app.config.i18n.fallbacks = true
|
286
274
|
end
|
@@ -296,7 +284,7 @@ module Decidim
|
|
296
284
|
Ransack.configure do |config|
|
297
285
|
# Avoid turning parameter values such as user_id[]=1&user_id[]=2 into
|
298
286
|
# { user_id: [true, "2"] }. This option allows us to handle the type
|
299
|
-
#
|
287
|
+
# conversions manually instead for each case.
|
300
288
|
# See: https://github.com/activerecord-hackery/ransack/issues/593
|
301
289
|
# See: https://github.com/activerecord-hackery/ransack/pull/742
|
302
290
|
config.sanitize_custom_scope_booleans = false
|
@@ -312,8 +300,8 @@ module Decidim
|
|
312
300
|
end
|
313
301
|
end
|
314
302
|
|
315
|
-
initializer "decidim_core.i18n_exceptions" do
|
316
|
-
|
303
|
+
initializer "decidim_core.i18n_exceptions" do |app|
|
304
|
+
app.config.i18n.raise_on_missing_translations = true unless Rails.env.production?
|
317
305
|
end
|
318
306
|
|
319
307
|
initializer "decidim_core.geocoding", after: :load_config_initializers do
|
@@ -393,18 +381,13 @@ module Decidim
|
|
393
381
|
|
394
382
|
initializer "decidim_core.menu" do
|
395
383
|
Decidim::Core::Menu.register_menu!
|
384
|
+
Decidim::Core::Menu.register_mobile_menu!
|
396
385
|
Decidim::Core::Menu.register_user_menu!
|
397
386
|
end
|
398
387
|
|
399
388
|
initializer "decidim_core.notifications" do
|
400
|
-
|
401
|
-
|
402
|
-
Decidim::EventsManager.subscribe_events!
|
403
|
-
end
|
404
|
-
else
|
405
|
-
config.to_prepare do
|
406
|
-
Decidim::EventsManager.subscribe_events!
|
407
|
-
end
|
389
|
+
config.after_initialize do
|
390
|
+
Decidim::EventsManager.subscribe_events!
|
408
391
|
end
|
409
392
|
end
|
410
393
|
|
data/lib/decidim/core/menu.rb
CHANGED
@@ -10,12 +10,22 @@ module Decidim
|
|
10
10
|
decidim.root_path,
|
11
11
|
position: 1,
|
12
12
|
active: :exclusive
|
13
|
+
end
|
14
|
+
end
|
13
15
|
|
14
|
-
|
16
|
+
def self.register_mobile_menu!
|
17
|
+
Decidim.menu :mobile_menu do |menu|
|
18
|
+
menu.add_item :root,
|
19
|
+
I18n.t("menu.home", scope: "decidim"),
|
20
|
+
decidim.root_path,
|
21
|
+
position: 1,
|
22
|
+
active: :exclusive
|
23
|
+
|
24
|
+
menu.add_item :help,
|
15
25
|
I18n.t("menu.help", scope: "decidim"),
|
16
26
|
decidim.pages_path,
|
17
|
-
position:
|
18
|
-
active: :
|
27
|
+
position: 10,
|
28
|
+
active: :exclusive
|
19
29
|
end
|
20
30
|
end
|
21
31
|
|
data/lib/decidim/core/seeds.rb
CHANGED
@@ -8,164 +8,53 @@ require "decidim/faker/internet"
|
|
8
8
|
module Decidim
|
9
9
|
module Core
|
10
10
|
class Seeds < Decidim::Seeds
|
11
|
-
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Rails/Output
|
12
11
|
def call
|
13
|
-
print "Creating seeds for decidim-core...\n" unless Rails.env.test?
|
12
|
+
print "Creating seeds for decidim-core...\n" unless Rails.env.test? # rubocop:disable Rails/Output
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
decidim_tables = ActiveRecord::Base.connection.tables.select do |table|
|
18
|
-
table.starts_with?("decidim_")
|
19
|
-
end
|
20
|
-
decidim_tables.map do |table|
|
21
|
-
table.tr("_", "/").classify.safe_constantize
|
22
|
-
end.compact.each(&:reset_column_information)
|
14
|
+
Rails.application.reloader.reload! if Rails.application.reloader.check!
|
15
|
+
reset_column_information
|
23
16
|
|
24
|
-
|
25
|
-
smtp_email = ENV.fetch("SMTP_FROM_EMAIL", ::Faker::Internet.email)
|
17
|
+
ActiveJob::Base.queue_adapter = :inline
|
26
18
|
|
27
|
-
|
28
|
-
["#bf4044", "#09780e", "#3584e4"],
|
29
|
-
["#09780e", "#4448bb", "#da565b"],
|
30
|
-
["#bf4086", "#487511", "#5384ac"],
|
31
|
-
["#086263", "#811380", "#abac53"],
|
32
|
-
["#5340bf", "#a82c2c", "#40bf53"]
|
33
|
-
].sample
|
34
|
-
|
35
|
-
colors = {
|
36
|
-
alert: "#e7131a",
|
37
|
-
primary: primary_color,
|
38
|
-
secondary: secondary_color,
|
39
|
-
tertiary: tertiary_color,
|
40
|
-
success: "#28a745",
|
41
|
-
warning: "#ffb703"
|
42
|
-
}
|
43
|
-
|
44
|
-
organization = Decidim::Organization.first || Decidim::Organization.create!(
|
45
|
-
name: ::Faker::Company.name,
|
46
|
-
twitter_handler: ::Faker::Hipster.word,
|
47
|
-
facebook_handler: ::Faker::Hipster.word,
|
48
|
-
instagram_handler: ::Faker::Hipster.word,
|
49
|
-
youtube_handler: ::Faker::Hipster.word,
|
50
|
-
github_handler: ::Faker::Hipster.word,
|
51
|
-
smtp_settings: {
|
52
|
-
from: "#{smtp_label} <#{smtp_email}>",
|
53
|
-
from_email: smtp_email,
|
54
|
-
from_label: smtp_label,
|
55
|
-
user_name: ENV.fetch("SMTP_USERNAME", ::Faker::Twitter.unique.screen_name),
|
56
|
-
encrypted_password: Decidim::AttributeEncryptor.encrypt(ENV.fetch("SMTP_PASSWORD", ::Faker::Internet.password(min_length: 8))),
|
57
|
-
address: ENV.fetch("SMTP_ADDRESS", nil) || ENV.fetch("DECIDIM_HOST", "localhost"),
|
58
|
-
port: ENV.fetch("SMTP_PORT", nil) || ENV.fetch("DECIDIM_SMTP_PORT", "25")
|
59
|
-
},
|
60
|
-
host: ENV.fetch("DECIDIM_HOST", "localhost"),
|
61
|
-
secondary_hosts: ENV.fetch("DECIDIM_HOST", "localhost") == "localhost" ? ["0.0.0.0", "127.0.0.1"] : nil,
|
62
|
-
external_domain_whitelist: ["decidim.org", "github.com"],
|
63
|
-
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
64
|
-
Decidim::Faker::Localized.sentence(word_count: 15)
|
65
|
-
end,
|
66
|
-
default_locale: Decidim.default_locale,
|
67
|
-
available_locales: Decidim.available_locales,
|
68
|
-
reference_prefix: ::Faker::Name.suffix,
|
69
|
-
available_authorizations: Decidim.authorization_workflows.map(&:name),
|
70
|
-
users_registration_mode: :enabled,
|
71
|
-
tos_version: Time.current,
|
72
|
-
badges_enabled: true,
|
73
|
-
user_groups_enabled: true,
|
74
|
-
send_welcome_notification: true,
|
75
|
-
file_upload_settings: Decidim::OrganizationSettings.default(:upload),
|
76
|
-
colors:
|
77
|
-
)
|
19
|
+
organization = create_organization!
|
78
20
|
|
79
21
|
if organization.top_scopes.none?
|
80
22
|
province = create_scope_type!(name: "province", plural: "provinces")
|
81
23
|
municipality = create_scope_type!(name: "municipality", plural: "municipalities")
|
24
|
+
|
82
25
|
3.times do
|
83
26
|
parent = create_scope!(scope_type: province, parent: nil)
|
27
|
+
|
84
28
|
5.times do
|
85
29
|
create_scope!(scope_type: municipality, parent:)
|
86
30
|
end
|
87
31
|
end
|
88
32
|
end
|
89
33
|
|
90
|
-
territorial =
|
91
|
-
|
92
|
-
plural: Decidim::Faker::Localized.literal("territorials"),
|
93
|
-
organization:
|
94
|
-
)
|
95
|
-
|
96
|
-
sectorial = Decidim::AreaType.create!(
|
97
|
-
name: Decidim::Faker::Localized.literal("sectorials"),
|
98
|
-
plural: Decidim::Faker::Localized.literal("sectorials"),
|
99
|
-
organization:
|
100
|
-
)
|
34
|
+
territorial = create_area_type!(name: "territorial", plural: "territorials")
|
35
|
+
sectorial = create_area_type!(name: "sectorials", plural: "sectorials")
|
101
36
|
|
102
37
|
3.times do
|
103
|
-
|
104
|
-
name: Decidim::Faker::Localized.word,
|
105
|
-
area_type: territorial,
|
106
|
-
organization:
|
107
|
-
)
|
38
|
+
create_area!(area_type: territorial)
|
108
39
|
end
|
109
40
|
|
110
41
|
5.times do
|
111
|
-
|
112
|
-
name: Decidim::Faker::Localized.word,
|
113
|
-
area_type: sectorial,
|
114
|
-
organization:
|
115
|
-
)
|
42
|
+
create_area!(area_type: sectorial)
|
116
43
|
end
|
117
44
|
|
118
|
-
admin =
|
119
|
-
|
120
|
-
name: ::Faker::Name.name,
|
121
|
-
nickname: ::Faker::Twitter.unique.screen_name,
|
122
|
-
organization:,
|
123
|
-
confirmed_at: Time.current,
|
124
|
-
locale: I18n.default_locale,
|
45
|
+
admin = find_or_initialize_user_by(email: "admin@example.org")
|
46
|
+
admin.update!(
|
125
47
|
admin: true,
|
126
|
-
tos_agreement: true,
|
127
|
-
personal_url: ::Faker::Internet.url,
|
128
|
-
about: ::Faker::Lorem.paragraph(sentence_count: 2),
|
129
|
-
accepted_tos_version: organization.tos_version + 1.hour,
|
130
|
-
newsletter_notifications_at: Time.current,
|
131
|
-
password_updated_at: Time.current,
|
132
48
|
admin_terms_accepted_at: Time.current
|
133
|
-
|
134
|
-
admin_hash.merge!(password: "decidim123456789") if admin.encrypted_password.blank?
|
135
|
-
admin.update!(admin_hash)
|
49
|
+
)
|
136
50
|
|
137
51
|
["user@example.org", "user2@example.org"].each do |email|
|
138
|
-
|
139
|
-
name: ::Faker::Name.name,
|
140
|
-
nickname: ::Faker::Twitter.unique.screen_name,
|
141
|
-
password: "decidim123456789",
|
142
|
-
confirmed_at: Time.current,
|
143
|
-
locale: I18n.default_locale,
|
144
|
-
organization:,
|
145
|
-
tos_agreement: true,
|
146
|
-
personal_url: ::Faker::Internet.url,
|
147
|
-
about: ::Faker::Lorem.paragraph(sentence_count: 2),
|
148
|
-
accepted_tos_version: organization.tos_version + 1.hour,
|
149
|
-
newsletter_notifications_at: Time.current
|
150
|
-
)
|
52
|
+
find_or_initialize_user_by(email:)
|
151
53
|
end
|
152
54
|
|
153
55
|
regular_user = Decidim::User.find_or_initialize_by(email: "user@example.org")
|
154
56
|
|
155
|
-
locked_user =
|
156
|
-
|
157
|
-
locked_user.update!(
|
158
|
-
name: ::Faker::Name.name,
|
159
|
-
nickname: ::Faker::Twitter.unique.screen_name,
|
160
|
-
password: "decidim123456789",
|
161
|
-
confirmed_at: Time.current,
|
162
|
-
locale: I18n.default_locale,
|
163
|
-
organization:,
|
164
|
-
tos_agreement: true,
|
165
|
-
personal_url: ::Faker::Internet.url,
|
166
|
-
about: ::Faker::Lorem.paragraph(sentence_count: 2),
|
167
|
-
accepted_tos_version: organization.tos_version + 1.hour
|
168
|
-
)
|
57
|
+
locked_user = find_or_initialize_user_by(email: "locked_user@example.org")
|
169
58
|
|
170
59
|
locked_user.lock_access!
|
171
60
|
|
@@ -177,24 +66,7 @@ module Decidim
|
|
177
66
|
|
178
67
|
Decidim::User.find_each do |user|
|
179
68
|
[nil, Time.current].each do |verified_at|
|
180
|
-
|
181
|
-
name: ::Faker::Company.unique.name,
|
182
|
-
nickname: ::Faker::Twitter.unique.screen_name,
|
183
|
-
email: ::Faker::Internet.email,
|
184
|
-
confirmed_at: Time.current,
|
185
|
-
extended_data: {
|
186
|
-
document_number: ::Faker::Number.number(digits: 10).to_s,
|
187
|
-
phone: ::Faker::PhoneNumber.phone_number,
|
188
|
-
verified_at:
|
189
|
-
},
|
190
|
-
decidim_organization_id: user.organization.id
|
191
|
-
)
|
192
|
-
|
193
|
-
Decidim::UserGroupMembership.create!(
|
194
|
-
user:,
|
195
|
-
role: "creator",
|
196
|
-
user_group:
|
197
|
-
)
|
69
|
+
create_user_group!(user:, verified_at:)
|
198
70
|
end
|
199
71
|
end
|
200
72
|
|
@@ -218,10 +90,74 @@ module Decidim
|
|
218
90
|
settings = welcome_text.inject(settings) { |acc, (k, v)| acc.update("welcome_text_#{k}" => v) }
|
219
91
|
hero_content_block.settings = settings
|
220
92
|
hero_content_block.save!
|
93
|
+
|
94
|
+
create_user_report!(reportable: Decidim::User.take, current_user: Decidim::User.take)
|
95
|
+
end
|
96
|
+
|
97
|
+
def reset_column_information
|
98
|
+
# Since we usually migrate and seed in the same process, make sure
|
99
|
+
# that we do not have invalid or cached information after a migration.
|
100
|
+
decidim_tables = ActiveRecord::Base.connection.tables.select do |table|
|
101
|
+
table.starts_with?("decidim_")
|
102
|
+
end
|
103
|
+
decidim_tables.map do |table|
|
104
|
+
table.tr("_", "/").classify.safe_constantize
|
105
|
+
end.compact.each(&:reset_column_information)
|
221
106
|
end
|
222
|
-
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Rails/Output
|
223
107
|
|
224
|
-
|
108
|
+
def create_organization!
|
109
|
+
smtp_label = ENV.fetch("SMTP_FROM_LABEL", ::Faker::Twitter.unique.screen_name)
|
110
|
+
smtp_email = ENV.fetch("SMTP_FROM_EMAIL", ::Faker::Internet.email)
|
111
|
+
|
112
|
+
primary_color, secondary_color, tertiary_color = [
|
113
|
+
["#bf4044", "#09780e", "#3584e4"],
|
114
|
+
["#09780e", "#4448bb", "#da565b"],
|
115
|
+
["#bf4086", "#487511", "#5384ac"],
|
116
|
+
["#086263", "#811380", "#abac53"],
|
117
|
+
["#5340bf", "#a82c2c", "#40bf53"]
|
118
|
+
].sample
|
119
|
+
|
120
|
+
colors = {
|
121
|
+
primary: primary_color,
|
122
|
+
secondary: secondary_color,
|
123
|
+
tertiary: tertiary_color
|
124
|
+
}
|
125
|
+
|
126
|
+
Decidim::Organization.first || Decidim::Organization.create!(
|
127
|
+
name: Decidim::Faker::Localized.company,
|
128
|
+
twitter_handler: ::Faker::Hipster.word,
|
129
|
+
facebook_handler: ::Faker::Hipster.word,
|
130
|
+
instagram_handler: ::Faker::Hipster.word,
|
131
|
+
youtube_handler: ::Faker::Hipster.word,
|
132
|
+
github_handler: ::Faker::Hipster.word,
|
133
|
+
smtp_settings: {
|
134
|
+
from: "#{smtp_label} <#{smtp_email}>",
|
135
|
+
from_email: smtp_email,
|
136
|
+
from_label: smtp_label,
|
137
|
+
user_name: ENV.fetch("SMTP_USERNAME", ::Faker::Twitter.unique.screen_name),
|
138
|
+
encrypted_password: Decidim::AttributeEncryptor.encrypt(ENV.fetch("SMTP_PASSWORD", ::Faker::Internet.password(min_length: 8))),
|
139
|
+
address: ENV.fetch("SMTP_ADDRESS", nil) || ENV.fetch("DECIDIM_HOST", "localhost"),
|
140
|
+
port: ENV.fetch("SMTP_PORT", nil) || ENV.fetch("DECIDIM_SMTP_PORT", "25")
|
141
|
+
},
|
142
|
+
host: ENV.fetch("DECIDIM_HOST", "localhost"),
|
143
|
+
secondary_hosts: ENV.fetch("DECIDIM_HOST", "localhost") == "localhost" ? ["0.0.0.0", "127.0.0.1"] : nil,
|
144
|
+
external_domain_allowlist: ["decidim.org", "github.com"],
|
145
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
146
|
+
Decidim::Faker::Localized.sentence(word_count: 15)
|
147
|
+
end,
|
148
|
+
default_locale: Decidim.default_locale,
|
149
|
+
available_locales: Decidim.available_locales,
|
150
|
+
reference_prefix: ::Faker::Name.suffix,
|
151
|
+
available_authorizations: Decidim.authorization_workflows.map(&:name),
|
152
|
+
users_registration_mode: :enabled,
|
153
|
+
tos_version: Time.current,
|
154
|
+
badges_enabled: true,
|
155
|
+
user_groups_enabled: true,
|
156
|
+
send_welcome_notification: true,
|
157
|
+
file_upload_settings: Decidim::OrganizationSettings.default(:upload),
|
158
|
+
colors:
|
159
|
+
)
|
160
|
+
end
|
225
161
|
|
226
162
|
def create_scope_type!(name:, plural:)
|
227
163
|
Decidim::ScopeType.create!(
|
@@ -246,6 +182,43 @@ module Decidim
|
|
246
182
|
rescue ActiveRecord::RecordInvalid
|
247
183
|
retry
|
248
184
|
end
|
185
|
+
|
186
|
+
def create_area_type!(name:, plural:)
|
187
|
+
Decidim::AreaType.create!(
|
188
|
+
name: Decidim::Faker::Localized.literal(name),
|
189
|
+
plural: Decidim::Faker::Localized.literal(plural),
|
190
|
+
organization:
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
def create_area!(area_type:)
|
195
|
+
Decidim::Area.create!(
|
196
|
+
name: Decidim::Faker::Localized.word,
|
197
|
+
area_type:,
|
198
|
+
organization:
|
199
|
+
)
|
200
|
+
end
|
201
|
+
|
202
|
+
def create_user_group!(user:, verified_at:)
|
203
|
+
user_group = Decidim::UserGroup.create!(
|
204
|
+
name: ::Faker::Company.unique.name,
|
205
|
+
nickname: ::Faker::Twitter.unique.screen_name,
|
206
|
+
email: ::Faker::Internet.email,
|
207
|
+
confirmed_at: Time.current,
|
208
|
+
extended_data: {
|
209
|
+
document_number: ::Faker::Number.number(digits: 10).to_s,
|
210
|
+
phone: ::Faker::PhoneNumber.phone_number,
|
211
|
+
verified_at:
|
212
|
+
},
|
213
|
+
decidim_organization_id: user.organization.id
|
214
|
+
)
|
215
|
+
|
216
|
+
Decidim::UserGroupMembership.create!(
|
217
|
+
user:,
|
218
|
+
role: "creator",
|
219
|
+
user_group:
|
220
|
+
)
|
221
|
+
end
|
249
222
|
end
|
250
223
|
end
|
251
224
|
end
|
@@ -112,7 +112,11 @@ FactoryBot.define do
|
|
112
112
|
create_static_pages { true }
|
113
113
|
end
|
114
114
|
|
115
|
-
|
115
|
+
# we do not want machine translation here
|
116
|
+
name do
|
117
|
+
Decidim.available_locales.index_with { |_locale| Faker::Company.unique.name }
|
118
|
+
end
|
119
|
+
|
116
120
|
reference_prefix { Faker::Name.suffix }
|
117
121
|
time_zone { "UTC" }
|
118
122
|
twitter_handler { Faker::Hipster.word }
|
@@ -137,7 +141,7 @@ FactoryBot.define do
|
|
137
141
|
admin_terms_of_service_body { generate_localized_description(:admin_terms_of_service_body, skip_injection:) }
|
138
142
|
force_users_to_authenticate_before_access_organization { false }
|
139
143
|
machine_translation_display_priority { "original" }
|
140
|
-
|
144
|
+
external_domain_allowlist { ["example.org", "twitter.com", "facebook.com", "youtube.com", "github.com", "mytesturl.me"] }
|
141
145
|
smtp_settings do
|
142
146
|
{
|
143
147
|
"from" => "test@example.org",
|
@@ -149,7 +153,18 @@ FactoryBot.define do
|
|
149
153
|
end
|
150
154
|
file_upload_settings { Decidim::OrganizationSettings.default(:upload) }
|
151
155
|
enable_participatory_space_filters { true }
|
152
|
-
content_security_policy
|
156
|
+
content_security_policy do
|
157
|
+
{
|
158
|
+
"default-src" => "localhost:* #{host}:*",
|
159
|
+
"script-src" => "localhost:* #{host}:*",
|
160
|
+
"style-src" => "localhost:* #{host}:*",
|
161
|
+
"img-src" => "localhost:* #{host}:*",
|
162
|
+
"font-src" => "localhost:* #{host}:*",
|
163
|
+
"connect-src" => "localhost:* #{host}:*",
|
164
|
+
"frame-src" => "localhost:* #{host}:* www.example.org",
|
165
|
+
"media-src" => "localhost:* #{host}:*"
|
166
|
+
}
|
167
|
+
end
|
153
168
|
colors do
|
154
169
|
{
|
155
170
|
primary: "#e02d2d",
|
@@ -422,6 +437,7 @@ FactoryBot.define do
|
|
422
437
|
end
|
423
438
|
title { generate_localized_title(:static_page_topic_title, skip_injection:) }
|
424
439
|
description { generate_localized_description(:static_page_topic_description, skip_injection:) }
|
440
|
+
show_in_footer { true }
|
425
441
|
organization
|
426
442
|
end
|
427
443
|
|
@@ -457,6 +473,11 @@ FactoryBot.define do
|
|
457
473
|
content_type { "application/pdf" }
|
458
474
|
file_size { 17_525 }
|
459
475
|
end
|
476
|
+
|
477
|
+
trait :with_link do
|
478
|
+
file { nil }
|
479
|
+
link { Faker::Internet.url }
|
480
|
+
end
|
460
481
|
end
|
461
482
|
|
462
483
|
factory :component, class: "Decidim::Component" do
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
# users of this test should
|
5
|
+
# users of this test should declare the `subject` variable.
|
6
6
|
shared_examples "acts as author" do
|
7
7
|
describe "presenter" do
|
8
8
|
it "returns an instance of the presenter for this author" do
|
@@ -4,7 +4,7 @@ shared_examples "withdraw amendment" do
|
|
4
4
|
context "when current user is the author of the amendment" do
|
5
5
|
let(:current_user) { amendment.amender }
|
6
6
|
|
7
|
-
context "and the amendment has no
|
7
|
+
context "and the amendment has no votes" do
|
8
8
|
it "withdraws the amendment" do
|
9
9
|
expect { command.call }.to broadcast(:ok)
|
10
10
|
expect(amendment.state).to eq("withdrawn")
|
@@ -12,7 +12,7 @@ shared_examples "withdraw amendment" do
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
context "and the amendment has some
|
15
|
+
context "and the amendment has some votes" do
|
16
16
|
before do
|
17
17
|
emendation.votes.create!(author: other_user)
|
18
18
|
end
|
@@ -12,7 +12,7 @@ shared_examples "manage announcements" do
|
|
12
12
|
ca: "Un avís molt important"
|
13
13
|
)
|
14
14
|
|
15
|
-
|
15
|
+
click_on "Update"
|
16
16
|
|
17
17
|
visit main_component_path(current_component)
|
18
18
|
|
@@ -46,12 +46,12 @@ shared_examples "manage announcements" do
|
|
46
46
|
ca: "Un avís per a aquesta fase"
|
47
47
|
)
|
48
48
|
|
49
|
-
|
49
|
+
click_on "Update"
|
50
50
|
|
51
51
|
visit main_component_path(current_component)
|
52
52
|
|
53
53
|
within page.find("[data-announcement]", match: :first) do
|
54
|
-
expect(page).
|
54
|
+
expect(page).to have_no_content("An important announcement")
|
55
55
|
expect(page).to have_content("An announcement for this step")
|
56
56
|
end
|
57
57
|
end
|