diff --git a/Gemfile b/Gemfile index 2cea564b..198d6007 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" ruby RUBY_VERSION -DECIDIM_VERSION = { git: "https://github.com/decidim/decidim.git", branch: "release/0.23-stable" }.freeze +DECIDIM_VERSION = { git: "https://github.com/Platoniq/decidim.git", branch: "backport/meetings-order" }.freeze gem "codit-devise-cas-authenticable", git: "https://github.com/Som-Energia/codit-devise-cas-authenticable.git" gem "decidim", DECIDIM_VERSION diff --git a/Gemfile.lock b/Gemfile.lock index 2cbaab86..c415a1f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,89 +7,73 @@ GIT decidim-core (>= 0.18.0) GIT - remote: https://github.com/Som-Energia/codit-devise-cas-authenticable.git - revision: 27f87ab349d397224185cae5232dcb30d523d025 + remote: https://github.com/Platoniq/decidim.git + revision: f30f42a547e77fda78c0d397b26b6db9e9ed5f1c + branch: backport/meetings-order specs: - codit-devise-cas-authenticable (0.0.6) - devise (>= 1.2.0) - rubycas-client (>= 2.2.1) - -GIT - remote: https://github.com/Som-Energia/decidim-cas-client.git - revision: c412d59766607f4c8ce75810ed5069751eaeca2f - specs: - decidim-cas_client (0.0.20) - decidim-core (>= 0.16.0) - decidim-verifications (>= 0.16.0) - -GIT - remote: https://github.com/decidim/decidim.git - revision: a9abb976e93b9f834a15dc053e9c9f42de003669 - branch: release/0.23-stable - specs: - decidim (0.23.4) - decidim-accountability (= 0.23.4) - decidim-admin (= 0.23.4) - decidim-api (= 0.23.4) - decidim-assemblies (= 0.23.4) - decidim-blogs (= 0.23.4) - decidim-budgets (= 0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) - decidim-debates (= 0.23.4) - decidim-forms (= 0.23.4) - decidim-generators (= 0.23.4) - decidim-meetings (= 0.23.4) - decidim-pages (= 0.23.4) - decidim-participatory_processes (= 0.23.4) - decidim-proposals (= 0.23.4) - decidim-sortitions (= 0.23.4) - decidim-surveys (= 0.23.4) - decidim-system (= 0.23.4) - decidim-verifications (= 0.23.4) - decidim-accountability (0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) + decidim (0.23.5) + decidim-accountability (= 0.23.5) + decidim-admin (= 0.23.5) + decidim-api (= 0.23.5) + decidim-assemblies (= 0.23.5) + decidim-blogs (= 0.23.5) + decidim-budgets (= 0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) + decidim-debates (= 0.23.5) + decidim-forms (= 0.23.5) + decidim-generators (= 0.23.5) + decidim-meetings (= 0.23.5) + decidim-pages (= 0.23.5) + decidim-participatory_processes (= 0.23.5) + decidim-proposals (= 0.23.5) + decidim-sortitions (= 0.23.5) + decidim-surveys (= 0.23.5) + decidim-system (= 0.23.5) + decidim-verifications (= 0.23.5) + decidim-accountability (0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-admin (0.23.4) + decidim-admin (0.23.5) active_link_to (~> 1.0) - decidim-core (= 0.23.4) + decidim-core (= 0.23.5) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 1.7) jquery-rails (~> 4.3) sassc (~> 2.3.0) sassc-rails (~> 2.1.2) - decidim-api (0.23.4) + decidim-api (0.23.5) graphiql-rails (~> 1.4, < 1.5) graphql (~> 1.9) rack-cors (~> 1.0) redcarpet (~> 3.4) sprockets-es6 (~> 0.9.2) - decidim-assemblies (0.23.4) - decidim-core (= 0.23.4) - decidim-blogs (0.23.4) - decidim-admin (= 0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) + decidim-assemblies (0.23.5) + decidim-core (= 0.23.5) + decidim-blogs (0.23.5) + decidim-admin (= 0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) httparty (~> 0.17) jquery-tmpl-rails (~> 1.1) kaminari (~> 1.2, >= 1.2.1) - decidim-budgets (0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) + decidim-budgets (0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-comments (0.23.4) - decidim-core (= 0.23.4) + decidim-comments (0.23.5) + decidim-core (= 0.23.5) jquery-rails (~> 4.3) redcarpet (~> 3.4) - decidim-consultations (0.23.4) - decidim-admin (= 0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) - decidim-core (0.23.4) + decidim-consultations (0.23.5) + decidim-admin (= 0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) + decidim-core (0.23.5) active_link_to (~> 1.0) anchored (>= 1.1.0) autoprefixer-rails (~> 8.0) @@ -100,7 +84,7 @@ GIT cells-rails (~> 0.0.9) charlock_holmes (~> 0.7) date_validator (~> 0.9.0) - decidim-api (= 0.23.4) + decidim-api (= 0.23.5) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) @@ -147,16 +131,16 @@ GIT uglifier (~> 4.1) valid_email2 (~> 2.1) wisper (~> 2.0) - decidim-debates (0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) + decidim-debates (0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-dev (0.23.4) + decidim-dev (0.23.5) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.9.0) - decidim (= 0.23.4) + decidim (= 0.23.5) erb_lint (~> 0.0.28) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) @@ -178,66 +162,82 @@ GIT system_test_html_screenshots (~> 0.1.1) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.23.4) - decidim-core (= 0.23.4) + decidim-forms (0.23.5) + decidim-core (= 0.23.5) wicked_pdf (~> 1.4) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.23.4) - decidim-core (= 0.23.4) - decidim-initiatives (0.23.4) - decidim-admin (= 0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) - decidim-verifications (= 0.23.4) + decidim-generators (0.23.5) + decidim-core (= 0.23.5) + decidim-initiatives (0.23.5) + decidim-admin (= 0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) + decidim-verifications (= 0.23.5) kaminari (~> 1.2, >= 1.2.1) origami (~> 2.1) virtus-multiparams (~> 0.1) wicked (~> 1.3) wicked_pdf (~> 1.4) wkhtmltopdf-binary (~> 0.12) - decidim-meetings (0.23.4) + decidim-meetings (0.23.5) cells-erb (~> 0.1.0) cells-rails (~> 0.0.9) - decidim-core (= 0.23.4) - decidim-forms (= 0.23.4) + decidim-core (= 0.23.5) + decidim-forms (= 0.23.5) httparty (~> 0.17) icalendar (~> 2.5) jquery-tmpl-rails (~> 1.1) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-pages (0.23.4) - decidim-core (= 0.23.4) - decidim-participatory_processes (0.23.4) - decidim-core (= 0.23.4) - decidim-proposals (0.23.4) + decidim-pages (0.23.5) + decidim-core (= 0.23.5) + decidim-participatory_processes (0.23.5) + decidim-core (= 0.23.5) + decidim-proposals (0.23.5) acts_as_list (~> 0.9) cells-erb (~> 0.1.0) cells-rails (~> 0.0.9) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) doc2text (~> 0.4.2) kaminari (~> 1.2, >= 1.2.1) ransack (~> 2.1.1) redcarpet (~> 3.4) - decidim-sortitions (0.23.4) - decidim-admin (= 0.23.4) - decidim-comments (= 0.23.4) - decidim-core (= 0.23.4) - decidim-proposals (= 0.23.4) - decidim-surveys (0.23.4) - decidim-core (= 0.23.4) - decidim-forms (= 0.23.4) - decidim-system (0.23.4) + decidim-sortitions (0.23.5) + decidim-admin (= 0.23.5) + decidim-comments (= 0.23.5) + decidim-core (= 0.23.5) + decidim-proposals (= 0.23.5) + decidim-surveys (0.23.5) + decidim-core (= 0.23.5) + decidim-forms (= 0.23.5) + decidim-system (0.23.5) active_link_to (~> 1.0) - decidim-core (= 0.23.4) + decidim-core (= 0.23.5) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 1.7) jquery-rails (~> 4.3) sassc (~> 2.3.0) sassc-rails (~> 2.1.2) - decidim-verifications (0.23.4) - decidim-core (= 0.23.4) + decidim-verifications (0.23.5) + decidim-core (= 0.23.5) + +GIT + remote: https://github.com/Som-Energia/codit-devise-cas-authenticable.git + revision: 27f87ab349d397224185cae5232dcb30d523d025 + specs: + codit-devise-cas-authenticable (0.0.6) + devise (>= 1.2.0) + rubycas-client (>= 2.2.1) + +GIT + remote: https://github.com/Som-Energia/decidim-cas-client.git + revision: c412d59766607f4c8ce75810ed5069751eaeca2f + specs: + decidim-cas_client (0.0.20) + decidim-core (>= 0.16.0) + decidim-verifications (>= 0.16.0) GEM remote: https://rubygems.org/ @@ -367,7 +367,7 @@ GEM actionpack (>= 3.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (16.11.7) + chef-utils (16.13.16) childprocess (3.0.0) chronic (0.10.2) coercible (1.0.0) @@ -393,10 +393,11 @@ GEM db-query-matchers (0.9.0) activesupport (>= 4.0, <= 6.0) rspec (~> 3.0) - decidim-decidim_awesome (0.6.6) + decidim-decidim_awesome (0.6.7) decidim-admin (>= 0.22.0, < 0.24) decidim-core (>= 0.22.0, < 0.24) redcarpet (~> 3.4) + sassc (~> 2.3.0) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -426,7 +427,7 @@ GEM docile (1.3.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.5.0) + doorkeeper (5.5.1) railties (>= 5) doorkeeper-i18n (4.0.1) equalizer (0.0.11) @@ -451,11 +452,15 @@ GEM railties (>= 3.0.0) faker (1.9.6) i18n (>= 0.7) - faraday (1.3.0) + faraday (1.4.1) + faraday-excon (~> 1.1) faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) multipart-post (>= 1.2, < 3) - ruby2_keywords + ruby2_keywords (>= 0.0.4) + faraday-excon (1.1.0) faraday-net_http (1.0.1) + faraday-net_http_persistent (1.1.0) ffi (1.15.0) figaro (1.2.0) thor (>= 0.14.0, < 2) @@ -472,13 +477,13 @@ GEM activesupport (>= 4.1, < 6.0) railties (>= 4.1, < 6.0) tzinfo (~> 1.2, >= 1.2.2) - geocoder (1.6.6) + geocoder (1.6.7) globalid (0.4.2) activesupport (>= 4.2.0) graphiql-rails (1.4.11) railties sprockets-rails - graphql (1.12.6) + graphql (1.12.8) hashdiff (1.0.1) hashie (4.1.0) highline (2.0.3) @@ -579,7 +584,7 @@ GEM netrc (0.11.0) nio4r (2.5.7) nobspw (0.6.2) - nokogiri (1.11.2) + nokogiri (1.11.3) mini_portile2 (~> 2.5.0) racc (~> 1.4) oauth (0.5.6) @@ -618,7 +623,7 @@ GEM activerecord (>= 4.2) request_store (~> 1.1) parallel (1.20.1) - parser (3.0.0.0) + parser (3.0.1.0) ast (~> 2.4.1) passenger (6.0.7) rack @@ -706,7 +711,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.4) + rexml (3.2.5) rspec (3.9.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) @@ -854,7 +859,7 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webmock (3.12.1) + webmock (3.12.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/app/controllers/decidim/proposals/proposals_controller.rb b/app/controllers/decidim/proposals/proposals_controller.rb index 3bf74637..87cc350d 100644 --- a/app/controllers/decidim/proposals/proposals_controller.rb +++ b/app/controllers/decidim/proposals/proposals_controller.rb @@ -38,11 +38,13 @@ def index .order(position: :asc) render "decidim/proposals/proposals/participatory_texts/participatory_text" else - @proposals = search - .results - .published - .not_hidden - .includes(:amendable, :category, :component, :resource_permission, :scope) + @base_query = search + .results + .published + .not_hidden + + @proposals = @base_query.includes(:amendable, :category, :component, :resource_permission, :scope) + @all_geocoded_proposals = @base_query.geocoded @voted_proposals = if current_user ProposalVote.where( diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb new file mode 100644 index 00000000..f5858e60 --- /dev/null +++ b/spec/lib/overrides_spec.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +require "rails_helper" + +# We make sure that the checksum of the file overriden is the same +# as the expected. If this test fails, it means that the overriden +# file should be updated to match any change/bug fix introduced in the core +checksums = [ + { + package: "decidim-core", + files: { + # cells + "/app/controllers/decidim/devise/invitations_controller.rb" => "faa5403c358f686a87eea2d9f4eaf1d4", + "/app/views/layouts/decidim/mailer.html.erb" => "5bbe335c1dfd02f8448af287328a49dc" + } + }, + { + package: "decidim-assemblies", + files: { + # cells + "/app/views/decidim/assemblies/_filter_by_type.html.erb" => "76988d76b84d96079e6d9e1b252a3fda" + } + }, + { + package: "decidim-proposals", + files: { + # cells + "/app/controllers/concerns/decidim/proposals/orderable.rb" => "066b6b777567297eefd80020468d4610", + "/app/controllers/decidim/proposals/proposals_controller.rb" => "793356c0a8dc924d25b1e6bfbcb91621" + } + }, + { + package: "decidim-meetings", + files: { + # cells + "/app/views/decidim/meetings/registration_mailer/confirmation.html.erb" => "8b1da026a6cada495fa7c1c921e62bee" + } + }, + { + package: "decidim-consultations", + files: { + # not directly manipulated but worth taking a look if anythign changes + "/app/controllers/decidim/consultations/consultations_controller.rb" => "3d75aa7d00721dc3d91aca131d348362", + "/app/controllers/decidim/consultations/questions_controller.rb" => "1b7ec4c7265caccd47f9dc9be08498a9", + "/app/views/decidim/consultations/consultations/_question.html.erb" => "364d7f8370cdbe7ae70c545fff2e21fa", + "/app/helpers/decidim/consultations/consultations_helper.rb" => "bb921ed6da446b9544b81c9f9f9a7574" + } + }, + { + package: "decidim-initiatives", + files: { + "/app/controllers/decidim/initiatives/initiatives_controller.rb" => "62144c4ad2a96dfae9c8f77e92ab1ee3", + "/app/mailers/decidim/initiatives/initiatives_mailer.rb" => "435a4110f6bc5c8f37eebc36fae4d444", + "/app/views/decidim/initiatives/initiatives_mailer/notify_creation.html.erb" => "5ce00a2d62b52b098bb8464e5bf5e16a", + "/app/views/decidim/initiatives/initiatives_mailer/notify_state_change.html.erb" => "6472242f33e29183e08c2caefd5d6067" + } + }, + { + package: "decidim-admin", + files: { + # views + "/app/views/decidim/admin/participatory_space_private_users/_form.html.erb" => "be3e6ce2ae14caee518d0def6091c9e0", + "/app/views/decidim/admin/participatory_space_private_users/index.html.erb" => "9b23dffda10546025aa467a3628b2184", + "/app/commands/decidim/admin/create_participatory_space_private_user.rb" => "3218d35c8bbc77abfbbc56ba1d2bf427", + "/app/forms/decidim/admin/participatory_space_private_user_form.rb" => "3479f27dcc88f98267374490b446b24c" + } + } +] + +describe "Overriden files", type: :view do + # rubocop:disable Rails/DynamicFindBy + checksums.each do |item| + spec = ::Gem::Specification.find_by_name(item[:package]) + + item[:files].each do |file, signature| + it "#{spec.gem_dir}#{file} matches checksum" do + expect(md5("#{spec.gem_dir}#{file}")).to eq(signature) + end + end + end + # rubocop:enable Rails/DynamicFindBy + + private + + def md5(file) + Digest::MD5.hexdigest(File.read(file)) + end +end