diff --git a/.rubocop.yml b/.rubocop.yml index 7f5e2681..534b6163 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,9 @@ -inherit_from: - - https://raw.githubusercontent.com/decidim/decidim/release/0.28-stable/.rubocop.yml +inherit_gem: + decidim-dev: rubocop-decidim.yml AllCops: Exclude: - - "spec/decidim_dummy_app*/**/*" + - 'db/**/*.rb' + - 'vendor/**/*' + - 'spec/decidim_dummy_app/**/*' + - 'development_app/**/*' diff --git a/Gemfile b/Gemfile index cdc3f0d2..12a5bed7 100644 --- a/Gemfile +++ b/Gemfile @@ -15,8 +15,9 @@ gemspec group :development, :test do gem "bootsnap", require: false gem "byebug", "~> 11.0", platform: :mri - gem "decidim", "0.30.1", require: true - gem "decidim-dev", "0.30.1", require: true + gem "decidim", "0.31", require: true + gem "decidim-dev", "~> 0.31", require: true + gem "decidim-initiatives", "~> 0.31" gem "faker", "~> 3.2" gem "letter_opener_web" gem "listen" diff --git a/Gemfile.lock b/Gemfile.lock index 6e59cdea..2a5e6442 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,90 +1,100 @@ PATH remote: . specs: - decidim-file_authorization_handler (0.30.1.0) - decidim (~> 0.30.1) - decidim-admin (~> 0.30.1) + decidim-file_authorization_handler (0.31.0) + decidim (~> 0.31) + decidim-admin (~> 0.31) + decidim-initiatives (~> 0.31) GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) + actioncable (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.7) - actionpack (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activesupport (= 7.0.8.7) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.7) - actionview (= 7.0.8.7) - activesupport (= 7.0.8.7) - rack (~> 2.0, >= 2.2.4) + 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 (7.0.8.7) - actionpack (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + 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 (7.0.8.7) - activesupport (= 7.0.8.7) + 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 (7.0.8.7) - activesupport (= 7.0.8.7) + activejob (7.2.3) + activesupport (= 7.2.3) globalid (>= 0.3.6) - activemodel (7.0.8.7) - activesupport (= 7.0.8.7) - activerecord (7.0.8.7) - activemodel (= 7.0.8.7) - activesupport (= 7.0.8.7) - activestorage (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activesupport (= 7.0.8.7) + 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 (7.0.8.7) - 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) - acts_as_list (1.2.4) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + acts_as_list (1.2.6) activerecord (>= 6.1) activesupport (>= 6.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.2) base64 (0.3.0) - batch-loader (2.0.5) - bcrypt (3.1.20) + batch-loader (2.0.6) + bcrypt (3.1.21) + benchmark (0.5.0) better_html (2.1.1) actionview (>= 6.0) activesupport (>= 6.0) @@ -92,7 +102,7 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.3.1) + bigdecimal (4.0.1) bootsnap (1.18.4) msgpack (~> 1.2) browser (6.2.0) @@ -121,14 +131,16 @@ GEM cells-rails (0.1.6) actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) + 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.4) - connection_pool (2.5.4) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) crack (1.0.0) bigdecimal rexml @@ -136,57 +148,61 @@ GEM css_parser (1.21.1) addressable csv (3.3.5) - date (3.4.1) + data_migrate (11.3.1) + activerecord (>= 6.1) + railties (>= 6.1) + date (3.5.1) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - decidim (0.30.1) - decidim-accountability (= 0.30.1) - decidim-admin (= 0.30.1) - decidim-api (= 0.30.1) - decidim-assemblies (= 0.30.1) - decidim-blogs (= 0.30.1) - decidim-budgets (= 0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-debates (= 0.30.1) - decidim-forms (= 0.30.1) - decidim-generators (= 0.30.1) - decidim-meetings (= 0.30.1) - decidim-pages (= 0.30.1) - decidim-participatory_processes (= 0.30.1) - decidim-proposals (= 0.30.1) - decidim-sortitions (= 0.30.1) - decidim-surveys (= 0.30.1) - decidim-system (= 0.30.1) - decidim-verifications (= 0.30.1) - decidim-accountability (0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-admin (0.30.1) + decidim (0.31.0) + decidim-accountability (= 0.31.0) + decidim-admin (= 0.31.0) + decidim-api (= 0.31.0) + decidim-assemblies (= 0.31.0) + decidim-blogs (= 0.31.0) + decidim-budgets (= 0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-debates (= 0.31.0) + decidim-forms (= 0.31.0) + decidim-generators (= 0.31.0) + decidim-meetings (= 0.31.0) + decidim-pages (= 0.31.0) + decidim-participatory_processes (= 0.31.0) + decidim-proposals (= 0.31.0) + decidim-sortitions (= 0.31.0) + decidim-surveys (= 0.31.0) + decidim-system (= 0.31.0) + decidim-verifications (= 0.31.0) + decidim-accountability (0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-admin (0.31.0) active_link_to (~> 1.0) - decidim-core (= 0.30.1) + decidim-core (= 0.31.0) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.30.1) - decidim-core (= 0.30.1) - graphql (~> 2.4.0) + decidim-api (0.31.0) + decidim-core (= 0.31.0) + devise-jwt (~> 0.12.1) + graphql (~> 2.4.0, >= 2.4.17) graphql-docs (~> 5.0) rack-cors (~> 1.0) - decidim-assemblies (0.30.1) - decidim-core (= 0.30.1) - decidim-blogs (0.30.1) - decidim-admin (= 0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-budgets (0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-comments (0.30.1) - decidim-core (= 0.30.1) + decidim-assemblies (0.31.0) + decidim-core (= 0.31.0) + decidim-blogs (0.31.0) + decidim-admin (= 0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-budgets (0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-comments (0.31.0) + decidim-core (= 0.31.0) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.30.1) + decidim-core (0.31.0) active_link_to (~> 1.0) acts_as_list (~> 1.0) batch-loader (~> 2.0) @@ -195,7 +211,8 @@ GEM cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) chartkick (~> 5.1.2) - concurrent-ruby (= 1.3.4) + concurrent-ruby (~> 1.3.0) + data_migrate (~> 11.3) date_validator (~> 0.12.0) devise (~> 4.7) devise-i18n (~> 1.2) @@ -227,30 +244,31 @@ GEM premailer-rails (~> 1.10) rack (~> 2.2, >= 2.2.8.1) rack-attack (~> 6.0) - rails (~> 7.0.8) + rails (~> 7.2.0, >= 7.2.2.2) rails-i18n (~> 7.0) ransack (~> 4.2.0) redis (~> 4.1) request_store (~> 1.7.0) + rqrcode (~> 2.2.0) rubyXL (~> 3.4) rubyzip (~> 2.0) - shakapacker (~> 7.1.0) + shakapacker (~> 8.3.0) valid_email2 (~> 7.0) web-push (~> 3.0) wisper (~> 3.0) - decidim-debates (0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-dev (0.30.1) + decidim-debates (0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-dev (0.31.0) bullet (~> 8.0.0) byebug (~> 11.0) capybara (~> 3.39) - decidim-admin (= 0.30.1) - decidim-api (= 0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-generators (= 0.30.1) - decidim-verifications (= 0.30.1) + decidim-admin (= 0.31.0) + decidim-api (= 0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-generators (= 0.31.0) + decidim-verifications (= 0.31.0) erb_lint (~> 0.8.0) factory_bot_rails (~> 6.2) faker (~> 3.2) @@ -265,16 +283,16 @@ GEM rspec-rails (~> 6.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.6.0) - rubocop (~> 1.69.0) - rubocop-capybara (~> 2.21) - rubocop-factory_bot (~> 2.26) - rubocop-faker (~> 1.1) - rubocop-graphql (~> 1.5) - rubocop-performance (~> 1.21) - rubocop-rails (~> 2.25) - rubocop-rspec (~> 3.0) - rubocop-rspec_rails (~> 2.30) - rubocop-rubycw (~> 0.1) + 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) @@ -283,39 +301,44 @@ GEM w3c_rspec_validators (~> 0.3.0) webmock (~> 3.18) wisper-rspec (~> 1.0) - decidim-forms (0.30.1) - decidim-core (= 0.30.1) - decidim-generators (0.30.1) - decidim-core (= 0.30.1) - decidim-meetings (0.30.1) - decidim-core (= 0.30.1) - decidim-forms (= 0.30.1) + decidim-forms (0.31.0) + decidim-core (= 0.31.0) + decidim-generators (0.31.0) + decidim-core (= 0.31.0) + decidim-initiatives (0.31.0) + decidim-admin (= 0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-verifications (= 0.31.0) + decidim-meetings (0.31.0) + decidim-core (= 0.31.0) + decidim-forms (= 0.31.0) icalendar (~> 2.5) - decidim-pages (0.30.1) - decidim-core (= 0.30.1) - decidim-participatory_processes (0.30.1) - decidim-core (= 0.30.1) - decidim-proposals (0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - doc2text (~> 0.4.7) + decidim-pages (0.31.0) + decidim-core (= 0.31.0) + decidim-participatory_processes (0.31.0) + decidim-core (= 0.31.0) + decidim-proposals (0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + doc2text (~> 0.4.0, >= 0.4.8) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.30.1) - decidim-admin (= 0.30.1) - decidim-comments (= 0.30.1) - decidim-core (= 0.30.1) - decidim-proposals (= 0.30.1) - decidim-surveys (0.30.1) - decidim-core (= 0.30.1) - decidim-forms (= 0.30.1) - decidim-system (0.30.1) + decidim-sortitions (0.31.0) + decidim-admin (= 0.31.0) + decidim-comments (= 0.31.0) + decidim-core (= 0.31.0) + decidim-proposals (= 0.31.0) + decidim-surveys (0.31.0) + decidim-core (= 0.31.0) + decidim-forms (= 0.31.0) + decidim-system (0.31.0) active_link_to (~> 1.0) - decidim-core (= 0.30.1) + decidim-core (= 0.31.0) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-verifications (0.30.1) - decidim-core (= 0.30.1) + decidim-verifications (0.31.0) + decidim-core (= 0.31.0) declarative-builder (0.2.0) trailblazer-option (~> 0.1.0) declarative-option (0.1.0) @@ -328,6 +351,9 @@ GEM devise-i18n (1.15.0) devise (>= 4.9.0) 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) @@ -340,6 +366,18 @@ GEM doorkeeper (5.8.2) railties (>= 5) doorkeeper-i18n (4.0.1) + 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.1) erb_lint (0.8.0) activesupport better_html (>= 2.0.1) @@ -351,7 +389,7 @@ GEM temple erubi (1.13.1) escape_utils (1.3.0) - excon (1.3.0) + excon (1.3.2) logger extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) @@ -366,16 +404,16 @@ GEM faraday-net_http (>= 2.0, < 3.5) json logger - faraday-net_http (3.4.1) - net-http (>= 0.5.0) - ffi (1.17.2-aarch64-linux-gnu) - ffi (1.17.2-aarch64-linux-musl) - ffi (1.17.2-arm-linux-gnu) - ffi (1.17.2-arm-linux-musl) - ffi (1.17.2-arm64-darwin) - ffi (1.17.2-x86_64-darwin) - ffi (1.17.2-x86_64-linux-gnu) - ffi (1.17.2-x86_64-linux-musl) + faraday-net_http (3.4.2) + net-http (~> 0.5) + ffi (1.17.3-aarch64-linux-gnu) + ffi (1.17.3-aarch64-linux-musl) + ffi (1.17.3-arm-linux-gnu) + ffi (1.17.3-arm-linux-musl) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-darwin) + ffi (1.17.3-x86_64-linux-gnu) + ffi (1.17.3-x86_64-linux-musl) fiber-storage (1.0.1) file_validators (3.0.0) activemodel (>= 3.2) @@ -387,7 +425,7 @@ GEM mime-types fog-local (0.9.0) fog-core (>= 1.27, < 3.0) - formatador (1.2.1) + formatador (1.2.3) reline gemoji (3.0.1) geocoder (1.8.6) @@ -396,25 +434,25 @@ GEM geom2d (0.4.1) globalid (1.3.0) activesupport (>= 6.1) - google-protobuf (4.32.1) + google-protobuf (4.33.4) bigdecimal rake (>= 13) - google-protobuf (4.32.1-aarch64-linux-gnu) + google-protobuf (4.33.4-aarch64-linux-gnu) bigdecimal rake (>= 13) - google-protobuf (4.32.1-aarch64-linux-musl) + google-protobuf (4.33.4-aarch64-linux-musl) bigdecimal rake (>= 13) - google-protobuf (4.32.1-arm64-darwin) + google-protobuf (4.33.4-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.32.1-x86_64-darwin) + google-protobuf (4.33.4-x86_64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.32.1-x86_64-linux-gnu) + google-protobuf (4.33.4-x86_64-linux-gnu) bigdecimal rake (>= 13) - google-protobuf (4.32.1-x86_64-linux-musl) + google-protobuf (4.33.4-x86_64-linux-musl) bigdecimal rake (>= 13) graphql (2.4.17) @@ -432,7 +470,8 @@ GEM ostruct (~> 0.6) sass-embedded (~> 1.58) hashdiff (1.2.1) - hashie (5.0.0) + hashie (5.1.0) + logger hexapdf (1.1.1) cmdparse (~> 3.0, >= 3.0.3) geom2d (~> 0.4, >= 0.4.1) @@ -443,8 +482,8 @@ GEM html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - htmlentities (4.3.4) - i18n (1.14.7) + htmlentities (4.4.2) + i18n (1.14.8) concurrent-ruby (~> 1.0) i18n-tasks (1.0.15) activesupport (>= 4.0.2) @@ -457,7 +496,7 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.8, >= 1.8.1) terminal-table (>= 1.5.1) - icalendar (2.12.0) + icalendar (2.12.1) base64 ice_cube (~> 0.16) logger @@ -468,8 +507,12 @@ GEM ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - io-console (0.8.1) - json (2.15.1) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.18.0) jwt (3.1.2) base64 kaminari (1.2.2) @@ -496,34 +539,36 @@ GEM letter_opener (~> 1.9) railties (>= 6.1) rexml + lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - loofah (2.24.1) + loofah (2.25.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp marcel (1.1.0) matrix (0.4.2) - method_source (1.1.0) mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2025.0924) + mime-types-data (3.2026.0113) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.26.0) + minitest (6.0.1) + prism (~> 1.5) msgpack (1.8.0) - multi_xml (0.7.2) - bigdecimal (~> 3.1) - net-http (0.6.0) - uri - net-imap (0.5.12) + multi_xml (0.8.1) + bigdecimal (>= 3.1, < 5) + net-http (0.9.1) + uri (>= 0.11.1) + net-imap (0.6.2) date net-protocol net-pop (0.1.2) @@ -532,30 +577,31 @@ GEM timeout net-smtp (0.5.1) net-protocol - nio4r (2.7.4) - nokogiri (1.18.10-aarch64-linux-gnu) + nio4r (2.7.5) + nokogiri (1.19.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.10-aarch64-linux-musl) + nokogiri (1.19.0-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.18.10-arm-linux-gnu) + nokogiri (1.19.0-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.18.10-arm-linux-musl) + nokogiri (1.19.0-arm-linux-musl) racc (~> 1.4) - nokogiri (1.18.10-arm64-darwin) + nokogiri (1.19.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.10-x86_64-darwin) + nokogiri (1.19.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.10-x86_64-linux-gnu) + nokogiri (1.19.0-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.10-x86_64-linux-musl) + nokogiri (1.19.0-x86_64-linux-musl) racc (~> 1.4) - oauth (1.1.2) + oauth (1.1.3) + base64 (~> 0.1) oauth-tty (~> 1.0, >= 1.0.6) snaky_hash (~> 2.0) version_gem (~> 1.1, >= 1.1.9) oauth-tty (1.0.6) version_gem (~> 1.1, >= 1.1.9) - oauth2 (2.0.17) + oauth2 (2.0.18) faraday (>= 0.17.3, < 4.0) jwt (>= 1.0, < 4.0) logger (~> 1.2) @@ -579,8 +625,8 @@ GEM oauth omniauth (>= 1.0, < 3) rack (>= 1.6.2, < 4) - omniauth-oauth2 (1.8.0) - oauth2 (>= 1.4, < 3) + omniauth-oauth2 (1.9.0) + oauth2 (>= 2.0.2, < 3) omniauth (~> 2.0) omniauth-rails_csrf_protection (1.0.2) actionpack (>= 4.2) @@ -588,9 +634,10 @@ GEM omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack - openssl (3.3.1) + openssl (4.0.0) orm_adapter (0.5.0) ostruct (0.6.3) + package_json (0.2.0) paper_trail (16.0.0) activerecord (>= 6.1) request_store (~> 1.4) @@ -599,13 +646,15 @@ GEM parallel paranoia (3.0.1) activerecord (>= 6, < 8.1) - parser (3.3.7.1) + parser (3.3.10.1) ast (~> 2.4.1) racc pg (1.5.9) pg_search (2.3.7) activerecord (>= 6.1) activesupport (>= 6.1) + pp (0.6.3) + prettyprint premailer (1.27.0) addressable css_parser (>= 1.19.0) @@ -614,12 +663,17 @@ GEM actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) - public_suffix (6.0.2) + prettyprint (0.2.0) + prism (1.8.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.2) puma (6.6.0) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.20) - rack-attack (6.7.0) + rack (2.2.21) + rack-attack (6.8.0) rack (>= 1.0, < 4) rack-cors (1.1.1) rack (>= 2.0.0) @@ -630,22 +684,27 @@ GEM rack (~> 2.2, >= 2.2.4) rack-proxy (0.7.7) rack + rack-session (1.0.2) + rack (< 3) rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8.7) - actioncable (= 7.0.8.7) - actionmailbox (= 7.0.8.7) - actionmailer (= 7.0.8.7) - actionpack (= 7.0.8.7) - actiontext (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activemodel (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + 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 (= 7.0.8.7) + railties (= 7.2.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -660,15 +719,18 @@ GEM rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) - method_source + 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) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.3.0) + rake (13.3.1) ransack (4.2.1) activerecord (>= 6.1.5) activesupport (>= 6.1.5) @@ -676,12 +738,16 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) + rdoc (7.1.0) + erb + psych (>= 4.0.0) + tsort redcarpet (3.6.1) redis (4.8.1) redis-client (0.26.1) connection_pool regexp_parser (2.10.0) - reline (0.6.2) + reline (0.6.3) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) @@ -689,6 +755,10 @@ GEM actionpack (>= 7.0) railties (>= 7.0) rexml (3.4.1) + rqrcode (2.2.0) + chunky_png (~> 1.0) + rqrcode_core (~> 1.0) + rqrcode_core (1.2.0) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -720,66 +790,78 @@ GEM rspec-support (3.13.2) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.69.2) + rubocop (1.78.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.36.2, < 2.0) + rubocop-ast (>= 1.45.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) - rubocop-capybara (2.21.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.26.1) - rubocop (~> 1.61) - rubocop-faker (1.2.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 (>= 1.13.0) - rubocop-graphql (1.5.4) - rubocop (>= 1.50, < 2) - rubocop-performance (1.23.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.29.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-graphql (1.5.6) + 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.52.0, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.4.0) - rubocop (~> 1.61) - rubocop-rspec_rails (2.30.0) - rubocop (~> 1.61) - rubocop-rspec (~> 3, >= 3.0.1) - rubocop-rubycw (0.1.6) - rubocop (~> 1.0) + 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.2.5) + ruby-vips (2.3.0) ffi (~> 1.12) logger rubyXL (3.4.33) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) rubyzip (2.3.2) - sass-embedded (1.93.2-aarch64-linux-gnu) + sass-embedded (1.97.3-aarch64-linux-gnu) google-protobuf (~> 4.31) - sass-embedded (1.93.2-aarch64-linux-musl) + sass-embedded (1.97.3-aarch64-linux-musl) google-protobuf (~> 4.31) - sass-embedded (1.93.2-arm-linux-gnueabihf) + sass-embedded (1.97.3-arm-linux-gnueabihf) google-protobuf (~> 4.31) - sass-embedded (1.93.2-arm-linux-musleabihf) + sass-embedded (1.97.3-arm-linux-musleabihf) google-protobuf (~> 4.31) - sass-embedded (1.93.2-arm64-darwin) + sass-embedded (1.97.3-arm64-darwin) google-protobuf (~> 4.31) - sass-embedded (1.93.2-x86_64-darwin) + sass-embedded (1.97.3-x86_64-darwin) google-protobuf (~> 4.31) - sass-embedded (1.93.2-x86_64-linux-gnu) + sass-embedded (1.97.3-x86_64-linux-gnu) google-protobuf (~> 4.31) - sass-embedded (1.93.2-x86_64-linux-musl) + sass-embedded (1.97.3-x86_64-linux-musl) google-protobuf (~> 4.31) + securerandom (0.4.1) selenium-webdriver (4.29.1) base64 (~> 0.2) logger (~> 1.4) @@ -787,8 +869,9 @@ GEM rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) semantic_range (3.1.0) - shakapacker (7.1.0) + shakapacker (8.3.0) activesupport (>= 5.2) + package_json rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) @@ -815,20 +898,23 @@ GEM spring-watcher-listen (2.1.0) listen (>= 2.7, < 4.0) spring (>= 4) - strscan (3.1.5) + 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.4.0) - tilt (2.6.1) - timeout (0.4.3) + 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) unicode-display_width (2.6.0) uniform_notifier (1.16.0) - uri (1.0.4) + uri (1.1.1) + useragent (0.16.11) valid_email2 (7.0.13) activemodel (>= 6.0) mail (~> 2.5) @@ -843,13 +929,19 @@ GEM rexml (~> 3.2) warden (1.2.9) rack (>= 2.0.9) - web-push (3.0.2) + 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-push (3.1.0) jwt (~> 3.0) - openssl (~> 3.0) + openssl (>= 3.0) webmock (3.25.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.9.2) websocket (1.2.11) websocket-driver (0.8.0) base64 @@ -859,7 +951,7 @@ GEM wisper-rspec (1.1.0) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.7.3) + zeitwerk (2.7.4) PLATFORMS aarch64-linux-gnu @@ -874,9 +966,10 @@ PLATFORMS DEPENDENCIES bootsnap byebug (~> 11.0) - decidim (= 0.30.1) - decidim-dev (= 0.30.1) + decidim (= 0.31) + decidim-dev (~> 0.31) decidim-file_authorization_handler! + decidim-initiatives (~> 0.31) faker (~> 3.2) letter_opener_web listen diff --git a/README.md b/README.md index 6c93f116..6ca630f1 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,6 @@ bin/rails decidim_file_authorization_handler:install:migrations bin/rails db:migrate ``` -Finally, add the following line to your `config/routes.rb` file: - -```ruby -mount Decidim::FileAuthorizationHandler::AdminEngine => '/admin' -``` - ## Create development_app Run: ```bash @@ -112,8 +106,6 @@ bin/rails db:migrate ## Run tests -Node 16.9.1 is required! - Create a dummy app in your application (if not present): ```bash @@ -138,7 +130,7 @@ undefined method 'decidim_file_authorization_handler_admin_path' for module# ``` -review if you have mounted the Engine routes into your application routes. +review if you have mounted the Engine routes into your application routes, cause is not longer necessary. ## License diff --git a/app/models/decidim/file_authorization_handler/census_datum.rb b/app/models/decidim/file_authorization_handler/census_datum.rb index b2e62cfd..312cd28a 100644 --- a/app/models/decidim/file_authorization_handler/census_datum.rb +++ b/app/models/decidim/file_authorization_handler/census_datum.rb @@ -27,7 +27,7 @@ def self.normalize_and_encode_id_document(id_document) return "" if id_document.blank? Digest::SHA256.hexdigest( - "#{id_document}-#{Rails.application.secrets.secret_key_base}" + "#{id_document}-#{Rails.application.secret_key_base}" ) end diff --git a/app/services/file_authorization_handler.rb b/app/services/file_authorization_handler.rb index 27abac1e..99faefd6 100644 --- a/app/services/file_authorization_handler.rb +++ b/app/services/file_authorization_handler.rb @@ -49,7 +49,7 @@ def authorized? def unique_id return nil unless organization - Digest::SHA256.hexdigest("#{census_for_user&.id_document}-#{organization.id}-#{Rails.application.secrets.secret_key_base}") + Digest::SHA256.hexdigest("#{census_for_user&.id_document}-#{organization.id}-#{Rails.application.secret_key_base}") end def census_for_user diff --git a/lib/decidim/file_authorization_handler/admin_engine.rb b/lib/decidim/file_authorization_handler/admin_engine.rb index b904756d..fbbe470c 100644 --- a/lib/decidim/file_authorization_handler/admin_engine.rb +++ b/lib/decidim/file_authorization_handler/admin_engine.rb @@ -5,10 +5,19 @@ module FileAuthorizationHandler class AdminEngine < ::Rails::Engine isolate_namespace Decidim::FileAuthorizationHandler::Admin + paths["db/migrate"] = nil + paths["lib/tasks"] = nil + routes do resource :censuses, only: [:show, :create, :destroy] end + initializer "decidim_file_authorization_handler.admin_mount_routes" do + Decidim::Core::Engine.routes do + mount Decidim::FileAuthorizationHandler::AdminEngine, at: "/admin/file_authorization_handler", as: "decidim_file_authorization_handler_admin" + end + end + initializer "decidim_file_authorization.add_admin_menu" do Decidim.menu :admin_menu do |menu| menu.add_item :file_authorization_handler, diff --git a/lib/decidim/file_authorization_handler/version.rb b/lib/decidim/file_authorization_handler/version.rb index f4533fee..fca1c06a 100644 --- a/lib/decidim/file_authorization_handler/version.rb +++ b/lib/decidim/file_authorization_handler/version.rb @@ -2,7 +2,7 @@ module Decidim module FileAuthorizationHandler - DECIDIM_VERSION = "0.30.1" + DECIDIM_VERSION = "0.31" # Uses the latest matching Decidim version for # - major, minor and patch diff --git a/spec/helpers/decidim/file_authorization_handler/encoding_helper.rb b/spec/helpers/decidim/file_authorization_handler/encoding_helper.rb index 740e4de0..b4dc8c46 100644 --- a/spec/helpers/decidim/file_authorization_handler/encoding_helper.rb +++ b/spec/helpers/decidim/file_authorization_handler/encoding_helper.rb @@ -4,7 +4,7 @@ module Decidim module FileAuthorizationHandler module EncodingHelper def encode_id_document(id_document) - Digest::SHA256.hexdigest("#{id_document}-#{Rails.application.secrets.secret_key_base}") + Digest::SHA256.hexdigest("#{id_document}-#{Rails.application.secret_key_base}") end end end diff --git a/spec/services/decidim/file_authorization_handler/file_authorization_handler_spec.rb b/spec/services/decidim/file_authorization_handler/file_authorization_handler_spec.rb index e9143cb7..1490f4c3 100644 --- a/spec/services/decidim/file_authorization_handler/file_authorization_handler_spec.rb +++ b/spec/services/decidim/file_authorization_handler/file_authorization_handler_spec.rb @@ -12,7 +12,7 @@ .with_context(current_organization: organization) end let!(:unique_id) do - Digest::SHA256.hexdigest("#{handler.census_for_user&.id_document}-#{organization.id}-#{Rails.application.secrets.secret_key_base}") + Digest::SHA256.hexdigest("#{handler.census_for_user&.id_document}-#{organization.id}-#{Rails.application.secret_key_base}") end it "accepts either id_document or document_number in the constructor" do