diff --git a/Gemfile.lock b/Gemfile.lock index 6938b840..fcf43972 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,56 +1,55 @@ GIT remote: https://github.com/CodiTramuntana/decidim - revision: 9ea65926c526c968666c163c9b7e7484c073d6f6 + revision: 21c297b5feafdeae836090a3a4ed3766aae3a69d branch: release/0.27-stable specs: - decidim (0.27.8) - decidim-accountability (= 0.27.8) - decidim-admin (= 0.27.8) - decidim-api (= 0.27.8) - decidim-assemblies (= 0.27.8) - decidim-blogs (= 0.27.8) - decidim-budgets (= 0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-debates (= 0.27.8) - decidim-forms (= 0.27.8) - decidim-generators (= 0.27.8) - decidim-meetings (= 0.27.8) - decidim-pages (= 0.27.8) - decidim-participatory_processes (= 0.27.8) - decidim-proposals (= 0.27.8) - decidim-sortitions (= 0.27.8) - decidim-surveys (= 0.27.8) - decidim-system (= 0.27.8) - decidim-templates (= 0.27.8) - decidim-verifications (= 0.27.8) - decidim-accountability (0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-admin (0.27.8) + decidim (0.27.9) + decidim-accountability (= 0.27.9) + decidim-admin (= 0.27.9) + decidim-api (= 0.27.9) + decidim-assemblies (= 0.27.9) + decidim-blogs (= 0.27.9) + decidim-budgets (= 0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-debates (= 0.27.9) + decidim-forms (= 0.27.9) + decidim-generators (= 0.27.9) + decidim-meetings (= 0.27.9) + decidim-pages (= 0.27.9) + decidim-participatory_processes (= 0.27.9) + decidim-proposals (= 0.27.9) + decidim-sortitions (= 0.27.9) + decidim-surveys (= 0.27.9) + decidim-system (= 0.27.9) + decidim-verifications (= 0.27.9) + decidim-accountability (0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-admin (0.27.9) active_link_to (~> 1.0) - decidim-core (= 0.27.8) + decidim-core (= 0.27.9) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.27.8) - decidim-core (= 0.27.8) + decidim-api (0.27.9) + decidim-core (= 0.27.9) graphql (~> 1.12, < 1.13) graphql-docs (~> 2.1.0) rack-cors (~> 1.0) - decidim-assemblies (0.27.8) - decidim-core (= 0.27.8) - decidim-blogs (0.27.8) - decidim-admin (= 0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-budgets (0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-comments (0.27.8) - decidim-core (= 0.27.8) + decidim-assemblies (0.27.9) + decidim-core (= 0.27.9) + decidim-blogs (0.27.9) + decidim-admin (= 0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-budgets (0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-comments (0.27.9) + decidim-core (= 0.27.9) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.27.8) + decidim-core (0.27.9) active_link_to (~> 1.0) acts_as_list (~> 0.9) batch-loader (~> 1.2) @@ -99,15 +98,15 @@ GIT webpacker (= 6.0.0.rc.5) webpush (~> 1.1) wisper (~> 2.0) - decidim-debates (0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-dev (0.27.8) + decidim-debates (0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-dev (0.27.9) axe-core-rspec (~> 4.1.0) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.10.0) - decidim (= 0.27.8) + decidim (= 0.27.9) erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8) faker (= 2.19.0) @@ -118,6 +117,7 @@ GIT puma (~> 5.0) rails-controller-testing (~> 1.0) rspec-cells (~> 0.3.7) + rspec-expectations (= 3.13.1) rspec-html-matchers (~> 0.9.1) rspec-rails (~> 4.0) rspec-retry (~> 0.6.2) @@ -131,44 +131,44 @@ GIT w3c_rspec_validators (~> 0.3.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.27.8) - decidim-core (= 0.27.8) + decidim-forms (0.27.9) + decidim-core (= 0.27.9) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.8) - decidim-core (= 0.27.8) - decidim-meetings (0.27.8) - decidim-core (= 0.27.8) - decidim-forms (= 0.27.8) + decidim-generators (0.27.9) + decidim-core (= 0.27.9) + decidim-meetings (0.27.9) + decidim-core (= 0.27.9) + decidim-forms (= 0.27.9) icalendar (~> 2.5) - decidim-pages (0.27.8) - decidim-core (= 0.27.8) - decidim-participatory_processes (0.27.8) - decidim-core (= 0.27.8) - decidim-proposals (0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) + decidim-pages (0.27.9) + decidim-core (= 0.27.9) + decidim-participatory_processes (0.27.9) + decidim-core (= 0.27.9) + decidim-proposals (0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) doc2text (~> 0.4.5) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.8) - decidim-admin (= 0.27.8) - decidim-comments (= 0.27.8) - decidim-core (= 0.27.8) - decidim-proposals (= 0.27.8) - decidim-surveys (0.27.8) - decidim-core (= 0.27.8) - decidim-forms (= 0.27.8) - decidim-system (0.27.8) + decidim-sortitions (0.27.9) + decidim-admin (= 0.27.9) + decidim-comments (= 0.27.9) + decidim-core (= 0.27.9) + decidim-proposals (= 0.27.9) + decidim-surveys (0.27.9) + decidim-core (= 0.27.9) + decidim-forms (= 0.27.9) + decidim-system (0.27.9) active_link_to (~> 1.0) - decidim-core (= 0.27.8) + decidim-core (= 0.27.9) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-templates (0.27.8) - decidim-core (= 0.27.8) - decidim-forms (= 0.27.8) - decidim-verifications (0.27.8) - decidim-core (= 0.27.8) + decidim-templates (0.27.9) + decidim-core (= 0.27.9) + decidim-forms (= 0.27.9) + decidim-verifications (0.27.9) + decidim-core (= 0.27.9) GIT remote: https://github.com/gencat/decidim-module-challenges.git @@ -310,7 +310,7 @@ GEM addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) - axe-core-api (4.9.1) + axe-core-api (4.10.0) dumb_delegator virtus axe-core-rspec (4.1.0) @@ -334,7 +334,7 @@ GEM smart_properties bigdecimal (3.1.8) bindex (0.8.1) - bootsnap (1.18.3) + bootsnap (1.18.4) msgpack (~> 1.2) browser (2.7.1) builder (3.3.0) @@ -385,12 +385,12 @@ GEM execjs coffee-script-source (1.12.2) commonmarker (0.23.10) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) crack (1.0.0) bigdecimal rexml crass (1.0.6) - css_parser (1.17.1) + css_parser (1.19.0) addressable csv (3.3.0) daemons (1.4.1) @@ -424,9 +424,9 @@ GEM polyglot railties (>= 5.2) rainbow (>= 2.1.0) - delayed_job (4.1.11) + delayed_job (4.1.12) activesupport (>= 3.0, < 8.0) - delayed_job_active_record (4.1.8) + delayed_job_active_record (4.1.10) activerecord (>= 3.0, < 8.0) delayed_job (>= 3.0, < 5) descendants_tracker (0.0.4) @@ -475,10 +475,10 @@ GEM railties (>= 3.0.0) faker (2.19.0) i18n (>= 1.6, < 2) - faraday (2.10.0) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.11.0) + faraday-net_http (>= 2.0, < 3.4) logger - faraday-net_http (3.1.0) + faraday-net_http (3.3.0) net-http ffi (1.17.0) figaro (1.2.0) @@ -486,7 +486,7 @@ GEM file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.4.0) + fog-core (2.5.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) @@ -514,9 +514,9 @@ GEM graphql (~> 1.12) html-pipeline (~> 2.9) sass (~> 3.4) - hashdiff (1.1.0) + hashdiff (1.1.1) hashie (3.6.0) - highline (3.1.0) + highline (3.1.1) reline hkdf (0.3.0) html-pipeline (2.14.3) @@ -577,7 +577,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -597,10 +597,10 @@ GEM method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) + mime-types-data (3.2024.0903) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.24.1) + minitest (5.25.1) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb @@ -611,7 +611,7 @@ GEM multipart-post (2.0.0) net-http (0.4.1) uri - net-imap (0.4.14) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) @@ -621,7 +621,7 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.6-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -642,7 +642,7 @@ GEM rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (1.1.2) + omniauth-google-oauth2 (1.1.3) jwt (>= 2.0) oauth2 (~> 2.0) omniauth (~> 2.0) @@ -650,9 +650,10 @@ GEM omniauth-idcat_mobil (0.5.0) omniauth (~> 2.0.4) omniauth-oauth2 (>= 1.7.2, < 2.0) - omniauth-oauth (1.2.0) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) + rack (>= 1.6.2, < 4) omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) @@ -666,30 +667,30 @@ GEM paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.25.1) + parallel (1.26.3) parallel_tests (3.13.0) parallel - parser (3.3.4.0) + parser (3.3.5.0) ast (~> 2.4.1) racc pg (1.1.4) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) polyglot (0.3.5) - premailer (1.23.0) + premailer (1.27.0) addressable - css_parser (>= 1.12.0) + css_parser (>= 1.19.0) htmlentities (>= 4.0.0) premailer-rails (1.12.0) actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) psych (3.3.4) - public_suffix (6.0.0) + public_suffix (6.0.1) puma (5.6.8) nio4r (~> 2.0) - racc (1.8.0) + racc (1.8.1) rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) @@ -749,15 +750,14 @@ GEM redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.2) - strscan + rexml (3.3.7) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -765,7 +765,7 @@ GEM rspec-cells (0.3.9) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.2.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) @@ -798,7 +798,7 @@ GEM rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) rubocop-faker (1.1.0) faker (>= 2.12.0) @@ -835,7 +835,7 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) snaky_hash (2.0.1) @@ -854,18 +854,17 @@ GEM sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) ssrf_filter (1.1.2) - strscan (3.1.0) sys-uname (1.0.4) ffi (>= 1.0.0) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.1) + thor (1.3.2) thread_safe (0.3.6) tilt (2.4.0) timeout (0.4.1) @@ -874,7 +873,7 @@ GEM concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.5.0) - uri (0.13.0) + uri (0.13.1) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) @@ -919,10 +918,10 @@ GEM activesupport wisper (2.0.1) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.7) + wkhtmltopdf-binary (0.12.6.8) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.16) + zeitwerk (2.6.18) PLATFORMS x86_64-linux diff --git a/decidim-process-extended/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb b/decidim-process-extended/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb index 6e3f6803..934266c8 100644 --- a/decidim-process-extended/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +++ b/decidim-process-extended/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb @@ -22,15 +22,38 @@ def serialize id: process.id, socrata_published_at: Date.current, title_ca: process.title["ca"], + subtitle: process.subtitle, url: url, slug: process.slug, - short_description_ca: short_description_ca, process_type: process_type, + description: process.description, + short_description: process.short_description, + promoted: process.promoted, + developer_group: process.developer_group, + local_area: process.local_area, + target: process.target, + participatory_scope: process.participatory_scope, + participatory_structure: process.participatory_structure, + meta_scope: process.meta_scope, + announcement: process.announcement, + private_space: process.private_space, + scopes_enabled: process.scopes_enabled, + show_metrics: process.show_metrics, + show_statistics: process.show_statistics, + scope: { + id: process.scope.try(:id), + name: process.scope.try(:name) || empty_translatable + }, scope_id: process.scope&.id, scope_name_ca: process.scope&.name.try(:[], "ca"), department_id: process.area&.id, department_name_ca: process.area&.name.try(:[], "ca"), - participatory_space: process.participatory_process_group&.title.try(:[], "ca")&.downcase, + participatory_process_group: { + id: process.participatory_process_group&.try(:id), + title: process.participatory_process_group.try(:title) || empty_translatable, + description: process.participatory_process_group.try(:description) || empty_translatable, + remote_hero_image_url: Decidim::ParticipatoryProcesses::ParticipatoryProcessGroupPresenter.new(process.participatory_process_group).hero_image_url + }, participatory_process_type: { id: process.participatory_process_type.try(:id), title: process.participatory_process_type.try(:title) || empty_translatable @@ -61,7 +84,11 @@ def serialize debates_num_debates: debates.count, # Related Resources: Assemblies has_related_assembly: related_assembly.present?, - related_assembly_name_ca: related_assembly&.title.try(:[], "ca") + related_assembly_name_ca: related_assembly&.title.try(:[], "ca"), + attachments: { + attachment_collections: serialize_attachment_collections, + files: serialize_attachments + }, } end @@ -69,12 +96,40 @@ def serialize attr_reader :process - def url - Decidim::ResourceLocatorPresenter.new(process).url&.split("?")&.first + def serialize_attachment_collections + return unless process.attachment_collections.any? + + process.attachment_collections.map do |collection| + { + id: collection.try(:id), + name: collection.try(:name), + weight: collection.try(:weight), + description: collection.try(:description) + } + end + end + + def serialize_attachments + return unless process.attachments.any? + + process.attachments.map do |attachment| + { + id: attachment.try(:id), + title: attachment.try(:title), + weight: attachment.try(:weight), + description: attachment.try(:description), + attachment_collection: { + name: attachment.attachment_collection.try(:name), + weight: attachment.attachment_collection.try(:weight), + description: attachment.attachment_collection.try(:description) + }, + remote_file_url: Decidim::AttachmentPresenter.new(attachment).attachment_file_url + } + end end - def short_description_ca - ActionController::Base.helpers.strip_tags(process.short_description["ca"]) + def url + Decidim::ResourceLocatorPresenter.new(process).url&.split("?")&.first end def process_type