diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 38773e2..0edbceb 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -3,14 +3,15 @@ name: "[CI/CD]" on: [push] env: - NODE_VERSION: 16.9.1 - RUBY_VERSION: 3.0.2 + NODE_VERSION: 22.14.0 + RUBY_VERSION: 3.3.4 + DISABLE_SPRING: 1 jobs: lints: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2.0.0 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 @@ -25,10 +26,10 @@ jobs: - run: bundle exec erblint app/**/*.erb name: Lint ERB files tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 services: postgres: - image: postgres:11 + image: postgres:14 ports: ["5432:5432"] options: >- --health-cmd pg_isready @@ -42,7 +43,7 @@ jobs: DATABASE_PASSWORD: postgres DATABASE_HOST: localhost steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 @@ -51,20 +52,24 @@ jobs: bundler-cache: true - name: Setup test_app run: bundle exec rake test_app + - run: | + rm -f ./spec/decidim_dummy_app/app/services/dummy_signature_handler.rb + rm -f ./spec/decidim_dummy_app/app/services/dummy_sms_mobile_phone_validator.rb + name: Remove Initiative-dependent dummy files - name: Rspec unit tests run: bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb" - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 - - uses: actions/upload-artifact@v2-preview + - uses: actions/upload-artifact@v4 if: always() with: name: screenshots path: ./spec/decidim_dummy_app/tmp/screenshots system_tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 services: postgres: - image: postgres:11 + image: postgres:14 ports: ["5432:5432"] options: >- --health-cmd pg_isready @@ -78,7 +83,7 @@ jobs: DATABASE_PASSWORD: postgres DATABASE_HOST: localhost steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 1 - uses: ruby/setup-ruby@v1 @@ -87,11 +92,15 @@ jobs: bundler-cache: true - name: Setup test_app run: bundle exec rake test_app + - run: | + rm -f ./spec/decidim_dummy_app/app/services/dummy_signature_handler.rb + rm -f ./spec/decidim_dummy_app/app/services/dummy_sms_mobile_phone_validator.rb + name: Remove Initiative-dependent dummy files - name: Rspec system tests run: bundle exec rspec --pattern "spec/system/**/*_spec.rb" - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 - - uses: actions/upload-artifact@v2-preview + - uses: actions/upload-artifact@v4 if: always() with: name: screenshots diff --git a/.rubocop_ruby.yml b/.rubocop_ruby.yml index 26f5568..1393035 100644 --- a/.rubocop_ruby.yml +++ b/.rubocop_ruby.yml @@ -69,7 +69,7 @@ AllCops: # If a value is specified for TargetRubyVersion then it is used. # Else if .ruby-version exists and it contains an MRI version it is used. # Otherwise we fallback to the oldest officially supported Ruby version (2.0). - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.3 RSpec: Patterns: @@ -1248,6 +1248,7 @@ RSpec/DescribeClass: - spec/i18n_spec.rb - "**/*/spec/**/*_badge_spec.rb" - "**/tasks/**/*" + - spec/system/* RSpec/ExampleLength: Max: 49 @@ -1278,6 +1279,7 @@ RSpec/RepeatedExampleGroupDescription: RSpec/RepeatedExampleGroupBody: Enabled: false + RSpec/VerifiedDoubles: Enabled: false @@ -1287,6 +1289,9 @@ RSpec/LeakyConstantDeclaration: RSpec/DescribedClass: Enabled: false +RSpec/IndexedLet: + Enabled: false + # This is the default configuration file. Faker/DeprecatedArguments: diff --git a/.ruby-version b/.ruby-version index b502146..a0891f5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.2 +3.3.4 diff --git a/Gemfile b/Gemfile index 23edbba..984985c 100644 --- a/Gemfile +++ b/Gemfile @@ -16,21 +16,21 @@ gem "decidim", DECIDIM_VERSION gem "decidim-budgets_paper_ballots", path: "." gem "bootsnap", "~> 1.4" -gem "puma", ">= 5.5.1" +gem "puma", ">= 6.3.1" gem "uglifier", "~> 4.1" group :development, :test do gem "byebug", "~> 11.0", platform: :mri gem "decidim-dev", DECIDIM_VERSION - gem "rubocop-faker" + gem "rubocop-faker", "~> 1.3", ">= 1.3.0" end group :development do - gem "faker", "~> 2.14" - gem "letter_opener_web", "~> 1.3" + gem "faker", "3.5.3" + gem "letter_opener_web", "~> 2.0" gem "listen", "~> 3.1" - gem "spring", "~> 2.0" - gem "spring-watcher-listen", "~> 2.0" - gem "web-console", "~> 3.5" + gem "spring", "~> 4.0" + gem "spring-watcher-listen", "~> 2.1" + gem "web-console", "~> 4.2" end diff --git a/Gemfile.lock b/Gemfile.lock index 9be0e21..4d060d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,444 +1,497 @@ PATH remote: . specs: - decidim-budgets_paper_ballots (0.27.0) - decidim-budgets (>= 0.27.0) - decidim-core (>= 0.27.0) + decidim-budgets_paper_ballots (0.31) + decidim-budgets (~> 0.31.0) + decidim-core (~> 0.31.0) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.4) - actionpack (= 6.1.7.4) - activesupport (= 6.1.7.4) + actioncable (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.4) - actionpack (= 6.1.7.4) - activejob (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) - mail (>= 2.7.1) - actionmailer (6.1.7.4) - actionpack (= 6.1.7.4) - actionview (= 6.1.7.4) - activejob (= 6.1.7.4) - activesupport (= 6.1.7.4) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.1.7.4) - actionview (= 6.1.7.4) - activesupport (= 6.1.7.4) - rack (~> 2.0, >= 2.0.9) + zeitwerk (~> 2.6) + actionmailbox (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + actionmailer (7.2.3) + actionpack (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.3) + actionview (= 7.2.3) + activesupport (= 7.2.3) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.3) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.4) - actionpack (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.3) + actionpack (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.4) - activesupport (= 6.1.7.4) + actionview (7.2.3) + activesupport (= 7.2.3) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) active_link_to (1.0.5) actionpack addressable - activejob (6.1.7.4) - activesupport (= 6.1.7.4) + activejob (7.2.3) + activesupport (= 7.2.3) globalid (>= 0.3.6) - activemodel (6.1.7.4) - activesupport (= 6.1.7.4) - activerecord (6.1.7.4) - activemodel (= 6.1.7.4) - activesupport (= 6.1.7.4) - activestorage (6.1.7.4) - actionpack (= 6.1.7.4) - activejob (= 6.1.7.4) - activerecord (= 6.1.7.4) - activesupport (= 6.1.7.4) + activemodel (7.2.3) + activesupport (= 7.2.3) + activerecord (7.2.3) + activemodel (= 7.2.3) + activesupport (= 7.2.3) + timeout (>= 0.4.0) + activestorage (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activesupport (= 7.2.3) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (6.1.7.4) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (7.2.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - acts_as_list (0.9.19) - activerecord (>= 3.0) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) - ast (2.4.2) - axe-core-api (4.7.0) - dumb_delegator - virtus - axe-core-rspec (4.1.0) - axe-core-api - dumb_delegator - virtus - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) - batch-loader (1.5.0) - bcrypt (3.1.19) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + acts_as_list (1.2.6) + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable (2.8.9) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + base64 (0.3.0) + batch-loader (2.0.6) + bcrypt (3.1.21) + benchmark (0.5.0) + better_html (2.2.0) + actionview (>= 7.0) + activesupport (>= 7.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties + bigdecimal (4.0.1) bindex (0.8.1) bootsnap (1.16.0) msgpack (~> 1.2) - browser (2.7.1) - builder (3.2.4) + browser (6.2.0) + builder (3.3.0) + bullet (8.0.8) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.11) byebug (11.1.3) - capybara (3.39.2) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.4) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) - addressable (~> 2.6) - image_processing (~> 1.1) - marcel (~> 1.0.0) - mini_mime (>= 0.1.3) - ssrf_filter (~> 1.0) - cells (4.1.7) - declarative-builder (< 0.2.0) + cells (4.1.8) + declarative-builder (~> 0.2.0) declarative-option (< 0.2.0) tilt (>= 1.4, < 3) uber (< 0.2.0) cells-erb (0.1.0) cells (~> 4.0) erbse (>= 0.1.1) - cells-rails (0.1.5) + cells-rails (0.1.6) actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) - charlock_holmes (0.7.7) - chef-utils (18.2.7) - concurrent-ruby - childprocess (4.1.0) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - coffee-rails (5.0.0) - coffee-script (>= 2.2.0) - railties (>= 5.2.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) - commonmarker (0.23.9) - concurrent-ruby (1.2.2) - crack (0.4.5) + cgi (0.5.1) + charlock_holmes (0.7.9) + chartkick (5.1.5) + childprocess (5.1.0) + logger (~> 1.5) + chunky_png (1.4.0) + cmdparse (3.0.7) + commonmarker (0.23.12) + concurrent-ruby (1.3.6) + connection_pool (2.5.5) + crack (1.0.1) + bigdecimal rexml crass (1.0.6) - css_parser (1.14.0) + css_parser (2.0.0) addressable - date (3.3.3) + csv (3.3.5) + data_migrate (11.3.1) + activerecord (>= 6.1) + railties (>= 6.1) + date (3.5.1) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - db-query-matchers (0.10.0) - activesupport (>= 4.0, < 7) - rspec (~> 3.0) - decidim (0.27.3) - decidim-accountability (= 0.27.3) - decidim-admin (= 0.27.3) - decidim-api (= 0.27.3) - decidim-assemblies (= 0.27.3) - decidim-blogs (= 0.27.3) - decidim-budgets (= 0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-debates (= 0.27.3) - decidim-forms (= 0.27.3) - decidim-generators (= 0.27.3) - decidim-meetings (= 0.27.3) - decidim-pages (= 0.27.3) - decidim-participatory_processes (= 0.27.3) - decidim-proposals (= 0.27.3) - decidim-sortitions (= 0.27.3) - decidim-surveys (= 0.27.3) - decidim-system (= 0.27.3) - decidim-templates (= 0.27.3) - decidim-verifications (= 0.27.3) - decidim-accountability (0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-admin (0.27.3) + decidim (0.31.2) + decidim-accountability (= 0.31.2) + decidim-admin (= 0.31.2) + decidim-api (= 0.31.2) + decidim-assemblies (= 0.31.2) + decidim-blogs (= 0.31.2) + decidim-budgets (= 0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-debates (= 0.31.2) + decidim-forms (= 0.31.2) + decidim-generators (= 0.31.2) + decidim-meetings (= 0.31.2) + decidim-pages (= 0.31.2) + decidim-participatory_processes (= 0.31.2) + decidim-proposals (= 0.31.2) + decidim-sortitions (= 0.31.2) + decidim-surveys (= 0.31.2) + decidim-system (= 0.31.2) + decidim-verifications (= 0.31.2) + decidim-accountability (0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-admin (0.31.2) active_link_to (~> 1.0) - decidim-core (= 0.27.3) + decidim-core (= 0.31.2) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 2.0) - decidim-api (0.27.3) - graphql (~> 1.12, < 1.13) - graphql-docs (~> 2.1.0) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-api (0.31.2) + decidim-core (= 0.31.2) + devise-jwt (~> 0.12.1) + graphql (~> 2.4.0, >= 2.4.17) + graphql-docs (~> 5.0) rack-cors (~> 1.0) - decidim-assemblies (0.27.3) - decidim-core (= 0.27.3) - decidim-blogs (0.27.3) - decidim-admin (= 0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-budgets (0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-comments (0.27.3) - decidim-core (= 0.27.3) + decidim-assemblies (0.31.2) + decidim-core (= 0.31.2) + decidim-blogs (0.31.2) + decidim-admin (= 0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-budgets (0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-comments (0.31.2) + decidim-core (= 0.31.2) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.27.3) + decidim-core (0.31.2) active_link_to (~> 1.0) - acts_as_list (~> 0.9) - batch-loader (~> 1.2) - browser (~> 2.7) - carrierwave (~> 2.2.1) + acts_as_list (~> 1.0) + batch-loader (~> 2.0) + browser (~> 6.2.0) cells-erb (~> 0.1.0) cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) + chartkick (~> 5.1.2) + concurrent-ruby (~> 1.3.0) + connection_pool (< 3) + data_migrate (~> 11.3) date_validator (~> 0.12.0) - decidim-api (= 0.27.3) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) - doorkeeper (~> 5.1) + doorkeeper (~> 5.6, >= 5.6.6) doorkeeper-i18n (~> 4.0) file_validators (~> 3.0) fog-local (~> 0.6) - foundation_rails_helper (~> 4.0) geocoder (~> 1.8) hashdiff (>= 0.4.0, < 2.0.0) + hexapdf (~> 1.1.0) + image_processing (~> 1.2) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.3.1) + loofah (~> 2.19, >= 2.19.1) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) - mustache (~> 1.1.0) + net-smtp (~> 0.5.0) + nokogiri (~> 1.16, >= 1.16.2) omniauth (~> 2.0) omniauth-facebook (~> 5.0) omniauth-google-oauth2 (~> 1.0) omniauth-rails_csrf_protection (~> 1.0) omniauth-twitter (~> 1.4) - paper_trail (~> 12.0) - pg (~> 1.1.4, < 2) + paper_trail (~> 16.0) + paranoia (~> 3.0.0) + pg (~> 1.5.0, < 2) pg_search (~> 2.2) premailer-rails (~> 1.10) - rack (~> 2.2, >= 2.2.3) + rack (~> 2.2, >= 2.2.8.1) rack-attack (~> 6.0) - rails (~> 6.1.0) - rails-i18n (~> 6.0) - ransack (~> 2.4.1) + rails (~> 7.2.0, >= 7.2.2.2) + rails-i18n (~> 7.0) + ransack (~> 4.2.0) redis (~> 4.1) - request_store (~> 1.5.0) + request_store (~> 1.7.0) + rqrcode (~> 2.2.0) rubyXL (~> 3.4) rubyzip (~> 2.0) - seven_zip_ruby (~> 1.3) - social-share-button (~> 1.2, >= 1.2.1) - valid_email2 (~> 2.1) - webpacker (= 6.0.0.rc.5) - webpush (~> 1.1) - wisper (~> 2.0) - decidim-debates (0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-dev (0.27.3) - axe-core-rspec (~> 4.1.0) + shakapacker (~> 8.3.0) + valid_email2 (~> 7.0) + web-push (~> 3.0) + wisper (~> 3.0) + decidim-debates (0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-dev (0.31.2) + bullet (~> 8.0.0) byebug (~> 11.0) - capybara (~> 3.24) - db-query-matchers (~> 0.10.0) - decidim (= 0.27.3) - erb_lint (~> 0.0.35) - factory_bot_rails (~> 4.8) - i18n-tasks (~> 0.9.18) - mdl (~> 0.5) - nokogiri (~> 1.13) - parallel_tests (~> 3.7) - puma (~> 5.0) + capybara (~> 3.39) + decidim-admin (= 0.31.2) + decidim-api (= 0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-generators (= 0.31.2) + decidim-verifications (= 0.31.2) + erb_lint (~> 0.8.0) + factory_bot_rails (~> 6.2) + faker (~> 3.2) + i18n-tasks (~> 1.0) + nokogiri (~> 1.16, >= 1.16.2) + parallel_tests (~> 4.2) + puma (~> 6.5) rails-controller-testing (~> 1.0) + rspec (~> 3.12) rspec-cells (~> 0.3.7) - rspec-html-matchers (~> 0.9.1) - rspec-rails (~> 4.0) + rspec-html-matchers (~> 0.10) + rspec-rails (~> 6.0) rspec-retry (~> 0.6.2) - rspec_junit_formatter (~> 0.3.0) - rubocop (~> 1.28.0) - rubocop-rails (~> 2.14) - rubocop-rspec (~> 2.10) - selenium-webdriver (~> 4.1.0) - simplecov (~> 0.21.0) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.78.0) + rubocop-capybara (~> 2.22.0, >= 2.22.1) + rubocop-factory_bot (~> 2.27.0) + rubocop-faker (~> 1.3, >= 1.3.0) + rubocop-graphql (~> 1.5, >= 1.5.6) + rubocop-performance (~> 1.25, >= 1.25.0) + rubocop-rails (~> 2.32.0, >= 2.32.0) + rubocop-rspec (~> 3.0, >= 3.6.0) + rubocop-rspec_rails (~> 2.31.0) + rubocop-rubycw (~> 0.2.0) + selenium-webdriver (~> 4.9) + simplecov (~> 0.22.0) simplecov-cobertura (~> 2.1.0) + spring (~> 4.0) + spring-watcher-listen (~> 2.0) w3c_rspec_validators (~> 0.3.0) - webmock (~> 3.6) + webmock (~> 3.18) wisper-rspec (~> 1.0) - decidim-forms (0.27.3) - decidim-core (= 0.27.3) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.3) - decidim-core (= 0.27.3) - decidim-meetings (0.27.3) - decidim-core (= 0.27.3) - decidim-forms (= 0.27.3) + decidim-forms (0.31.2) + decidim-core (= 0.31.2) + decidim-generators (0.31.2) + decidim-core (= 0.31.2) + decidim-meetings (0.31.2) + decidim-core (= 0.31.2) + decidim-forms (= 0.31.2) icalendar (~> 2.5) - decidim-pages (0.27.3) - decidim-core (= 0.27.3) - decidim-participatory_processes (0.27.3) - decidim-core (= 0.27.3) - decidim-proposals (0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - doc2text (~> 0.4.5) + decidim-pages (0.31.2) + decidim-core (= 0.31.2) + decidim-participatory_processes (0.31.2) + decidim-core (= 0.31.2) + decidim-proposals (0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + doc2text (~> 0.4.0, >= 0.4.8) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.3) - decidim-admin (= 0.27.3) - decidim-comments (= 0.27.3) - decidim-core (= 0.27.3) - decidim-proposals (= 0.27.3) - decidim-surveys (0.27.3) - decidim-core (= 0.27.3) - decidim-forms (= 0.27.3) - decidim-templates (= 0.27.3) - decidim-system (0.27.3) + decidim-sortitions (0.31.2) + decidim-admin (= 0.31.2) + decidim-comments (= 0.31.2) + decidim-core (= 0.31.2) + decidim-proposals (= 0.31.2) + decidim-surveys (0.31.2) + decidim-core (= 0.31.2) + decidim-forms (= 0.31.2) + decidim-system (0.31.2) active_link_to (~> 1.0) - decidim-core (= 0.27.3) + decidim-core (= 0.31.2) devise (~> 4.7) devise-i18n (~> 1.2) - devise_invitable (~> 2.0) - decidim-templates (0.27.3) - decidim-core (= 0.27.3) - decidim-forms (= 0.27.3) - decidim-verifications (0.27.3) - decidim-core (= 0.27.3) - declarative-builder (0.1.0) - declarative-option (< 0.2.0) + devise_invitable (~> 2.0, >= 2.0.9) + decidim-verifications (0.31.2) + decidim-core (= 0.31.2) + declarative-builder (0.2.0) + trailblazer-option (~> 0.1.0) declarative-option (0.1.0) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - devise (4.9.2) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.11.0) + devise-i18n (1.15.0) devise (>= 4.9.0) - devise_invitable (2.0.8) + rails-i18n + devise-jwt (0.12.1) + devise (~> 4.0) + warden-jwt_auth (~> 0.10) + devise_invitable (2.0.11) actionmailer (>= 5.0) devise (>= 4.6) - diff-lcs (1.5.0) - diffy (3.4.2) - doc2text (0.4.6) - nokogiri (>= 1.13.2, < 1.15.0) + diff-lcs (1.6.2) + diffy (3.4.4) + doc2text (0.4.8) + nokogiri (>= 1.18.2) rubyzip (~> 2.3.0) - docile (1.4.0) - doorkeeper (5.6.6) + docile (1.4.1) + doorkeeper (5.9.0) railties (>= 5) doorkeeper-i18n (4.0.1) - dumb_delegator (1.0.0) - erb_lint (0.0.37) + drb (2.2.3) + dry-auto_inject (1.1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-configurable (1.3.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-core (1.2.0) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + erb (6.0.2) + erb_lint (0.8.0) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow - rubocop + rubocop (>= 1) smart_properties erbse (0.1.4) temple - erubi (1.12.0) + erubi (1.13.1) escape_utils (1.3.0) - excon (0.100.0) + excon (1.4.0) + logger execjs (2.8.1) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) - factory_bot (4.11.1) - activesupport (>= 3.0.0) - factory_bot_rails (4.11.1) - factory_bot (~> 4.11.1) - railties (>= 3.0.0) - faker (2.23.0) + factory_bot (6.5.6) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.1) + factory_bot (~> 6.5) + railties (>= 6.1.0) + faker (3.5.3) i18n (>= 1.8.11, < 2) - faraday (2.7.10) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) + faraday (2.14.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.2) + net-http (~> 0.5) ffi (1.15.5) + fiber-storage (1.0.1) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.3.0) + fog-core (2.6.0) builder - excon (~> 0.71) + excon (~> 1.0) formatador (>= 0.2, < 2.0) mime-types - fog-local (0.8.0) + fog-local (0.9.0) fog-core (>= 1.27, < 3.0) - formatador (1.1.0) - foundation_rails_helper (4.0.1) - actionpack (>= 4.1, < 7.1) - activemodel (>= 4.1, < 7.1) - activesupport (>= 4.1, < 7.1) - railties (>= 4.1, < 7.1) + formatador (1.2.3) + reline gemoji (3.0.1) - geocoder (1.8.2) - globalid (1.1.0) - activesupport (>= 5.0) - graphql (1.12.24) - graphql-docs (2.1.0) - commonmarker (~> 0.16) + geocoder (1.8.6) + base64 (>= 0.1.0) + csv (>= 3.0.0) + geom2d (0.4.1) + globalid (1.3.0) + activesupport (>= 6.1) + google-protobuf (4.34.0-x86_64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.0-x86_64-linux-gnu) + bigdecimal + rake (~> 13.3) + graphql (2.4.17) + base64 + fiber-storage + logger + graphql-docs (5.2.0) + commonmarker (~> 0.23, >= 0.23.6) escape_utils (~> 1.2) extended-markdown-filter (~> 0.4) gemoji (~> 3.0) - graphql (~> 1.12) - html-pipeline (~> 2.9) - sass (~> 3.4) - hashdiff (1.0.1) - hashie (5.0.0) - highline (2.1.0) - hkdf (0.3.0) + graphql (~> 2.0) + html-pipeline (~> 2.14, >= 2.14.3) + logger (~> 1.6) + ostruct (~> 0.6) + sass-embedded (~> 1.58) + hashdiff (1.2.1) + hashie (5.1.0) + logger + hexapdf (1.1.1) + cmdparse (~> 3.0, >= 3.0.3) + geom2d (~> 0.4, >= 0.4.1) + openssl (>= 2.2.1) + strscan (>= 3.1.2) + highline (3.1.2) + reline html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - html_tokenizer (0.0.7) - htmlentities (4.3.4) - i18n (1.14.1) + htmlentities (4.4.2) + i18n (1.14.8) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.37) + i18n-tasks (1.1.2) activesupport (>= 4.0.2) ast (>= 2.1.0) erubi - highline (>= 2.0.0) + highline (>= 3.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) + prism rails-i18n rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) - icalendar (2.8.0) + icalendar (2.12.1) + base64 ice_cube (~> 0.16) - ice_cube (0.16.4) - ice_nine (0.11.2) - image_processing (1.12.2) - mini_magick (>= 4.9.5, < 5) + logger + ostruct + ice_cube (0.17.0) + image_processing (1.14.0) + mini_magick (>= 4.9.5, < 6) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - json (2.6.3) - jwt (2.7.1) + io-console (0.8.2) + irb (1.17.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.18.1) + jwt (3.1.2) + base64 kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -451,310 +504,369 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - kramdown (2.4.0) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - launchy (2.5.2) + language_server-protocol (3.17.0.5) + launchy (3.1.1) addressable (~> 2.8) - letter_opener (1.8.1) - launchy (>= 2.2, < 3) - letter_opener_web (1.4.1) - actionmailer (>= 3.2) - letter_opener (~> 1.0) - railties (>= 3.2) + childprocess (~> 5.0) + logger (~> 1.6) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) + letter_opener_web (2.0.0) + actionmailer (>= 5.2) + letter_opener (~> 1.7) + railties (>= 5.2) + rexml + lint_roller (1.1.0) listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.3.1) + logger (1.7.0) + loofah (2.25.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.1) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - matrix (0.4.2) - mdl (0.12.0) - kramdown (~> 2.3) - kramdown-parser-gfm (~> 1.1) - mixlib-cli (~> 2.1, >= 2.1.1) - mixlib-config (>= 2.2.1, < 4) - mixlib-shellout - method_source (1.0.0) - mime-types (3.4.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) - mini_magick (4.12.0) - mini_mime (1.1.2) - minitest (5.18.1) - mixlib-cli (2.1.8) - mixlib-config (3.0.27) - tomlrb - mixlib-shellout (3.2.7) - chef-utils + marcel (1.1.0) + matrix (0.4.3) + mime-types (3.7.0) + logger + mime-types-data (~> 3.2025, >= 3.2025.0507) + mime-types-data (3.2026.0303) + mini_magick (4.13.2) + mini_mime (1.1.5) + minitest (6.0.2) + drb (~> 2.0) + prism (~> 1.5) msgpack (1.7.2) - multi_xml (0.6.0) - mustache (1.1.1) - net-imap (0.3.6) + multi_xml (0.8.1) + bigdecimal (>= 3.1, < 5) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.6.3) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.1) net-protocol - nio4r (2.5.9) - nokogiri (1.14.5-x86_64-darwin) + nio4r (2.7.5) + nokogiri (1.19.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.5-x86_64-linux) + nokogiri (1.19.1-x86_64-linux-gnu) racc (~> 1.4) - oauth (1.1.0) - oauth-tty (~> 1.0, >= 1.0.1) + oauth (1.1.3) + base64 (~> 0.1) + oauth-tty (~> 1.0, >= 1.0.6) snaky_hash (~> 2.0) - version_gem (~> 1.1) - oauth-tty (1.0.5) - version_gem (~> 1.1, >= 1.1.1) - oauth2 (2.0.9) - faraday (>= 0.17.3, < 3.0) - jwt (>= 1.0, < 3.0) + version_gem (~> 1.1, >= 1.1.9) + oauth-tty (1.0.6) + version_gem (~> 1.1, >= 1.1.9) + oauth2 (2.0.18) + faraday (>= 0.17.3, < 4.0) + jwt (>= 1.0, < 4.0) + logger (~> 1.2) multi_xml (~> 0.5) rack (>= 1.2, < 4) - snaky_hash (~> 2.0) - version_gem (~> 1.1) - omniauth (2.1.1) + snaky_hash (~> 2.0, >= 2.0.3) + version_gem (~> 1.1, >= 1.1.9) + omniauth (2.1.4) hashie (>= 3.4.6) + logger rack (>= 2.2.3) rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (1.1.1) - jwt (>= 2.0) - oauth2 (~> 2.0.6) + omniauth-google-oauth2 (1.2.2) + jwt (>= 2.9.2) + oauth2 (~> 2.0) omniauth (~> 2.0) - omniauth-oauth2 (~> 1.8.0) - omniauth-oauth (1.2.0) + omniauth-oauth2 (~> 1.8) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) - omniauth-oauth2 (1.8.0) - oauth2 (>= 1.4, < 3) + rack (>= 1.6.2, < 4) + omniauth-oauth2 (1.9.0) + oauth2 (>= 2.0.2, < 3) omniauth (~> 2.0) - omniauth-rails_csrf_protection (1.0.1) + omniauth-rails_csrf_protection (1.0.2) actionpack (>= 4.2) omniauth (~> 2.0) omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack + openssl (4.0.1) orm_adapter (0.5.0) - paper_trail (12.3.0) - activerecord (>= 5.2) - request_store (~> 1.1) - parallel (1.23.0) - parallel_tests (3.13.0) + ostruct (0.6.3) + package_json (0.2.0) + paper_trail (16.0.0) + activerecord (>= 6.1) + request_store (~> 1.4) + parallel (1.27.0) + parallel_tests (4.10.1) parallel - parser (3.2.2.3) + paranoia (3.0.1) + activerecord (>= 6, < 8.1) + parser (3.3.10.2) ast (~> 2.4.1) racc - pg (1.1.4) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) - premailer (1.21.0) + pg (1.5.9) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) + pp (0.6.3) + prettyprint + premailer (1.28.0) addressable - css_parser (>= 1.12.0) + css_parser (>= 1.19.0) htmlentities (>= 4.0.0) premailer-rails (1.12.0) actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) - public_suffix (5.0.3) - puma (5.6.6) + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.5) + puma (6.6.1) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.7) - rack-attack (6.6.1) - rack (>= 1.0, < 3) + racc (1.8.1) + rack (2.2.22) + rack-attack (6.8.0) + rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) - rack-protection (3.0.6) - rack - rack-proxy (0.7.6) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) rack - rack-test (2.1.0) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) rack (>= 1.3) - rails (6.1.7.4) - actioncable (= 6.1.7.4) - actionmailbox (= 6.1.7.4) - actionmailer (= 6.1.7.4) - actionpack (= 6.1.7.4) - actiontext (= 6.1.7.4) - actionview (= 6.1.7.4) - activejob (= 6.1.7.4) - activemodel (= 6.1.7.4) - activerecord (= 6.1.7.4) - activestorage (= 6.1.7.4) - activesupport (= 6.1.7.4) + rackup (1.0.1) + rack (< 3) + webrick + rails (7.2.3) + actioncable (= 7.2.3) + actionmailbox (= 7.2.3) + actionmailer (= 7.2.3) + actionpack (= 7.2.3) + actiontext (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activemodel (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) bundler (>= 1.15.0) - railties (= 6.1.7.4) - sprockets-rails (>= 2.0.0) + railties (= 7.2.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.1.1) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) - rails-i18n (6.0.0) + rails-html-sanitizer (1.7.0) + loofah (~> 2.25) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (7.0.10) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 7) - railties (6.1.7.4) - actionpack (= 6.1.7.4) - activesupport (= 6.1.7.4) - method_source + railties (>= 6.0.0, < 8) + railties (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) + cgi + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - ransack (2.4.2) - activerecord (>= 5.2.4) - activesupport (>= 5.2.4) + rake (13.3.1) + ransack (4.2.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) i18n rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - redcarpet (3.6.0) + rdoc (7.2.0) + erb + psych (>= 4.0.0) + tsort + redcarpet (3.6.1) redis (4.8.1) - regexp_parser (2.8.1) - request_store (1.5.1) + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) - responders (3.1.0) - actionpack (>= 5.2) - railties (>= 5.2) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-cells (0.3.8) + responders (3.2.0) + actionpack (>= 7.0) + railties (>= 7.0) + rexml (3.4.4) + rqrcode (2.2.0) + chunky_png (~> 1.0) + rqrcode_core (~> 1.0) + rqrcode_core (1.2.0) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-cells (0.3.10) cells (>= 4.0.0, < 6.0.0) - rspec-rails (>= 3.0.0, < 6.1.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-rails (>= 3.0.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-html-matchers (0.9.4) + rspec-support (~> 3.13.0) + rspec-html-matchers (0.10.0) nokogiri (~> 1) - rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.12.6) + rspec (>= 3.0.0.a) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (4.1.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) + rspec-support (~> 3.13.0) + rspec-rails (6.1.5) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.12.1) - rspec_junit_formatter (0.3.0) + rspec-support (3.13.7) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.28.2) + rubocop (1.78.0) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.17.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.45.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-faker (1.1.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-capybara (2.22.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-factory_bot (2.27.1) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-faker (1.3.0) faker (>= 2.12.0) - rubocop (>= 0.82.0) - rubocop-rails (2.15.2) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-graphql (1.6.0) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2) + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) + rubocop-rails (2.32.0) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rspec (2.11.1) - rubocop (~> 1.19) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) + rubocop-rspec (3.7.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-rspec_rails (2.31.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + rubocop-rspec (~> 3.5) + rubocop-rubycw (0.2.2) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) - ruby-vips (2.1.4) + ruby-vips (2.3.0) ffi (~> 1.12) - ruby2_keywords (0.0.5) - rubyXL (3.4.25) + logger + rubyXL (3.4.33) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) rubyzip (2.3.2) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - selenium-webdriver (4.1.0) - childprocess (>= 0.5, < 5.0) + sass-embedded (1.97.3-x86_64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.97.3-x86_64-linux-gnu) + google-protobuf (~> 4.31) + securerandom (0.4.1) + selenium-webdriver (4.41.0) + base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2) - semantic_range (3.0.0) - seven_zip_ruby (1.3.0) - simplecov (0.21.2) + rubyzip (>= 1.2.2, < 4.0) + websocket (~> 1.0) + semantic_range (3.1.1) + shakapacker (8.3.0) + activesupport (>= 5.2) + package_json + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) - snaky_hash (2.0.1) - hashie - version_gem (~> 1.1, >= 1.1.1) - social-share-button (1.2.4) - coffee-rails - spring (2.1.1) - spring-watcher-listen (2.0.1) + snaky_hash (2.0.3) + hashie (>= 0.1.0, < 6) + version_gem (>= 1.1.8, < 3) + spring (4.4.2) + spring-watcher-listen (2.1.0) listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.2.0) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - ssrf_filter (1.1.1) - temple (0.10.2) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) - thread_safe (0.3.6) - tilt (2.2.0) - timeout (0.4.0) - tomlrb (2.0.3) + spring (>= 4) + stringio (3.2.0) + strscan (3.1.7) + temple (0.10.4) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.5.0) + tilt (2.7.0) + timeout (0.6.0) + trailblazer-option (0.1.2) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.4.2) - valid_email2 (2.3.1) - activemodel (>= 3.2) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + uniform_notifier (1.18.0) + uri (1.1.1) + useragent (0.16.11) + valid_email2 (7.0.15) + activemodel (>= 6.0) mail (~> 2.5) - version_gem (1.1.3) - virtus (2.0.0) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) + version_gem (1.1.9) w3c_rspec_validators (0.3.0) rails rspec @@ -765,57 +877,59 @@ GEM rexml (~> 3.2) warden (1.2.9) rack (>= 2.0.9) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + warden-jwt_auth (0.12.0) + dry-auto_inject (>= 0.8, < 2) + dry-configurable (>= 0.13, < 2) + jwt (>= 2.1, < 4) + warden (~> 1.2) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) - webmock (3.18.1) + railties (>= 6.0.0) + web-push (3.1.0) + jwt (~> 3.0) + openssl (>= 3.0) + webmock (3.26.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webpacker (6.0.0.rc.5) - activesupport (>= 5.2) - rack-proxy (>= 0.6.1) - railties (>= 5.2) - semantic_range (>= 2.3.0) - webpush (1.1.0) - hkdf (~> 0.2) - jwt (~> 2.0) - websocket-driver (0.7.5) + webrick (1.9.2) + websocket (1.2.11) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.6.3) - activesupport - wisper (2.0.1) + wisper (3.0.0) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.7.5) PLATFORMS x86_64-darwin-21 + x86_64-darwin-23 + x86_64-darwin-24 x86_64-linux DEPENDENCIES bootsnap (~> 1.4) byebug (~> 11.0) - decidim (>= 0.27.0) + decidim (~> 0.31.0) decidim-budgets_paper_ballots! - decidim-dev (>= 0.27.0) - faker (~> 2.14) - letter_opener_web (~> 1.3) + decidim-dev (~> 0.31.0) + faker (= 3.5.3) + letter_opener_web (~> 2.0) listen (~> 3.1) - puma (>= 5.5.1) - rubocop-faker - spring (~> 2.0) - spring-watcher-listen (~> 2.0) + puma (>= 6.3.1) + rubocop-faker (~> 1.3, >= 1.3.0) + spring (~> 4.0) + spring-watcher-listen (~> 2.1) uglifier (~> 4.1) - web-console (~> 3.5) + web-console (~> 4.2) RUBY VERSION - ruby 3.0.2p107 + ruby 3.3.4p94 BUNDLED WITH - 2.4.9 + 2.3.20 diff --git a/app/cells/decidim/budgets_paper_ballots/project_votes_count_cell_override.rb b/app/cells/decidim/budgets_paper_ballots/project_votes_count_cell_override.rb index 2391e2c..bd01588 100644 --- a/app/cells/decidim/budgets_paper_ballots/project_votes_count_cell_override.rb +++ b/app/cells/decidim/budgets_paper_ballots/project_votes_count_cell_override.rb @@ -7,12 +7,12 @@ def content if options[:layout] == :one_line safe_join([model.total_votes, " ", count_label]) else - safe_join([number, count_label]) + safe_join([number, " ", count_label]) end end def number - content_tag :div, model.total_votes, class: "text-large" + content_tag :span, model.total_votes, class: "text-large" end def count_label diff --git a/app/controllers/concerns/budgets_controller_override.rb b/app/controllers/concerns/budgets_controller_override.rb new file mode 100644 index 0000000..41d2a3a --- /dev/null +++ b/app/controllers/concerns/budgets_controller_override.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require "active_support/concern" + +module BudgetsControllerOverride + extend ActiveSupport::Concern + + included do + helper_method :paper_ballots_count + + def paper_ballot_results + @paper_ballot_results ||= Decidim::BudgetsPaperBallots::PaperBallotResult.joins(:project).where(decidim_budgets_projects: { decidim_budgets_budget_id: budgets.pluck(:id) }) + end + + def paper_ballots_count + paper_ballot_results.sum(:votes) + end + end +end diff --git a/app/views/decidim/budgets/admin/budgets/index.html.erb b/app/views/decidim/budgets/admin/budgets/index.html.erb index 111c94a..7da57ea 100644 --- a/app/views/decidim/budgets/admin/budgets/index.html.erb +++ b/app/views/decidim/budgets/admin/budgets/index.html.erb @@ -4,7 +4,7 @@
| <%= t("models.budget.fields.name", scope: "decidim.budgets") %> | -<%= t("models.budget.fields.total_budget", scope: "decidim.budgets") %> | -<%= t("models.budget.fields.projects_count", scope: "decidim.budgets") %> | - <% if current_component.has_subscopes? %> - <%= th_resource_scope_label %> - <% end %> -<%= t("actions.title", scope: "decidim.budgets") %> | -
|---|---|---|---|
|
- <% if allowed_to? :update, :budget, budget: budget %>
- <%= link_to translated_attribute(budget.title), budget_projects_path(budget) %> - <% else %> - <%= translated_attribute(budget.title) %> - <% end %> - |
- - <%= number_to_currency budget.total_budget, unit: Decidim.currency_unit, precision: 0 %> - | -- <%= link_to budget.projects.count, budget_projects_path(budget) %> - | - <% if current_component.has_subscopes? %> - <%= td_resource_scope_for(budget.scope) %> - <% end %> -- <% if allowed_to? :update, :budget, budget: budget %> - <%= icon_link_to "pencil-line", edit_budget_path(budget), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %> - <% else %> - <%= icon "pencil-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.edit", scope: "decidim.budgets") %> - <% end %> - - <%= icon_link_to "list-check", budget_projects_path(budget), t("actions.edit_projects", scope: "decidim.budgets"), class: "action-icon--edit-projects" %> - - <%= icon_link_to "eye-line", resource_locator(budget).path, t("actions.preview", scope: "decidim.budgets"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %> - - <% if allowed_to? :delete, :budget, budget: budget %> - <%= icon_link_to "delete-bin-line", budget_path(budget), t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %> - <% else %> - <%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %> - <% end %> - | -
| <%= check_box_tag "projects_bulk", "all", false, class: "js-check-all" %> | -<%= sort_link(query, :id, t("models.project.fields.id", scope: "decidim.budgets"), default_order: :desc) %> | -<%= sort_link(query, :title, t("models.project.fields.title", scope: "decidim.budgets")) %> | -<%= sort_link(query, :category_name, t("models.project.fields.category", scope: "decidim.budgets") ) %> | - <% if current_component.has_subscopes? %> - <%= th_scope_sort_link %> - <% end %> -<%= sort_link(query, :total_votes, t("index.confirmed_orders_count")) %> | -<%= sort_link(query, :selected, t(".selected")) %> | - <% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %> -<%= t("models.project.fields.map", scope: "decidim.budgets") %> | - <% end %> -<%= t("actions.title", scope: "decidim.budgets") %> | -
|---|
Decidim is great but it can be better
") + end + end + + it_behaves_like( + "a record with front-end geocoding address field", + Decidim::Budgets::Project, + within_selector: ".new_project", + address_field: :project_address + ) do + let(:geocoded_address_value) { address } + let(:geocoded_address_coordinates) { [latitude, longitude] } + + before do + stub_geocoding(address, [latitude, longitude]) + within ".new_project" do + fill_in_i18n :project_title, "#project-title-tabs", en: "Make decidim great again" + fill_in_i18n_editor :project_description, "#project-description-tabs", en: "Decidim is great but it can be better" + fill_in :project_budget_amount, with: 1234 + end + end + end + end + + context "when the proposal module is not installed" do + before do + allow(Decidim).to receive(:module_installed?).and_return(false) # Reload the page with the updated settings visit current_path end it "does not display the proposal picker" do - expect(page).not_to have_content "Choose proposals" + expect(page).to have_no_content "Choose proposals" end end end it "updates a project" do - within find("tr", text: translated(project.title)) do - click_link "Edit" + within "tr", text: translated(project.title) do + find("button[data-controller='dropdown']").click + click_on "Edit" end within ".edit_project" do @@ -54,64 +105,53 @@ context "when previewing projects" do it "allows the user to preview the project" do - within find("tr", text: translated(project.title)) do - klass = "action-icon--preview" - href = resource_locator([project.budget, project]).path - target = "blank" - - expect(page).to have_selector( - :xpath, - "//a[contains(@class,'#{klass}')][@href='#{href}'][@target='#{target}']" - ) + within "tr", text: translated(project.title) do + find("button[data-controller='dropdown']").click + preview_window = window_opened_by { click_on "Preview" } + + within_window preview_window do + expect(page).to have_current_path resource_locator(project).path + end end end end context "when seeing finished and pending votes" do - let!(:project) { create(:project, budget_amount: 70_000_000, budget: budget) } + let!(:project) { create(:project, budget_amount: 70_000_000, budget:) } let!(:finished_orders) do - orders = create_list(:order, 10, budget: budget) + orders = create_list(:order, 10, budget:) orders.each do |order| - order.update!(line_items: [create(:line_item, project: project, order: order)]) + order.update!(line_items: [create(:line_item, project:, order:)]) order.reload order.update!(checked_out_at: Time.zone.today) end end let!(:pending_orders) do - create_list(:order, 5, budget: budget, checked_out_at: nil) + create_list(:order, 5, budget:, checked_out_at: nil) end it "shows the order count" do visit current_path - expect(page).to have_content("Finished votes: \n10") - expect(page).to have_content("Pending votes: \n5") + expect(page).to have_content("Finished votes: 10") + expect(page).to have_content("Pending votes: 5") end end - it "creates a new project", :slow do - find(".card-title a.button.new").click + let(:attributes) { attributes_for(:project) } + + it "creates a new project", :versioning do + within ".item_show__header-title" do + click_on "New project" + end within ".new_project" do - fill_in_i18n( - :project_title, - "#project-title-tabs", - en: "My project", - es: "Mi proyecto", - ca: "El meu projecte" - ) - fill_in_i18n_editor( - :project_description, - "#project-description-tabs", - en: "A longer description", - es: "Descripción más larga", - ca: "Descripció més llarga" - ) + fill_in_i18n(:project_title, "#project-title-tabs", **attributes[:title].except("machine_translations")) + fill_in_i18n_editor(:project_description, "#project-description-tabs", **attributes[:description].except("machine_translations")) fill_in :project_budget_amount, with: 22_000_000 - scope_pick select_data_picker(:project_decidim_scope_id), scope - select translated(category.name), from: :project_decidim_category_id + select decidim_sanitize_translated(taxonomy.name), from: "taxonomies-#{taxonomy_filter.id}" find("*[type=submit]").click end @@ -119,20 +159,24 @@ expect(page).to have_admin_callout("successfully") within "table" do - expect(page).to have_content("My project") + expect(page).to have_content(translated(attributes[:title])) + expect(page).to have_content(decidim_sanitize_translated(taxonomy.name)) end + visit decidim_admin.root_path + expect(page).to have_content("created the #{translated(attributes[:title])} project") end - context "when deleting a project" do - let!(:project2) { create(:project, budget: budget) } + context "when soft deleting a project" do + let!(:project2) { create(:project, budget:) } before do visit current_path end it "deletes a project" do - within find("tr", text: translated(project2.title)) do - accept_confirm { click_link "Delete" } + within "tr", text: translated(project2.title) do + find("button[data-controller='dropdown']").click + accept_confirm { click_on "Move to trash" } end expect(page).to have_admin_callout("successfully") @@ -144,24 +188,21 @@ end context "when having existing proposals" do - let!(:proposal_component) { create(:proposal_component, participatory_space: participatory_space) } - let!(:proposals) { create_list :proposal, 5, component: proposal_component, skip_injection: true } - - it "updates a project" do - within find("tr", text: translated(project.title)) do - click_link "Edit" + let!(:proposal_component) { create(:proposal_component, participatory_space:) } + let!(:proposals) { create_list(:proposal, 5, component: proposal_component) } + let(:attributes) { attributes_for(:project) } + + it "updates a project", :versioning do + within "tr", text: translated(project.title) do + find("button[data-controller='dropdown']").click + click_on "Edit" end within ".edit_project" do - fill_in_i18n( - :project_title, - "#project-title-tabs", - en: "My new title", - es: "Mi nuevo título", - ca: "El meu nou títol" - ) + fill_in_i18n(:project_title, "#project-title-tabs", **attributes[:title].except("machine_translations")) + fill_in_i18n_editor(:project_description, "#project-description-tabs", **attributes[:description].except("machine_translations")) - proposals_pick(select_data_picker(:project_proposals, multiple: true), proposals.last(2)) + tom_select("#proposals_list", option_id: proposals.last(2).map(&:id)) find("*[type=submit]").click end @@ -169,8 +210,11 @@ expect(page).to have_admin_callout("successfully") within "table" do - expect(page).to have_content("My new title") + expect(page).to have_content(translated(attributes[:title])) end + + visit decidim_admin.root_path + expect(page).to have_content("updated the #{translated(attributes[:title])} project") end it "removes proposals from project", :slow do @@ -178,12 +222,13 @@ not_removed_projects_title = project.linked_resources(:proposals, "included_proposals").first.title expect(project.linked_resources(:proposals, "included_proposals").count).to eq(5) - within find("tr", text: translated(project.title)) do - click_link "Edit" + within "tr", text: translated(project.title) do + find("button[data-controller='dropdown']").click + click_on "Edit" end within ".edit_project" do - proposals_remove(select_data_picker(:project_proposals, multiple: true), proposals.last(4)) + tom_select("#proposals_list", option_id: proposals.first(proposals.length - 4).map(&:id)) find("*[type=submit]").click end @@ -193,8 +238,10 @@ expect(project.linked_resources(:proposals, "included_proposals").first.title).to eq(not_removed_projects_title) end - it "creates a new project", :slow do - find(".card-title a.button.new").click + it "creates a new project" do + within ".item_show__header-title" do + click_on "New project" + end within ".new_project" do fill_in_i18n( @@ -213,9 +260,9 @@ ) fill_in :project_budget_amount, with: 22_000_000 - proposals_pick(select_data_picker(:project_proposals, multiple: true), proposals.first(2)) - scope_pick(select_data_picker(:project_decidim_scope_id), scope) - select translated(category.name), from: :project_decidim_category_id + tom_select("#proposals_list", option_id: proposals.first(2).map(&:id)) + + select decidim_sanitize_translated(taxonomy.name), from: "taxonomies-#{taxonomy_filter.id}" find("*[type=submit]").click end @@ -224,6 +271,7 @@ within "table" do expect(page).to have_content("My project") + expect(page).to have_content(decidim_sanitize_translated(taxonomy.name)) end end end diff --git a/spec/system/admin_manages_budgets_spec.rb b/spec/system/admin_manages_budgets_spec.rb index 5ec445a..6c7d0e9 100644 --- a/spec/system/admin_manages_budgets_spec.rb +++ b/spec/system/admin_manages_budgets_spec.rb @@ -2,143 +2,124 @@ require "spec_helper" -describe "Admin manages budgets", type: :system do - let(:budget) { create :budget, component: current_component } +describe "Admin manages budgets" do + let!(:budget) { create(:budget, component: current_component) } let(:manifest_name) { "budgets" } + let(:attributes) { attributes_for(:budget) } include_context "when managing a component as an admin" before do - budget switch_to_host(organization.host) login_as user, scope: :user visit_component_admin end + it_behaves_like "manage taxonomy filters in settings" + it_behaves_like "access component permissions form" + describe "admin form" do - before { click_on "New Budget" } + before { click_on "New budget" } it_behaves_like "having a rich text editor", "new_budget", "content" end - it "creates a new budget" do - within ".card-title" do - click_link "New Budget" - end + it "creates a new budget", :versioning do + click_on "New budget" within ".new_budget" do - fill_in_i18n( - :budget_title, - "#budget-title-tabs", - en: "My Budget", - es: "Mi Presupuesto", - ca: "El meu Pressupost" - ) - fill_in_i18n_editor( - :budget_description, - "#budget-description-tabs", - en: "Long description", - es: "Descripción más larga", - ca: "Descripció més llarga" - ) + fill_in_i18n(:budget_title, "#budget-title-tabs", **attributes[:title].except("machine_translations")) + fill_in_i18n_editor(:budget_description, "#budget-description-tabs", **attributes[:description].except("machine_translations")) + fill_in :budget_weight, with: 1 fill_in :budget_total_budget, with: 100_000_00 - scope_pick select_data_picker(:budget_decidim_scope_id), scope end - within ".new_budget" do - find("*[type=submit]").click - end + click_on "Create budget" - within ".callout-wrapper" do - expect(page).to have_content("successfully") - end + expect(page).to have_admin_callout("Budget successfully created.") within "table" do - expect(page).to have_content("My Budget") + expect(page).to have_content(translated(attributes[:title])) end + + visit decidim_admin.root_path + expect(page).to have_content("created the #{translated(attributes[:title])} budget") end - describe "updating a budget" do + describe "updating a budget", :versioning do it "updates a budget" do - within find("tr", text: translated(budget.title)) do - page.find(".action-icon--edit").click + within "tr", text: translated(budget.title) do + find("button[data-controller='dropdown']").click + click_on "Edit" end within ".edit_budget" do - fill_in_i18n( - :budget_title, - "#budget-title-tabs", - en: "My new title", - es: "Mi nuevo título", - ca: "El meu nou títol" - ) - - find("*[type=submit]").click + fill_in_i18n(:budget_title, "#budget-title-tabs", **attributes[:title].except("machine_translations")) + fill_in_i18n_editor(:budget_description, "#budget-description-tabs", **attributes[:description].except("machine_translations")) end - within ".callout-wrapper" do - expect(page).to have_content("successfully") - end + click_on "Update budget" + + expect(page).to have_admin_callout("Budget successfully updated.") within "table" do - expect(page).to have_content("My new title") + expect(page).to have_content(translated(attributes[:title])) end + + visit decidim_admin.root_path + expect(page).to have_content("updated the #{translated(attributes[:title])} budget") end end describe "previewing budgets" do it "links the budget correctly" do - link = find("a[title=Preview]") - expect(link[:href]).to include(resource_locator(budget).path) + within "tr", text: translated(budget.title) do + find("button[data-controller='dropdown']").click + preview_window = window_opened_by { click_on "Preview" } + within_window preview_window do + expect(page).to have_current_path(Decidim::EngineRouter.main_proxy(budget.component).budget_projects_path(budget)) + end + end end end - describe "deleting a budget" do - it "deletes a budget" do - within find("tr", text: translated(budget.title)) do + describe "soft deleting a budget" do + it "moves to the trash a budget" do + within "tr", text: translated(budget.title) do accept_confirm do - page.find(".action-icon--remove").click + find("button[data-controller='dropdown']").click + click_on "Move to trash" end end - within ".callout-wrapper" do - expect(page).to have_content("successfully") - end + expect(page).to have_admin_callout("Budget successfully deleted.") within "table" do - expect(page).not_to have_content(translated(budget.title)) - end - end - - context "when the budget has projects" do - let!(:budget) { create(:budget, :with_projects, component: current_component) } - - it "cannot delete the budget" do - within find("tr", text: translated(budget.title)) do - expect(page).to have_no_selector(".action-icon--remove") - end + expect(page).to have_no_content(translated(budget.title)) end end end - describe "component page shows finished and pending orders of all budgets" do + describe "component page shows finished and pending orders of all budgets, and paper ballots" do context "when component has many budgets with orders" do let(:budget2) { create(:budget, :with_projects, component: current_component) } - let(:project) { create(:project, budget: budget, budget_amount: 90_000_000) } + let(:project) { create(:project, budget:, budget_amount: 90_000_000) } + let!(:paper_ballot_result) { create :paper_ballot_result, project:, votes: 20 } let(:project2) { create(:project, budget: budget2, budget_amount: 95_000_000) } - let(:user2) { create :user, :confirmed, organization: organization } - let(:user3) { create :user, :confirmed, organization: organization } + let!(:paper_ballot_result2) { create :paper_ballot_result, project: project2, votes: 25 } + let(:user2) { create(:user, :confirmed, organization:) } + let(:user3) { create(:user, :confirmed, organization:) } # User has one finished and pending order let!(:finished_order) do - order = create(:order, user: user, budget: budget) + order = create(:order, user:, budget:) order.projects << project order.checked_out_at = Time.current order.save! order end let!(:pending_order) do - order = create(:order, user: user, budget: budget2) + order = create(:order, user:, budget: budget2) order.projects << project2 order.save! order @@ -146,7 +127,7 @@ # User2 has two finished orders let!(:finished_order2) do - order = create(:order, user: user2, budget: budget) + order = create(:order, user: user2, budget:) order.projects << project order.checked_out_at = Time.current order.save! @@ -172,18 +153,61 @@ it "shows finished and pending orders" do visit current_path within find_all(".card-divider").last do - expect(page).to have_content("Finished votes: \n4") - expect(page).to have_content("Pending votes: \n1") + expect(page).to have_content("Finished votes: 4") + expect(page).to have_content("Pending votes: 1") end end it "shows count of users with finished and pending orders" do visit current_path within find_all(".card-divider").last do - expect(page).to have_content("Users with finished votes: \n3") - expect(page).to have_content("Users with pending votes: \n1") + expect(page).to have_content("Users with finished votes: 3") + expect(page).to have_content("Users with pending votes: 1") + end + end + + it "shows count of paper ballots" do + visit current_path + within find_all(".card-divider").last do + expect(page).to have_content("Paper ballots: 45") end end end end + + describe "soft delete a budget" do + let(:admin_resource_path) { current_path } + let(:trash_path) { "#{admin_resource_path}/budgets/manage_trash" } + let(:title) { { en: "My budget" } } + let!(:resource) { create(:budget, title:, component: current_component) } + + it_behaves_like "manage soft deletable resource", "budget" + it_behaves_like "manage trashed resource", "budget" + end + + describe "more information button" do + context "when budget has more_information content" do + let!(:budget_with_info) { create(:budget, :with_projects, component: current_component) } + + before do + current_component.update!(settings: { more_information_modal: { en: "Additional budget information" } }) + end + + it "displays the more information button" do + visit Decidim::EngineRouter.main_proxy(current_component).budget_projects_path(budget_with_info) + + expect(page).to have_button("More information") + end + end + + context "when budget has no more_information content" do + let!(:budget_without_info) { create(:budget, :with_projects, component: current_component) } + + it "does not display the more information button" do + visit Decidim::EngineRouter.main_proxy(current_component).budget_projects_path(budget_without_info) + + expect(page).to have_no_button("More information") + end + end + end end diff --git a/spec/system/admin_manages_projects_spec.rb b/spec/system/admin_manages_projects_spec.rb index b76aabe..7b61e15 100644 --- a/spec/system/admin_manages_projects_spec.rb +++ b/spec/system/admin_manages_projects_spec.rb @@ -1,81 +1,154 @@ # frozen_string_literal: true require "spec_helper" -require "decidim/proposals/test/capybara_proposals_picker" -describe "Admin manages projects", type: :system do +describe "Admin manages projects" do + include_context "when managing a component as an admin" let(:manifest_name) { "budgets" } - let(:budget) { create :budget, component: current_component } - let!(:project) { create :project, budget: budget } + let!(:budget) { create(:budget, component: current_component) } + let!(:project) { create(:project, budget:) } + let!(:destination_budget) { create(:budget, component: current_component) } + let(:root_taxonomy) { create(:taxonomy, organization:) } + let!(:taxonomy) { create(:taxonomy, parent: root_taxonomy, organization:) } + let(:taxonomy_filter) { create(:taxonomy_filter, root_taxonomy:) } + let!(:taxonomy_filter_item) { create(:taxonomy_filter_item, taxonomy_filter:, taxonomy_item: taxonomy) } + let(:taxonomy_filter_ids) { [taxonomy_filter.id] } - include_context "when managing a component as an admin" + let!(:component) { create(:component, manifest:, participatory_space:, settings: { taxonomy_filters: taxonomy_filter_ids }) } before do - budget switch_to_host(organization.host) login_as user, scope: :user visit_component_admin - within find("tr", text: translated(budget.title)) do - page.find(".action-icon--edit-projects").click + within "tr", text: translated(budget.title) do + find("button[data-controller='dropdown']").click + click_on "Add projects" end end it_behaves_like "manage projects" it_behaves_like "import proposals to projects" + # it_behaves_like "export projects" describe "bulk actions" do - let!(:project2) { create(:project, budget: budget) } - let!(:category) { create(:category, participatory_space: current_component.participatory_space) } - let!(:scope) { create(:scope, organization: current_component.organization) } + let!(:project2) { create(:project, budget:) } + let!(:another_taxonomy) { create(:taxonomy, :with_parent, organization:) } + let(:another_taxonomy_filter) { create(:taxonomy_filter, root_taxonomy: another_taxonomy.parent) } + let!(:another_taxonomy_filter_item) { create(:taxonomy_filter_item, taxonomy_filter: another_taxonomy_filter, taxonomy_item: another_taxonomy) } + let(:taxonomy_filter_ids) { [taxonomy_filter.id, another_taxonomy_filter.id] } before do visit current_path end - it "changes projects category" do + it "changes projects taxonomies" do find(".js-resource-id-#{project.id}").set(true) - find("#js-bulk-actions-button").click - click_button "Change category" - select translated(category.name), from: "category_id" - click_button "Update" - expect(page).to have_css(".callout.success") - within "tr[data-id='#{project.id}']" do - expect(page).to have_content(translated(category.name)) - end - expect(::Decidim::Budgets::Project.find(project.id).category).to eq(category) - expect(::Decidim::Budgets::Project.find(project2.id).category).to be_nil + find_by_id("js-bulk-actions-button").click + click_on "Change taxonomies" + select decidim_sanitize_translated(taxonomy.name), from: "taxonomies_for_filter_#{taxonomy_filter.id}" + select decidim_sanitize_translated(another_taxonomy.name), from: "taxonomies_for_filter_#{another_taxonomy_filter.id}" + click_on "Change taxonomies" + + expect(page).to have_admin_callout "Projects successfully updated" + expect(page).to have_admin_callout translated(taxonomy.name) + expect(page).to have_admin_callout translated(another_taxonomy.name) + expect(project.reload.taxonomies).to include(taxonomy) + expect(project.taxonomies).to include(another_taxonomy) + expect(project2.reload.taxonomies).to be_empty end - it "changes projects scope" do - find(".js-resource-id-#{project.id}").set(true) - find("#js-bulk-actions-button").click - click_button "Change scope" - scope_pick select_data_picker(:scope_id), scope - click_button "Update" - expect(page).to have_css(".callout.success") + it "selects projects to implementation" do within "tr[data-id='#{project.id}']" do - expect(page).to have_content(translated(scope.name)) + expect(page).to have_content("No") + end + within "tr[data-id='#{project2.id}']" do + expect(page).to have_content("No") end - expect(::Decidim::Budgets::Project.find(project.id).scope).to eq(scope) - expect(::Decidim::Budgets::Project.find(project2.id).scope).to be_nil - end - it "selects projects to implementation" do - find("#projects_bulk").set(true) - find("#js-bulk-actions-button").click - click_button "Change selected" + find_by_id("projects_bulk").set(true) + find_by_id("js-bulk-actions-button").click + click_on "Change selected" select "Select", from: "selected_value" - click_button "Update" - expect(page).to have_css(".callout.success") + click_on "Update" + + expect(page).to have_admin_callout "These projects were successfully selected for implementation" within "tr[data-id='#{project.id}']" do - expect(page).to have_content("Selected") + expect(page).to have_content("Yes") end within "tr[data-id='#{project2.id}']" do - expect(page).to have_content("Selected") + expect(page).to have_content("Yes") end - expect(::Decidim::Budgets::Project.find(project.id).selected_at).to eq(Time.zone.today) - expect(::Decidim::Budgets::Project.find(project2.id).selected_at).to eq(Time.zone.today) + expect(Decidim::Budgets::Project.find(project.id).selected_at).to eq(Time.zone.today) + expect(Decidim::Budgets::Project.find(project2.id).selected_at).to eq(Time.zone.today) end + + describe "update projects budget" do + let!(:another_component) { create(:budgets_component, organization:, participatory_space: current_component.participatory_space) } + let!(:another_budget) { create(:budget, component: another_component) } + let!(:paper_ballot_result) { create :paper_ballot_result, project:, votes: 20 } + let!(:paper_ballot_result2) { create :paper_ballot_result, project: project2, votes: 15 } + + it "shows all of the budgets within the participatory_space" do + visit current_path + find_by_id("projects_bulk").set(true) + find_by_id("js-bulk-actions-button").click + click_on "Change budget" + options = ["Select budget", format_title(destination_budget), format_title(budget), format_title(another_budget)] + expect(page).to have_select("reference_id", options:) + end + + it "shows the paper ballots count" do + visit current_path + within find_all(".card-divider").last do + expect(page).to have_content("Paper ballots: 35") + end + + within "tr[data-id='#{project.id}']" do + within "td[data-label='Votes count']" do + expect(page).to have_content("20 (0/20)") + end + end + + within "tr[data-id='#{project2.id}']" do + within "td[data-label='Votes count']" do + expect(page).to have_content("15 (0/15)") + end + end + end + + it "changes project budget" do + find_by_id("projects_bulk").set(true) + find_by_id("js-bulk-actions-button").click + click_on "Change budget" + select translated(destination_budget.title), from: "reference_id" + click_on "Update project's budget" + within_flash_messages do + expect(page).to have_content("Projects successfully updated to the budget: #{translated(project.title)} and #{translated(project2.title)}") + end + expect(page).to have_no_css("tr[data-id='#{project.id}']") + expect(page).to have_no_css("tr[data-id='#{project2.id}']") + + expect(project.reload.budget).to eq(destination_budget) + expect(project2.reload.budget).to eq(destination_budget) + end + end + + describe "soft delete a projects" do + let(:admin_resource_path) { current_path } + let(:trash_path) { "#{admin_resource_path}/manage_trash" } + let(:title) { { en: "My projects" } } + let!(:budget) { create(:budget, component: current_component) } + let!(:resource) { create(:project, budget:, title:) } + + it_behaves_like "manage soft deletable resource", "project" + it_behaves_like "manage trashed resource", "project" + end + end + + private + + def format_title(budget) + " #{translated(budget.title)}" end end