Skip to content

Commit

Permalink
Graded proposal voting (decidim-ice#238)
Browse files Browse the repository at this point in the history
* Setup migrations and models (#13)

* add migrations

* change grade to weight

* totals name

* hooks (wip)

* add total weight cache

* graded voting/set defaults (#14)

* initial defaults

* add deface

* add views to manifest

* add cells view hacker

* set weight validator for voting manifest

* test fixing

* add basic weight voting

* add specs

* manifest spec

* add controller spec

* add readme

* fix awesome spec

* rubocop

* fix system checker spec

* set openstreet map

* used mocked openstreet maps

* modernize actions

* Prevent changin voting manifest if votes exist (#16)

* update codecov report

* Export weights (#17)

* add label generation for the manifest

* tweak exported

* add weights to the exporter

* fix tests

* add graphql entry

* Order proposals by my votes (#18)

* override filters

* add specs

* FrontEnd vote action UI/implementation (#15)

* add vote button, add modal, change votes counter view

* change frontend

* add voting to modal

* add action cable, updating results

* refactoring

* isolate the specific implementation of the voting

* add abstain setting

* change modal, change voting

* add abstain to voting

* refactoring

* change weight colors

* add tests

* add cells specs

* fix lint

* fix stylelint

* normalize locale

* change controller

* fix proposal_vote_path

* fix locale

* fix locale

---------

Co-authored-by: Ivan Vergés <[email protected]>

* Minor fixes and improvements for frontend voting (#19)

* change basic copies

* namespace css

* add link "change my vote"

* change opacity method

* add tests

* add check settings for abstain

* fix cell test

---------

Co-authored-by: Anna Topalidi <[email protected]>

* Add modal window with instructions (#20)

* change basic copies

* namespace css

* introduce modal pre-voting

* handle localstorage

* refactor namespaces for copies

* fix copy

* copies

* add finger

* add svg icons

* add margin

* fix margins in modal

* abstain style

* fix tests

* prevent voting abstain if not allowed

* fix footer

* normalize i18n

* add additional specs

* add conf var for sorting

* fix cache proposal_m

* proposal conf fixes

* Rename manifest and minor fixes (#22)

* rename voting_cards manifest

* mend

* abstain color

* fix modal title

* fix test

* fix counter colors

* fix xss

* style fix

---------

Co-authored-by: Anna Topalidi <[email protected]>
Co-authored-by: Anna Topalidi <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2023
1 parent 9f4732c commit de30639
Show file tree
Hide file tree
Showing 95 changed files with 3,344 additions and 285 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
pull_request:

env:
RUBY_VERSION: 3.0.5
RUBY_VERSION: 3.0.6
NODE_VERSION: 16.9.1

jobs:
lint-report:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.0.0
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
pull_request:

env:
RUBY_VERSION: 3.0.5
RUBY_VERSION: 3.0.6
NODE_VERSION: 16.9.1

jobs:
lint-report:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

services:
postgres:
Expand All @@ -31,7 +31,7 @@ jobs:
DATABASE_HOST: localhost

steps:
- uses: actions/checkout@v2.0.0
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/tests-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
pull_request:

env:
CI: 1
SIMPLECOV: 1
NODE_VERSION: 16.9.1
RUBY_VERSION: 2.7.7
BUNDLE_GEMFILE: Gemfile.legacy

jobs:
tests-legacy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
Expand Down Expand Up @@ -44,7 +46,7 @@ jobs:
DATABASE_HOST: localhost

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -53,15 +55,17 @@ jobs:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Test App
run: bundle exec rake test_app

- name: General RSpec with config vars enabled
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
FEATURES: ${{ matrix.features }}
SIMPLECOV: 1
CODECOV: 1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
pull_request:

env:
CI: 1
SIMPLECOV: 1
NODE_VERSION: 16.9.1
RUBY_VERSION: 3.0.5
RUBY_VERSION: 3.0.6
BUNDLE_GEMFILE: Gemfile

jobs:
tests-latest:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
Expand Down Expand Up @@ -44,7 +46,7 @@ jobs:
DATABASE_HOST: localhost

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -53,15 +55,17 @@ jobs:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Test App
run: bundle exec rake test_app

- name: General RSpec with config vars enabled
run: bundle exec rspec spec/${{ matrix.rspec }}
env:
FEATURES: ${{ matrix.features }}
SIMPLECOV: 1
CODECOV: 1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
22 changes: 14 additions & 8 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# frozen_string_literal: true

SimpleCov.start do
root ENV.fetch("ENGINE_ROOT", nil)
if ENV["SIMPLECOV"]
SimpleCov.start do
# We ignore some of the files because they are never tested
add_filter "/config/"
add_filter "/db/"
add_filter "lib/decidim/decidim_awesome/version.rb"
add_filter "/spec"
end

add_filter "lib/decidim/decidim_awesome/version.rb"
add_filter "/spec"
end

SimpleCov.command_name ENV.fetch("COMMAND_NAME", nil) || File.basename(Dir.pwd)
SimpleCov.merge_timeout 1800

SimpleCov.merge_timeout 1800
if ENV["CI"]
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
end
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
CHANGELOG
=========

v0.10.0
------

Compatibility:
- Decidim v0.27.4
- Decidim v0.26.8

Features:
- Migrate to [Deface](https://github.com/spree/deface) for overrides
- Introduce Weighted Voting with configurable manifests for different types of votings with grades
- Fix wrong behaviour showing proposals on map

v0.9.3
------

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "decidim-decidim_awesome", path: "."
gem "bootsnap", "~> 1.4"

gem "puma", ">= 5.5.1"
gem "uglifier", "~> 4.1"

gem "faker", "~> 2.14"

Expand Down
10 changes: 9 additions & 1 deletion Gemfile.legacy.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PATH
decidim-decidim_awesome (0.9.3)
decidim-admin (>= 0.26.0, < 0.28)
decidim-core (>= 0.26.0, < 0.28)
deface (>= 1.5)
sassc (~> 2.3)

GEM
Expand Down Expand Up @@ -326,6 +327,12 @@ GEM
declarative-builder (0.1.0)
declarative-option (< 0.2.0)
declarative-option (0.1.0)
deface (1.9.0)
actionview (>= 5.2)
nokogiri (>= 1.6)
polyglot
railties (>= 5.2)
rainbow (>= 2.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.9.2)
Expand Down Expand Up @@ -543,6 +550,7 @@ GEM
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
polyglot (0.3.5)
premailer (1.21.0)
addressable
css_parser (>= 1.12.0)
Expand Down Expand Up @@ -801,4 +809,4 @@ RUBY VERSION
ruby 2.7.7p221

BUNDLED WITH
2.3.24
2.3.20
11 changes: 9 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PATH
decidim-decidim_awesome (0.9.3)
decidim-admin (>= 0.26.0, < 0.28)
decidim-core (>= 0.26.0, < 0.28)
deface (>= 1.5)
sassc (~> 2.3)

GEM
Expand Down Expand Up @@ -331,6 +332,12 @@ GEM
declarative-builder (0.1.0)
declarative-option (< 0.2.0)
declarative-option (0.1.0)
deface (1.9.0)
actionview (>= 5.2)
nokogiri (>= 1.6)
polyglot
railties (>= 5.2)
rainbow (>= 2.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.9.3)
Expand Down Expand Up @@ -564,6 +571,7 @@ GEM
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
polyglot (0.3.5)
premailer (1.21.0)
addressable
css_parser (>= 1.12.0)
Expand Down Expand Up @@ -816,11 +824,10 @@ DEPENDENCIES
rubocop-faker
spring (~> 2.0)
spring-watcher-listen (~> 2.0.0)
uglifier (~> 4.1)
web-console

RUBY VERSION
ruby 3.0.6p216

BUNDLED WITH
2.4.6
2.4.20
Loading

0 comments on commit de30639

Please sign in to comment.