decidim-core 0.23.3 → 0.24.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 +2 -2
- data/app/assets/images/decidim/icons.svg +1 -1
- data/app/assets/javascripts/decidim.js.es6 +1 -0
- data/app/assets/javascripts/decidim/core/bundle.js +1 -1
- data/app/assets/javascripts/decidim/core/bundle.js.map +1 -1
- data/app/assets/javascripts/decidim/editor.js.es6 +15 -4
- data/app/assets/javascripts/decidim/editor/history_override.js.es6 +117 -0
- data/app/assets/javascripts/decidim/editor/linebreak_module.js.es6 +83 -0
- data/app/assets/javascripts/decidim/editor/modified_backspace_offset1.js.es6 +98 -0
- data/app/assets/javascripts/decidim/editor/modified_backspace_offset_any.js.es6 +48 -0
- data/app/assets/javascripts/decidim/editor/modified_backspace_utils.js.es6 +31 -0
- data/app/assets/javascripts/decidim/editor/modified_enter.js.es6 +118 -0
- data/app/assets/javascripts/decidim/form_filter.component.js.es6 +25 -0
- data/app/assets/javascripts/decidim/geocoding/attach_input.js.es6 +41 -4
- data/app/assets/javascripts/decidim/input_character_counter.js.es6 +6 -1
- data/app/assets/javascripts/decidim/map/controller/markers.js.es6 +27 -9
- data/app/assets/javascripts/decidim/session_timeouter.js.es6 +78 -0
- data/app/assets/stylesheets/decidim/_variables.scss +9 -0
- data/app/assets/stylesheets/decidim/email.scss +14 -2
- data/app/assets/stylesheets/decidim/extras/_external-links.scss +0 -1
- data/app/assets/stylesheets/decidim/extras/_process_stats.scss +1 -1
- data/app/assets/stylesheets/decidim/extras/_results-per-page.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/_author-avatar.scss +2 -2
- data/app/assets/stylesheets/decidim/modules/_buttons.scss +2 -2
- data/app/assets/stylesheets/decidim/modules/_cards.scss +18 -1
- data/app/assets/stylesheets/decidim/modules/_collapsible-list.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_comments.scss +5 -1
- data/app/assets/stylesheets/decidim/modules/_conference-speaker.scss +4 -3
- data/app/assets/stylesheets/decidim/modules/_data-picker.scss +7 -0
- data/app/assets/stylesheets/decidim/modules/_extra.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_forms.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_loading-spinner.scss +34 -0
- data/app/assets/stylesheets/decidim/modules/_modules.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_opinion-toggle.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_reveal.scss +6 -0
- data/app/assets/stylesheets/decidim/modules/_signup.scss +1 -0
- data/app/assets/stylesheets/decidim/modules/{_process-stats.scss → _space-stats.scss} +1 -1
- data/app/cells/decidim/activity_cell.rb +11 -8
- data/app/cells/decidim/announcement/show.erb +4 -4
- data/app/cells/decidim/announcement_cell.rb +22 -2
- data/app/cells/decidim/author/flag_user.erb +10 -0
- data/app/cells/decidim/author/profile_minicard.erb +1 -1
- data/app/cells/decidim/author_cell.rb +9 -1
- data/app/cells/decidim/card_m/top.erb +1 -1
- data/app/cells/decidim/card_m_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/cta/show.erb +14 -0
- data/app/cells/decidim/content_blocks/cta_cell.rb +35 -0
- data/app/cells/decidim/content_blocks/cta_settings_form/show.erb +9 -0
- data/app/cells/decidim/content_blocks/cta_settings_form_cell.rb +13 -0
- data/app/cells/decidim/content_blocks/hero_cell.rb +14 -0
- data/app/cells/decidim/content_blocks/highlighted_elements/elements.erb +0 -0
- data/app/cells/decidim/content_blocks/highlighted_elements/heading.erb +0 -0
- data/app/cells/decidim/content_blocks/highlighted_elements/show.erb +4 -0
- data/app/cells/decidim/content_blocks/highlighted_elements_cell.rb +51 -0
- data/app/cells/decidim/content_blocks/highlighted_elements_settings_form/show.erb +3 -0
- data/app/cells/decidim/content_blocks/highlighted_elements_settings_form_cell.rb +28 -0
- data/app/cells/decidim/content_blocks/last_activity_cell.rb +11 -0
- data/app/cells/decidim/content_blocks/metrics_cell.rb +0 -6
- data/app/cells/decidim/content_blocks/stats_cell.rb +0 -6
- data/app/cells/decidim/date/show.erb +31 -0
- data/app/cells/decidim/date_cell.rb +50 -0
- data/app/cells/decidim/endorsement_buttons_cell.rb +3 -3
- data/app/cells/decidim/flag_modal/flag_user.erb +24 -0
- data/app/cells/decidim/flag_modal/show.erb +24 -0
- data/app/cells/decidim/flag_modal_cell.rb +25 -0
- data/app/cells/decidim/profile/inaccessible.erb +9 -0
- data/app/cells/decidim/profile_cell.rb +9 -1
- data/app/cells/decidim/profile_sidebar/show.erb +10 -1
- data/app/cells/decidim/profile_sidebar_cell.rb +1 -0
- data/app/cells/decidim/reported_content/show.erb +5 -0
- data/app/cells/decidim/reported_content_cell.rb +44 -0
- data/app/cells/decidim/scopes_picker/scope_picker_prompt.erb +3 -0
- data/app/cells/decidim/scopes_picker/scope_picker_values.erb +5 -0
- data/app/cells/decidim/scopes_picker/show.erb +14 -0
- data/app/cells/decidim/scopes_picker_cell.rb +93 -0
- data/app/cells/decidim/tos_page/announcement.erb +1 -1
- data/app/cells/decidim/tos_page/form.erb +15 -13
- data/app/cells/decidim/tos_page_cell.rb +10 -8
- data/app/cells/decidim/translation_bar_cell.rb +1 -1
- data/app/cells/decidim/user_conversation/conversation_header.erb +1 -1
- data/app/cells/decidim/user_conversations_cell.rb +1 -1
- data/app/commands/decidim/create_report.rb +11 -1
- data/app/commands/decidim/create_user_report.rb +67 -0
- data/app/commands/decidim/gallery_methods.rb +2 -2
- data/app/commands/decidim/multiple_attachments_methods.rb +14 -10
- data/app/commands/decidim/search.rb +5 -2
- data/app/commands/decidim/update_notifications_settings.rb +1 -0
- data/app/commands/decidim/update_user_group.rb +1 -0
- data/app/controllers/concerns/decidim/devise_controllers.rb +1 -0
- data/app/controllers/concerns/decidim/flaggable.rb +5 -1
- data/app/controllers/concerns/decidim/force_authentication.rb +11 -3
- data/app/controllers/concerns/decidim/locale_switcher.rb +5 -0
- data/app/controllers/concerns/decidim/needs_permission.rb +7 -1
- data/app/controllers/concerns/decidim/orderable.rb +3 -1
- data/app/controllers/concerns/decidim/user_blocked_checker.rb +26 -0
- data/app/controllers/decidim/application_controller.rb +22 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +3 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +10 -6
- data/app/controllers/decidim/errors_controller.rb +1 -1
- data/app/controllers/decidim/locales_controller.rb +1 -1
- data/app/controllers/decidim/profiles_controller.rb +6 -0
- data/app/controllers/decidim/report_users_controller.rb +42 -0
- data/app/controllers/decidim/scopes_controller.rb +19 -10
- data/app/controllers/decidim/timeouts_controller.rb +28 -0
- data/app/controllers/decidim/user_activities_controller.rb +5 -0
- data/app/controllers/decidim/user_timeline_controller.rb +1 -0
- data/app/events/decidim/demoted_membership_event.rb +2 -2
- data/app/events/decidim/invited_to_group_event.rb +2 -2
- data/app/events/decidim/join_request_accepted_event.rb +2 -2
- data/app/events/decidim/join_request_created_event.rb +2 -2
- data/app/events/decidim/join_request_rejected_event.rb +2 -2
- data/app/events/decidim/promoted_to_admin_event.rb +2 -2
- data/app/events/decidim/removed_from_group_event.rb +2 -2
- data/app/forms/decidim/account_form.rb +1 -1
- data/app/forms/decidim/invite_user_form.rb +2 -2
- data/app/forms/decidim/messaging/conversation_form.rb +1 -1
- data/app/forms/decidim/messaging/message_form.rb +1 -1
- data/app/forms/decidim/notifications_settings_form.rb +20 -0
- data/app/forms/url_validator.rb +20 -0
- data/app/helpers/decidim/action_authorization_helper.rb +2 -0
- data/app/helpers/decidim/application_helper.rb +1 -2
- data/app/helpers/decidim/cells_helper.rb +6 -0
- data/app/helpers/decidim/filters_helper.rb +9 -0
- data/app/helpers/decidim/messaging/conversation_helper.rb +11 -1
- data/app/helpers/decidim/newsletters_helper.rb +7 -9
- data/app/helpers/decidim/scopes_helper.rb +1 -1
- data/app/jobs/decidim/block_user_job.rb +11 -0
- data/app/jobs/decidim/export_job.rb +2 -2
- data/app/jobs/decidim/find_and_update_descendants_job.rb +48 -0
- data/app/jobs/decidim/machine_translation_resource_job.rb +3 -0
- data/app/jobs/decidim/machine_translation_save_job.rb +29 -0
- data/app/jobs/decidim/update_search_indexes_job.rb +11 -0
- data/app/jobs/decidim/user_report_job.rb +11 -0
- data/app/mailers/decidim/block_user_mailer.rb +21 -0
- data/app/mailers/decidim/reported_mailer.rb +33 -3
- data/app/mailers/decidim/user_report_mailer.rb +21 -0
- data/app/models/decidim/area.rb +0 -1
- data/app/models/decidim/area_type.rb +1 -1
- data/app/models/decidim/attachment.rb +3 -2
- data/app/models/decidim/attachment_collection.rb +1 -1
- data/app/models/decidim/authorization.rb +4 -0
- data/app/models/decidim/category.rb +6 -1
- data/app/models/decidim/impersonation_log.rb +5 -7
- data/app/models/decidim/metric.rb +2 -2
- data/app/models/decidim/moderation.rb +12 -0
- data/app/models/decidim/organization.rb +5 -1
- data/app/models/decidim/scope.rb +5 -2
- data/app/models/decidim/scope_type.rb +1 -1
- data/app/models/decidim/share_token.rb +1 -1
- data/app/models/decidim/static_page.rb +11 -1
- data/app/models/decidim/static_page_topic.rb +4 -0
- data/app/models/decidim/user.rb +12 -1
- data/app/models/decidim/user_base_entity.rb +12 -12
- data/app/models/decidim/user_block.rb +10 -0
- data/app/models/decidim/user_group.rb +1 -0
- data/app/models/decidim/user_moderation.rb +22 -0
- data/app/models/decidim/user_report.rb +31 -0
- data/app/permissions/decidim/permissions.rb +1 -3
- data/app/permissions/decidim/report_user_permissions.rb +13 -0
- data/app/presenters/decidim/admin_log/impersonation_log_presenter.rb +39 -0
- data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -2
- data/app/presenters/decidim/admin_log/user_moderation_presenter.rb +63 -0
- data/app/presenters/decidim/admin_log/user_presenter.rb +18 -9
- data/app/presenters/decidim/home_stats_presenter.rb +3 -3
- data/app/presenters/decidim/log/diff_presenter.rb +4 -3
- data/app/presenters/decidim/log/resource_presenter.rb +4 -4
- data/app/presenters/decidim/log/user_presenter.rb +1 -1
- data/app/presenters/decidim/menu_presenter.rb +12 -7
- data/app/presenters/decidim/nil_presenter.rb +0 -2
- data/app/presenters/decidim/user_presenter.rb +1 -1
- data/app/queries/decidim/metrics/blocked_users_metric_manage.rb +26 -0
- data/app/queries/decidim/metrics/followers_metric_manage.rb +3 -0
- data/app/queries/decidim/metrics/participants_metric_manage.rb +3 -0
- data/app/queries/decidim/metrics/reported_users_metric_manage.rb +26 -0
- data/app/queries/decidim/metrics/user_reports_metric_manage.rb +26 -0
- data/app/services/decidim/activity_search.rb +1 -3
- data/app/services/decidim/base_diff_renderer.rb +1 -1
- data/app/services/decidim/data_portability_exporter.rb +1 -0
- data/app/services/decidim/email_notification_generator.rb +2 -2
- data/app/services/decidim/events_manager.rb +1 -1
- data/app/services/decidim/open_data_exporter.rb +36 -7
- data/app/services/decidim/zip_stream/zip_stream_writer.rb +3 -3
- data/app/uploaders/decidim/application_uploader.rb +22 -2
- data/app/uploaders/decidim/attachment_uploader.rb +2 -4
- data/app/uploaders/decidim/downloader.rb +9 -0
- data/app/uploaders/decidim/image_uploader.rb +9 -21
- data/app/uploaders/decidim/open_data_uploader.rb +5 -0
- data/app/uploaders/decidim/record_image_uploader.rb +2 -2
- data/app/validators/etiquette_validator.rb +0 -7
- data/app/validators/uploader_content_type_validator.rb +4 -2
- data/app/views/decidim/block_user_mailer/notify.html.erb +7 -0
- data/app/views/decidim/devise/confirmations/new.html.erb +1 -1
- data/app/views/decidim/devise/registrations/edit.html.erb +1 -1
- data/app/views/decidim/devise/unlocks/new.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_conversation.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_messages.html.erb +1 -1
- data/app/views/decidim/messaging/conversations/_show.html.erb +4 -4
- data/app/views/decidim/notifications_settings/show.html.erb +11 -0
- data/app/views/decidim/pages/_standalone.html.erb +3 -1
- data/app/views/decidim/reported_mailer/report.html.erb +8 -8
- data/app/views/decidim/shared/_check_boxes_tree.html.erb +3 -3
- data/app/views/decidim/shared/_component_announcement.html.erb +2 -2
- data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +1 -1
- data/app/views/decidim/user_report_mailer/notify.html.erb +7 -0
- data/app/views/decidim/widgets/_data_picker.html.erb +1 -1
- data/app/views/layouts/decidim/_application.html.erb +1 -0
- data/app/views/layouts/decidim/_js_configuration.html.erb +1 -1
- data/app/views/layouts/decidim/_main_footer.html.erb +6 -4
- data/app/views/layouts/decidim/_timeout_modal.html.erb +21 -0
- data/config/initializers/active_support.rb +7 -0
- data/config/initializers/devise.rb +1 -1
- data/config/initializers/omniauth.rb +1 -1
- data/config/locales/ar.yml +1 -9
- data/config/locales/bg.yml +1 -15
- data/config/locales/ca.yml +42 -15
- data/config/locales/cs.yml +79 -14
- data/config/locales/de.yml +78 -13
- data/config/locales/el.yml +1 -16
- data/config/locales/en.yml +79 -14
- data/config/locales/eo.yml +0 -1
- data/config/locales/es-MX.yml +30 -15
- data/config/locales/es-PY.yml +30 -15
- data/config/locales/es.yml +30 -15
- data/config/locales/eu.yml +1 -9
- data/config/locales/fi-plain.yml +76 -12
- data/config/locales/fi.yml +76 -12
- data/config/locales/fr-CA.yml +79 -14
- data/config/locales/fr.yml +76 -11
- data/config/locales/gl.yml +1 -15
- data/config/locales/hu.yml +1 -14
- data/config/locales/id-ID.yml +1 -9
- data/config/locales/is-IS.yml +0 -2
- data/config/locales/it.yml +65 -14
- data/config/locales/ja.yml +1 -16
- data/config/locales/lv.yml +1 -14
- data/config/locales/nl.yml +38 -15
- data/config/locales/no.yml +7 -16
- data/config/locales/pl.yml +98 -23
- data/config/locales/pt-BR.yml +1 -9
- data/config/locales/pt.yml +1 -16
- data/config/locales/ro-RO.yml +20 -16
- data/config/locales/ru.yml +1 -10
- data/config/locales/sk.yml +1 -14
- data/config/locales/sr-CS.yml +0 -9
- data/config/locales/sv.yml +5 -16
- data/config/locales/tr-TR.yml +62 -13
- data/config/locales/uk.yml +1 -7
- data/config/locales/zh-CN.yml +1 -16
- data/config/routes.rb +9 -4
- data/db/migrate/20170713131206_add_admin_to_users.rb +1 -1
- data/db/migrate/20180206143340_fix_reference_for_all_resources.rb +2 -0
- data/db/migrate/20180314085339_rename_maximum_votes_per_proposal_to_threshold_per_proposal.rb +2 -2
- data/db/migrate/20200929171508_remove_show_statistics_from_organizations.rb +7 -0
- data/db/migrate/20201010124755_create_decidim_user_moderations.rb +12 -0
- data/db/migrate/20201010124756_create_decidim_user_reports.rb +16 -0
- data/db/migrate/20201010224433_add_suspension_fields_to_decidim_users.rb +8 -0
- data/db/migrate/20201011074641_create_decidim_user_suspensions.rb +14 -0
- data/db/migrate/20201011081626_add_current_suspension_id_to_decidim_users.rb +7 -0
- data/db/migrate/20201013071533_add_reported_content_to_moderations.rb +7 -0
- data/db/migrate/20201019074554_add_locale_to_moderation_reports.rb +7 -0
- data/db/migrate/20201127114444_encrypt_authorization_metadatas.rb +35 -0
- data/db/migrate/20201128130723_add_allow_public_access_to_static_pages.rb +17 -0
- data/db/migrate/20201218144706_update_table_block_user_functionality.rb +8 -0
- data/db/migrate/20201218145252_rename_decidim_user_fields_for_block_functionality.rb +9 -0
- data/db/migrate/20210208134328_add_email_on_moderations_to_users.rb +7 -0
- data/db/seeds.rb +14 -13
- data/lib/decidim/amendable.rb +3 -2
- data/{app/functions/decidim/core → lib/decidim/api/functions}/component_finder_base.rb +1 -1
- data/{app/functions/decidim/core → lib/decidim/api/functions}/component_list.rb +4 -4
- data/{app/functions/decidim/core → lib/decidim/api/functions}/component_list_base.rb +3 -1
- data/lib/decidim/api/functions/needs_api_default_order.rb +24 -0
- data/{app/functions/decidim/core → lib/decidim/api/functions}/needs_api_filter_and_order.rb +0 -0
- data/{app/functions/decidim/core → lib/decidim/api/functions}/participatory_space_finder_base.rb +2 -2
- data/{app/functions/decidim/core → lib/decidim/api/functions}/participatory_space_list_base.rb +3 -1
- data/{app/functions/decidim/core → lib/decidim/api/functions}/user_entity_finder.rb +1 -4
- data/{app/functions/decidim/core → lib/decidim/api/functions}/user_entity_list.rb +1 -3
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/base_input_filter.rb +0 -0
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/component_input_filter.rb +20 -22
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/has_hastaggable_input_filter.rb +1 -1
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/has_localized_input_filter.rb +3 -3
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/has_publishable_input_filter.rb +6 -6
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/has_timestamp_input_filter.rb +12 -12
- data/{app/types/decidim/core → lib/decidim/api/input_filters}/participatory_space_input_filter.rb +0 -1
- data/lib/decidim/api/input_filters/user_entity_input_filter.rb +89 -0
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/base_input_sort.rb +3 -2
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/component_input_sort.rb +10 -11
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/has_endorsable_input_sort.rb +2 -4
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/has_localized_input_sort.rb +3 -3
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/has_publishable_input_sort.rb +1 -1
- data/lib/decidim/api/input_sorts/has_timestamp_input_sort.rb +12 -0
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/participatory_space_input_sort.rb +1 -1
- data/{app/types/decidim/core → lib/decidim/api/input_sorts}/user_entity_input_sort.rb +4 -4
- data/lib/decidim/api/{amendable_entity_interface.rb → interfaces/amendable_entity_interface.rb} +5 -5
- data/lib/decidim/api/interfaces/amendable_interface.rb +17 -0
- data/lib/decidim/api/{attachable_interface.rb → interfaces/attachable_interface.rb} +3 -3
- data/lib/decidim/api/interfaces/author_interface.rb +32 -0
- data/lib/decidim/api/interfaces/authorable_interface.rb +23 -0
- data/lib/decidim/api/{categorizable_interface.rb → interfaces/categorizable_interface.rb} +3 -3
- data/lib/decidim/api/interfaces/coauthorable_interface.rb +30 -0
- data/lib/decidim/api/interfaces/component_interface.rb +22 -0
- data/lib/decidim/api/interfaces/endorsable_interface.rb +19 -0
- data/lib/decidim/api/{fingerprint_interface.rb → interfaces/fingerprint_interface.rb} +3 -3
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +48 -0
- data/lib/decidim/api/interfaces/participatory_space_resourceable_interface.rb +25 -0
- data/lib/decidim/api/{scopable_interface.rb → interfaces/scopable_interface.rb} +3 -3
- data/lib/decidim/api/interfaces/timestamps_interface.rb +15 -0
- data/lib/decidim/api/interfaces/traceable_interface.rb +14 -0
- data/lib/decidim/api/scalars/date_time_type.rb +17 -0
- data/lib/decidim/api/scalars/date_type.rb +17 -0
- data/lib/decidim/api/types/amendment_type.rb +19 -0
- data/lib/decidim/api/types/area_api_type.rb +16 -0
- data/lib/decidim/api/types/area_type_type.rb +13 -0
- data/lib/decidim/api/types/attachment_type.rb +13 -0
- data/lib/decidim/api/types/category_type.rb +14 -0
- data/{app/types/decidim/core → lib/decidim/api/types}/component_type.rb +2 -4
- data/lib/decidim/api/types/coordinates_type.rb +21 -0
- data/lib/decidim/api/types/decidim_type.rb +13 -0
- data/lib/decidim/api/types/fingerprint_type.rb +12 -0
- data/lib/decidim/api/types/hashtag_type.rb +13 -0
- data/lib/decidim/api/types/localized_string_type.rb +13 -0
- data/lib/decidim/api/types/metric_history_type.rb +18 -0
- data/lib/decidim/api/types/metric_type.rb +13 -0
- data/lib/decidim/api/types/organization_type.rb +17 -0
- data/lib/decidim/api/types/participatory_space_link_type.rb +22 -0
- data/lib/decidim/api/types/participatory_space_type.rb +10 -0
- data/lib/decidim/api/types/scope_api_type.rb +16 -0
- data/lib/decidim/api/types/session_type.rb +22 -0
- data/lib/decidim/api/types/statistic_type.rb +20 -0
- data/lib/decidim/api/types/trace_version_type.rb +21 -0
- data/lib/decidim/api/types/translated_field_type.rb +36 -0
- data/lib/decidim/api/types/user_group_type.rb +64 -0
- data/lib/decidim/api/types/user_type.rb +67 -0
- data/lib/decidim/attachment_attributes.rb +57 -0
- data/lib/decidim/attributes.rb +1 -0
- data/lib/decidim/attributes/clean_string.rb +37 -0
- data/lib/decidim/coauthorable.rb +3 -3
- data/lib/decidim/component_manifest.rb +17 -0
- data/lib/decidim/content_block_manifest.rb +1 -1
- data/lib/decidim/content_parsers/hashtag_parser.rb +3 -6
- data/lib/decidim/content_parsers/user_group_parser.rb +2 -5
- data/lib/decidim/content_parsers/user_parser.rb +2 -5
- data/lib/decidim/content_processor.rb +1 -1
- data/lib/decidim/content_renderers/hashtag_renderer.rb +3 -6
- data/lib/decidim/core.rb +11 -3
- data/lib/decidim/core/api.rb +71 -16
- data/lib/decidim/core/engine.rb +35 -6
- data/lib/decidim/core/test.rb +2 -0
- data/lib/decidim/core/test/factories.rb +53 -15
- data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/amendable/amendment_accepted_event_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/amendable/amendment_rejected_event_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +11 -9
- data/lib/decidim/core/test/shared_examples/component_type.rb +1 -1
- data/lib/decidim/core/test/shared_examples/controller_render_views.rb +28 -0
- data/lib/decidim/core/test/shared_examples/follows_examples.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 +1 -1
- data/lib/decidim/core/test/shared_examples/process_announcements_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/reportable.rb +8 -0
- data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +2 -3
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +46 -0
- data/lib/decidim/core/test/shared_examples/static_pages_examples.rb +43 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/diffy_extension.rb +2 -2
- data/lib/decidim/exporters/csv.rb +3 -2
- data/lib/decidim/exporters/export_data.rb +1 -1
- data/lib/decidim/faker/internet.rb +17 -0
- data/lib/decidim/faker/localized.rb +43 -20
- data/lib/decidim/file_validator_humanizer.rb +6 -4
- data/lib/decidim/form_builder.rb +33 -22
- data/lib/decidim/gamification/badge_scorer.rb +3 -2
- data/lib/decidim/gamification/base_event.rb +2 -2
- data/lib/decidim/geocodable.rb +2 -0
- data/lib/decidim/has_category.rb +1 -1
- data/lib/decidim/has_private_users.rb +1 -1
- data/lib/decidim/importers/import_manifest.rb +36 -0
- data/lib/decidim/map/autocomplete.rb +11 -1
- data/lib/decidim/metric_operation.rb +5 -6
- data/lib/decidim/participatory_space_resourceable.rb +1 -3
- data/lib/decidim/query_extensions.rb +90 -69
- data/lib/decidim/randomable.rb +6 -1
- data/lib/decidim/record_encryptor.rb +131 -0
- data/lib/decidim/reportable.rb +26 -0
- data/lib/decidim/resource_manifest.rb +3 -0
- data/lib/decidim/resourceable.rb +6 -6
- data/lib/decidim/scopable.rb +1 -1
- data/lib/decidim/search_resource_fields_mapper.rb +1 -1
- data/lib/decidim/searchable.rb +9 -0
- data/lib/decidim/settings_manifest.rb +2 -1
- data/lib/decidim/shareable_with_token.rb +0 -1
- data/lib/decidim/translatable_attributes.rb +2 -1
- data/lib/decidim/translatable_resource.rb +10 -0
- data/lib/decidim/user_reportable.rb +33 -0
- data/lib/decidim/view_model.rb +26 -0
- data/lib/premailer/adapter/decidim.rb +4 -4
- data/lib/tasks/decidim_data_portability_tasks.rake +4 -4
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ko.js +18 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.vi.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.zh-CN.js +14 -0
- data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.zh-TW.js +14 -0
- metadata +192 -101
- data/app/functions/decidim/core/participatory_space_finder.rb +0 -11
- data/app/functions/decidim/core/participatory_space_list.rb +0 -11
- data/app/types/decidim/core/amendment_type.rb +0 -26
- data/app/types/decidim/core/area_api_type.rb +0 -16
- data/app/types/decidim/core/area_type_type.rb +0 -14
- data/app/types/decidim/core/attachment_type.rb +0 -14
- data/app/types/decidim/core/category_type.rb +0 -16
- data/app/types/decidim/core/coordinates_type.rb +0 -19
- data/app/types/decidim/core/date_time_type.rb +0 -12
- data/app/types/decidim/core/date_type.rb +0 -13
- data/app/types/decidim/core/decidim_type.rb +0 -19
- data/app/types/decidim/core/fingerprint_type.rb +0 -15
- data/app/types/decidim/core/has_timestamp_input_sort.rb +0 -12
- data/app/types/decidim/core/hashtag_type.rb +0 -13
- data/app/types/decidim/core/localized_string_type.rb +0 -14
- data/app/types/decidim/core/metric_history_type.rb +0 -17
- data/app/types/decidim/core/metric_type.rb +0 -14
- data/app/types/decidim/core/organization_type.rb +0 -20
- data/app/types/decidim/core/participatory_space_link_type.rb +0 -24
- data/app/types/decidim/core/participatory_space_type.rb +0 -12
- data/app/types/decidim/core/scope_api_type.rb +0 -16
- data/app/types/decidim/core/session_type.rb +0 -19
- data/app/types/decidim/core/statistic_type.rb +0 -22
- data/app/types/decidim/core/trace_version_type.rb +0 -29
- data/app/types/decidim/core/translated_field_type.rb +0 -45
- data/app/types/decidim/core/user_entity_input_filter.rb +0 -81
- data/app/types/decidim/core/user_group_type.rb +0 -51
- data/app/types/decidim/core/user_type.rb +0 -52
- data/app/views/decidim/shared/_announcement.html.erb +0 -1
- data/app/views/decidim/shared/_flag_modal.html.erb +0 -20
- data/lib/decidim/api/amendable_interface.rb +0 -18
- data/lib/decidim/api/author_interface.rb +0 -29
- data/lib/decidim/api/authorable_interface.rb +0 -22
- data/lib/decidim/api/coauthorable_interface.rb +0 -29
- data/lib/decidim/api/component_interface.rb +0 -20
- data/lib/decidim/api/endorsable_interface.rb +0 -22
- data/lib/decidim/api/participatory_space_interface.rb +0 -47
- data/lib/decidim/api/participatory_space_resourceable_interface.rb +0 -21
- data/lib/decidim/api/timestamps_interface.rb +0 -21
- data/lib/decidim/api/traceable_interface.rb +0 -14
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
# A set of convenience methods to deal with attachment attributes for Virtus
|
7
|
+
# models that may set the attachment records through the original model
|
8
|
+
# (Decidim::Attachment) or through the user submitted form data (String).
|
9
|
+
module AttachmentAttributes
|
10
|
+
extend ActiveSupport::Concern
|
11
|
+
|
12
|
+
class_methods do
|
13
|
+
# Public: Mirrors Virtus' `attribute` interface to define attachment
|
14
|
+
# attributes for form objects.
|
15
|
+
#
|
16
|
+
# name - The attribute's name
|
17
|
+
#
|
18
|
+
#
|
19
|
+
# Example:
|
20
|
+
#
|
21
|
+
# attachment_attribute :photos
|
22
|
+
# # This will create two attributes of the following types:
|
23
|
+
# # attribute :photos, Array[String]
|
24
|
+
# # attribute :add_photos, Array
|
25
|
+
# # In addition, it will generate the getter method for the attribute
|
26
|
+
# # returning an array of the Decidim::Attachment records.
|
27
|
+
#
|
28
|
+
# Returns nothing.
|
29
|
+
def attachments_attribute(name)
|
30
|
+
attribute name, Array[String]
|
31
|
+
attribute "add_#{name}".to_sym, Array
|
32
|
+
|
33
|
+
# Define the getter method that fetches the attachment records based on
|
34
|
+
# their types. For Strings and Integers, assumes they are IDs and will
|
35
|
+
# fetch the attachment record matching that ID.
|
36
|
+
variable_name = "@#{name}_records"
|
37
|
+
define_method name do
|
38
|
+
return instance_variable_get(variable_name) if instance_variable_defined?(variable_name)
|
39
|
+
|
40
|
+
original = instance_variable_get("@#{name}")
|
41
|
+
return original unless original.is_a?(Array)
|
42
|
+
|
43
|
+
instance_variable_set(
|
44
|
+
variable_name,
|
45
|
+
original.map do |attachment|
|
46
|
+
if attachment.is_a?(String) || attachment.is_a?(Integer)
|
47
|
+
Decidim::Attachment.find_by(id: attachment)
|
48
|
+
else
|
49
|
+
attachment
|
50
|
+
end
|
51
|
+
end.compact
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/decidim/attributes.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Attributes
|
5
|
+
# Custom Virtus value to "standardize" the newline characters within strings
|
6
|
+
# that are sent through user entered forms. This strips out the carriage
|
7
|
+
# return characters from the strings in order to avoid validation mismatches
|
8
|
+
# with the string lengths between the frontend and the backend.
|
9
|
+
#
|
10
|
+
# This type should be used with forms that have:
|
11
|
+
# - A user input defined with the <textarea> element
|
12
|
+
# - The input element having the `maxlength` attribute defined for it
|
13
|
+
# - The backend having a maximum length validation for the input
|
14
|
+
class CleanString < Virtus::Attribute
|
15
|
+
# When using Windows or copying texts from existing documents, the text
|
16
|
+
# can contain the carriage return characters (\r) that the front-end
|
17
|
+
# character counter does not consider as actual characters. This happens
|
18
|
+
# because the character counter currently counts the characters using
|
19
|
+
# jQuery's `$input.val()` method which strips out the carriage return
|
20
|
+
# characters as explained at:
|
21
|
+
# https://api.jquery.com/val/
|
22
|
+
#
|
23
|
+
# Note: At present, using .val() on <textarea> elements strips carriage
|
24
|
+
# return characters from the browser-reported value.
|
25
|
+
#
|
26
|
+
# The backend, on the other hand, calculates these as characters as they
|
27
|
+
# are included in the data that gets sent to the server. In order to fix
|
28
|
+
# this mismatch, remove the carriage return characters from the text
|
29
|
+
# using this attribute type.
|
30
|
+
def coerce(value)
|
31
|
+
return value unless value.is_a?(String)
|
32
|
+
|
33
|
+
value.gsub(/\r/, "")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/decidim/coauthorable.rb
CHANGED
@@ -91,7 +91,7 @@ module Decidim
|
|
91
91
|
#
|
92
92
|
# author - the author to check for authorship
|
93
93
|
def authored_by?(author)
|
94
|
-
coauthorships.
|
94
|
+
coauthorships.exists?(author: author)
|
95
95
|
end
|
96
96
|
|
97
97
|
# Returns the identities for the authors, whether they are user groups, users or others.
|
@@ -140,8 +140,8 @@ module Decidim
|
|
140
140
|
def add_coauthor(author, extra_attributes = {})
|
141
141
|
user_group = extra_attributes[:user_group]
|
142
142
|
|
143
|
-
return if coauthorships.
|
144
|
-
return if user_group && coauthorships.
|
143
|
+
return if coauthorships.exists?(decidim_author_id: author.id, decidim_author_type: author.class.base_class.name) && user_group.blank?
|
144
|
+
return if user_group && coauthorships.exists?(user_group: user_group)
|
145
145
|
|
146
146
|
coauthorship_attributes = extra_attributes.merge(author: author)
|
147
147
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "decidim/settings_manifest"
|
4
4
|
require "decidim/exporters/export_manifest"
|
5
|
+
require "decidim/importers/import_manifest"
|
5
6
|
|
6
7
|
module Decidim
|
7
8
|
# This class handles all the logic associated to configuring a component
|
@@ -189,6 +190,22 @@ module Decidim
|
|
189
190
|
end
|
190
191
|
end
|
191
192
|
|
193
|
+
def imports(name, &block)
|
194
|
+
return unless name
|
195
|
+
|
196
|
+
@imports ||= []
|
197
|
+
@imports << [name, block]
|
198
|
+
@import_manifests = nil
|
199
|
+
end
|
200
|
+
|
201
|
+
def import_manifests
|
202
|
+
@import_manifests ||= Array(@imports).map do |(name, block)|
|
203
|
+
Decidim::Importers::ImportManifest.new(name, self).tap do |manifest|
|
204
|
+
block.call(manifest)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
192
209
|
def serializes_specific_data?
|
193
210
|
serializes_specific_data
|
194
211
|
end
|
@@ -53,7 +53,7 @@ module Decidim
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def image_names_are_unique
|
56
|
-
image_names = images.
|
56
|
+
image_names = images.pluck(:name)
|
57
57
|
errors.add(:images, "names must be unique per manifest") if image_names.count != image_names.uniq.count
|
58
58
|
end
|
59
59
|
|
@@ -25,7 +25,7 @@ module Decidim
|
|
25
25
|
# @return [String] the content with the hashtags replaced by global ids
|
26
26
|
def rewrite
|
27
27
|
content.gsub(HASHTAG_REGEX) do |match|
|
28
|
-
hashtag(match[1..-1]).to_global_id
|
28
|
+
"#{hashtag(match[1..-1]).to_global_id}/#{(extra_hashtags? ? "_" : "")}#{match[1..-1]}"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -40,11 +40,8 @@ module Decidim
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def hashtags
|
43
|
-
@hashtags ||=
|
44
|
-
existing_hashtags.
|
45
|
-
[hashtag.name, hashtag]
|
46
|
-
end
|
47
|
-
]
|
43
|
+
@hashtags ||=
|
44
|
+
existing_hashtags.index_by(&:name)
|
48
45
|
end
|
49
46
|
|
50
47
|
def existing_hashtags
|
@@ -116,7 +116,7 @@ module Decidim
|
|
116
116
|
return content if content.blank?
|
117
117
|
|
118
118
|
Decidim.content_processors.reduce(content) do |result, type|
|
119
|
-
renderer_klass(type).constantize.new(result).render(options)
|
119
|
+
renderer_klass(type).constantize.new(result).render(**options)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -10,7 +10,7 @@ module Decidim
|
|
10
10
|
# @see BaseRenderer Examples of how to use a content renderer
|
11
11
|
class HashtagRenderer < BaseRenderer
|
12
12
|
# Matches a global id representing a Decidim::Hashtag
|
13
|
-
GLOBAL_ID_REGEX = %r{gid
|
13
|
+
GLOBAL_ID_REGEX = %r{gid://[\w-]*/Decidim::Hashtag/(\d+)/?(_?)([[:alnum:]](?:[[:alnum:]]|_)*)?\b}.freeze
|
14
14
|
|
15
15
|
# Replaces found Global IDs matching an existing hashtag with
|
16
16
|
# a link to their detail page. The Global IDs representing an
|
@@ -47,11 +47,8 @@ module Decidim
|
|
47
47
|
private
|
48
48
|
|
49
49
|
def hashtags
|
50
|
-
@hashtags ||=
|
51
|
-
existing_hashtags.
|
52
|
-
[hashtag.id, hashtag]
|
53
|
-
end
|
54
|
-
]
|
50
|
+
@hashtags ||=
|
51
|
+
existing_hashtags.index_by(&:id)
|
55
52
|
end
|
56
53
|
|
57
54
|
def existing_hashtags
|
data/lib/decidim/core.rb
CHANGED
@@ -20,6 +20,7 @@ module Decidim
|
|
20
20
|
autoload :Traceable, "decidim/traceable"
|
21
21
|
autoload :Loggable, "decidim/loggable"
|
22
22
|
autoload :Reportable, "decidim/reportable"
|
23
|
+
autoload :UserReportable, "decidim/user_reportable"
|
23
24
|
autoload :Authorable, "decidim/authorable"
|
24
25
|
autoload :Coauthorable, "decidim/coauthorable"
|
25
26
|
autoload :Participable, "decidim/participable"
|
@@ -92,6 +93,8 @@ module Decidim
|
|
92
93
|
autoload :HasUploadValidations, "decidim/has_upload_validations"
|
93
94
|
autoload :FileValidatorHumanizer, "decidim/file_validator_humanizer"
|
94
95
|
autoload :ShareableWithToken, "decidim/shareable_with_token"
|
96
|
+
autoload :RecordEncryptor, "decidim/record_encryptor"
|
97
|
+
autoload :AttachmentAttributes, "decidim/attachment_attributes"
|
95
98
|
|
96
99
|
include ActiveSupport::Configurable
|
97
100
|
# Loads seeds from all engines.
|
@@ -115,7 +118,7 @@ module Decidim
|
|
115
118
|
organization,
|
116
119
|
manifest.name,
|
117
120
|
Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
118
|
-
Decidim::Faker::Localized.sentence(15)
|
121
|
+
Decidim::Faker::Localized.sentence(word_count: 15)
|
119
122
|
end
|
120
123
|
)
|
121
124
|
end
|
@@ -149,7 +152,7 @@ module Decidim
|
|
149
152
|
|
150
153
|
# Exposes a configuration option: The application available locales.
|
151
154
|
config_accessor :available_locales do
|
152
|
-
%w(en bg ar ca cs da de el eo es es-MX es-PY et eu fi-pl fi fr fr-CA ga gl hr hu id is it ja lt lv mt nl no pl pt pt-BR ro ru sk sl sr sv tr uk)
|
155
|
+
%w(en bg ar ca cs da de el eo es es-MX es-PY et eu fi-pl fi fr fr-CA ga gl hr hu id is it ja ko lt lv mt nl no pl pt pt-BR ro ru sk sl sr sv tr uk vi zh-CN zh-TW)
|
153
156
|
end
|
154
157
|
|
155
158
|
# Exposes a configuration option: The application default locale.
|
@@ -357,6 +360,11 @@ module Decidim
|
|
357
360
|
"decidim-cc"
|
358
361
|
end
|
359
362
|
|
363
|
+
# Defines how often session_timeouter.js checks time between current moment and last request
|
364
|
+
config_accessor :session_timeouter_interval do
|
365
|
+
10_000
|
366
|
+
end
|
367
|
+
|
360
368
|
# Public: Registers a global engine. This method is intended to be used
|
361
369
|
# by component engines that also offer unscoped functionality
|
362
370
|
#
|
@@ -556,7 +564,7 @@ module Decidim
|
|
556
564
|
organization = begin
|
557
565
|
if model.is_a?(Decidim::Organization)
|
558
566
|
model
|
559
|
-
elsif model.respond_to?(:organization)
|
567
|
+
elsif model.respond_to?(:organization) && model.organization.present?
|
560
568
|
model.organization
|
561
569
|
end
|
562
570
|
end
|
data/lib/decidim/core/api.rb
CHANGED
@@ -2,21 +2,76 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Core
|
5
|
-
autoload :
|
6
|
-
autoload :
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
autoload :
|
10
|
-
autoload :
|
11
|
-
autoload :
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
|
15
|
-
autoload :
|
16
|
-
autoload :
|
17
|
-
autoload :
|
18
|
-
autoload :
|
19
|
-
autoload :
|
20
|
-
autoload :
|
5
|
+
autoload :ComponentFinderBase, "decidim/api/functions/component_finder_base"
|
6
|
+
autoload :ComponentList, "decidim/api/functions/component_list"
|
7
|
+
autoload :ComponentListBase, "decidim/api/functions/component_list_base"
|
8
|
+
autoload :NeedsApiFilterAndOrder, "decidim/api/functions/needs_api_filter_and_order"
|
9
|
+
autoload :NeedsApiDefaultOrder, "decidim/api/functions/needs_api_default_order"
|
10
|
+
autoload :ParticipatorySpaceFinderBase, "decidim/api/functions/participatory_space_finder_base"
|
11
|
+
autoload :ParticipatorySpaceListBase, "decidim/api/functions/participatory_space_list_base"
|
12
|
+
autoload :UserEntityFinder, "decidim/api/functions/user_entity_finder"
|
13
|
+
autoload :UserEntityList, "decidim/api/functions/user_entity_list"
|
14
|
+
|
15
|
+
autoload :AmendmentType, "decidim/api/types/amendment_type"
|
16
|
+
autoload :AreaApiType, "decidim/api/types/area_api_type"
|
17
|
+
autoload :AreaTypeType, "decidim/api/types/area_type_type"
|
18
|
+
autoload :AttachmentType, "decidim/api/types/attachment_type"
|
19
|
+
autoload :CategoryType, "decidim/api/types/category_type"
|
20
|
+
autoload :ComponentType, "decidim/api/types/component_type"
|
21
|
+
autoload :CoordinatesType, "decidim/api/types/coordinates_type"
|
22
|
+
autoload :DecidimType, "decidim/api/types/decidim_type"
|
23
|
+
autoload :FingerprintType, "decidim/api/types/fingerprint_type"
|
24
|
+
autoload :HashtagType, "decidim/api/types/hashtag_type"
|
25
|
+
autoload :LocalizedStringType, "decidim/api/types/localized_string_type"
|
26
|
+
autoload :MetricHistoryType, "decidim/api/types/metric_history_type"
|
27
|
+
autoload :MetricType, "decidim/api/types/metric_type"
|
28
|
+
autoload :OrganizationType, "decidim/api/types/organization_type"
|
29
|
+
autoload :ParticipatorySpaceType, "decidim/api/types/participatory_space_type"
|
30
|
+
autoload :ParticipatorySpaceLinkType, "decidim/api/types/participatory_space_link_type"
|
31
|
+
autoload :ScopeApiType, "decidim/api/types/scope_api_type"
|
32
|
+
autoload :SessionType, "decidim/api/types/session_type"
|
33
|
+
autoload :StatisticType, "decidim/api/types/statistic_type"
|
34
|
+
autoload :TraceVersionType, "decidim/api/types/trace_version_type"
|
35
|
+
autoload :TranslatedFieldType, "decidim/api/types/translated_field_type"
|
36
|
+
autoload :UserGroupType, "decidim/api/types/user_group_type"
|
37
|
+
autoload :UserType, "decidim/api/types/user_type"
|
38
|
+
|
39
|
+
autoload :BaseInputFilter, "decidim/api/input_filters/base_input_filter"
|
40
|
+
autoload :ComponentInputFilter, "decidim/api/input_filters/component_input_filter"
|
41
|
+
autoload :HasHastaggableInputFilter, "decidim/api/input_filters/has_hastaggable_input_filter"
|
42
|
+
autoload :HasLocalizedInputFilter, "decidim/api/input_filters/has_localized_input_filter"
|
43
|
+
autoload :HasPublishableInputFilter, "decidim/api/input_filters/has_publishable_input_filter"
|
44
|
+
autoload :HasTimestampInputFilter, "decidim/api/input_filters/has_timestamp_input_filter"
|
45
|
+
autoload :ParticipatorySpaceInputFilter, "decidim/api/input_filters/participatory_space_input_filter"
|
46
|
+
autoload :UserEntityInputFilter, "decidim/api/input_filters/user_entity_input_filter"
|
47
|
+
|
48
|
+
autoload :BaseInputSort, "decidim/api/input_sorts/base_input_sort"
|
49
|
+
autoload :ComponentInputSort, "decidim/api/input_sorts/component_input_sort"
|
50
|
+
autoload :HasEndorsableInputSort, "decidim/api/input_sorts/has_endorsable_input_sort"
|
51
|
+
autoload :HasLocalizedInputSort, "decidim/api/input_sorts/has_localized_input_sort"
|
52
|
+
autoload :HasPublishableInputSort, "decidim/api/input_sorts/has_publishable_input_sort"
|
53
|
+
autoload :HasTimestampInputSort, "decidim/api/input_sorts/has_timestamp_input_sort"
|
54
|
+
autoload :ParticipatorySpaceInputSort, "decidim/api/input_sorts/participatory_space_input_sort"
|
55
|
+
autoload :UserEntityInputSort, "decidim/api/input_sorts/user_entity_input_sort"
|
56
|
+
|
57
|
+
autoload :ParticipatorySpaceInterface, "decidim/api/interfaces/participatory_space_interface"
|
58
|
+
autoload :ComponentInterface, "decidim/api/interfaces/component_interface"
|
59
|
+
autoload :AuthorInterface, "decidim/api/interfaces/author_interface"
|
60
|
+
autoload :AuthorableInterface, "decidim/api/interfaces/authorable_interface"
|
61
|
+
autoload :CoauthorableInterface, "decidim/api/interfaces/coauthorable_interface"
|
62
|
+
autoload :CategorizableInterface, "decidim/api/interfaces/categorizable_interface"
|
63
|
+
autoload :ScopableInterface, "decidim/api/interfaces/scopable_interface"
|
64
|
+
autoload :AttachableInterface, "decidim/api/interfaces/attachable_interface"
|
65
|
+
autoload :HashtagInterface, "decidim/api/interfaces/hashtag_interface"
|
66
|
+
autoload :ParticipatorySpaceResourceableInterface, "decidim/api/interfaces/participatory_space_resourceable_interface"
|
67
|
+
autoload :FingerprintInterface, "decidim/api/interfaces/fingerprint_interface"
|
68
|
+
autoload :AmendableInterface, "decidim/api/interfaces/amendable_interface"
|
69
|
+
autoload :AmendableEntityInterface, "decidim/api/interfaces/amendable_entity_interface"
|
70
|
+
autoload :TraceableInterface, "decidim/api/interfaces/traceable_interface"
|
71
|
+
autoload :TimestampsInterface, "decidim/api/interfaces/timestamps_interface"
|
72
|
+
autoload :EndorsableInterface, "decidim/api/interfaces/endorsable_interface"
|
73
|
+
|
74
|
+
autoload :DateTimeType, "decidim/api/scalars/date_time_type"
|
75
|
+
autoload :DateType, "decidim/api/scalars/date_type"
|
21
76
|
end
|
22
77
|
end
|
data/lib/decidim/core/engine.rb
CHANGED
@@ -37,7 +37,6 @@ require "kaminari"
|
|
37
37
|
require "doorkeeper"
|
38
38
|
require "doorkeeper-i18n"
|
39
39
|
require "nobspw"
|
40
|
-
require "kaminari"
|
41
40
|
require "batch-loader"
|
42
41
|
require "etherpad-lite"
|
43
42
|
require "diffy"
|
@@ -89,9 +88,9 @@ module Decidim
|
|
89
88
|
end
|
90
89
|
|
91
90
|
initializer "decidim.graphql_api" do
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
# Enable them method `!` everywhere for compatibility, this line will be removed when upgrading to GraphQL 2.0
|
92
|
+
GraphQL::DeprecatedDSL.activate
|
93
|
+
Decidim::Api::QueryType.include Decidim::QueryExtensions
|
95
94
|
|
96
95
|
Decidim::Api.add_orphan_type Decidim::Core::UserType
|
97
96
|
Decidim::Api.add_orphan_type Decidim::Core::UserGroupType
|
@@ -110,7 +109,7 @@ module Decidim
|
|
110
109
|
# that may be using the `geocoded_by` or `reverse_geocoded_by` class
|
111
110
|
# methods injected by the Geocoder gem.
|
112
111
|
ActiveSupport.on_load :active_record do
|
113
|
-
ActiveRecord::Base.
|
112
|
+
ActiveRecord::Base.include Decidim::Geocodable
|
114
113
|
end
|
115
114
|
end
|
116
115
|
|
@@ -335,6 +334,36 @@ module Decidim
|
|
335
334
|
end
|
336
335
|
end
|
337
336
|
|
337
|
+
Decidim.metrics_registry.register(:blocked_users) do |metric_registry|
|
338
|
+
metric_registry.manager_class = "Decidim::Metrics::BlockedUsersMetricManage"
|
339
|
+
|
340
|
+
metric_registry.settings do |settings|
|
341
|
+
settings.attribute :highlighted, type: :boolean, default: false
|
342
|
+
settings.attribute :scopes, type: :array, default: %w(home)
|
343
|
+
settings.attribute :weight, type: :integer, default: 1
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
Decidim.metrics_registry.register(:user_reports) do |metric_registry|
|
348
|
+
metric_registry.manager_class = "Decidim::Metrics::UserReportsMetricManage"
|
349
|
+
|
350
|
+
metric_registry.settings do |settings|
|
351
|
+
settings.attribute :highlighted, type: :boolean, default: false
|
352
|
+
settings.attribute :scopes, type: :array, default: %w(home)
|
353
|
+
settings.attribute :weight, type: :integer, default: 1
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
Decidim.metrics_registry.register(:reported_users) do |metric_registry|
|
358
|
+
metric_registry.manager_class = "Decidim::Metrics::ReportedUsersMetricManage"
|
359
|
+
|
360
|
+
metric_registry.settings do |settings|
|
361
|
+
settings.attribute :highlighted, type: :boolean, default: false
|
362
|
+
settings.attribute :scopes, type: :array, default: %w(home)
|
363
|
+
settings.attribute :weight, type: :integer, default: 1
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
338
367
|
Decidim.metrics_registry.register(:participants) do |metric_registry|
|
339
368
|
metric_registry.manager_class = "Decidim::Metrics::ParticipantsMetricManage"
|
340
369
|
|
@@ -513,7 +542,7 @@ module Decidim
|
|
513
542
|
end
|
514
543
|
|
515
544
|
config.to_prepare do
|
516
|
-
FoundationRailsHelper::FlashHelper.
|
545
|
+
FoundationRailsHelper::FlashHelper.include Decidim::FlashHelperExtensions
|
517
546
|
end
|
518
547
|
end
|
519
548
|
end
|