From 2493a66ad56304ba54bd7d3221e244a0d33d6ad4 Mon Sep 17 00:00:00 2001 From: Laura Jaime Date: Fri, 11 Oct 2024 13:16:45 +0200 Subject: [PATCH] Update to Decidim 0.28 --- .github/workflows/linters.yml | 2 +- .github/workflows/test.yml | 2 +- .rubocop.yml | 6 +- .ruby-version | 2 +- CHANGELOG.md | 4 + Gemfile | 7 +- Gemfile.lock | 567 +++++++++--------- .../admin/newsletters_controller_decorator.rb | 2 +- .../admin/users_controller_decorator.rb | 2 +- app/decorators/decidim/area_decorator.rb | 4 +- .../admin/assemblies_controller_decorator.rb | 2 +- .../admin/assemblies_helper_decorator.rb | 2 +- .../assemblies/create_assembly_decorator.rb | 2 +- .../parent_assemblies_for_select_decorator.rb | 2 +- .../assemblies/permissions_decorator.rb | 2 +- .../assemblies/update_assembly_decorator.rb | 2 +- .../decidim/assemblies_decorator.rb | 2 +- .../assemblies_with_user_role_decorator.rb | 2 +- .../decidim/conference_form_decorator.rb | 2 +- .../admin/conferences_controller_decorator.rb | 2 +- .../create_conference_decorator.rb | 3 +- .../conferences/permissions_decorator.rb | 2 +- .../update_conference_decorator.rb | 2 +- .../decidim/conferences_decorator.rb | 2 +- .../conferences_with_user_role_decorator.rb | 2 +- .../decidim/decidim_form_helper_decorator.rb | 2 +- .../decidim/invite_user_decorator.rb | 2 +- .../decidim/invite_user_form_decorator.rb | 2 +- .../decidim/newsletter_decorator.rb | 2 +- .../decidim/newsletters_helper_decorator.rb | 2 +- .../participatory_process_decorator.rb | 2 +- .../participatory_process_group_decorator.rb | 2 +- ...cipatory_processes_controller_decorator.rb | 2 +- .../create_participatory_process_decorator.rb | 2 +- .../permissions_decorator.rb | 2 +- .../update_participatory_process_decorator.rb | 2 +- ...tory_processes_with_user_role_decorator.rb | 2 +- app/decorators/decidim/user_decorator.rb | 16 +- ...ticipatory_space_resourceable_decorator.rb | 2 +- .../department_admin/application_helper.rb | 2 +- .../decidim/admin/department_admin.scss | 2 + .../decidim/admin/users/_filters.html.erb | 56 +- app/views/decidim/admin/users/_form.html.erb | 36 +- app/views/decidim/admin/users/index.html.erb | 156 +++-- app/views/decidim/admin/users/show.html.erb | 17 +- .../admin/assemblies/index.html.erb | 268 ++++----- .../admin/conferences/_form.html.erb | 59 +- .../admin/conferences/index.html.erb | 153 +++-- .../participatory_processes/index.html.erb | 259 ++++---- decidim-department_admin.gemspec | 5 +- lib/decidim/department_admin/version.rb | 2 +- .../decidim/admin/deliver_newsletter_spec.rb | 38 +- spec/commands/decidim/invite_user_spec.rb | 6 +- .../decidim/admin/users_controller_spec.rb | 28 +- .../department_admin_permissions_spec.rb | 23 +- .../parent_assemblies_for_select_spec.rb | 12 +- spec/system/admin_explores_processes_spec.rb | 10 +- .../admin_invite_department_admin_spec.rb | 18 +- ...partment_admin_manages_newsletters_spec.rb | 32 +- ..._be_able_to_access_admin_dashboard_spec.rb | 22 +- ...hould_be_able_to_manage_assemblies_spec.rb | 20 +- ...ould_be_able_to_manage_conferences_spec.rb | 8 +- ...should_be_able_to_manage_processes_spec.rb | 18 +- ..._see_only_assemblies_from_her_area_spec.rb | 10 +- ...see_only_newsletters_from_her_area_spec.rb | 12 +- ...o_see_only_processes_from_her_area_spec.rb | 10 +- 66 files changed, 955 insertions(+), 998 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 1b10e95..14bf581 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -9,7 +9,7 @@ on: pull_request: env: - RUBY_VERSION: 3.0.7 + RUBY_VERSION: 3.1.1 jobs: test-report: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e78946f..53713d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ on: pull_request: env: - RUBY_VERSION: 3.0.7 + RUBY_VERSION: 3.1.1 NODE_VERSION: 16.9.1 jobs: diff --git a/.rubocop.yml b/.rubocop.yml index ba18b65..7b0efab 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -65,7 +65,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: 3.0.7 + TargetRubyVersion: 3.1.1 RSpec: Patterns: - "(?:^|/)spec/" @@ -1194,10 +1194,14 @@ RSpec/DescribeClass: - spec/gemfiles_spec.rb - spec/js_bundles_spec.rb - spec/i18n_spec.rb + - spec/system/*.rb - "**/*/spec/**/*_badge_spec.rb" - decidim-core/spec/lib/global_engines_spec.rb - "**/tasks/**/*" +RSpec/NoExpectationExample: + Enabled: false + RSpec/EmptyExampleGroup: Exclude: - decidim-core/spec/lib/participatory_space_manifest_spec.rb diff --git a/.ruby-version b/.ruby-version index 2451c27..94ff29c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.7 +3.1.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 19282f4..c4c9452 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Following Semantic Versioning 2. ## next version: +## Version 0.8.0 (MINOR) +- Upgrade Decidim to v0.28 +- Upgrade Ruby to 3.1.1 + ## Version 0.7.1 (PATCH) - Fix Zeitwerk errors with decorators diff --git a/Gemfile b/Gemfile index ecc587b..5feef01 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,7 @@ ruby RUBY_VERSION gemspec -DECIDIM_VERSION = { git: "https://github.com/CodiTramuntana/decidim", branch: "release/0.27-stable" }.freeze +DECIDIM_VERSION = { git: "https://github.com/CodiTramuntana/decidim", branch: "release/0.28-stable" }.freeze # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. @@ -25,7 +25,10 @@ group :development, :test do gem "decidim", DECIDIM_VERSION gem "decidim-conferences", DECIDIM_VERSION gem "faker" - gem "rubocop-rspec" + # Set versions because Property AutoCorrect errors. + gem "rspec-rails", "~> 6.0.4" + gem "rubocop-factory_bot", "2.25.1" + gem "rubocop-rspec", "2.26.1" gem "social-share-button" end diff --git a/Gemfile.lock b/Gemfile.lock index cdbc41c..7fb61e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,63 +1,64 @@ GIT remote: https://github.com/CodiTramuntana/decidim - revision: 9a59d548007b1d173828aea234bff82cc1e2831d - branch: release/0.27-stable + revision: bfd1045422593e259014e8cf498a5ccf6ed86f29 + branch: release/0.28-stable specs: - decidim (0.27.6) - decidim-accountability (= 0.27.6) - decidim-admin (= 0.27.6) - decidim-api (= 0.27.6) - decidim-assemblies (= 0.27.6) - decidim-blogs (= 0.27.6) - decidim-budgets (= 0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-debates (= 0.27.6) - decidim-forms (= 0.27.6) - decidim-generators (= 0.27.6) - decidim-meetings (= 0.27.6) - decidim-pages (= 0.27.6) - decidim-participatory_processes (= 0.27.6) - decidim-proposals (= 0.27.6) - decidim-sortitions (= 0.27.6) - decidim-surveys (= 0.27.6) - decidim-system (= 0.27.6) - decidim-templates (= 0.27.6) - decidim-verifications (= 0.27.6) - decidim-accountability (0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-admin (0.27.6) + decidim (0.28.2) + decidim-accountability (= 0.28.2) + decidim-admin (= 0.28.2) + decidim-api (= 0.28.2) + decidim-assemblies (= 0.28.2) + decidim-blogs (= 0.28.2) + decidim-budgets (= 0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-debates (= 0.28.2) + decidim-forms (= 0.28.2) + decidim-generators (= 0.28.2) + decidim-meetings (= 0.28.2) + decidim-pages (= 0.28.2) + decidim-participatory_processes (= 0.28.2) + decidim-proposals (= 0.28.2) + decidim-sortitions (= 0.28.2) + decidim-surveys (= 0.28.2) + decidim-system (= 0.28.2) + decidim-templates (= 0.28.2) + decidim-verifications (= 0.28.2) + decidim-accountability (0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-admin (0.28.2) active_link_to (~> 1.0) - decidim-core (= 0.27.6) + decidim-core (= 0.28.2) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-api (0.27.6) - decidim-core (= 0.27.6) - graphql (~> 1.12, < 1.13) - graphql-docs (~> 2.1.0) + decidim-api (0.28.2) + commonmarker (~> 0.23.0, >= 0.23.9) + decidim-core (= 0.28.2) + graphql (~> 2.0.0) + graphql-docs (~> 3.0.1) rack-cors (~> 1.0) - decidim-assemblies (0.27.6) - decidim-core (= 0.27.6) - decidim-blogs (0.27.6) - decidim-admin (= 0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-budgets (0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-comments (0.27.6) - decidim-core (= 0.27.6) + decidim-assemblies (0.28.2) + decidim-core (= 0.28.2) + decidim-blogs (0.28.2) + decidim-admin (= 0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-budgets (0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-comments (0.28.2) + decidim-core (= 0.28.2) redcarpet (~> 3.5, >= 3.5.1) - decidim-conferences (0.27.6) - decidim-core (= 0.27.6) - decidim-meetings (= 0.27.6) - wicked_pdf (~> 2.1) + decidim-conferences (0.28.2) + decidim-core (= 0.28.2) + decidim-meetings (= 0.28.2) + wicked_pdf (~> 2.7) wkhtmltopdf-binary (~> 0.12) - decidim-core (0.27.6) + decidim-core (0.28.2) active_link_to (~> 1.0) - acts_as_list (~> 0.9) + acts_as_list (~> 1.0) batch-loader (~> 1.2) browser (~> 2.7) carrierwave (~> 2.2.5, >= 2.2.5) @@ -66,9 +67,9 @@ GIT charlock_holmes (~> 0.7) date_validator (~> 0.12.0) devise (~> 4.7) - devise-i18n (~> 1.2) + devise-i18n (~> 1.2, < 1.11.1) diffy (~> 3.3) - doorkeeper (~> 5.1) + doorkeeper (~> 5.6, >= 5.6.6) doorkeeper-i18n (~> 4.0) file_validators (~> 3.0) fog-local (~> 0.6) @@ -77,81 +78,81 @@ GIT hashdiff (>= 0.4.0, < 2.0.0) invisible_captcha (~> 0.12) kaminari (~> 1.2, >= 1.2.1) - loofah (~> 2.19.0) + loofah (~> 2.19, >= 2.19.1) mime-types (>= 1.16, < 4.0) mini_magick (~> 4.9) + net-smtp (~> 0.3.1) 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) + pg (~> 1.4.0, < 2) pg_search (~> 2.2) premailer-rails (~> 1.10) - rack (~> 2.2, >= 2.2.3) + psych (~> 4.0) + rack (~> 2.2, >= 2.2.6.4) rack-attack (~> 6.0) - rails (~> 6.1.0) + rails (~> 6.1.7, >= 6.1.7.4) rails-i18n (~> 6.0) - ransack (~> 2.4.1) + ransack (~> 3.2.1) redis (~> 4.1) request_store (~> 1.5.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) + shakapacker (~> 7.1.0) + valid_email2 (~> 4.0) + web-push (~> 3.0) wisper (~> 2.0) - decidim-debates (0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-forms (0.27.6) - decidim-core (= 0.27.6) + decidim-debates (0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-forms (0.28.2) + decidim-core (= 0.28.2) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.27.6) - decidim-core (= 0.27.6) - decidim-meetings (0.27.6) - decidim-core (= 0.27.6) - decidim-forms (= 0.27.6) + decidim-generators (0.28.2) + decidim-core (= 0.28.2) + decidim-meetings (0.28.2) + decidim-core (= 0.28.2) + decidim-forms (= 0.28.2) icalendar (~> 2.5) - decidim-pages (0.27.6) - decidim-core (= 0.27.6) - decidim-participatory_processes (0.27.6) - decidim-core (= 0.27.6) - decidim-proposals (0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - doc2text (~> 0.4.5) + decidim-pages (0.28.2) + decidim-core (= 0.28.2) + decidim-participatory_processes (0.28.2) + decidim-core (= 0.28.2) + decidim-proposals (0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + doc2text (~> 0.4.6) redcarpet (~> 3.5, >= 3.5.1) - decidim-sortitions (0.27.6) - decidim-admin (= 0.27.6) - decidim-comments (= 0.27.6) - decidim-core (= 0.27.6) - decidim-proposals (= 0.27.6) - decidim-surveys (0.27.6) - decidim-core (= 0.27.6) - decidim-forms (= 0.27.6) - decidim-system (0.27.6) + decidim-sortitions (0.28.2) + decidim-admin (= 0.28.2) + decidim-comments (= 0.28.2) + decidim-core (= 0.28.2) + decidim-proposals (= 0.28.2) + decidim-surveys (0.28.2) + decidim-core (= 0.28.2) + decidim-forms (= 0.28.2) + decidim-system (0.28.2) active_link_to (~> 1.0) - decidim-core (= 0.27.6) + decidim-core (= 0.28.2) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) - decidim-templates (0.27.6) - decidim-core (= 0.27.6) - decidim-forms (= 0.27.6) - decidim-verifications (0.27.6) - decidim-core (= 0.27.6) + decidim-templates (0.28.2) + decidim-core (= 0.28.2) + decidim-forms (= 0.28.2) + decidim-verifications (0.28.2) + decidim-core (= 0.28.2) PATH remote: . specs: - decidim-department_admin (0.7.1) - decidim-admin (~> 0.27.0) - decidim-core (~> 0.27.0) + decidim-department_admin (0.8.0) + decidim-admin (~> 0.28.0) + decidim-core (~> 0.28.0) GEM remote: https://rubygems.org/ @@ -218,39 +219,31 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - acts_as_list (0.9.19) - activerecord (>= 3.0) + acts_as_list (1.2.2) + activerecord (>= 6.1) + activesupport (>= 6.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) - axe-core-api (4.9.1) - 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) base64 (0.2.0) batch-loader (1.5.0) bcrypt (3.1.20) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties bigdecimal (3.1.8) bindex (0.8.1) - bootsnap (1.18.3) + bootsnap (1.18.4) msgpack (~> 1.2) browser (2.7.1) builder (3.3.0) + bullet (7.2.0) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.11) byebug (11.1.3) capybara (3.40.0) addressable @@ -281,11 +274,8 @@ GEM actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.9) - chef-utils (18.5.0) - concurrent-ruby - childprocess (4.1.0) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) + childprocess (5.1.0) + logger (~> 1.5) coffee-rails (5.0.0) coffee-script (>= 2.2.0) railties (>= 5.2.0) @@ -294,48 +284,46 @@ GEM execjs coffee-script-source (1.12.2) commonmarker (0.23.10) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) crack (1.0.0) bigdecimal rexml crass (1.0.6) - css_parser (1.17.1) + css_parser (1.19.0) addressable csv (3.3.0) date (3.3.4) date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - db-query-matchers (0.10.0) - activesupport (>= 4.0, < 7) - rspec (~> 3.0) - decidim-dev (0.27.6) - axe-core-rspec (~> 4.1.0) + decidim-dev (0.28.2) + bullet (~> 7.0) byebug (~> 11.0) - capybara (~> 3.24) - db-query-matchers (~> 0.10.0) - decidim (= 0.27.6) - 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 (= 0.28.2) + erb_lint (~> 0.4.0) + factory_bot_rails (~> 6.2) + faker (~> 3.2) + i18n-tasks (~> 1.0) + nokogiri (~> 1.14, >= 1.14.3) + parallel_tests (~> 4.2) + puma (~> 6.2, >= 6.3.1) 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.50.0) + rubocop-faker (~> 1.1) + rubocop-rails (~> 2.19) + rubocop-rspec (~> 2.20) + selenium-webdriver (~> 4.9) + simplecov (~> 0.22.0) simplecov-cobertura (~> 2.1.0) w3c_rspec_validators (~> 0.3.0) - webmock (~> 3.6) + webmock (~> 3.18) wisper-rspec (~> 1.0) declarative-builder (0.1.0) declarative-option (< 0.2.0) @@ -346,15 +334,13 @@ GEM polyglot railties (>= 5.2) rainbow (>= 2.1.0) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.12.1) + devise-i18n (1.11.0) devise (>= 4.9.0) devise_invitable (2.0.9) actionmailer (>= 5.0) @@ -364,15 +350,13 @@ GEM doc2text (0.4.7) nokogiri (>= 1.13.2, < 1.17.0) rubyzip (~> 2.3.0) - docile (1.4.0) + docile (1.4.1) doorkeeper (5.7.1) railties (>= 5) doorkeeper-i18n (4.0.1) - dumb_delegator (1.0.0) - erb_lint (0.0.37) + erb_lint (0.4.0) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow rubocop @@ -380,28 +364,29 @@ GEM erbse (0.1.4) temple erubi (1.13.0) - escape_utils (1.3.0) - excon (0.111.0) + escape_utils (1.2.2) + excon (0.112.0) execjs (2.7.0) 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 (3.4.1) + factory_bot (6.5.0) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) + railties (>= 5.0.0) + faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.10.0) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.12.0) + faraday-net_http (>= 2.0, < 3.4) + json logger - faraday-net_http (3.1.0) + faraday-net_http (3.3.0) net-http ffi (1.17.0) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.4.0) + fog-core (2.5.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) @@ -420,49 +405,48 @@ GEM csv (>= 3.0.0) globalid (1.2.1) activesupport (>= 6.1) - graphql (1.12.24) - graphql-docs (2.1.0) + graphql (2.0.31) + base64 + graphql-docs (3.0.1) commonmarker (~> 0.16) - escape_utils (~> 1.2) + escape_utils (~> 1.2.2) extended-markdown-filter (~> 0.4) gemoji (~> 3.0) - graphql (~> 1.12) + graphql (~> 2.0) html-pipeline (~> 2.9) sass (~> 3.4) - hashdiff (1.1.0) + hashdiff (1.1.1) hashie (5.0.0) - highline (3.1.0) + highline (3.1.1) reline - hkdf (0.3.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) - html_tokenizer (0.0.8) htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.37) + i18n-tasks (1.0.14) activesupport (>= 4.0.2) ast (>= 2.1.0) erubi highline (>= 2.0.0) i18n - parser (>= 2.2.3.0) + parser (>= 3.2.2.1) rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.1) + icalendar (2.10.3) ice_cube (~> 0.16) - ice_cube (0.16.4) - ice_nine (0.11.2) - image_processing (1.12.2) + ostruct + ice_cube (0.17.0) + image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) io-console (0.7.2) json (2.7.2) - jwt (2.8.2) + jwt (2.9.3) base64 kaminari (1.2.2) activesupport (>= 4.1.0) @@ -476,12 +460,9 @@ 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) + launchy (3.0.1) addressable (~> 2.8) + childprocess (~> 5.0) letter_opener (1.10.0) launchy (>= 2.2, < 4) letter_opener_web (1.4.1) @@ -491,10 +472,10 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) - loofah (2.19.1) + logger (1.6.1) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap @@ -502,39 +483,29 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) - mdl (0.13.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.1.0) - mime-types (3.5.2) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) + mime-types-data (3.2024.1001) mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.24.1) - mixlib-cli (2.1.8) - mixlib-config (3.0.27) - tomlrb - mixlib-shellout (3.2.8) - chef-utils - msgpack (1.7.2) + minitest (5.25.1) + msgpack (1.7.3) multi_xml (0.6.0) net-http (0.4.1) uri - net-imap (0.4.14) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.0) + net-smtp (0.3.4) net-protocol nio4r (2.7.3) - nokogiri (1.16.6-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -555,14 +526,15 @@ GEM rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (1.1.2) - jwt (>= 2.0) + omniauth-google-oauth2 (1.2.0) + jwt (>= 2.9) oauth2 (~> 2.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-oauth (1.2.0) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) + rack (>= 1.6.2, < 4) omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) @@ -572,33 +544,37 @@ GEM omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) rack + openssl (3.2.0) orm_adapter (0.5.0) + ostruct (0.6.0) paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.25.1) - parallel_tests (3.13.0) + parallel (1.26.3) + parallel_tests (4.7.2) parallel - parser (3.3.4.0) + parser (3.3.5.0) ast (~> 2.4.1) racc - pg (1.1.4) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) + pg (1.4.6) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) polyglot (0.3.5) - premailer (1.23.0) + premailer (1.27.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 (6.0.0) - puma (5.6.8) + psych (4.0.6) + stringio + public_suffix (6.0.1) + puma (6.4.3) nio4r (~> 2.0) - racc (1.8.0) + racc (1.8.1) rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) @@ -634,8 +610,9 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) @@ -647,9 +624,9 @@ GEM thor (~> 1.0) rainbow (3.1.1) rake (13.2.1) - ransack (2.4.2) - activerecord (>= 5.2.4) - activesupport (>= 5.2.4) + ransack (3.2.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) i18n rb-fsevent (0.11.2) rb-inotify (0.11.1) @@ -657,15 +634,14 @@ GEM redcarpet (3.6.0) redis (4.8.1) regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.2) - strscan + rexml (3.3.8) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -673,50 +649,62 @@ GEM rspec-cells (0.3.9) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.2.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-html-matchers (0.9.4) + rspec-html-matchers (0.10.0) nokogiri (~> 1) - rspec (>= 3.0.0.a, < 4) - rspec-mocks (3.13.1) + rspec (>= 3.0.0.a) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.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-rails (6.0.4) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) - rspec_junit_formatter (0.3.0) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.28.2) + rubocop (1.50.2) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.17.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.31.3) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) - rubocop-rails (2.15.2) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-faker (1.1.0) + faker (>= 2.12.0) + rubocop (>= 0.82.0) + rubocop-rails (2.25.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rspec (2.11.1) - rubocop (~> 1.19) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.26.1) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) - ruby-vips (2.2.1) + ruby-vips (2.2.2) ffi (~> 1.12) + logger rubyXL (3.4.27) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) @@ -726,20 +714,26 @@ GEM 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) + selenium-webdriver (4.25.0) + base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) - rubyzip (>= 1.2.2) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) semantic_range (3.0.0) - seven_zip_ruby (1.3.0) - simplecov (0.21.2) + shakapacker (7.1.0) + activesupport (>= 5.2) + 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.1) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) snaky_hash (2.0.1) @@ -754,33 +748,28 @@ GEM sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) ssrf_filter (1.1.2) - strscan (3.1.0) + stringio (3.1.1) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.1) - thread_safe (0.3.6) + thor (1.3.2) tilt (2.4.0) timeout (0.4.1) - tomlrb (2.0.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.5.0) - uri (0.13.0) - valid_email2 (2.3.1) + unicode-display_width (2.6.0) + uniform_notifier (1.16.0) + uri (0.13.1) + valid_email2 (4.0.6) activemodel (>= 3.2) mail (~> 2.5) version_gem (1.1.4) - virtus (2.0.0) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) w3c_rspec_validators (0.3.0) rails rspec @@ -796,29 +785,25 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webmock (3.23.1) + web-push (3.0.1) + jwt (~> 2.0) + openssl (~> 3.0) + webmock (3.24.0) 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 (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.8.0) + wicked_pdf (2.8.1) activesupport wisper (2.0.1) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.7) + wkhtmltopdf-binary (0.12.6.8) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.16) + zeitwerk (2.6.18) PLATFORMS x86_64-linux @@ -829,20 +814,22 @@ DEPENDENCIES decidim! decidim-conferences! decidim-department_admin! - decidim-dev (~> 0.27.0) + decidim-dev (~> 0.28.0) deface execjs (~> 2.7.0) faker letter_opener_web (~> 1.3) listen (~> 3.1) - rubocop-rspec + rspec-rails (~> 6.0.4) + rubocop-factory_bot (= 2.25.1) + rubocop-rspec (= 2.26.1) social-share-button spring (~> 2.0) spring-watcher-listen (~> 2.0) web-console (~> 3.5) RUBY VERSION - ruby 3.0.7p220 + ruby 3.1.1p18 BUNDLED WITH - 2.3.4 + 2.4.22 diff --git a/app/decorators/decidim/admin/newsletters_controller_decorator.rb b/app/decorators/decidim/admin/newsletters_controller_decorator.rb index ea31065..443a2ef 100644 --- a/app/decorators/decidim/admin/newsletters_controller_decorator.rb +++ b/app/decorators/decidim/admin/newsletters_controller_decorator.rb @@ -27,4 +27,4 @@ def current_user_areas end end -::Decidim::Admin::NewslettersControllerDecorator.decorate +Decidim::Admin::NewslettersControllerDecorator.decorate diff --git a/app/decorators/decidim/admin/users_controller_decorator.rb b/app/decorators/decidim/admin/users_controller_decorator.rb index 1eb47b5..1a874f1 100644 --- a/app/decorators/decidim/admin/users_controller_decorator.rb +++ b/app/decorators/decidim/admin/users_controller_decorator.rb @@ -125,4 +125,4 @@ def show # rubocop: enable Metrics/PerceivedComplexity end -::Decidim::Admin::UsersControllerDecorator.decorate +Decidim::Admin::UsersControllerDecorator.decorate diff --git a/app/decorators/decidim/area_decorator.rb b/app/decorators/decidim/area_decorator.rb index d469a1f..8a01b9f 100644 --- a/app/decorators/decidim/area_decorator.rb +++ b/app/decorators/decidim/area_decorator.rb @@ -29,7 +29,7 @@ def self.decorate end def has_department_admins? - Decidim::User.where(organization: organization).any? do |u| + Decidim::User.where(organization:).any? do |u| u.areas.exists?(id) end end @@ -41,4 +41,4 @@ def abort_if_department_admins end end -::Decidim::AreaDecorator.decorate +Decidim::AreaDecorator.decorate diff --git a/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb b/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb index 5de4470..d3ebbc0 100644 --- a/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb +++ b/app/decorators/decidim/assemblies/admin/assemblies_controller_decorator.rb @@ -22,4 +22,4 @@ def collection end end -::Decidim::Assemblies::Admin::AssembliesControllerDecorator.decorate +Decidim::Assemblies::Admin::AssembliesControllerDecorator.decorate diff --git a/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb b/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb index f457a0d..2bac954 100644 --- a/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb +++ b/app/decorators/decidim/assemblies/admin/assemblies_helper_decorator.rb @@ -21,4 +21,4 @@ def parent_assemblies_for_select end end -::Decidim::Assemblies::Admin::AssembliesHelperDecorator.decorate +Decidim::Assemblies::Admin::AssembliesHelperDecorator.decorate diff --git a/app/decorators/decidim/assemblies/create_assembly_decorator.rb b/app/decorators/decidim/assemblies/create_assembly_decorator.rb index 384ac8c..8e90a1f 100644 --- a/app/decorators/decidim/assemblies/create_assembly_decorator.rb +++ b/app/decorators/decidim/assemblies/create_assembly_decorator.rb @@ -16,4 +16,4 @@ def call end end -::Decidim::Assemblies::CreateAssemblyDecorator.decorate +Decidim::Assemblies::CreateAssemblyDecorator.decorate diff --git a/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb b/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb index 98d8280..7e012cb 100644 --- a/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb +++ b/app/decorators/decidim/assemblies/parent_assemblies_for_select_decorator.rb @@ -35,4 +35,4 @@ def query end end -::Decidim::Assemblies::ParentAssembliesForSelectDecorator.decorate +Decidim::Assemblies::ParentAssembliesForSelectDecorator.decorate diff --git a/app/decorators/decidim/assemblies/permissions_decorator.rb b/app/decorators/decidim/assemblies/permissions_decorator.rb index 637e2c8..ecb97fe 100644 --- a/app/decorators/decidim/assemblies/permissions_decorator.rb +++ b/app/decorators/decidim/assemblies/permissions_decorator.rb @@ -19,4 +19,4 @@ def has_manageable_assemblies?(role: :any) end end -::Decidim::Assemblies::PermissionsDecorator.decorate +Decidim::Assemblies::PermissionsDecorator.decorate diff --git a/app/decorators/decidim/assemblies/update_assembly_decorator.rb b/app/decorators/decidim/assemblies/update_assembly_decorator.rb index 27a9e2e..7f5406e 100644 --- a/app/decorators/decidim/assemblies/update_assembly_decorator.rb +++ b/app/decorators/decidim/assemblies/update_assembly_decorator.rb @@ -16,4 +16,4 @@ def call end end -::Decidim::Assemblies::UpdateAssemblyDecorator.decorate +Decidim::Assemblies::UpdateAssemblyDecorator.decorate diff --git a/app/decorators/decidim/assemblies_decorator.rb b/app/decorators/decidim/assemblies_decorator.rb index 251f5a9..a4140f4 100644 --- a/app/decorators/decidim/assemblies_decorator.rb +++ b/app/decorators/decidim/assemblies_decorator.rb @@ -18,4 +18,4 @@ def self.decorate end end -::Decidim::AssembliesDecorator.decorate +Decidim::AssembliesDecorator.decorate diff --git a/app/decorators/decidim/assemblies_with_user_role_decorator.rb b/app/decorators/decidim/assemblies_with_user_role_decorator.rb index 39d11a0..da0a635 100644 --- a/app/decorators/decidim/assemblies_with_user_role_decorator.rb +++ b/app/decorators/decidim/assemblies_with_user_role_decorator.rb @@ -24,4 +24,4 @@ def assembly_ids end end -::Decidim::AssembliesWithUserRoleDecorator.decorate +Decidim::AssembliesWithUserRoleDecorator.decorate diff --git a/app/decorators/decidim/conference_form_decorator.rb b/app/decorators/decidim/conference_form_decorator.rb index bd785b0..670a2e4 100644 --- a/app/decorators/decidim/conference_form_decorator.rb +++ b/app/decorators/decidim/conference_form_decorator.rb @@ -20,4 +20,4 @@ def area end end -::Decidim::ConferenceFormDecorator.decorate +Decidim::ConferenceFormDecorator.decorate diff --git a/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb b/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb index b651826..7dc11e6 100644 --- a/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb +++ b/app/decorators/decidim/conferences/admin/conferences_controller_decorator.rb @@ -24,4 +24,4 @@ def collection end end -::Decidim::Conferences::Admin::ConferencesControllerDecorator.decorate +Decidim::Conferences::Admin::ConferencesControllerDecorator.decorate diff --git a/app/decorators/decidim/conferences/create_conference_decorator.rb b/app/decorators/decidim/conferences/create_conference_decorator.rb index 2618be9..0b222bf 100644 --- a/app/decorators/decidim/conferences/create_conference_decorator.rb +++ b/app/decorators/decidim/conferences/create_conference_decorator.rb @@ -26,6 +26,7 @@ def conference slogan: form.slogan, slug: form.slug, hashtag: form.hashtag, + weight: form.weight, description: form.description, short_description: form.short_description, objectives: form.objectives, @@ -48,4 +49,4 @@ def conference end end -::Decidim::Conferences::CreateConferenceDecorator.decorate +Decidim::Conferences::CreateConferenceDecorator.decorate diff --git a/app/decorators/decidim/conferences/permissions_decorator.rb b/app/decorators/decidim/conferences/permissions_decorator.rb index 849db85..e499dcf 100644 --- a/app/decorators/decidim/conferences/permissions_decorator.rb +++ b/app/decorators/decidim/conferences/permissions_decorator.rb @@ -21,4 +21,4 @@ def has_manageable_conferences?(role: :any) end end -::Decidim::Conferences::PermissionsDecorator.decorate +Decidim::Conferences::PermissionsDecorator.decorate diff --git a/app/decorators/decidim/conferences/update_conference_decorator.rb b/app/decorators/decidim/conferences/update_conference_decorator.rb index 2765cc1..49be1b2 100644 --- a/app/decorators/decidim/conferences/update_conference_decorator.rb +++ b/app/decorators/decidim/conferences/update_conference_decorator.rb @@ -18,4 +18,4 @@ def call end end -::Decidim::Conferences::UpdateConferenceDecorator.decorate +Decidim::Conferences::UpdateConferenceDecorator.decorate diff --git a/app/decorators/decidim/conferences_decorator.rb b/app/decorators/decidim/conferences_decorator.rb index be9a382..c7fb429 100644 --- a/app/decorators/decidim/conferences_decorator.rb +++ b/app/decorators/decidim/conferences_decorator.rb @@ -24,4 +24,4 @@ def self.decorate end end -::Decidim::ConferencesDecorator.decorate +Decidim::ConferencesDecorator.decorate diff --git a/app/decorators/decidim/conferences_with_user_role_decorator.rb b/app/decorators/decidim/conferences_with_user_role_decorator.rb index 4f70284..e6b418d 100644 --- a/app/decorators/decidim/conferences_with_user_role_decorator.rb +++ b/app/decorators/decidim/conferences_with_user_role_decorator.rb @@ -26,4 +26,4 @@ def conference_ids end end -::Decidim::ConferencesWithUserRoleDecorator.decorate +Decidim::ConferencesWithUserRoleDecorator.decorate diff --git a/app/decorators/decidim/decidim_form_helper_decorator.rb b/app/decorators/decidim/decidim_form_helper_decorator.rb index 06f596c..2afeea8 100644 --- a/app/decorators/decidim/decidim_form_helper_decorator.rb +++ b/app/decorators/decidim/decidim_form_helper_decorator.rb @@ -20,4 +20,4 @@ def areas_for_select(organization) end end -::Decidim::DecidimFormHelperDecorator.decorate +Decidim::DecidimFormHelperDecorator.decorate diff --git a/app/decorators/decidim/invite_user_decorator.rb b/app/decorators/decidim/invite_user_decorator.rb index 966e11a..a8f867d 100644 --- a/app/decorators/decidim/invite_user_decorator.rb +++ b/app/decorators/decidim/invite_user_decorator.rb @@ -53,4 +53,4 @@ def clear_department_admin_role end end -::Decidim::InviteUserDecorator.decorate +Decidim::InviteUserDecorator.decorate diff --git a/app/decorators/decidim/invite_user_form_decorator.rb b/app/decorators/decidim/invite_user_form_decorator.rb index 1d27fa2..a66d7b0 100644 --- a/app/decorators/decidim/invite_user_form_decorator.rb +++ b/app/decorators/decidim/invite_user_form_decorator.rb @@ -42,4 +42,4 @@ def selected_area end end -::Decidim::InviteUserFormDecorator.decorate +Decidim::InviteUserFormDecorator.decorate diff --git a/app/decorators/decidim/newsletter_decorator.rb b/app/decorators/decidim/newsletter_decorator.rb index ebdd3e4..169d2cf 100644 --- a/app/decorators/decidim/newsletter_decorator.rb +++ b/app/decorators/decidim/newsletter_decorator.rb @@ -17,4 +17,4 @@ def area end end -::Decidim::NewsletterDecorator.decorate +Decidim::NewsletterDecorator.decorate diff --git a/app/decorators/decidim/newsletters_helper_decorator.rb b/app/decorators/decidim/newsletters_helper_decorator.rb index 3e4b31a..6554bec 100644 --- a/app/decorators/decidim/newsletters_helper_decorator.rb +++ b/app/decorators/decidim/newsletters_helper_decorator.rb @@ -41,4 +41,4 @@ def spaces_department_admin_can_admin # rubocop: enable Metrics/PerceivedComplexity end -::Decidim::NewslettersHelperDecorator.decorate +Decidim::NewslettersHelperDecorator.decorate diff --git a/app/decorators/decidim/participatory_process_decorator.rb b/app/decorators/decidim/participatory_process_decorator.rb index 4dfdfad..370bc66 100644 --- a/app/decorators/decidim/participatory_process_decorator.rb +++ b/app/decorators/decidim/participatory_process_decorator.rb @@ -18,4 +18,4 @@ def self.decorate end end -::Decidim::ParticipatoryProcessDecorator.decorate +Decidim::ParticipatoryProcessDecorator.decorate diff --git a/app/decorators/decidim/participatory_process_group_decorator.rb b/app/decorators/decidim/participatory_process_group_decorator.rb index 6e73e3c..c5c91fc 100644 --- a/app/decorators/decidim/participatory_process_group_decorator.rb +++ b/app/decorators/decidim/participatory_process_group_decorator.rb @@ -14,4 +14,4 @@ def self.decorate end end -::Decidim::ParticipatoryProcessGroupDecorator.decorate +Decidim::ParticipatoryProcessGroupDecorator.decorate diff --git a/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb b/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb index 762aaec..f12d367 100644 --- a/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb +++ b/app/decorators/decidim/participatory_processes/admin/participatory_processes_controller_decorator.rb @@ -22,4 +22,4 @@ def collection end end -::Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessesControllerDecorator.decorate +Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessesControllerDecorator.decorate diff --git a/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb b/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb index 481f8fe..89a5688 100644 --- a/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb +++ b/app/decorators/decidim/participatory_processes/create_participatory_process_decorator.rb @@ -16,4 +16,4 @@ def call end end -::Decidim::ParticipatoryProcesses::CreateParticipatoryProcessDecorator.decorate +Decidim::ParticipatoryProcesses::CreateParticipatoryProcessDecorator.decorate diff --git a/app/decorators/decidim/participatory_processes/permissions_decorator.rb b/app/decorators/decidim/participatory_processes/permissions_decorator.rb index f17b0fa..ed54015 100644 --- a/app/decorators/decidim/participatory_processes/permissions_decorator.rb +++ b/app/decorators/decidim/participatory_processes/permissions_decorator.rb @@ -19,4 +19,4 @@ def has_manageable_processes?(role: :any) end end -::Decidim::ParticipatoryProcesses::PermissionsDecorator.decorate +Decidim::ParticipatoryProcesses::PermissionsDecorator.decorate diff --git a/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb b/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb index 9ac4463..879c741 100644 --- a/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb +++ b/app/decorators/decidim/participatory_processes/update_participatory_process_decorator.rb @@ -16,4 +16,4 @@ def call end end -::Decidim::ParticipatoryProcesses::UpdateParticipatoryProcessDecorator.decorate +Decidim::ParticipatoryProcesses::UpdateParticipatoryProcessDecorator.decorate diff --git a/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb b/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb index df22c00..24ff452 100644 --- a/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb +++ b/app/decorators/decidim/participatory_processes_with_user_role_decorator.rb @@ -24,4 +24,4 @@ def process_ids end end -::Decidim::ParticipatoryProcessesWithUserRoleDecorator.decorate +Decidim::ParticipatoryProcessesWithUserRoleDecorator.decorate diff --git a/app/decorators/decidim/user_decorator.rb b/app/decorators/decidim/user_decorator.rb index 7aed325..a4581c6 100644 --- a/app/decorators/decidim/user_decorator.rb +++ b/app/decorators/decidim/user_decorator.rb @@ -42,18 +42,18 @@ def department_admin? def self.space_admins(organization) if Decidim::DepartmentAdmin.conferences_defined? - Decidim::User.where(organization: organization) - .where('"decidim_users"."id" in (select "decidim_participatory_process_user_roles"."decidim_user_id" from "decidim_participatory_process_user_roles")' \ - ' or "decidim_users"."id" in (select "decidim_assembly_user_roles"."decidim_user_id" from "decidim_assembly_user_roles")' \ - ' or "decidim_users"."id" in (select "decidim_conference_user_roles"."decidim_user_id" from "decidim_conference_user_roles")') + Decidim::User.where(organization:) + .where('"decidim_users"."id" in (select "decidim_participatory_process_user_roles"."decidim_user_id" from "decidim_participatory_process_user_roles") ' \ + 'or "decidim_users"."id" in (select "decidim_assembly_user_roles"."decidim_user_id" from "decidim_assembly_user_roles") ' \ + 'or "decidim_users"."id" in (select "decidim_conference_user_roles"."decidim_user_id" from "decidim_conference_user_roles")') else - Decidim::User.where(organization: organization) - .where('"decidim_users"."id" in (select "decidim_participatory_process_user_roles"."decidim_user_id" from "decidim_participatory_process_user_roles")' \ - ' or "decidim_users"."id" in (select "decidim_assembly_user_roles"."decidim_user_id" from "decidim_assembly_user_roles")') + Decidim::User.where(organization:) + .where('"decidim_users"."id" in (select "decidim_participatory_process_user_roles"."decidim_user_id" from "decidim_participatory_process_user_roles") ' \ + 'or "decidim_users"."id" in (select "decidim_assembly_user_roles"."decidim_user_id" from "decidim_assembly_user_roles")') end end end end end -::Decidim::UserDecorator.decorate +Decidim::UserDecorator.decorate diff --git a/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb b/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb index 6137bd7..fa3b626 100644 --- a/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb +++ b/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb @@ -30,4 +30,4 @@ def user_role_config_for(user, role_name) end end -::Lib::Decidim::ParticipatorySpaceResourceableDecorator.decorate +Lib::Decidim::ParticipatorySpaceResourceableDecorator.decorate diff --git a/app/helpers/decidim/department_admin/application_helper.rb b/app/helpers/decidim/department_admin/application_helper.rb index d0bcd3d..6d464bf 100644 --- a/app/helpers/decidim/department_admin/application_helper.rb +++ b/app/helpers/decidim/department_admin/application_helper.rb @@ -10,7 +10,7 @@ module ApplicationHelper # rubocop: disable Rails/HelperInstanceVariable def roles_with_title(user) roles_with_title = user.roles.collect { |role| [role, ""] } - # if user had particiatory processes then add role of process admin + # if user had participatory processes then add role of process admin user_participatory_processes_filtered(user, current_locale, @search_text).each do |participatory_process| roles_with_title << ["process_admin", translated_attribute(participatory_process.title)] end diff --git a/app/packs/stylesheets/decidim/admin/department_admin.scss b/app/packs/stylesheets/decidim/admin/department_admin.scss index db5b07e..6fae640 100644 --- a/app/packs/stylesheets/decidim/admin/department_admin.scss +++ b/app/packs/stylesheets/decidim/admin/department_admin.scss @@ -1,4 +1,6 @@ .department-admin-filter { + margin-left: 20px; + .dropdown { z-index: 0 !important; } diff --git a/app/views/decidim/admin/users/_filters.html.erb b/app/views/decidim/admin/users/_filters.html.erb index f490fd8..f4ea442 100644 --- a/app/views/decidim/admin/users/_filters.html.erb +++ b/app/views/decidim/admin/users/_filters.html.erb @@ -1,28 +1,32 @@ -
-
- <%= t('.filter_by') %> : - +
+ <%= t('models.user.fields.search_question', scope: 'decidim.admin') %> + style='margin-left: 20px'> + + > + +
+
- +<% end %> diff --git a/app/views/decidim/admin/users/_form.html.erb b/app/views/decidim/admin/users/_form.html.erb index f2b0976..20b5ed6 100644 --- a/app/views/decidim/admin/users/_form.html.erb +++ b/app/views/decidim/admin/users/_form.html.erb @@ -1,21 +1,27 @@ -
- <%= form.text_field :name, label: t(".name") %> -
+
+
+
+
+ <%= form.text_field :name, label: t(".name") %> +
-
- <%= form.email_field :email, label: t(".email") %> -
+
+ <%= form.email_field :email, label: t(".email") %> +
-
- <%= form.select :role, @form.available_roles_for_select, label: t(".role") %> -
+
+ <%= form.select :role, @form.available_roles_for_select, label: t(".role") %> +
-
- <%= form.select :area_id, - @form.available_areas_for_select, - { label: t(".area") }, - { disabled: current_user.roles.include?('department_admin') } - %> +
+ <%= form.select :area_id, + @form.available_areas_for_select, + { label: t(".area") }, + { disabled: current_user.roles.include?('department_admin') } + %> +
+
+
<%= javascript_tag do %> diff --git a/app/views/decidim/admin/users/index.html.erb b/app/views/decidim/admin/users/index.html.erb index a8beb0d..fdabc41 100644 --- a/app/views/decidim/admin/users/index.html.erb +++ b/app/views/decidim/admin/users/index.html.erb @@ -1,93 +1,91 @@ <% add_decidim_page_title(t("decidim.admin.titles.users")) %>
-
-

+
+

<%= t "decidim.admin.titles.users" %> <% if allowed_to? :create, :admin_user %> - <%= link_to t("actions.user.new", scope: "decidim.admin"), [:new, :user], class: "button tiny button--title" %> + <%= link_to t("actions.user.new", scope: "decidim.admin"), [:new, :user], class: "button button__sm button__secondary" %> <% end %> -

+

<%= admin_filter_selector %> -
-
- - - - - - - - - - - - - - - - - <% filtered_collection.each do |user| %> - <% roles_with_title(user).each do |role_and_title| %> - <% if @role.blank? || (@role == role_and_title[0] || @role == 'space_admin' && (role_and_title[0] == 'process_admin' || role_and_title[0] == 'assembly_admin' || role_and_title[0] == 'conference_admin')) %> - - - - - - - - - - - +
<%= sort_link(query, :role, t("models.user.fields.role", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :name, t("models.user.fields.name", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :email, t("models.user.fields.email", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :department, t("models.user.fields.department", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :spaces, t("models.user.fields.spaces", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :invitation_sent_at, t("models.user.fields.invitation_sent_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :invitation_accepted_at, t("models.user.fields.invitation_accepted_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :last_sign_in_at, t("models.user.fields.last_sign_in_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :created_at, t("models.user.fields.created_at", scope: "decidim.admin"), default_order: :desc) %>
- <% if role_and_title.nil? || role_and_title[0].empty? %> - <%= t("models.user.fields.roles.#{user.active_role}", scope: "decidim.admin") %> - <% else %> - <%= t("models.user.fields.roles.#{role_and_title[0] }", scope: "decidim.admin") %> - <% end %> - <%= user.name %><%= user.email %> - <% if user.department_admin? %> - <%= translated_attribute(user.areas.first&.name) %> - <% end %> - - <% if !role_and_title.nil? && !role_and_title[1].empty? %> - <%= role_and_title[1] %> - <% end %> - - <% if user.invitation_sent_at %> - <%= l user.invitation_sent_at, format: :short %> - <% end %> - - <% if user.invitation_accepted_at %> - <%= l user.invitation_accepted_at, format: :short %> - <% end %> - - <% if user.last_sign_in_at %> - <%= l user.last_sign_in_at, format: :short %> - <% end %> - <%= l user.created_at, format: :short %> - <% if user.participatory_processes.size > 0 || user.assemblies.size > 0 || (Decidim::DepartmentAdmin.conferences_defined? && user.conferences.size > 0) %> - <% if allowed_to? :preview, :user, user: user %> - <%= icon_link_to "eye", user_path(user.id), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %> - <% end %> +
+ + + + + + + + + + + + + + + + + <% @users.each do |user| %> + <% roles_with_title(user).each do |role_and_title| %> + <% if @role.blank? || (@role == role_and_title[0] || @role == 'space_admin' && (role_and_title[0] == 'process_admin' || role_and_title[0] == 'assembly_admin' || role_and_title[0] == 'conference_admin')) %> + + + + + + + + + + + - - <% end %> + <% if allowed_to? :destroy, :admin_user, user: user %> + <%= icon_link_to "delete-bin-line", user, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> + <% end %> + + <% end %> <% end %> - -
<%= sort_link(query, :role, t("models.user.fields.role", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :name, t("models.user.fields.name", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :email, t("models.user.fields.email", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :department, t("models.user.fields.department", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :spaces, t("models.user.fields.spaces", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :invitation_sent_at, t("models.user.fields.invitation_sent_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :invitation_accepted_at, t("models.user.fields.invitation_accepted_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :last_sign_in_at, t("models.user.fields.last_sign_in_at", scope: "decidim.admin"), default_order: :desc) %><%= sort_link(query, :created_at, t("models.user.fields.created_at", scope: "decidim.admin"), default_order: :desc) %>
+ <% if role_and_title.nil? || role_and_title[0].empty? %> + <%= t("models.user.fields.roles.#{user.active_role}", scope: "decidim.admin") %> + <% else %> + <%= t("models.user.fields.roles.#{role_and_title[0] }", scope: "decidim.admin") %> + <% end %> + <%= user.name %><%= user.email %> + <% if user.department_admin? %> + <%= translated_attribute(user.areas.first&.name) %> + <% end %> + + <% if !role_and_title.nil? && !role_and_title[1].empty? %> + <%= role_and_title[1] %> + <% end %> + + <% if user.invitation_sent_at %> + <%= l user.invitation_sent_at, format: :short %> + <% end %> + + <% if user.invitation_accepted_at %> + <%= l user.invitation_accepted_at, format: :short %> + <% end %> + + <% if user.last_sign_in_at %> + <%= l user.last_sign_in_at, format: :short %> + <% end %> + <%= l user.created_at, format: :short %> + <% if user.participatory_processes.size > 0 || user.assemblies.size > 0 || (Decidim::DepartmentAdmin.conferences_defined? && user.conferences.size > 0) %> + <% if allowed_to?(:preview, :user, user: user) %> + <%= icon_link_to "eye-line", user_path(user.id), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %> <% end %> + <% end %> - <% if allowed_to?(:invite, :admin_user, user: user) && user.invited_to_sign_up? %> - <%= icon_link_to "reload", [:resend_invitation, user], t("actions.resend_invitation", scope: "decidim.admin"), class: "resend-invitation", method: :post %> - <% end %> + <% if allowed_to?(:invite, :admin_user, user: user) && user.invited_to_sign_up? %> + <%= icon_link_to "refresh-line", [:resend_invitation, user], t("actions.resend_invitation", scope: "decidim.admin"), class: "resend-invitation", method: :post %> + <% end %> - <% if allowed_to? :destroy, :admin_user, user: user %> - <%= icon_link_to "circle-x", user, t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> - <% end %> -
- <%= paginate @users, theme: "decidim" %> -
+ <% end %> +
+ <%= paginate @users, theme: "decidim" %>
diff --git a/app/views/decidim/admin/users/show.html.erb b/app/views/decidim/admin/users/show.html.erb index 678e8a3..99497eb 100644 --- a/app/views/decidim/admin/users/show.html.erb +++ b/app/views/decidim/admin/users/show.html.erb @@ -1,15 +1,14 @@ <% @user = Decidim::User.find_by_id(params[:id]) %> -
- +
+
+

+ <%= @user.name + '(' + @user.email + ')' %> +

+
+ <%= t("models.user.fields.administrated_spaces", scope: "decidim.admin") %>
-
-

- <%= @user.name + '(' + @user.email + ')' %> -

-
+
diff --git a/app/views/decidim/assemblies/admin/assemblies/index.html.erb b/app/views/decidim/assemblies/admin/assemblies/index.html.erb index 5e75440..09231dc 100644 --- a/app/views/decidim/assemblies/admin/assemblies/index.html.erb +++ b/app/views/decidim/assemblies/admin/assemblies/index.html.erb @@ -1,147 +1,139 @@ -
-
-

- <% parent_assembly.self_and_ancestors.each do |assembly| %> - <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %> - > - <% end if parent_assembly %> - - <%= t("assemblies", scope: "decidim.admin.titles") %> - - <% if allowed_to? :create, :assembly %> - <%= link_to t("actions.new_assembly", scope: "decidim.admin"), - new_assembly_path(parent_id: parent_assembly&.id), - class: "button tiny button--title" %> - <% end %> +<% add_decidim_page_title(t("assemblies", scope: "decidim.admin.titles")) %> +
+ <% if parent_assembly && parent_assembly.self_and_ancestors.length %> +
+

+ <% parent_assembly.self_and_ancestors.each_with_index do |assembly, ix| %> + <%= translated_attribute(assembly.title) %> + <% unless ix == parent_assembly.self_and_ancestors.length - 1 %> + > + <% end %> + <% end if parent_assembly %> +

+
+ <% end %> - <% if allowed_to? :import, :assembly %> - <%= link_to t("actions.import_assembly", scope: "decidim.admin"), - new_import_path, - class: "button tiny button--title" %> - <% end %> -

-
<%= admin_filter_selector %> -
-
-
- + +
+
+ + + + + + + + + + + + + + <% @assemblies.each do |assembly| %> + <% next unless allowed_to? :list, :assembly, assembly: assembly %> - - - - - - - - - - - - <% @assemblies.each do |assembly| %> - <% next unless allowed_to? :list, :assembly, assembly: assembly %> - - - - - - - - - + + + + + + + - - <% end %> - -
+ <%= sort_link(query, :title, t("models.assembly.fields.title", scope: "decidim.admin")) %> + + <%= sort_link(query, :area_name, t("models.assembly.fields.department", scope: "decidim.admin")) %> + + <%= t("models.assembly.fields.department_role", scope: "decidim.admin") %> + + <%= t("models.assembly.fields.assembly_role", scope: "decidim.admin") %> + + <%= sort_link(query, :created_at, t("models.assembly.fields.created_at", scope: "decidim.admin"), default_order: :desc) %> + + <%= sort_link(query, :private_space, t("models.assembly.fields.private", scope: "decidim.admin")) %> + + <%= sort_link(query, :published_at, t("models.assembly.fields.published", scope: "decidim.admin")) %> + + <%= t("models.assembly.fields.actions", scope: "decidim.admin") %> +
- <%= sort_link(query, :title, t("models.assembly.fields.title", scope: "decidim.admin")) %> - - <%= sort_link(query, :area_name, t("models.assembly.fields.department", scope: "decidim.admin")) %> - - <%= t("models.assembly.fields.department_role", scope: "decidim.admin") %> - - <%= t("models.assembly.fields.assembly_role", scope: "decidim.admin") %> - - <%= sort_link(query, :created_at, t("models.assembly.fields.created_at", scope: "decidim.admin"), default_order: :desc) %> - - <%= sort_link(query, :private_space, t("models.assembly.fields.private", scope: "decidim.admin")) %> - - <%= sort_link(query, :published_at, t("models.assembly.fields.published", scope: "decidim.admin")) %> -
- <% if assembly.promoted? %> - "> - <%= icon "star", role: "img", "aria-hidden": true %> - - <% end %> - <% if allowed_to? :update, :assembly, assembly: assembly %> - <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %>
- <% elsif allowed_to? :read, :component, assembly: assembly %> - <%= link_to translated_attribute(assembly.title), components_path(assembly) %>
- <% elsif allowed_to? :preview, :assembly, assembly: assembly %> - <%= link_to translated_attribute(assembly.title), decidim_assemblies.assembly_path(assembly) %>
- <% elsif allowed_to? :read, :moderation, assembly: assembly %> - <%= link_to translated_attribute(assembly.title), moderations_path(assembly) %>
- <% else %> - <%= translated_attribute(assembly.title) %> - <% end %> -
- <% if(assembly.area != nil) %> - <%= translated_attribute(assembly.area.name)%> - <% end %> - - <% if(assembly.area != nil) %> - <%= assembly.area.users.map(&:name).join(", ") %> - <% end %> - - <%= assembly.users_with_any_role.map(&:name).join(", ") %> - - <%= l(assembly.created_at, format: :short) %> - - <% if assembly.private_space? %> - <%= t("assemblies.index.private", scope: "decidim.admin") %> - <% else %> - <%= t("assemblies.index.public", scope: "decidim.admin") %> - <% end %> - - <% if assembly.published? %> - <%= t("assemblies.index.published", scope: "decidim.admin") %> - <% else %> - <%= t("assemblies.index.not_published", scope: "decidim.admin") %> - <% end %> - - <% if allowed_to? :export, :assembly, assembly: assembly %> - <%= icon_link_to "data-transfer-download", assembly_export_path(assembly), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %> - <% else %> - - <% end %> + + <% if assembly.promoted? %> + <%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %> + <% end %> - <% if allowed_to? :copy, :assembly, assembly: assembly %> - <%= icon_link_to "clipboard", new_assembly_copy_path(assembly), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> - <% else %> - - <% end %> + <% if allowed_to? :update, :assembly, assembly: assembly %> + <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %>
+ <% elsif allowed_to? :read, :component, assembly: assembly %> + <%= link_to translated_attribute(assembly.title), components_path(assembly) %>
+ <% else %> + <%= translated_attribute(assembly.title) %> + <% end %> +
+ <% if(assembly.area != nil) %> + <%= translated_attribute(assembly.area.name)%> + <% end %> + + <% if(assembly.area != nil) %> + <%= assembly.area.users.map(&:name).join(", ") %> + <% end %> + + <%= assembly.users_with_any_role.map(&:name).join(", ") %> + + <%= l(assembly.created_at, format: :short) %> + + <% if assembly.private_space? %> + <%= t("assemblies.index.private", scope: "decidim.admin") %> + <% else %> + <%= t("assemblies.index.public", scope: "decidim.admin") %> + <% end %> + + <% if assembly.published? %> + <%= t("assemblies.index.published", scope: "decidim.admin") %> + <% else %> + <%= t("assemblies.index.not_published", scope: "decidim.admin") %> + <% end %> + + <% if allowed_to? :update, :assembly, assembly: assembly %> + <%= icon_link_to "pencil-line", edit_assembly_path(assembly), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> + <% else %> + + <% end %> + <% if assembly.children.count.positive? || allowed_to?(:create, :assembly) %> + <%= icon_link_to "government-line", + url_for(query_params_with(parent_id_eq: assembly.id)), + t("decidim.admin.titles.assemblies"), + class: "action-icon--dial #{"highlighted" if assembly.children.count.positive?}" %> + <% else %> + + <% end %> + <% if allowed_to? :copy, :assembly, assembly: assembly %> + <%= icon_link_to "file-copy-line", new_assembly_copy_path(assembly), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> + <% else %> + + <% end %> - <% if allowed_to? :update, :assembly, assembly: assembly %> - <%= icon_link_to "pencil", edit_assembly_path(assembly), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> - <% else %> - - <% end %> + <% if allowed_to? :export, :assembly, assembly: assembly %> + <%= icon_link_to "download-line", assembly_export_path(assembly), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %> + <% else %> + + <% end %> - <% if assembly.children.count.positive? || allowed_to?(:create, :assembly) %> - <%= icon_link_to "dial", - url_for(query_params_with(parent_id_eq: assembly.id)), - t("decidim.admin.titles.assemblies"), - class: "action-icon--dial #{'highlighted' if assembly.children.count.positive?}" %> - <% else %> - - <% end %> + <% if allowed_to? :preview, :assembly, assembly: assembly %> + <%= icon_link_to "eye-line", decidim_assemblies.assembly_path(assembly), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %> + <% else %> + + <% end %> - <% if allowed_to? :preview, :assembly, assembly: assembly %> - <%= icon_link_to "eye", decidim_assemblies.assembly_path(assembly), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %> - <% else %> - - <% end %> -
- <%= paginate @assemblies, theme: "decidim" %> -
+ <% if allowed_to? :read, :moderation, assembly: assembly %> + <%= icon_link_to "flag-line", moderations_path(assembly), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %> + <% else %> + + <% end %> + + + <% end %> + +
+ <%= decidim_paginate @assemblies %>
diff --git a/app/views/decidim/conferences/admin/conferences/_form.html.erb b/app/views/decidim/conferences/admin/conferences/_form.html.erb index e915147..1208c8b 100644 --- a/app/views/decidim/conferences/admin/conferences/_form.html.erb +++ b/app/views/decidim/conferences/admin/conferences/_form.html.erb @@ -1,24 +1,32 @@ -
-
-

<%= t "conferences.form.title", scope: "decidim.admin" %>

-
+
+
+
+ +
+
+
+ <%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %> +
-
- <%= form.translated :text_field, :title, autofocus: true %> + <%= form.translated :text_field, :slogan, aria: { label: :slogan } %>
- <%= form.translated :text_field, :slogan %> + <%= form.number_field :weight %>
-
- <%= form.text_field :slug %> -

<%== t(".slug_help", url: decidim_form_slug_url(:conferences, form.object.slug)) %>

+
+ <%= form.text_field :slug, help_text: t(".slug_help_html", url: decidim_form_slug_url(:conferences, form.object.slug)) %>
-
+
<%= form.text_field :hashtag %>
@@ -28,15 +36,15 @@
- <%= form.translated :editor, :short_description %> + <%= form.translated :editor, :short_description, aria: { label: :short_description } %>
- <%= form.translated :editor, :description %> + <%= form.translated :editor, :description, aria: { label: :description } %>
- <%= form.translated :editor, :objectives %> + <%= form.translated :editor, :objectives, aria: { label: :objectives } %>
@@ -45,11 +53,11 @@
- <%= form.upload :hero_image %> + <%= form.upload :hero_image, button_class: "button button__sm button__transparent-secondary" %>
- <%= form.upload :banner_image %> + <%= form.upload :banner_image, button_class: "button button__sm button__transparent-secondary" %>
@@ -86,12 +94,11 @@

<%= t(".registrations_count", count: current_participatory_space.present? ? current_participatory_space.conference_registrations.count : 0) %>

- <%= form.number_field :available_slots %> -

<%= t(".available_slots_help") %>

+ <%= form.number_field :available_slots, help_text: t(".available_slots_help") %>
- <%= form.translated :editor, :registration_terms, toolbar: :content %> + <%= form.translated :editor, :registration_terms, toolbar: :content, aria: { label: :registration_terms } %>
@@ -104,18 +111,18 @@
- <% if @form.assemblies_for_select %> - <%= form.select :assemblies_ids, - options_for_select(@form.assemblies_for_select, selected: assemblies_selected ), + <% if @form.processes_for_select %> + <%= form.select :participatory_processes_ids, + options_for_select(@form.processes_for_select, selected: processes_selected ), { include_blank: true }, { multiple: true, class: "chosen-select" } %> <% end %>
- <% if @form.consultations_for_select %> - <%= form.select :consultations_ids, - options_for_select(@form.consultations_for_select, selected: consultations_selected ), + <% if @form.assemblies_for_select %> + <%= form.select :assemblies_ids, + options_for_select(@form.assemblies_for_select, selected: assemblies_selected ), { include_blank: true }, { multiple: true, class: "chosen-select" } %> <% end %> @@ -124,4 +131,4 @@
-<%= javascript_pack_tag "decidim_conferences_admin" %> +<%= append_javascript_pack_tag "decidim_conferences_admin" %> diff --git a/app/views/decidim/conferences/admin/conferences/index.html.erb b/app/views/decidim/conferences/admin/conferences/index.html.erb index 5044588..711af1e 100644 --- a/app/views/decidim/conferences/admin/conferences/index.html.erb +++ b/app/views/decidim/conferences/admin/conferences/index.html.erb @@ -1,85 +1,78 @@ -
-
-

- <%= t "decidim.admin.titles.conferences" %> - <%= link_to t("actions.new_conference", scope: "decidim.admin"), new_conference_path, class: "button tiny button--title" if allowed_to? :create, :conference %> -

-
+<% add_decidim_page_title(t("decidim.admin.titles.conferences")) %> +
<%= admin_filter_selector %> -
-
- - +
+
+ + + + + + + + + + + + + <% @conferences.each do |conference| %> - - - - - - - + + + + + + + - - - <% @conferences.each do |conference| %> - - - - - - - - - - <% end %> - -
<%= t("models.conference.fields.title", scope: "decidim.admin") %><%= sort_link(query, :area_name, t("models.conference.fields.department", scope: "decidim.admin")) %><%= t("models.conference.fields.department_role", scope: "decidim.admin") %><%= t("models.conference.fields.conference_role", scope: "decidim.admin") %><%= sort_link(query, :created_at, t("models.conference.fields.created_at", scope: "decidim.admin"), default_order: :desc) %><%= t("models.conference.fields.published", scope: "decidim.admin") %>
<%= t("models.conference.fields.title", scope: "decidim.admin") %><%= sort_link(query, :area_name, t("models.conference.fields.department", scope: "decidim.admin")) %><%= t("models.conference.fields.department_role", scope: "decidim.admin") %><%= t("models.conference.fields.conference_role", scope: "decidim.admin") %><%= sort_link(query, :created_at, t("models.conference.fields.created_at", scope: "decidim.admin"), default_order: :desc) %><%= t("models.conference.fields.published", scope: "decidim.admin") %> + <% if conference.promoted? %> + <%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %> + <% end %> + + <% if allowed_to? :update, :conference, conference: conference %> + <%= link_to translated_attribute(conference.title), edit_conference_path(conference) %>
+ <% elsif allowed_to? :read, :component, conference: conference %> + <%= link_to translated_attribute(conference.title), components_path(conference) %>
+ <% else %> + <%= translated_attribute(conference.title) %> + <% end %> +
+ <% if(conference.area != nil) %> + <%= translated_attribute(conference.area.name) %> + <% end %> + + <% if(conference.area != nil) %> + <%= conference.area.users.map(&:name).join(", ") %> + <% end %> + + <%= conference.users_with_any_role.map(&:name).join(", ") %> + + <%= l conference.created_at, format: :short %> + + <% if conference.published? %> + <%= t("conferences.index.published", scope: "decidim.admin") %> + <% else %> + <%= t("conferences.index.not_published", scope: "decidim.admin") %> + <% end %> + + <% if allowed_to? :update, :conference, conference: conference %> + <%= icon_link_to "pencil-line", edit_conference_path(conference), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> + <% end %> + + <% if allowed_to? :create, :conference, conference: conference %> + <%= icon_link_to "file-copy-line", new_conference_copy_path(conference), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> + <% end %> + + <% if allowed_to? :preview, :conference, conference: conference %> + <%= icon_link_to "eye-line", decidim_conferences.conference_path(conference), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %> + <% end %> + + <% if allowed_to? :read, :moderation, conference: conference %> + <%= icon_link_to "flag-line", moderations_path(conference), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %> + <% end %> +
- <% if conference.promoted? %> - "> - <%= icon "star", aria_label: t("models.conference.fields.promoted", scope: "decidim.admin"), role: "img" %> - - <% end %> - <% if allowed_to? :update, :conference, conference: conference %> - <%= link_to translated_attribute(conference.title), edit_conference_path(conference) %>
- <% elsif allowed_to? :read, :component, conference: conference %> - <%= link_to translated_attribute(conference.title), components_path(conference) %>
- <% elsif allowed_to? :preview, :conference, conference: conference %> - <%= link_to translated_attribute(conference.title), decidim_conferences.conference_path(conference) %>
- <% elsif allowed_to? :read, :moderation, conference: conference %> - <%= link_to translated_attribute(conference.title), moderations_path(conference) %>
- <% else %> - <%= translated_attribute(conference.title) %> - <% end %> -
- <% if(conference.area != nil) %> - <%= translated_attribute(conference.area.name) %> - <% end %> - - <% if(conference.area != nil) %> - <%= conference.area.users.map(&:name).join(", ") %> - <% end %> - - <%= conference.users_with_any_role.map(&:name).join(", ") %> - - <%= l conference.created_at, format: :short %> - - <% if conference.published? %> - <%= t("conferences.index.published", scope: "decidim.admin") %> - <% else %> - <%= t("conferences.index.not_published", scope: "decidim.admin") %> - <% end %> - - <% if allowed_to? :create, :conference, conference: conference %> - <%= icon_link_to "clipboard", new_conference_copy_path(conference), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> - <% end %> - <% if allowed_to? :update, :conference, conference: conference %> - <%= icon_link_to "pencil", edit_conference_path(conference), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> - <% end %> - <% if allowed_to? :preview, :conference, conference: conference %> - <%= icon_link_to "eye", decidim_conferences.conference_path(conference), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %> - <% end %> -
- <%= paginate @conferences, theme: "decidim" %> + <% end %> +
-
+ <%= decidim_paginate @conferences %>
diff --git a/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb b/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb index 175dca3..7663773 100644 --- a/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +++ b/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb @@ -1,160 +1,117 @@ <% add_decidim_page_title(t("participatory_processes", scope: "decidim.admin.titles")) %> +<%= admin_tabs(:admin_participatory_processes_menu).render %> -<% content_for :sidebar_menu_nav do %> - <%= sidebar_menu(:admin_participatory_processes_menu).render %> -<% end %> - -
-
-

- <%= t("participatory_processes", scope: "decidim.admin.titles") %> - - <% if allowed_to? :create, :process %> - <%= link_to t("actions.new_process", scope: "decidim.admin"), - [:new, :participatory_process], - class: "button tiny button--title" %> - <% end %> - - <% if process_group %> - < - <%= link_to translated_attribute(process_group.title), - edit_participatory_process_group_path(process_group) %> - <% end %> +
+ <%= admin_filter_selector %> +
- <% if allowed_to? :import, :process %> - <%= link_to t("actions.import_process", scope: "decidim.admin"), - new_import_path, - class: "button tiny button--title" %> - <% end %> +
+ + + + + + + + + + + + + + + <% @participatory_processes.each do |process| %> + + + + + + + + + + + <% end %> + +
+ <%= sort_link(query, :title, t("models.participatory_process.fields.title", scope: "decidim.admin")) %> + + <%= sort_link(query, :area_name, t("models.participatory_process.fields.department", scope: "decidim.admin")) %> + + <%= t("models.participatory_process.fields.department_role", scope: "decidim.admin") %> + + <%= t("models.participatory_process.fields.process_role", scope: "decidim.admin") %> + + <%= sort_link(query, :created_at, t("models.participatory_process.fields.created_at", scope: "decidim.admin"), default_order: :desc) %> + + <%= sort_link(query, :private_space, t("models.participatory_process.fields.private", scope: "decidim.admin")) %> + + <%= sort_link(query, :published_at, t("models.participatory_process.fields.published", scope: "decidim.admin")) %> +
+ <% if process.promoted? %> + <%= icon_with_tooltip "star-s-fill", t("models.assembly.fields.promoted", scope: "decidim.admin") %> + <% end %> + <% if allowed_to? :update, :process, process: process %> + <%= link_to translated_attribute(process.title), edit_participatory_process_path(process) %>
+ <% elsif allowed_to? :read, :component, process: process %> + <%= link_to translated_attribute(process.title), components_path(process) %>
+ <% else %> + <%= translated_attribute(process.title) %> + <% end %> +
+ <% if(process.area != nil) %> + <%= translated_attribute(process.area.name)%> + <% end %> + + <% if(process.area != nil) %> + <%= process.area.users.map(&:name).join(", ") %> + <% end %> + + <%= process.users_with_any_role.map(&:name).join(", ") %> + + <%= l process.created_at, format: :short %> + + <% if process.private_space? %> + <%= t("participatory_processes.index.private", scope: "decidim.admin") %> + <% else %> + <%= t("participatory_processes.index.public", scope: "decidim.admin") %> + <% end %> + + <% if process.published? %> + <%= t("participatory_processes.index.published", scope: "decidim.admin") %> + <% else %> + <%= t("participatory_processes.index.unpublished", scope: "decidim.admin") %> + <% end %> + + <% if allowed_to? :update, :process, process: process %> + <%= icon_link_to "pencil-line", edit_participatory_process_path(process), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> + <% else %> + + <% end %> - - - - - <%= admin_filter_selector %> -
-
- - - - - - - - - - - - - - - <% @participatory_processes.each do |process| %> - - - - - - - - - - - <% end %> - -
- <%= sort_link(query, :title, t("models.participatory_process.fields.title", scope: "decidim.admin")) %> - - <%= sort_link(query, :area_name, t("models.participatory_process.fields.department", scope: "decidim.admin")) %> - - <%= t("models.participatory_process.fields.department_role", scope: "decidim.admin") %> - - <%= t("models.participatory_process.fields.process_role", scope: "decidim.admin") %> - - <%= sort_link(query, :created_at, t("models.participatory_process.fields.created_at", scope: "decidim.admin"), default_order: :desc) %> - - <%= sort_link(query, :private_space, t("models.participatory_process.fields.private", scope: "decidim.admin")) %> - - <%= sort_link(query, :published_at, t("models.participatory_process.fields.published", scope: "decidim.admin")) %> -
- <% if process.promoted? %> - "> - <%= icon "star" %> - - <% end %> - <% if allowed_to? :update, :process, process: process %> - <%= link_to translated_attribute(process.title), edit_participatory_process_path(process) %>
- <% elsif allowed_to? :read, :component, process: process %> - <%= link_to translated_attribute(process.title), components_path(process) %>
- <% elsif allowed_to? :preview, :process, process: process %> - <%= link_to translated_attribute(process.title), decidim_participatory_processes.participatory_process_path(process) %>
- <% elsif allowed_to? :read, :moderation, process: process %> - <%= link_to translated_attribute(process.title), moderations_path(process) %>
- <% else %> - <%= translated_attribute(process.title) %> - <% end %> -
- <% if(process.area != nil) %> - <%= translated_attribute(process.area.name)%> - <% end %> - - <% if(process.area != nil) %> - <%= process.area.users.map(&:name).join(", ") %> - <% end %> - - <%= process.users_with_any_role.map(&:name).join(", ") %> - - <%= l process.created_at, format: :short %> - - <% if process.private_space? %> - <%= t("participatory_processes.index.private", scope: "decidim.admin") %> - <% else %> - <%= t("participatory_processes.index.public", scope: "decidim.admin") %> - <% end %> - - <% if process.published? %> - <%= t("participatory_processes.index.published", scope: "decidim.admin") %> - <% else %> - <%= t("participatory_processes.index.not_published", scope: "decidim.admin") %> - <% end %> - - <% if allowed_to? :create, :process, process: process %> - <%= icon_link_to "data-transfer-download", participatory_process_export_path(process), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %> - <% else %> - - <% end %> - <% if allowed_to? :create, :process, process: process %> - <%= icon_link_to "clipboard", new_participatory_process_copy_path(process), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> - <% else %> - - <% end %> + <% if allowed_to? :create, :process, process: process %> + <%= icon_link_to "file-copy-line", new_participatory_process_copy_path(process), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %> + <% else %> + + <% end %> - <% if allowed_to? :update, :process, process: process %> - <%= icon_link_to "pencil", edit_participatory_process_path(process), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %> - <% else %> - - <% end %> + <% if allowed_to? :preview, :process, process: process %> + <%= icon_link_to "eye-line", decidim_participatory_processes.participatory_process_path(process), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %> + <% else %> + + <% end %> - <% if allowed_to? :preview, :process, process: process %> - <%= icon_link_to "eye", decidim_participatory_processes.participatory_process_path(process), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %> - <% else %> - - <% end %> -
- <%= paginate @participatory_processes, theme: "decidim" %> -
-
+ <% if allowed_to? :read, :moderation, process: process %> + <%= icon_link_to "flag-line", moderations_path(process), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %> + <% else %> + + <% end %> +
+<%= decidim_paginate @participatory_processes %> diff --git a/decidim-department_admin.gemspec b/decidim-department_admin.gemspec index f1310fa..4cb85ce 100644 --- a/decidim-department_admin.gemspec +++ b/decidim-department_admin.gemspec @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path("lib", __dir__) require "decidim/department_admin/version" -DECIDIM_VER = "~> 0.27.0" +DECIDIM_VER = "~> 0.28.0" Gem::Specification.new do |s| s.version = Decidim::DepartmentAdmin.version @@ -12,14 +12,13 @@ Gem::Specification.new do |s| s.email = ["oliver.vh@coditramuntana.com"] s.license = "AGPL-3.0" s.homepage = "https://github.com/decidim/decidim-module-department_admin" - s.required_ruby_version = ">= 3.0.7" + s.required_ruby_version = ">= 3.1.1" s.name = "decidim-department_admin" s.summary = "A decidim department_admin module" s.description = "This Dedicim's module produces a new \"department admin\" role which restricts the permissions of an Admin into participatory spaces of a given Area." s.files = Dir["{app,db,config,lib}/**/*", "LICENSE-AGPLv3.txt", "Rakefile", "README.md"] - s.test_files = Dir["spec/**/*"] s.add_dependency "decidim-admin", DECIDIM_VER s.add_dependency "decidim-core", DECIDIM_VER diff --git a/lib/decidim/department_admin/version.rb b/lib/decidim/department_admin/version.rb index e18b851..52f6623 100644 --- a/lib/decidim/department_admin/version.rb +++ b/lib/decidim/department_admin/version.rb @@ -5,7 +5,7 @@ module Decidim module DepartmentAdmin # see CHANGELOG.md def self.version - "0.7.1" + "0.8.0" end end end diff --git a/spec/commands/decidim/admin/deliver_newsletter_spec.rb b/spec/commands/decidim/admin/deliver_newsletter_spec.rb index 55991c7..17de28a 100644 --- a/spec/commands/decidim/admin/deliver_newsletter_spec.rb +++ b/spec/commands/decidim/admin/deliver_newsletter_spec.rb @@ -8,11 +8,11 @@ module Decidim::Admin let(:organization) { create(:organization) } let(:newsletter) do create(:newsletter, - organization: organization, + organization:, author: current_user) end - let(:area) { create(:area, organization: organization) } - let(:current_user) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:area) { create(:area, organization:) } + let(:current_user) { create(:department_admin, :confirmed, organization:, area:) } let(:send_to_all_users) { false } let(:send_to_followers) { false } let(:send_to_participants) { false } @@ -21,11 +21,11 @@ module Decidim::Admin let(:form_params) do { - send_to_all_users: send_to_all_users, - send_to_followers: send_to_followers, - send_to_participants: send_to_participants, - participatory_space_types: participatory_space_types, - scope_ids: scope_ids, + send_to_all_users:, + send_to_followers:, + send_to_participants:, + participatory_space_types:, + scope_ids:, } end @@ -34,7 +34,7 @@ module Decidim::Admin form_params ).with_context( current_organization: organization, - current_user: current_user + current_user: ) end @@ -55,7 +55,7 @@ module Decidim::Admin expect(newsletter.total_recipients).to eq(deliverable_users.count) end - it "logs the action", versioning: true do + it "logs the action", :versioning do expect(Decidim.traceability) .to receive(:perform_action!) .with("deliver", newsletter, current_user) @@ -73,7 +73,7 @@ module Decidim::Admin end context "when the user is a department admin" do - let!(:participatory_process) { create(:participatory_process, organization: organization, area: area) } + let!(:participatory_process) { create(:participatory_process, organization:, area:) } let!(:component) { create(:dummy_component, organization: newsletter.organization, participatory_space: participatory_process) } context "when no spaces selected" do @@ -107,11 +107,11 @@ module Decidim::Admin let(:send_to_followers) { true } let!(:deliverable_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end let!(:undeliverable_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end before do @@ -126,12 +126,12 @@ module Decidim::Admin context "when sending to all space participants" do let(:send_to_participants) { true } let!(:deliverable_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end before do deliverable_users.each do |participant| - create(:dummy_resource, component: component, author: participant, published_at: Time.current) + create(:dummy_resource, component:, author: participant, published_at: Time.current) end end @@ -143,22 +143,22 @@ module Decidim::Admin let(:send_to_followers) { true } let!(:participant_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end let!(:follower_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end let!(:deliverable_users) { participant_users + follower_users } let!(:undeliverable_users) do - create_list(:user, rand(2..9), :confirmed, organization: organization, newsletter_notifications_at: Time.current) + create_list(:user, rand(2..9), :confirmed, organization:, newsletter_notifications_at: Time.current) end before do participant_users.each do |participant| - create(:dummy_resource, component: component, author: participant, published_at: Time.current) + create(:dummy_resource, component:, author: participant, published_at: Time.current) end follower_users.each do |follower| diff --git a/spec/commands/decidim/invite_user_spec.rb b/spec/commands/decidim/invite_user_spec.rb index 914f2b2..36f639e 100644 --- a/spec/commands/decidim/invite_user_spec.rb +++ b/spec/commands/decidim/invite_user_spec.rb @@ -7,13 +7,13 @@ module Decidim describe "call" do let(:organization) { create(:organization) } - let(:current_user) { create(:admin, :confirmed, organization: organization) } + let(:current_user) { create(:admin, :confirmed, organization:) } let(:form_params) do { name: "user_name", email: "user_name@example.org", - organization: organization, + organization:, } end @@ -22,7 +22,7 @@ module Decidim form_params ).with_context( current_organization: organization, - current_user: current_user + current_user: ) end diff --git a/spec/controllers/decidim/admin/users_controller_spec.rb b/spec/controllers/decidim/admin/users_controller_spec.rb index 25f890f..dfc95d4 100644 --- a/spec/controllers/decidim/admin/users_controller_spec.rb +++ b/spec/controllers/decidim/admin/users_controller_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" module Decidim::Admin - describe UsersController, type: :controller do + describe UsersController do # routes { Decidim::Core::Engine.routes } routes { Decidim::Admin::Engine.routes } @@ -17,15 +17,15 @@ module Decidim::Admin end describe "role filter" do - let!(:participant) { create(:user, :confirmed, organization: organization) } - let!(:department_admin_user) { create(:department_admin, :confirmed, organization: organization) } - let!(:user_manager) { create(:user, :confirmed, organization: organization, roles: ["user_manager"]) } - let!(:process_admin) { create(:user, :confirmed, organization: organization) } - let!(:participatory_process) { create(:participatory_process, organization: organization, title: { en: "A Process space" }) } - let!(:process_admin_rel) { Decidim::ParticipatoryProcessUserRole.create(role: "admin", user: process_admin, participatory_process: participatory_process) } - let!(:assembly_admin) { create(:user, :confirmed, organization: organization) } - let!(:assembly) { create(:assembly, organization: organization, title: { en: "An Assembly space" }) } - let!(:assembly_admin_rel) { Decidim::AssemblyUserRole.create(role: "admin", user: assembly_admin, assembly: assembly) } + let!(:participant) { create(:user, :confirmed, organization:) } + let!(:department_admin_user) { create(:department_admin, :confirmed, organization:) } + let!(:user_manager) { create(:user, :confirmed, organization:, roles: ["user_manager"]) } + let!(:process_admin) { create(:user, :confirmed, organization:) } + let!(:participatory_process) { create(:participatory_process, organization:, title: { en: "A Process space" }) } + let!(:process_admin_rel) { Decidim::ParticipatoryProcessUserRole.create(role: "admin", user: process_admin, participatory_process:) } + let!(:assembly_admin) { create(:user, :confirmed, organization:) } + let!(:assembly) { create(:assembly, organization:, title: { en: "An Assembly space" }) } + let!(:assembly_admin_rel) { Decidim::AssemblyUserRole.create(role: "admin", user: assembly_admin, assembly:) } subject { controller.filtered_collection } @@ -65,7 +65,7 @@ module Decidim::Admin end it "lists only users with role admin" do - get :index, params: params + get(:index, params:) expect(subject).to include(admin_user) expect(subject).not_to include(department_admin_user, user_manager, process_admin, assembly_admin, participant) @@ -79,7 +79,7 @@ module Decidim::Admin end it "lists only users with role department_admin" do - get :index, params: params + get(:index, params:) expect(subject).to include(department_admin_user) expect(subject).not_to include(admin_user, user_manager, process_admin, assembly_admin, participant) @@ -93,7 +93,7 @@ module Decidim::Admin end it "lists only users with role user_manager" do - get :index, params: params + get(:index, params:) expect(subject).to include(user_manager) expect(subject).not_to include(admin_user, department_admin_user, process_admin, assembly_admin, participant) @@ -107,7 +107,7 @@ module Decidim::Admin end it "lists only users with role space_admin" do - get :index, params: params + get(:index, params:) expect(subject).to include(process_admin, assembly_admin) expect(subject).not_to include(admin_user, department_admin_user, user_manager, participant) diff --git a/spec/permissions/decidim/department_admin/department_admin_permissions_spec.rb b/spec/permissions/decidim/department_admin/department_admin_permissions_spec.rb index 519efb1..b127f82 100644 --- a/spec/permissions/decidim/department_admin/department_admin_permissions_spec.rb +++ b/spec/permissions/decidim/department_admin/department_admin_permissions_spec.rb @@ -7,17 +7,17 @@ module DepartmentAdmin describe Permissions do let(:area) { create(:area) } let!(:user) do - create(:department_admin, :confirmed, organization: area.organization, area: area) + create(:department_admin, :confirmed, organization: area.organization, area:) end def should_allow_action(scope, action, subject) - action = PermissionAction.new(scope: scope, action: action, subject: subject) + action = PermissionAction.new(scope:, action:, subject:) permissions = DepartmentAdmin::Permissions.new(user, action) expect(permissions.permissions).to be_allowed end def should_allow_action_with_ctx(scope, action, subject, ctx) - action = PermissionAction.new(scope: scope, action: action, subject: subject) + action = PermissionAction.new(scope:, action:, subject:) permissions = DepartmentAdmin::Permissions.new(user, action, ctx) expect(permissions.permissions).to be_allowed end @@ -65,23 +65,23 @@ def should_allow_action_with_ctx(scope, action, subject, ctx) context "when acction is allowed and context is process" do context "when process has same area as department_admin" do - let(:process) { create(:participatory_process, organization: area.organization, area: area) } - let(:assembly) { create(:assembly, organization: area.organization, area: area) } - let(:conference) { create(:conference, organization: area.organization, area: area) } + let(:process) { create(:participatory_process, organization: area.organization, area:) } + let(:assembly) { create(:assembly, organization: area.organization, area:) } + let(:conference) { create(:conference, organization: area.organization, area:) } it "allows accepted actions with expected context" do should_allow_action_with_ctx(:admin, :read, :participatory_space, current_participatory_space: process) - should_allow_action_with_ctx(:admin, :update, :process, process: process) + should_allow_action_with_ctx(:admin, :update, :process, process:) pps = ParticipatoryProcessStep.new(participatory_process: process) should_allow_action_with_ctx(:admin, :update, :process_step, process_step: pps) should_allow_action_with_ctx(:admin, :destroy, :process_step, process_step: pps) - should_allow_action_with_ctx(:admin, :update, :assembly, assembly: assembly) - should_allow_action_with_ctx(:admin, :update, :conference, conference: conference) + should_allow_action_with_ctx(:admin, :update, :assembly, assembly:) + should_allow_action_with_ctx(:admin, :update, :conference, conference:) # -> {permission_for?(requested_action, :admin, :read, :newsletter, restricted_rsrc: context[:newsletter])}, end context "when meeting has same area as department_admin" do - let(:meeting) { create(:meeing, participatory_space: process, area: area) } + let(:meeting) { create(:meeing, participatory_space: process, area:) } it "allows accepted actions with expected context" do should_allow_action(:admin, :create, :attachment) @@ -94,7 +94,7 @@ def should_allow_action_with_ctx(scope, action, subject, ctx) it "does not allow accepted actions with unexpected context" do action = PermissionAction.new(scope: :admin, action: :update, subject: :process) - permissions = DepartmentAdmin::Permissions.new(user, action, process: process) + permissions = DepartmentAdmin::Permissions.new(user, action, process:) expect { permissions.permissions.allowed? }.to raise_error(Decidim::PermissionAction::PermissionNotSetError) end end @@ -118,3 +118,4 @@ def should_allow_action_with_ctx(scope, action, subject, ctx) end end end +# rubocop:enable RSpec/NoExpectationExample diff --git a/spec/queries/parent_assemblies_for_select_spec.rb b/spec/queries/parent_assemblies_for_select_spec.rb index e112ad1..e813b02 100644 --- a/spec/queries/parent_assemblies_for_select_spec.rb +++ b/spec/queries/parent_assemblies_for_select_spec.rb @@ -7,10 +7,10 @@ module Decidim::Assemblies subject { described_class.for(organization, assembly) } let(:organization) { create(:organization) } - let!(:assembly) { create(:assembly, organization: organization) } - let!(:assemblies) { create_list(:assembly, 3, organization: organization) } - let!(:child_assembly) { create(:assembly, :with_parent, parent: assembly, organization: organization) } - let!(:grand_child_assembly) { create(:assembly, :with_parent, parent: child_assembly, organization: organization) } + let!(:assembly) { create(:assembly, organization:) } + let!(:assemblies) { create_list(:assembly, 3, organization:) } + let!(:child_assembly) { create(:assembly, :with_parent, parent: assembly, organization:) } + let!(:grand_child_assembly) { create(:assembly, :with_parent, parent: child_assembly, organization:) } describe "query" do context "when current_user is nil" do @@ -24,10 +24,10 @@ module Decidim::Assemblies subject { described_class.for(organization, assembly, current_user) } let!(:current_user) do - create(:department_admin, :confirmed, organization: area.organization, area: area) + create(:department_admin, :confirmed, organization: area.organization, area:) end let(:area) { create(:area) } - let!(:assemblies_with_area) { create_list(:assembly, 3, organization: organization, area: area) } + let!(:assemblies_with_area) { create_list(:assembly, 3, organization:, area:) } it "returns assemblies that can be parent with same current user area" do expect(subject.count).to eq(3) diff --git a/spec/system/admin_explores_processes_spec.rb b/spec/system/admin_explores_processes_spec.rb index 366c053..dab7a8b 100644 --- a/spec/system/admin_explores_processes_spec.rb +++ b/spec/system/admin_explores_processes_spec.rb @@ -2,12 +2,12 @@ require "spec_helper" -describe "Admin explores processes", type: :system do +describe "Admin explores processes" do let(:organization) { create(:organization) } - let!(:area) { create(:area, organization: organization) } - let!(:process) { create(:participatory_process, organization: organization, area: area) } + let!(:area) { create(:area, organization:) } + let!(:process) { create(:participatory_process, organization:, area:) } - let!(:admin) { create(:user, :admin, :confirmed, organization: organization) } + let!(:admin) { create(:user, :admin, :confirmed, organization:) } before do switch_to_host(organization.host) @@ -16,7 +16,7 @@ describe "when there are admins of all types" do let!(:department_admin) do - user = create(:user, :confirmed, organization: organization) + user = create(:user, :confirmed, organization:) user.roles << "department_admin" user.areas << area user.save! diff --git a/spec/system/admin_invite_department_admin_spec.rb b/spec/system/admin_invite_department_admin_spec.rb index f8ffece..f168c31 100644 --- a/spec/system/admin_invite_department_admin_spec.rb +++ b/spec/system/admin_invite_department_admin_spec.rb @@ -6,16 +6,16 @@ # To "downgrade" an admin to department_admin, it must first be removed from admins # create a new admin as department_admin. # -describe "Admin invite user", type: :system do +describe "Admin invite user" do let!(:area) { create(:area) } let(:organization) { create(:organization) } - let!(:admin) { create(:user, :admin, :confirmed, organization: organization) } - let(:user_manager) { create(:user, :user_manager, :confirmed, organization: organization) } + let!(:admin) { create(:user, :admin, :confirmed, organization:) } + let(:user_manager) { create(:user, :user_manager, :confirmed, organization:) } let(:department_admin) do - user = create(:user, :confirmed, organization: organization) + user = create(:user, :confirmed, organization:) user.roles << "department_admin" user.areas << area user.save! @@ -75,9 +75,9 @@ def fill_the_form_for_department_admin(name, email, selected_area = area) within "form.new_user" do fill_in :user_name, with: name fill_in :user_email, with: email - find("#user_role").find("option[value='department_admin']").select_option + find_by_id("user_role").find("option[value='department_admin']").select_option expect(page).to have_css("#user_area_id") - find("#user_area_id").find("option[value='#{selected_area.id}']").select_option + find_by_id("user_area_id").find("option[value='#{selected_area.id}']").select_option end end @@ -85,7 +85,7 @@ def fill_the_form_for_admin(name, email, _selected_area = area) within "form.new_user" do fill_in :user_name, with: name fill_in :user_email, with: email - find("#user_role").find("option[value='admin']").select_option + find_by_id("user_role").find("option[value='admin']").select_option end end @@ -99,14 +99,14 @@ def check_succeess end def check_is_admin(email) - user = Decidim::User.find_by(email: email).reload + user = Decidim::User.find_by(email:).reload expect(user).to be_admin expect(user.roles).not_to include("department_admin") expect(user.areas).to be_empty end def check_is_department_admin(email) - user = Decidim::User.find_by(email: email) + user = Decidim::User.find_by(email:) expect(user.roles).to include("department_admin") user end diff --git a/spec/system/department_admin_manages_newsletters_spec.rb b/spec/system/department_admin_manages_newsletters_spec.rb index fcabef4..2399cfa 100644 --- a/spec/system/department_admin_manages_newsletters_spec.rb +++ b/spec/system/department_admin_manages_newsletters_spec.rb @@ -2,11 +2,11 @@ require "spec_helper" -describe "Admin manages newsletters", type: :system do +describe "Admin manages newsletters" do let(:organization) { create(:organization) } - let(:area) { create(:area, organization: organization) } - let(:department_admin) { create(:department_admin, :confirmed, name: "Sarah Kerrigan", organization: organization, area: area) } - let!(:deliverable_users) { create_list(:user, 5, :confirmed, newsletter_notifications_at: Time.current, organization: organization) } + let(:area) { create(:area, organization:) } + let(:department_admin) { create(:department_admin, :confirmed, name: "Sarah Kerrigan", organization:, area:) } + let!(:deliverable_users) { create_list(:user, 5, :confirmed, newsletter_notifications_at: Time.current, organization:) } before do switch_to_host(organization.host) @@ -46,7 +46,7 @@ def fill_newsletter_form end within "#basic_only_text .card-footer" do - click_link("Use this template") + click_link_or_button("Use this template") end within "#new_newsletter_" do @@ -61,7 +61,7 @@ def fill_newsletter_form context "with existing newsletter" do let!(:newsletter) do create(:newsletter, - organization: organization, + organization:, subject: { en: "A fancy newsletter for %{name}", es: "Un correo electrónico muy chulo para %{name}", @@ -87,12 +87,12 @@ def fill_newsletter_form end context "when updating the newsletter" do - let!(:newsletter) { create(:newsletter, organization: organization, author: department_admin) } + let!(:newsletter) { create(:newsletter, organization:, author: department_admin) } it "allows a newsletter to be updated" do visit decidim_admin.newsletters_path within("tr[data-newsletter-id=\"#{newsletter.id}\"]") do - click_link "Edit" + click_link_or_button "Edit" end within ".edit_newsletter" do @@ -105,10 +105,10 @@ def fill_newsletter_form end context "when selecting newsletter recipients" do - let!(:newsletter) { create(:newsletter, organization: organization, author: department_admin) } + let!(:newsletter) { create(:newsletter, organization:, author: department_admin) } context "when followers are selected" do - let!(:participatory_processes) { create_list(:participatory_process, 2, organization: organization, area: area) } + let!(:participatory_processes) { create_list(:participatory_process, 2, organization:, area:) } let!(:followers) do deliverable_users.each do |follower| create(:follow, followable: participatory_processes.first, user: follower) @@ -142,12 +142,12 @@ def fill_newsletter_form end context "when participants are selected" do - let!(:participatory_process) { create(:participatory_process, organization: organization, area: area) } + let!(:participatory_process) { create(:participatory_process, organization:, area:) } let!(:component) { create(:dummy_component, organization: newsletter.organization, participatory_space: participatory_process) } before do deliverable_users.each do |participant| - create(:dummy_resource, component: component, author: participant, published_at: Time.current) + create(:dummy_resource, component:, author: participant, published_at: Time.current) end end @@ -178,7 +178,7 @@ def fill_newsletter_form end context "when selecting both followers and participants" do - let!(:participatory_process) { create(:participatory_process, organization: organization, area: area) } + let!(:participatory_process) { create(:participatory_process, organization:, area:) } let!(:component) { create(:dummy_component, organization: newsletter.organization, participatory_space: participatory_process) } let!(:followers) do @@ -189,7 +189,7 @@ def fill_newsletter_form before do deliverable_users.each do |participant| - create(:dummy_resource, component: component, author: participant, published_at: Time.current) + create(:dummy_resource, component:, author: participant, published_at: Time.current) end end @@ -221,13 +221,13 @@ def fill_newsletter_form end context "when deleting a newsletter" do - let!(:newsletter) { create(:newsletter, organization: organization, author: department_admin) } + let!(:newsletter) { create(:newsletter, organization:, author: department_admin) } it "deletes a newsletter" do visit decidim_admin.newsletters_path within("tr[data-newsletter-id=\"#{newsletter.id}\"]") do - accept_confirm { click_link "Delete" } + accept_confirm { click_link_or_button "Delete" } end expect(page).to have_content("successfully") diff --git a/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb b/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb index 366c759..393ed9a 100644 --- a/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb +++ b/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb @@ -2,11 +2,11 @@ require "spec_helper" -describe "Department admin should be able to access Admin Dashboard", type: :system do +describe "Department admin should be able to access Admin Dashboard" do let(:organization) { create(:organization) } let(:area) { create(:area) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area, accepted_tos_version: Time.current) } - let!(:process) { create(:participatory_process, :published, organization: organization, area: area) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:, accepted_tos_version: Time.current) } + let!(:process) { create(:participatory_process, :published, organization:, area:) } before do switch_to_host(organization.host) @@ -22,35 +22,35 @@ context "when accessing the dashboard some left menu elements should be accessible" do it "is able to access 'Processes'" do expect(page).to have_content("Processes") - click_link "Processes" + click_link_or_button "Processes" expect(page).to have_current_path "/admin/participatory_processes" expect(page).to have_content("Participatory processes") end it "is able to access 'Assemblies'" do expect(page).to have_content("Assemblies") - click_link "Assemblies" + click_link_or_button "Assemblies" expect(page).to have_current_path "/admin/assemblies" expect(page).to have_content("New assembly") end it "is able to access 'Participants'" do expect(page).to have_content("Participants") - click_link "Participants" + click_link_or_button "Participants" expect(page).to have_current_path "/admin/users" expect(page).to have_content("New admin") end it "is able to access 'Newsletter'" do expect(page).to have_content("Newsletter") - click_link "Newsletter" + click_link_or_button "Newsletter" expect(page).to have_current_path "/admin/newsletters" expect(page).to have_content("New newsletter") end it "is able to access 'Conferences'" do expect(page).to have_content("Conferences") - click_link "Conferences" + click_link_or_button "Conferences" expect(page).to have_current_path "/admin/conferences" expect(page).to have_content("New Conference") end @@ -61,15 +61,15 @@ context "when accessing the dashboard some left menu elements should NOT be accessible" do it "is not able to access 'Pages'" do - expect(page).not_to have_content("Pages") + expect(page).to have_no_content("Pages") end it "is not able to access 'Settings'" do - expect(page).not_to have_content("Settings") + expect(page).to have_no_content("Settings") end it "is not able to access 'Admin Activity Log'" do - expect(page).not_to have_content("Admin activity log") + expect(page).to have_no_content("Admin activity log") end end end diff --git a/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb b/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb index d2c5561..e74339f 100644 --- a/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb +++ b/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb @@ -2,10 +2,10 @@ require "spec_helper" -describe "Admin manages assemblies", versioning: true, type: :system do +describe "Admin manages assemblies", :versioning do let(:organization) { create(:organization) } - let(:area) { create(:area, organization: organization) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:area) { create(:area, organization:) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } before do switch_to_host(organization.host) @@ -18,11 +18,11 @@ let(:image2_filename) { "city2.jpeg" } let(:image2_path) { Decidim::Dev.asset(image2_filename) } - let(:attributes) { attributes_for(:assembly, organization: organization) } + let(:attributes) { attributes_for(:assembly, organization:) } before do visit decidim_admin_assemblies.assemblies_path - click_link "New assembly" + click_link_or_button "New assembly" end it "creates a new assembly" do @@ -67,7 +67,7 @@ context "when managing parent assemblies" do let(:parent_assembly) { nil } - let!(:assembly) { create :assembly, organization: organization } + let!(:assembly) { create(:assembly, organization:) } before do switch_to_host(organization.host) @@ -80,16 +80,16 @@ end context "when managing child assemblies" do - let!(:parent_assembly) { create :assembly, organization: organization, area: area } - let!(:child_assembly) { create :assembly, organization: organization, parent: parent_assembly, area: area } + let!(:parent_assembly) { create(:assembly, organization:, area:) } + let!(:child_assembly) { create(:assembly, organization:, parent: parent_assembly, area:) } let(:assembly) { child_assembly } before do switch_to_host(organization.host) login_as department_admin, scope: :user visit decidim_admin_assemblies.assemblies_path - within find("tr", text: translated(parent_assembly.title)) do - click_link "Assemblies" + within "tr", text: translated(parent_assembly.title) do + click_link_or_button "Assemblies" end end diff --git a/spec/system/department_admin_should_be_able_to_manage_conferences_spec.rb b/spec/system/department_admin_should_be_able_to_manage_conferences_spec.rb index 5efa7bc..8d21eb8 100644 --- a/spec/system/department_admin_should_be_able_to_manage_conferences_spec.rb +++ b/spec/system/department_admin_should_be_able_to_manage_conferences_spec.rb @@ -2,10 +2,10 @@ require "spec_helper" -describe "Admin manages conferences", versioning: true, type: :system do +describe "Admin manages conferences", :versioning do let(:organization) { create(:organization) } - let(:area) { create(:area, organization: organization) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:area) { create(:area, organization:) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } before do switch_to_host(organization.host) @@ -21,7 +21,7 @@ before do visit decidim_admin_conferences.assemblies_path - click_link "New conference" + click_link_or_button "New conference" end it "creates a new conference" do diff --git a/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb b/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb index b656099..4223b7b 100644 --- a/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb +++ b/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb @@ -2,13 +2,13 @@ require "spec_helper" -describe "Admin manages participatory processes", versioning: true, type: :system do +describe "Admin manages participatory processes", :versioning do let(:organization) { create(:organization) } - let(:area) { create(:area, organization: organization) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:area) { create(:area, organization:) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } let!(:participatory_process_groups) do - create_list(:participatory_process_group, 3, organization: organization) + create_list(:participatory_process_group, 3, organization:) end before do @@ -21,7 +21,7 @@ # it_behaves_like "manage processes announcements" context "with processes" do - let!(:participatory_process) { create(:participatory_process, organization: organization, area: area, participatory_process_group: participatory_process_groups.first) } + let!(:participatory_process) { create(:participatory_process, organization:, area:, participatory_process_group: participatory_process_groups.first) } it "browses the list of processes" do visit decidim_admin_participatory_processes.participatory_processes_path @@ -37,7 +37,7 @@ let(:image2_path) { Decidim::Dev.asset(image2_filename) } before do - click_link "New process" + click_link_or_button_or_button "New process" end it "creates a new participatory process with department admin's area" do @@ -97,16 +97,16 @@ end context "when updating a participatory process" do - let!(:participatory_process_3) { create(:participatory_process, organization: organization, area: area) } + let!(:participatory_process_3) { create(:participatory_process, organization:, area:) } before do visit decidim_admin_participatory_processes.participatory_processes_path end it "update a participatory process without images does not delete them" do - click_link translated(participatory_process_3.title) + click_link_or_button translated(participatory_process_3.title) click_submenu_link "Info" - click_button "Update" + click_link_or_button "Update" expect(participatory_process_3.reload.area).to eq(area) expect(page).to have_admin_callout("successfully") diff --git a/spec/system/department_admin_should_be_able_to_see_only_assemblies_from_her_area_spec.rb b/spec/system/department_admin_should_be_able_to_see_only_assemblies_from_her_area_spec.rb index c8f2c27..ae4fab7 100644 --- a/spec/system/department_admin_should_be_able_to_see_only_assemblies_from_her_area_spec.rb +++ b/spec/system/department_admin_should_be_able_to_see_only_assemblies_from_her_area_spec.rb @@ -2,13 +2,13 @@ require "spec_helper" -describe "Admin manages assemblies", versioning: true, type: :system do +describe "Admin manages assemblies", :versioning do let(:organization) { create(:organization) } let(:area) { create(:area) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } - let!(:assembly_w_area) { create(:assembly, organization: organization, area: area) } - let!(:assembly_wo_area) { create(:assembly, organization: organization) } + let!(:assembly_w_area) { create(:assembly, organization:, area:) } + let!(:assembly_wo_area) { create(:assembly, organization:) } def visit_admin_assemblies_list switch_to_host(organization.host) @@ -29,7 +29,7 @@ def visit_admin_assemblies_list it "sees only processes in the same area" do visit_admin_assemblies_list expect(page).to have_content(assembly_w_area.title["en"]) - expect(page).not_to have_content(assembly_wo_area.title["en"]) + expect(page).to have_no_content(assembly_wo_area.title["en"]) end context "when department_admin has a user_role in an assembly_wo_area" do diff --git a/spec/system/department_admin_should_be_able_to_see_only_newsletters_from_her_area_spec.rb b/spec/system/department_admin_should_be_able_to_see_only_newsletters_from_her_area_spec.rb index 10e2ada..22ca060 100644 --- a/spec/system/department_admin_should_be_able_to_see_only_newsletters_from_her_area_spec.rb +++ b/spec/system/department_admin_should_be_able_to_see_only_newsletters_from_her_area_spec.rb @@ -2,15 +2,15 @@ require "spec_helper" -describe "Admin manages newsletters", versioning: true, type: :system do +describe "Admin manages newsletters", :versioning do let(:organization) { create(:organization) } let(:area) { create(:area) } - let(:admin) { create(:user, :admin, :confirmed, organization: organization) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:admin) { create(:user, :admin, :confirmed, organization:) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } let!(:newsletter_w_area) do create(:newsletter, - organization: organization, + organization:, subject: { en: "A fancy newsletter for %{name}", es: "Un correo electrónico muy chulo para %{name}", @@ -26,7 +26,7 @@ let!(:newsletter_wo_area) do create(:newsletter, - organization: organization, + organization:, subject: { en: "A fancy newsletter for %{name} without area", es: "Un correo electrónico muy chulo para %{name} sin area", @@ -48,6 +48,6 @@ it "sees only newsletters in the same area" do expect(page).to have_content(newsletter_w_area.subject["en"]) - expect(page).not_to have_content(newsletter_wo_area.subject["en"]) + expect(page).to have_no_content(newsletter_wo_area.subject["en"]) end end diff --git a/spec/system/department_admin_should_be_able_to_see_only_processes_from_her_area_spec.rb b/spec/system/department_admin_should_be_able_to_see_only_processes_from_her_area_spec.rb index 19b41db..312812d 100644 --- a/spec/system/department_admin_should_be_able_to_see_only_processes_from_her_area_spec.rb +++ b/spec/system/department_admin_should_be_able_to_see_only_processes_from_her_area_spec.rb @@ -2,16 +2,16 @@ require "spec_helper" -describe "Admin manages participatory processes", versioning: true, type: :system do +describe "Admin manages participatory processes", :versioning do let(:organization) { create(:organization) } let(:area) { create(:area) } - let(:department_admin) { create(:department_admin, :confirmed, organization: organization, area: area) } + let(:department_admin) { create(:department_admin, :confirmed, organization:, area:) } let!(:participatory_process_w_area) do - create(:participatory_process, organization: organization, area: area) + create(:participatory_process, organization:, area:) end let!(:participatory_process_wo_area) do - create(:participatory_process, organization: organization) + create(:participatory_process, organization:) end def visit_admin_processes_list @@ -33,7 +33,7 @@ def visit_admin_processes_list it "sees only processes in the same area" do visit_admin_processes_list expect(page).to have_content(participatory_process_w_area.title["en"]) - expect(page).not_to have_content(participatory_process_wo_area.title["en"]) + expect(page).to have_no_content(participatory_process_wo_area.title["en"]) end context "when department_admin has a user_role in a participatory_process_wo_area" do