From fbd0a9adaa7039edf5981838b460c09c2eaeab5e Mon Sep 17 00:00:00 2001 From: Anna Topalidi Date: Sun, 22 Dec 2024 13:04:27 +0100 Subject: [PATCH] upgrade --- .github/workflows/lint.yml | 4 +- .github/workflows/tests.yml | 4 +- .gitpod.dockerfile | 2 +- CHANGELOG.md | 11 +- Gemfile | 10 +- Gemfile.lock | 511 +- README.md | 8 +- .../update_account_override.rb | 8 +- .../admin/create_constraint.rb | 2 +- .../decidim_awesome/create_editor_image.rb | 4 +- .../system/organization_form_override.rb | 4 +- .../migrate_legacy_images_job.rb | 107 - ...dim_admin_decidim_awesome_search_form.scss | 1 + .../admin/admin_accountability.scss | 67 + .../decidim/decidim_awesome/permissions.rb | 5 +- .../cw/decidim_awesome/image_uploader.rb | 26 - .../decidim/decidim_awesome/image_uploader.rb | 12 + .../admin/admin_accountability/index.html.erb | 1 + .../admin/shared/_filters_with_date.html.erb | 75 +- .../map_component/map/_map_template.html.erb | 2 +- babel.config.json | 25 - config/assets.rb | 3 +- decidim-decidim_awesome.gemspec | 2 +- lib/decidim/decidim_awesome.rb | 1 - lib/decidim/decidim_awesome/checksums.yml | 34 +- .../content_parsers/editor_images_parser.rb | 39 - .../context_analyzers/request_analyzer.rb | 4 +- lib/decidim/decidim_awesome/engine.rb | 7 +- .../middleware}/current_config.rb | 0 .../box_label_editor_examples.rb | 28 +- .../test/shared_examples/config_examples.rb | 2 +- .../shared_examples/custom_fields_examples.rb | 16 +- .../shared_examples/custom_styles_examples.rb | 12 +- .../test/shared_examples/editor_examples.rb | 6 +- .../shared_examples/scoped_admins_examples.rb | 10 +- .../test/shared_examples/summary_examples.rb | 6 +- lib/decidim/decidim_awesome/version.rb | 4 +- ...esome_active_storage_migrations_tasks.rake | 35 - lib/tasks/decidim_awesome_upgrade_tasks.rake | 2 +- package-lock.json | 11561 +++++++++++++--- package.json | 10 +- spec/cells/content_blocks/map_cell_spec.rb | 4 +- .../voting/proposal_metadata_cell_spec.rb | 2 + spec/commands/create_proposal_spec.rb | 2 +- .../system/register_organization_spec.rb | 2 +- .../system/update_organization_spec.rb | 2 +- spec/commands/update_account_spec.rb | 4 +- .../editor_images_controller_spec.rb | 11 +- spec/controllers/proposals_controller_spec.rb | 6 +- .../proposal_wizard_create_step_form_spec.rb | 2 +- spec/jobs/migrate_legacy_images_job_spec.rb | 45 - spec/lib/config_spec.rb | 2 +- .../current_config_spec.rb | 2 +- ...min_accountability_admin_filtering_spec.rb | 4 +- .../admin_accountability_ps_filtering_spec.rb | 4 +- .../system/admin/admin_accountability_spec.rb | 62 +- ...dmin_edits_proposals_custom_fields_spec.rb | 50 +- .../admin/admin_manages_mainenance_spec.rb | 24 +- .../admin_manages_menu_overrides_spec.rb | 18 +- ...min_manages_proposal_custom_fields_spec.rb | 2 +- .../admin/admin_manages_scoped_admins_spec.rb | 10 +- .../admin/admin_manages_verifications_spec.rb | 4 +- spec/system/admin/admin_spec.rb | 10 +- .../admin/admins_authorizations_admin_spec.rb | 16 +- .../admins_authorizations_system_spec.rb | 19 +- spec/system/admin/scoped_admins_spec.rb | 2 +- spec/system/awesome_map/awesome_map_spec.rb | 18 +- spec/system/public/awesome_iframe_spec.rb | 4 +- spec/system/public/awesome_intergram_spec.rb | 4 +- .../public/check_images_in_editors_spec.rb | 2 +- .../create_proposal_custom_fields_spec.rb | 36 +- spec/system/public/custom_redirects_spec.rb | 2 +- .../edit_proposal_custom_fields_spec.rb | 34 +- .../public/forced_verifications_spec.rb | 20 +- .../home_content_block_menu_hacks_spec.rb | 18 +- spec/system/public/limit_amendments_spec.rb | 18 +- spec/system/public/menu_hacks_spec.rb | 18 +- spec/system/public/questionnaires_spec.rb | 2 +- .../user_uses_custom_time_zones_spec.rb | 6 +- spec/system/public/voting_cards_spec.rb | 56 +- spec/uploaders/cw/image_uploader_spec.rb | 37 - spec/uploaders/image_uploader_spec.rb | 43 + 82 files changed, 10334 insertions(+), 2964 deletions(-) delete mode 100644 app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb create mode 100644 app/packs/entrypoints/decidim_admin_decidim_awesome_search_form.scss create mode 100644 app/packs/stylesheets/decidim/decidim_awesome/admin/admin_accountability.scss delete mode 100644 app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb delete mode 100644 babel.config.json delete mode 100644 lib/decidim/decidim_awesome/content_parsers/editor_images_parser.rb rename {app/middleware/decidim/decidim_awesome => lib/decidim/decidim_awesome/middleware}/current_config.rb (100%) delete mode 100644 lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake delete mode 100644 spec/jobs/migrate_legacy_images_job_spec.rb rename spec/{middleware => lib}/current_config_spec.rb (98%) delete mode 100644 spec/uploaders/cw/image_uploader_spec.rb create mode 100644 spec/uploaders/image_uploader_spec.rb diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 264e79800..08a1a1e70 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ on: pull_request: env: - RUBY_VERSION: 3.1.1 + RUBY_VERSION: 3.2.2 NODE_VERSION: 18.17.1 jobs: @@ -40,4 +40,4 @@ jobs: name: Lint SCSS files - run: bundle exec erblint app/**/*.erb - name: Lint ERB files \ No newline at end of file + name: Lint ERB files diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84495b812..f21f2eb13 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ env: CI: 1 SIMPLECOV: 1 NODE_VERSION: 18.17.1 - RUBY_VERSION: 3.1.1 + RUBY_VERSION: 3.2.2 BUNDLE_GEMFILE: Gemfile DISPLAY: ":99" PARALLEL_TEST_PROCESSORS: 2 @@ -143,7 +143,7 @@ jobs: with: name: workspace path: /tmp - + - run: tar -zxf /tmp/testapp-env.tar.gz name: Restore application diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index e5b1c718f..25014a810 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -5,4 +5,4 @@ RUN sudo apt-get update && sudo apt-get install -y redis-server apt-transport-h USER gitpod SHELL ["/bin/bash", "-c"] -RUN cd && /home/gitpod/.rvm/bin/rvm install "ruby-3.1.1" +RUN cd && /home/gitpod/.rvm/bin/rvm install "ruby-3.2.2" diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e01a418..16c1c4e61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,12 @@ CHANGELOG Current ------- Compatibility: - - Decidim v0.28.x + - Decidim v0.29.x -Features: - - Added user time zones in account settings +v0.12.0 +------- +Compatibility: + - Decidim v0.29.x v0.11.2 ------- @@ -18,6 +20,7 @@ Compatibility: Features: - SQL vulnerability fix for admin accountability - Private fields proposal draft update fix + - Added user time zones in account settings v0.11.1 ------ @@ -98,7 +101,7 @@ Compatibility: Features: - Fixes for the menu hacker - + v0.9.1 ------ diff --git a/Gemfile b/Gemfile index c7b37d5bc..01a610c4a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" ruby RUBY_VERSION -DECIDIM_VERSION = "0.28.4" +DECIDIM_VERSION = "0.29.1" gem "decidim", DECIDIM_VERSION # this causes failures if not enabled (check if still necessary in the future) @@ -20,9 +20,9 @@ group :development, :test do gem "decidim-dev", DECIDIM_VERSION - gem "brakeman", "~> 5.4" - gem "net-imap", "~> 0.2.3" - gem "net-pop", "~> 0.1.1" + gem "brakeman", "~> 6.1" + gem "net-imap", "~> 0.4.16" + gem "net-pop", "~> 0.1.2" gem "net-smtp", "~> 0.3.1" gem "parallel_tests", "~> 4.2" end @@ -30,7 +30,5 @@ end group :development do gem "letter_opener_web", "~> 2.0" gem "listen", "~> 3.1" - gem "spring", "~> 2.0" - gem "spring-watcher-listen", "~> 2.0" gem "web-console", "~> 4.2" end diff --git a/Gemfile.lock b/Gemfile.lock index 2fbf84c6d..a4dce024c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,49 +1,56 @@ PATH remote: . specs: - decidim-decidim_awesome (0.11.2) - decidim-admin (>= 0.28.0, < 0.29) - decidim-core (>= 0.28.0, < 0.29) + decidim-decidim_awesome (0.12.0) + decidim-admin (>= 0.29.1, < 0.30) + decidim-core (>= 0.29.1, < 0.30) deface (>= 1.5) sassc (~> 2.3) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + actioncable (7.0.8.6) + actionpack (= 7.0.8.6) + activesupport (= 7.0.8.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actionmailbox (7.0.8.6) + actionpack (= 7.0.8.6) + activejob (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) mail (>= 2.7.1) - actionmailer (6.1.7.10) - actionpack (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activesupport (= 6.1.7.10) + net-imap + net-pop + net-smtp + actionmailer (7.0.8.6) + actionpack (= 7.0.8.6) + actionview (= 7.0.8.6) + activejob (= 7.0.8.6) + activesupport (= 7.0.8.6) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.10) - actionview (= 6.1.7.10) - activesupport (= 6.1.7.10) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8.6) + actionview (= 7.0.8.6) + activesupport (= 7.0.8.6) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.10) - actionpack (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + actiontext (7.0.8.6) + actionpack (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.10) - activesupport (= 6.1.7.10) + actionview (7.0.8.6) + activesupport (= 7.0.8.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -51,28 +58,27 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.1.7.10) - activesupport (= 6.1.7.10) + activejob (7.0.8.6) + activesupport (= 7.0.8.6) globalid (>= 0.3.6) - activemodel (6.1.7.10) - activesupport (= 6.1.7.10) - activerecord (6.1.7.10) - activemodel (= 6.1.7.10) - activesupport (= 6.1.7.10) - activestorage (6.1.7.10) - actionpack (= 6.1.7.10) - activejob (= 6.1.7.10) - activerecord (= 6.1.7.10) - activesupport (= 6.1.7.10) + activemodel (7.0.8.6) + activesupport (= 7.0.8.6) + activerecord (7.0.8.6) + activemodel (= 7.0.8.6) + activesupport (= 7.0.8.6) + activestorage (7.0.8.6) + actionpack (= 7.0.8.6) + activejob (= 7.0.8.6) + activerecord (= 7.0.8.6) + activesupport (= 7.0.8.6) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.10) + activesupport (7.0.8.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - acts_as_list (1.2.3) + acts_as_list (1.2.4) activerecord (>= 6.1) activesupport (>= 6.1) addressable (2.8.7) @@ -92,10 +98,11 @@ GEM bindex (0.8.1) bootsnap (1.18.4) msgpack (~> 1.2) - brakeman (5.4.1) + brakeman (6.2.2) + racc browser (2.7.1) builder (3.3.0) - bullet (7.2.0) + bullet (7.1.6) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -108,29 +115,21 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (2.2.6) - 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.9) childprocess (5.1.0) logger (~> 1.5) - commonmarker (0.23.10) + commonmarker (0.23.11) concurrent-ruby (1.3.4) crack (1.0.0) bigdecimal @@ -139,62 +138,62 @@ GEM css_parser (1.19.1) addressable csv (3.3.0) + dartsass (1.49.8) + date (3.4.1) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - decidim (0.28.4) - decidim-accountability (= 0.28.4) - decidim-admin (= 0.28.4) - decidim-api (= 0.28.4) - decidim-assemblies (= 0.28.4) - decidim-blogs (= 0.28.4) - decidim-budgets (= 0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-debates (= 0.28.4) - decidim-forms (= 0.28.4) - decidim-generators (= 0.28.4) - decidim-meetings (= 0.28.4) - decidim-pages (= 0.28.4) - decidim-participatory_processes (= 0.28.4) - decidim-proposals (= 0.28.4) - decidim-sortitions (= 0.28.4) - decidim-surveys (= 0.28.4) - decidim-system (= 0.28.4) - decidim-verifications (= 0.28.4) - decidim-accountability (0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-admin (0.28.4) + decidim (0.29.1) + decidim-accountability (= 0.29.1) + decidim-admin (= 0.29.1) + decidim-api (= 0.29.1) + decidim-assemblies (= 0.29.1) + decidim-blogs (= 0.29.1) + decidim-budgets (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-debates (= 0.29.1) + decidim-forms (= 0.29.1) + decidim-generators (= 0.29.1) + decidim-meetings (= 0.29.1) + decidim-pages (= 0.29.1) + decidim-participatory_processes (= 0.29.1) + decidim-proposals (= 0.29.1) + decidim-sortitions (= 0.29.1) + decidim-surveys (= 0.29.1) + decidim-system (= 0.29.1) + decidim-verifications (= 0.29.1) + decidim-accountability (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-admin (0.29.1) active_link_to (~> 1.0) - decidim-core (= 0.28.4) + decidim-core (= 0.29.1) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.28.4) - commonmarker (~> 0.23.0, >= 0.23.9) - decidim-core (= 0.28.4) - graphql (~> 2.0.0) - graphql-docs (~> 3.0.1) + decidim-api (0.29.1) + decidim-core (= 0.29.1) + graphql (~> 2.2.6) + graphql-docs (~> 4.0) rack-cors (~> 1.0) - decidim-assemblies (0.28.4) - decidim-core (= 0.28.4) - decidim-blogs (0.28.4) - decidim-admin (= 0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-budgets (0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-comments (0.28.4) - decidim-core (= 0.28.4) + decidim-assemblies (0.29.1) + decidim-core (= 0.29.1) + decidim-blogs (0.29.1) + decidim-admin (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-budgets (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-comments (0.29.1) + decidim-core (= 0.29.1) redcarpet (~> 3.5, >= 3.5.1) - decidim-core (0.28.4) + decidim-core (0.29.1) active_link_to (~> 1.0) acts_as_list (~> 1.0) batch-loader (~> 1.2) browser (~> 2.7) - carrierwave (~> 2.2.5, >= 2.2.5) cells-erb (~> 0.1.0) cells-rails (~> 0.1.3) charlock_holmes (~> 0.7) @@ -209,12 +208,14 @@ GEM foundation_rails_helper (~> 4.0) geocoder (~> 1.8) hashdiff (>= 0.4.0, < 2.0.0) + image_processing (~> 1.2) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) loofah (~> 2.19, >= 2.19.1) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) net-smtp (~> 0.3.1) + nokogiri (~> 1.16, >= 1.16.2) omniauth (~> 2.0) omniauth-facebook (~> 5.0) omniauth-google-oauth2 (~> 1.0) @@ -225,10 +226,10 @@ GEM pg_search (~> 2.2) premailer-rails (~> 1.10) psych (~> 4.0) - rack (~> 2.2, >= 2.2.6.4) + rack (~> 2.2, >= 2.2.8.1) rack-attack (~> 6.0) - rails (~> 6.1.7, >= 6.1.7.4) - rails-i18n (~> 6.0) + rails (~> 7.0.8) + rails-i18n (~> 7.0) ransack (~> 3.2.1) redis (~> 4.1) request_store (~> 1.5.0) @@ -238,19 +239,19 @@ GEM valid_email2 (~> 4.0) web-push (~> 3.0) wisper (~> 2.0) - decidim-debates (0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-dev (0.28.4) - bullet (~> 7.0) + decidim-debates (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-dev (0.29.1) + bullet (~> 7.1.6) byebug (~> 11.0) capybara (~> 3.39) - decidim (= 0.28.4) + decidim (= 0.29.1) erb_lint (~> 0.4.0) factory_bot_rails (~> 6.2) faker (~> 3.2) i18n-tasks (~> 1.0) - nokogiri (~> 1.14, >= 1.14.3) + nokogiri (~> 1.16, >= 1.16.2) parallel_tests (~> 4.2) puma (~> 6.2, >= 6.3.1) rails-controller-testing (~> 1.0) @@ -260,58 +261,63 @@ GEM rspec-rails (~> 6.0) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.6.0) - rubocop (~> 1.50.0) + rubocop (~> 1.65.0) + rubocop-capybara (~> 2.21) + rubocop-factory_bot (~> 2.26) rubocop-faker (~> 1.1) - rubocop-rails (~> 2.19) - rubocop-rspec (~> 2.20) + rubocop-performance (~> 1.21) + rubocop-rails (~> 2.25) + rubocop-rspec (~> 3.0) + rubocop-rspec_rails (~> 2.30) + rubocop-rubycw (~> 0.1) selenium-webdriver (~> 4.9) simplecov (~> 0.22.0) simplecov-cobertura (~> 2.1.0) - spring (~> 2.0) + spring (~> 4.0) spring-watcher-listen (~> 2.0) w3c_rspec_validators (~> 0.3.0) webmock (~> 3.18) wisper-rspec (~> 1.0) - decidim-forms (0.28.4) - decidim-core (= 0.28.4) + decidim-forms (0.29.1) + decidim-core (= 0.29.1) wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.28.4) - decidim-core (= 0.28.4) - decidim-meetings (0.28.4) - decidim-core (= 0.28.4) - decidim-forms (= 0.28.4) + wkhtmltopdf-binary (= 0.12.6.6) + decidim-generators (0.29.1) + decidim-core (= 0.29.1) + decidim-meetings (0.29.1) + decidim-core (= 0.29.1) + decidim-forms (= 0.29.1) icalendar (~> 2.5) - decidim-pages (0.28.4) - decidim-core (= 0.28.4) - decidim-participatory_processes (0.28.4) - decidim-core (= 0.28.4) - decidim-proposals (0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - doc2text (~> 0.4.6) + decidim-pages (0.29.1) + decidim-core (= 0.29.1) + decidim-participatory_processes (0.29.1) + decidim-core (= 0.29.1) + decidim-proposals (0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + doc2text (~> 0.4.7) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.28.4) - decidim-admin (= 0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-proposals (= 0.28.4) - decidim-surveys (0.28.4) - decidim-core (= 0.28.4) - decidim-forms (= 0.28.4) - decidim-system (0.28.4) + decidim-sortitions (0.29.1) + decidim-admin (= 0.29.1) + decidim-comments (= 0.29.1) + decidim-core (= 0.29.1) + decidim-proposals (= 0.29.1) + decidim-surveys (0.29.1) + decidim-core (= 0.29.1) + decidim-forms (= 0.29.1) + decidim-system (0.29.1) active_link_to (~> 1.0) - decidim-core (= 0.28.4) + decidim-core (= 0.29.1) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-templates (0.28.4) - decidim-core (= 0.28.4) - decidim-forms (= 0.28.4) - decidim-verifications (0.28.4) - decidim-core (= 0.28.4) - declarative-builder (0.1.0) - declarative-option (< 0.2.0) + decidim-templates (0.29.1) + decidim-core (= 0.29.1) + decidim-forms (= 0.29.1) + decidim-verifications (0.29.1) + decidim-core (= 0.29.1) + declarative-builder (0.2.0) + trailblazer-option (~> 0.1.0) declarative-option (0.1.0) deface (1.9.0) actionview (>= 5.2) @@ -332,12 +338,11 @@ GEM devise (>= 4.6) diff-lcs (1.5.1) diffy (3.4.3) - digest (3.1.1) doc2text (0.4.7) nokogiri (>= 1.13.2, < 1.17.0) rubyzip (~> 2.3.0) docile (1.4.1) - doorkeeper (5.8.0) + doorkeeper (5.8.1) railties (>= 5) doorkeeper-i18n (4.0.1) erb_lint (0.4.0) @@ -350,8 +355,8 @@ GEM erbse (0.1.4) temple erubi (1.13.0) - escape_utils (1.2.2) - excon (1.1.1) + escape_utils (1.3.0) + excon (1.2.2) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) factory_bot (6.5.0) @@ -361,13 +366,14 @@ GEM railties (>= 5.0.0) faker (3.5.1) i18n (>= 1.8.11, < 2) - faraday (2.12.0) - faraday-net_http (>= 2.0, < 3.4) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) json logger - faraday-net_http (3.3.0) - net-http + faraday-net_http (3.4.0) + net-http (>= 0.5.0) ffi (1.17.0) + ffi (1.17.0-arm64-darwin) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) @@ -385,22 +391,22 @@ GEM activesupport (>= 4.1, < 7.1) railties (>= 4.1, < 7.1) gemoji (3.0.1) - geocoder (1.8.3) + geocoder (1.8.4) base64 (>= 0.1.0) csv (>= 3.0.0) globalid (1.2.1) activesupport (>= 6.1) - graphql (2.0.31) + graphql (2.2.16) base64 - graphql-docs (3.0.1) - commonmarker (~> 0.16) - escape_utils (~> 1.2.2) + graphql-docs (4.0.0) + commonmarker (~> 0.23, >= 0.23.6) + dartsass (~> 1.49) + escape_utils (~> 1.2) extended-markdown-filter (~> 0.4) gemoji (~> 3.0) graphql (~> 2.0) - html-pipeline (~> 2.9) - sass (~> 3.4) - hashdiff (1.1.1) + html-pipeline (~> 2.14, >= 2.14.3) + hashdiff (1.1.2) hashie (5.0.0) highline (3.1.1) reline @@ -429,8 +435,8 @@ GEM ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) - io-console (0.7.2) - json (2.7.5) + io-console (0.8.0) + json (2.9.0) jwt (2.9.3) base64 kaminari (1.2.2) @@ -445,6 +451,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + language_server-protocol (3.17.0.3) launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) @@ -458,7 +465,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.1) + logger (1.6.2) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -473,18 +480,18 @@ GEM mime-types (3.6.0) logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.1001) + mime-types-data (3.2024.1203) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.25.1) - msgpack (1.7.3) - multi_xml (0.6.0) - net-http (0.4.1) + minitest (5.25.4) + msgpack (1.7.5) + multi_xml (0.7.1) + bigdecimal (~> 3.1) + net-http (0.6.0) uri - net-imap (0.2.4) - digest + net-imap (0.4.18) + date net-protocol - strscan net-pop (0.1.2) net-protocol net-protocol (0.2.2) @@ -492,7 +499,11 @@ GEM net-smtp (0.3.4) net-protocol nio4r (2.7.4) - nokogiri (1.16.7-x86_64-linux) + nokogiri (1.16.8-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.8-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.8-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -533,14 +544,14 @@ GEM rack openssl (3.2.0) orm_adapter (0.5.0) - ostruct (0.6.0) + ostruct (0.6.1) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) parallel (1.26.3) parallel_tests (4.7.2) parallel - parser (3.3.5.0) + parser (3.3.6.0) ast (~> 2.4.1) racc pg (1.4.6) @@ -559,7 +570,7 @@ GEM psych (4.0.6) stringio public_suffix (6.0.1) - puma (6.4.3) + puma (6.5.0) nio4r (~> 2.0) racc (1.8.1) rack (2.2.10) @@ -574,21 +585,20 @@ GEM rack rack-test (2.1.0) rack (>= 1.3) - rails (6.1.7.10) - actioncable (= 6.1.7.10) - actionmailbox (= 6.1.7.10) - actionmailer (= 6.1.7.10) - actionpack (= 6.1.7.10) - actiontext (= 6.1.7.10) - actionview (= 6.1.7.10) - activejob (= 6.1.7.10) - activemodel (= 6.1.7.10) - activerecord (= 6.1.7.10) - activestorage (= 6.1.7.10) - activesupport (= 6.1.7.10) + rails (7.0.8.6) + actioncable (= 7.0.8.6) + actionmailbox (= 7.0.8.6) + actionmailer (= 7.0.8.6) + actionpack (= 7.0.8.6) + actiontext (= 7.0.8.6) + actionview (= 7.0.8.6) + activejob (= 7.0.8.6) + activemodel (= 7.0.8.6) + activerecord (= 7.0.8.6) + activestorage (= 7.0.8.6) + activesupport (= 7.0.8.6) bundler (>= 1.15.0) - railties (= 6.1.7.10) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8.6) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -597,18 +607,19 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.1) loofah (~> 2.21) - nokogiri (~> 1.14) - rails-i18n (6.0.0) + 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.10) - actionpack (= 6.1.7.10) - activesupport (= 6.1.7.10) + railties (>= 6.0.0, < 8) + railties (7.0.8.6) + actionpack (= 7.0.8.6) + activesupport (= 7.0.8.6) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.2.1) ransack (3.2.1) @@ -620,8 +631,8 @@ GEM ffi (~> 1.0) redcarpet (3.6.0) redis (4.8.1) - regexp_parser (2.9.2) - reline (0.5.10) + regexp_parser (2.9.3) + reline (0.5.12) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -633,9 +644,9 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-cells (0.3.9) + rspec-cells (0.3.10) cells (>= 4.0.0, < 6.0.0) - rspec-rails (>= 3.0.0, < 6.2.0) + rspec-rails (>= 3.0.0) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) @@ -657,33 +668,44 @@ GEM rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.13.1) + rspec-support (3.13.2) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.50.2) + rubocop (1.65.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) - rubocop-capybara (2.18.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-faker (1.1.0) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-faker (1.2.0) faker (>= 2.12.0) - rubocop (>= 0.82.0) - rubocop-rails (2.19.1) + rubocop (>= 1.13.0) + rubocop-performance (1.23.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.27.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.20.0) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) + rubocop (>= 1.52.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.2.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) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) @@ -692,20 +714,15 @@ GEM 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) sassc (2.4.0) ffi (~> 1.9) - selenium-webdriver (4.26.0) + selenium-webdriver (4.27.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - semantic_range (3.0.0) + semantic_range (3.1.0) shakapacker (7.1.0) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -724,32 +741,24 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - spring (2.1.1) - spring-watcher-listen (2.0.1) + spring (4.2.1) + spring-watcher-listen (2.1.0) listen (>= 2.7, < 4.0) - spring (>= 1.2, < 3.0) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.5.2) - actionpack (>= 6.1) - activesupport (>= 6.1) - sprockets (>= 3.0.0) - ssrf_filter (1.1.2) - stringio (3.1.1) - strscan (3.1.0) + spring (>= 4) + stringio (3.1.2) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.2) tilt (2.4.0) - timeout (0.4.1) + timeout (0.4.2) + trailblazer-option (0.1.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.6.0) uniform_notifier (1.16.0) - uri (0.13.1) + uri (1.0.2) valid_email2 (4.0.6) activemodel (>= 3.2) mail (~> 2.5) @@ -785,35 +794,35 @@ GEM ostruct wisper (2.0.1) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.8) + wkhtmltopdf-binary (0.12.6.6) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.18) + zeitwerk (2.7.1) PLATFORMS + arm64-darwin-23 + x86_64-darwin x86_64-linux DEPENDENCIES bootsnap (~> 1.4) - brakeman (~> 5.4) + brakeman (~> 6.1) byebug (~> 11.0) - decidim (= 0.28.4) + decidim (= 0.29.1) decidim-decidim_awesome! - decidim-dev (= 0.28.4) - decidim-templates (= 0.28.4) + decidim-dev (= 0.29.1) + decidim-templates (= 0.29.1) letter_opener_web (~> 2.0) listen (~> 3.1) - net-imap (~> 0.2.3) - net-pop (~> 0.1.1) + net-imap (~> 0.4.16) + net-pop (~> 0.1.2) net-smtp (~> 0.3.1) parallel_tests (~> 4.2) puma (>= 6.3.1) - spring (~> 2.0) - spring-watcher-listen (~> 2.0) web-console (~> 4.2) RUBY VERSION - ruby 3.1.1p18 + ruby 3.2.2p53 BUNDLED WITH - 2.5.4 + 2.5.17 diff --git a/README.md b/README.md index e5cd83280..a86a9705b 100644 --- a/README.md +++ b/README.md @@ -413,7 +413,7 @@ Decidim::DecidimAwesome.configure do |config| #### 21. Manual verifications The admin will be allowed to manually authorize users using the methods specified in the `/system` admin section. -Currently, only form based handlers are supported (Direct methods). +Currently, only form based handlers are supported (Direct methods). Admins can manually override or verify users in the participants list but they still have to fulfill the requirements of the verifier (although they will be allowed to force the authorization even if some of them fails). Admin logs are also created in each action for accountability. @@ -618,9 +618,9 @@ You can run run tests against the legacy Decidim versions by using: ```bash export DATABASE_USERNAME= export DATABASE_PASSWORD= -RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle -RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rake test_app -RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rspec +RBENV_VERSION=3.2.2 BUNDLE_GEMFILE=Gemfile.legacy bundle +RBENV_VERSION=3.2.2 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rake test_app +RBENV_VERSION=3.2.2 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rspec ``` For convenience, you can use the scripts `bin/test` and `bin/test-legacy` to run tests against one or the other version: diff --git a/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb b/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb index 3b7a5f679..454fc33cc 100644 --- a/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb +++ b/app/commands/concerns/decidim/decidim_awesome/update_account_override.rb @@ -13,11 +13,11 @@ def update_personal_data decidim_update_personal_data return if @form.user_time_zone.blank? - @user.extended_data ||= {} - if @form.user_time_zone == @user.organization.time_zone - @user.extended_data.delete("time_zone") + current_user.extended_data ||= {} + if @form.user_time_zone == current_user.organization.time_zone + current_user.extended_data.delete("time_zone") else - @user.extended_data["time_zone"] = @form.user_time_zone + current_user.extended_data["time_zone"] = @form.user_time_zone end end diff --git a/app/commands/decidim/decidim_awesome/admin/create_constraint.rb b/app/commands/decidim/decidim_awesome/admin/create_constraint.rb index 0ca2d59e5..028f8fbbb 100644 --- a/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +++ b/app/commands/decidim/decidim_awesome/admin/create_constraint.rb @@ -39,7 +39,7 @@ def call attr_reader :form, :constraint def attributes - form.attributes.filter { |_i, v| v.present? } + form.attributes.compact_blank end end end diff --git a/app/commands/decidim/decidim_awesome/create_editor_image.rb b/app/commands/decidim/decidim_awesome/create_editor_image.rb index 199083cf9..a1dbb036a 100644 --- a/app/commands/decidim/decidim_awesome/create_editor_image.rb +++ b/app/commands/decidim/decidim_awesome/create_editor_image.rb @@ -2,7 +2,7 @@ module Decidim module DecidimAwesome - class CreateEditorImage < Command + class CreateEditorImage < Decidim::Command # Creates a blueprint. # # form - The form with the data. @@ -13,7 +13,7 @@ def initialize(form) # Executes the command. Broadcasts these events: # # - :ok when everything is valid - # - :invalid if the form wasn't valid and we couldn't proceed. + # - :invalid if the form wasn't valid, and we couldn't proceed. # # Returns nothing. def call diff --git a/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb b/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb index 85e4e795c..d400c3709 100644 --- a/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb +++ b/app/forms/concerns/decidim/decidim_awesome/system/organization_form_override.rb @@ -9,7 +9,7 @@ module OrganizationFormOverride included do alias_method :decidim_original_map_model, :map_model - attribute :awesome_admins_available_authorizations, Array[String] + attribute :awesome_admins_available_authorizations, [String] def map_model(model) decidim_original_map_model(model) @@ -19,7 +19,7 @@ def map_model(model) def clean_awesome_admins_available_authorizations return unless awesome_admins_available_authorizations - awesome_admins_available_authorizations.select(&:present?) + awesome_admins_available_authorizations.compact_blank end private diff --git a/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb b/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb deleted file mode 100644 index f9e3629a6..000000000 --- a/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -module Decidim - module DecidimAwesome - class MigrateLegacyImagesJob < ApplicationJob - queue_as :default - - def perform(organization_id, mappings = [], logger = Rails.logger) - @organization_id = organization_id - @routes_mappings = mappings - @logger = logger - - migrate_all! - transform_images_urls - end - - private - - attr_reader :routes_mappings, :logger - - def migrate_all! - Decidim::CarrierWaveMigratorService.migrate_attachment!( - klass: Decidim::DecidimAwesome::EditorImage, - cw_attribute: "image", - cw_uploader: Decidim::Cw::DecidimAwesome::ImageUploader, - as_attribute: "file", - logger: @logger, - routes_mappings: - ) - end - - def transform_images_urls - mappings = routes_mappings.map do |mapping| - klass, id = mapping[:instance].split("#") - next unless klass == "Decidim::DecidimAwesome::EditorImage" - - instance = Decidim::DecidimAwesome::EditorImage.find_by(id:) - - next if instance.blank? - - mapping.merge!(instance:) - end.compact - - editor_images_available_attributes.each do |model, attributes| - model.all.each do |item| - attributes.each do |attribute| - item.update(attribute => rewrite_value(item.send(attribute), mappings)) - end - end - @logger.info "Updated model #{model.name} (attributes: #{attributes.join(", ")})" - end - end - - def rewrite_value(value, mappings) - if value.is_a?(Hash) - value.transform_values do |nested_value| - rewrite_value(nested_value, mappings) - end - else - parser = Decidim::DecidimAwesome::ContentParsers::EditorImagesParser.new(value, routes_mappings: mappings) - parser.rewrite - end - end - - def editor_images_available_attributes - { - "Decidim::Accountability::Result" => %w(description), - "Decidim::Proposals::Proposal" => %w(body answer cost_report execution_period), - "Decidim::Votings::Voting" => %w(description), - "Decidim::Elections::Question" => %w(description), - "Decidim::Elections::Answer" => %w(description), - "Decidim::Elections::Election" => %w(description), - "Decidim::Initiative" => %w(description answer), - "Decidim::InitiativesType" => %w(description extra_fields_legal_information), - "Decidim::Assembly" => %w(short_description description purpose_of_action composition internal_organisation announcement closing_date_reason special_features), - "Decidim::Forms::Questionnaire" => %w(description tos), - "Decidim::Forms::Question" => %w(description), - "Decidim::Organization" => %w(welcome_notification_body admin_terms_of_service_body description highlighted_content_banner_short_description - id_documents_explanation_text), - "Decidim::StaticPage" => %w(content), - "Decidim::ContextualHelpSection" => %w(content), - "Decidim::Category" => %w(description), - "Decidim::Blogs::Post" => %w(body), - "Decidim::Pages::Page" => %w(body), - "Decidim::Sortitions::Sortition" => %w(additional_info witnesses cancel_reason), - "Decidim::Consultations::Question" => %w(title question_context what_is_decided instructions), - "Decidim::Consultation" => %w(description), - "Decidim::Debates::Debate" => %w(description instructions information_updates conclusions), - "Decidim::Budgets::Budget" => %w(description), - "Decidim::Budgets::Project" => %w(description), - "Decidim::ConferenceSpeaker" => %w(short_bio), - "Decidim::Conferences::RegistrationType" => %w(description), - "Decidim::Conference" => %w(short_description description objectives registration_terms), - "Decidim::ParticipatoryProcessGroup" => %w(description), - "Decidim::ParticipatoryProcess" => %w(short_description description announcement), - "Decidim::ParticipatoryProcessStep" => %w(description), - "Decidim::Meetings::AgendaItem" => %w(description), - "Decidim::Meetings::Meeting" => %w(registration_terms description registration_email_custom_content closing_report) - }.each_with_object({}) do |(main_model, attributes), hash| - hash[main_model.constantize] = attributes - rescue NameError - hash - end - end - end - end -end diff --git a/app/packs/entrypoints/decidim_admin_decidim_awesome_search_form.scss b/app/packs/entrypoints/decidim_admin_decidim_awesome_search_form.scss new file mode 100644 index 000000000..75eb00ade --- /dev/null +++ b/app/packs/entrypoints/decidim_admin_decidim_awesome_search_form.scss @@ -0,0 +1 @@ +@import "stylesheets/decidim/decidim_awesome/admin/admin_accountability"; diff --git a/app/packs/stylesheets/decidim/decidim_awesome/admin/admin_accountability.scss b/app/packs/stylesheets/decidim/decidim_awesome/admin/admin_accountability.scss new file mode 100644 index 000000000..aa54b2097 --- /dev/null +++ b/app/packs/stylesheets/decidim/decidim_awesome/admin/admin_accountability.scss @@ -0,0 +1,67 @@ +.filters__section { + @apply flex gap-4 items-start; + + input { + @apply h-9; + } + + .form-label { + @apply block; + } + + .dropdown__container { + @apply flex flex-col items-start gap-0 py-0; + + .form-label { + @apply block text-sm p-0; + } + + .dropdown { + @apply flex items-center h-9; + } + } + + .grid { + @apply flex gap-4 items-start; + } + + .datepicker_field { + @apply flex flex-col; + + .datepicker__datepicker-row { + @apply flex items-center gap-2 order-1; + } + + .datepicker__help-text-container { + @apply order-2 w-full; + } + + .help-text.datepicker__help-date { + @apply w-full; + } + + .input-group-field { + @apply h-9 px-2; + } + + button { + @apply h-9 w-9 flex items-center justify-center; + } + } + + .row.column:last-child { + @apply flex items-center justify-center; + } + + .search-button-container { + @apply flex flex-col items-start; + + button { + @apply h-9 px-4 flex items-center justify-center; + } + } + + .row.column.search-field { + @apply flex-grow; + } +} diff --git a/app/permissions/decidim/decidim_awesome/permissions.rb b/app/permissions/decidim/decidim_awesome/permissions.rb index 158644911..acea172e5 100644 --- a/app/permissions/decidim/decidim_awesome/permissions.rb +++ b/app/permissions/decidim/decidim_awesome/permissions.rb @@ -22,13 +22,14 @@ def editor_image_action? return allow! if user.admin? return allow! if config[:allow_images_in_proposals] return allow! if config[:allow_images_in_editors] - return allow! if config[:allow_videos_in_editors] + + allow! if config[:allow_videos_in_editors] end def required_authorizations_action? return false unless permission_action.subject == :required_authorizations - return allow! unless context[:user_is_authorized] + allow! unless context[:user_is_authorized] end end end diff --git a/app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb b/app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb deleted file mode 100644 index b4c5cfd89..000000000 --- a/app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module Decidim::Cw - module DecidimAwesome - # Transitional class to allow carrierwave to active storage migrations - class ImageUploader < Decidim::Cw::ImageUploader - process :validate_size, :validate_dimensions - - version :thumbnail do - process resize_to_fit: [nil, 237] - end - - def extension_whitelist - %w(jpg jpeg png) - end - - def content_type_whitelist - %w(image/jpeg image/png) - end - - def max_image_height_or_width - 8000 - end - end - end -end diff --git a/app/uploaders/decidim/decidim_awesome/image_uploader.rb b/app/uploaders/decidim/decidim_awesome/image_uploader.rb index 21144707c..92c468702 100644 --- a/app/uploaders/decidim/decidim_awesome/image_uploader.rb +++ b/app/uploaders/decidim/decidim_awesome/image_uploader.rb @@ -9,6 +9,18 @@ class ImageUploader < Decidim::ImageUploader thumbnail: { resize_to_fit: [nil, 237] } } end + + def extension_allowlist + %w(jpg jpeg png) + end + + def content_type_allowlist + %w(image/jpeg image/png) + end + + def max_image_height_or_width + 8000 + end end end end diff --git a/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb b/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb index 7816e1610..f7b4447cf 100644 --- a/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +++ b/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb @@ -68,3 +68,4 @@ +<% append_stylesheet_pack_tag "decidim_admin_decidim_awesome_search_form" %> diff --git a/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb b/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb index f314e6be9..8bce2c025 100644 --- a/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +++ b/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb @@ -1,5 +1,7 @@
-
+ +