Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v0.6.0 #125

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ FRIENDLY_SIGNUP_USE_CONFIRMATION_CODES=1
DECIDIM_SESSION_TIMEOUT=

# SKIP_FIRST_LOGIN_AUTHORIZATION=true
# RAILS_LOG_LEVEL=warn
# RAILS_LOG_LEVEL=warn

# DECIDIM_AWESOME_WEIGHTED_PROPOSAL_VOTING_ENABLED=disabled # or enabled
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ 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
gem "decidim-simple_proposal", git: "https://github.com/opensourcepolitics/decidim-module-simple_proposal.git", branch: DECIDIM_BRANCH
gem "decidim-slider", git: "https://github.com/OpenSourcePolitics/decidim-module-slider", branch: "rc/0.27"
gem "decidim-spam_detection", git: "https://github.com/OpenSourcePolitics/decidim-spam_detection.git", tag: "4.1.1"
gem "decidim-spam_detection", git: "https://github.com/OpenSourcePolitics/decidim-spam_detection.git", tag: "4.1.2"
gem "decidim-term_customizer", git: "https://github.com/opensourcepolitics/decidim-module-term_customizer.git", branch: "fix/multi-threading-compliant"

# Omniauth gems
Expand Down
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ GIT

GIT
remote: https://github.com/OpenSourcePolitics/decidim-spam_detection.git
revision: fb2ee4624b728ce6f73603bfb84eda1d9b4e04d4
tag: 4.1.1
revision: 5e4f92f19b903228b8349fb002d735e900d63ed4
tag: 4.1.2
specs:
decidim-spam_detection (4.1.1)
decidim-spam_detection (4.1.2)
decidim-core (~> 0.27.0)

GIT
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions config/initializers/decidim_awesome.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Decidim::DecidimAwesome.configure do |config|
config.weighted_proposal_voting = Rails.application.secrets.dig(:decidim, :decidim_awesome, :weighted_proposal_voting_enabled)&.to_sym
end
2 changes: 2 additions & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def serialize
},
comments: proposal.comments_count,
attachments: proposal.attachments.count,
attachment_urls: attachment_urls,
followers: proposal.followers.count,
published_at: proposal.published_at,
url: url,
Expand All @@ -45,6 +46,12 @@ def serialize
}
}
end

def attachment_urls
proposal.attachments.map do |attc|
Rails.application.routes.url_helpers.rails_blob_url(attc.file.blob, host: proposal.participatory_space.organization.host)
end.join("\n")
end
end

Decidim::Proposals::ProposalSerializer.class_eval do
Expand Down
4 changes: 4 additions & 0 deletions spec/services/decidim/proposals/proposal_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ module Proposals
expect(serialized).to include(attachments: proposal.attachments.count)
end

it "serializes the attachments urls" do
expect(serialized).to include(:attachment_urls)
end

it "serializes the endorsements" do
expect(serialized[:endorsements]).to include(total_count: proposal.endorsements.count)
expect(serialized[:endorsements]).to include(user_endorsements: proposal.endorsements.for_listing.map { |identity| identity.normalized_author&.name })
Expand Down
Loading