From 4210c2fbf0c4c87e6d640b267521ed1dd7adc0e7 Mon Sep 17 00:00:00 2001 From: Quentin Champenois Date: Fri, 8 Nov 2024 15:14:58 +0100 Subject: [PATCH 1/3] fix: Deactivate vote_weigth in decidim awesome --- Gemfile | 2 +- Gemfile.lock | 22 +++++++++++----------- config/initializers/decidim_awesome.rb | 5 +++++ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 config/initializers/decidim_awesome.rb diff --git a/Gemfile b/Gemfile index 123bca7..b9ede83 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,7 @@ gem "decidim-budgets_paper_ballots", git: "https://github.com/digidemlab/decidim gem "decidim-cache_cleaner" gem "decidim-custom_proposal_states", git: "https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states", branch: DECIDIM_BRANCH -gem "decidim-decidim_awesome", git: "https://github.com/Quentinchampenois/decidim-module-decidim_awesome", branch: "rc/0.27-without-vote-weighted" +gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome", branch: DECIDIM_BRANCH gem "decidim-extra_user_fields", git: "https://github.com/OpenSourcePolitics/decidim-module-extra_user_fields.git", branch: DECIDIM_BRANCH gem "decidim-friendly_signup", git: "https://github.com/OpenSourcePolitics/decidim-module-friendly_signup.git" gem "decidim-homepage_interactive_map", git: "https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git", branch: DECIDIM_BRANCH diff --git a/Gemfile.lock b/Gemfile.lock index 651a28e..4a991f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,17 +67,6 @@ GIT omniauth (~> 2.0) omniauth-oauth2 (>= 1.7.2, < 2.0) -GIT - remote: https://github.com/Quentinchampenois/decidim-module-decidim_awesome - revision: 03a5b90f038d0662d61dc25ef3acf7692eb3dd87 - branch: rc/0.27-without-vote-weighted - specs: - decidim-decidim_awesome (0.10.3) - decidim-admin (>= 0.26.0, < 0.28) - decidim-core (>= 0.26.0, < 0.28) - deface (>= 1.5) - sassc (~> 2.3) - GIT remote: https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states revision: 848eb550d44d9bebc9e72c458c4e3aab79203d9e @@ -88,6 +77,17 @@ GIT decidim-proposals (~> 0.27) deface (>= 1.9) +GIT + remote: https://github.com/decidim-ice/decidim-module-decidim_awesome + revision: c72e7f0fa0fe98807ace8414ecc08cbf44ce72d5 + branch: release/0.27-stable + specs: + decidim-decidim_awesome (0.10.4) + decidim-admin (>= 0.26.0, < 0.28) + decidim-core (>= 0.26.0, < 0.28) + deface (>= 1.5) + sassc (~> 2.3) + GIT remote: https://github.com/digidemlab/decidim-module-budgets_paper_ballots revision: 750d20ecc670859df85393c01a72902e20509562 diff --git a/config/initializers/decidim_awesome.rb b/config/initializers/decidim_awesome.rb new file mode 100644 index 0000000..7bf5291 --- /dev/null +++ b/config/initializers/decidim_awesome.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Decidim::DecidimAwesome.configure do |config| + config.weighted_proposal_voting = :disabled +end From 24f55cf63c29a4f0db260b3013de664f86bdf58e Mon Sep 17 00:00:00 2001 From: Quentin Champenois Date: Fri, 8 Nov 2024 16:00:54 +0100 Subject: [PATCH 2/3] fix: enhance logs in dev mode --- config/environments/development.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 083f36c..72d3676 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -58,4 +58,5 @@ config.active_job.queue_adapter = :sidekiq config.action_mailer.perform_deliveries = true config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "debug").to_sym + config.log_tags = [:uuid, :remote_ip] end From 99b1453dba28e8fbe79cb1f87b2847e0129bce69 Mon Sep 17 00:00:00 2001 From: Quentin Champenois Date: Fri, 8 Nov 2024 16:06:45 +0100 Subject: [PATCH 3/3] fix: Allow to configure feat using env var --- .env-example | 4 +++- config/initializers/decidim_awesome.rb | 2 +- config/secrets.yml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env-example b/.env-example index d413951..f9aad2e 100644 --- a/.env-example +++ b/.env-example @@ -19,4 +19,6 @@ FRIENDLY_SIGNUP_USE_CONFIRMATION_CODES=1 DECIDIM_SESSION_TIMEOUT= # SKIP_FIRST_LOGIN_AUTHORIZATION=true -# RAILS_LOG_LEVEL=warn \ No newline at end of file +# RAILS_LOG_LEVEL=warn + +# DECIDIM_AWESOME_WEIGHTED_PROPOSAL_VOTING_ENABLED=disabled # or enabled \ No newline at end of file diff --git a/config/initializers/decidim_awesome.rb b/config/initializers/decidim_awesome.rb index 7bf5291..24a30cd 100644 --- a/config/initializers/decidim_awesome.rb +++ b/config/initializers/decidim_awesome.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true Decidim::DecidimAwesome.configure do |config| - config.weighted_proposal_voting = :disabled + config.weighted_proposal_voting = Rails.application.secrets.dig(:decidim, :decidim_awesome, :weighted_proposal_voting_enabled)&.to_sym end diff --git a/config/secrets.yml b/config/secrets.yml index c1026ce..d9c4a3a 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -13,6 +13,8 @@ default: &default asset_host: <%= ENV["ASSET_HOST"] %> decidim: + decidim_awesome: + weighted_proposal_voting_enabled: <%= ENV.fetch("DECIDIM_AWESOME_WEIGHTED_PROPOSAL_VOTING_ENABLED", "disabled") %> currency: <%= ENV["CURRENCY"] || "€" %> rack_attack: enabled: <%= ENV["ENABLE_RACK_ATTACK"] %>