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.5.5 #120

Merged
merged 4 commits into from
Nov 6, 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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/decidim-ice/decidim-module-decidim_awesome", 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-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
Expand Down
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ GIT

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module-friendly_signup.git
revision: 1c91e024ae4467c097b39673e5d78b06afd206d1
revision: 91756c7324172f39375519ab957704359f21c2b6
specs:
decidim-friendly_signup (0.4.5)
decidim-friendly_signup (0.4.6)
decidim-core (~> 0.27)

GIT
Expand Down Expand Up @@ -67,27 +67,27 @@ 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: 66bc4d1a9f00eb66356e583365597e737e1d6917
revision: 848eb550d44d9bebc9e72c458c4e3aab79203d9e
branch: release/0.27-stable
specs:
decidim-custom_proposal_states (0.27.5)
decidim-core (~> 0.27)
decidim-proposals (~> 0.27)
deface (>= 1.9)

GIT
remote: https://github.com/decidim-ice/decidim-module-decidim_awesome
revision: 51bc593da8fb72d14c2e5b5df55dbb686be1fbbe
branch: release/0.27-stable
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/digidemlab/decidim-module-budgets_paper_ballots
revision: 750d20ecc670859df85393c01a72902e20509562
Expand Down
31 changes: 31 additions & 0 deletions app/views/decidim/proposals/proposals/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<%= render partial: "decidim/shared/component_announcement" %>

<%= render partial: "voting_rules" %>
<div class="row columns">
<div class="title-action">
<h2 id="proposals-count" class="title-action__title section-heading">
<%= render partial: "count" %>
</h2>
<% if current_settings.creation_enabled && current_component.participatory_space.can_participate?(current_user) %>
<%= action_authorized_link_to :create, new_proposal_path, class: "title-action__action button small", data: { "redirect_url" => new_proposal_path } do %>
<%= t(".new_proposal") %>
<%= icon "plus", role: "img", "aria-hidden": true %>
<% end %>
<% end %>

<% if component_settings.collaborative_drafts_enabled? %>
<%= link_to t(".collaborative_drafts_list"), collaborative_drafts_path, class: "title-action__action button small hollow ml-s" %>
<% end %>
</div>
</div>
<div class="row">
<div class="columns mediumlarge-4 large-3">
<%= render partial: "filters_small_view" %>
<div class="card card--secondary show-for-mediumlarge">
<%= render partial: "filters" %>
</div>
</div>
<div id="proposals" class="columns mediumlarge-8 large-9" aria-live="polite">
<%= render partial: "proposals" %>
</div>
</div>
10 changes: 10 additions & 0 deletions app/views/decidim/proposals/proposals/index.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var $proposals = $('#proposals');
var $proposalsCount = $('#proposals-count');
var $orderFilterInput = $('.order_filter');

$proposals.html('<%= j(render partial: "proposals").strip.html_safe %>');
$proposalsCount.html('<%= j(render partial: "count").strip.html_safe %>');
$orderFilterInput.val('<%= order %>');

var $dropdownMenu = $('.dropdown.menu', $proposals);
$dropdownMenu.foundation();
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@

config.active_job.queue_adapter = :sidekiq
config.action_mailer.perform_deliveries = true
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "debug").to_sym
end
2 changes: 1 addition & 1 deletion config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ignore_missing:
- decidim.admin.actions.import
- decidim.budgets_importer.actions.import
- index.confirmed_orders_count

- decidim.proposals.proposals.index.{new_proposal,collaborative_drafts_list}
# Consider these keys used:
ignore_unused:
- faker.*
Expand Down
41 changes: 0 additions & 41 deletions spec/models/proposal_extra_field_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,47 +183,6 @@ module Decidim::DecidimAwesome
end
end

describe "all_vote_weights" do
let!(:extra_fields) { create(:awesome_proposal_extra_fields, proposal: proposal) }
let!(:another_extra_fields) { create(:awesome_proposal_extra_fields, proposal: another_proposal) }
let!(:unrelated_another_extra_fields) { create(:awesome_proposal_extra_fields, :with_votes, proposal: create(:extended_proposal)) }
let(:another_proposal) { create(:proposal, component: proposal.component) }
let!(:votes) do
vote = create(:proposal_vote, proposal: proposal, author: create(:user, organization: proposal.organization))
create(:awesome_vote_weight, vote: vote, weight: 1)
end
let!(:other_votes) do
vote = create(:proposal_vote, proposal: another_proposal, author: create(:user, organization: proposal.organization))
create(:awesome_vote_weight, vote: vote, weight: 2)
end

it "returns all vote weights for a component" do
expect(proposal.reload.all_vote_weights).to contain_exactly(1, 2)
expect(another_proposal.reload.all_vote_weights).to contain_exactly(1, 2)
expect(proposal.vote_weights).to eq({ "1" => 1, "2" => 0 })
expect(another_proposal.vote_weights).to eq({ "1" => 0, "2" => 1 })
end

context "when wrong cache exists" do
before do
# rubocop:disable Rails/SkipsModelValidations:
# we don't want to trigger the active record hooks
extra_fields.update_columns(vote_weight_totals: { "3" => 1, "4" => 1 })
# rubocop:enable Rails/SkipsModelValidations:
end

it "returns all vote weights for a component" do
expect(proposal.reload.extra_fields.vote_weight_totals).to eq({ "3" => 1, "4" => 1 })
expect(proposal.vote_weights).to eq({ "1" => 0, "2" => 0 })
proposal.update_vote_weights!
expect(proposal.vote_weights).to eq({ "1" => 1, "2" => 0 })
expect(another_proposal.reload.vote_weights).to eq({ "1" => 0, "2" => 1 })
expect(proposal.extra_fields.vote_weight_totals).to eq({ "1" => 1 })
expect(another_proposal.extra_fields.vote_weight_totals).to eq({ "2" => 1 })
end
end
end

describe "private_body" do
it "returns nil if no private_body" do
expect(extra_fields.private_body).to be_nil
Expand Down
Loading