From 0ad6da3550077241a569697eccf2d356677e184a Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:40:26 +0200 Subject: [PATCH 1/4] Refactor lib/decidim/verify_wo_registration/version.rb --- CHANGELOG.md | 4 ++++ decidim-verify_wo_registration.gemspec | 14 +++++++------- lib/decidim/verify_wo_registration/version.rb | 9 ++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b93d9d0..d726001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog Current version is defined at `lib/decidim/verify_wo_registration/version.rb` +## Version 0.0.4 + +- Refactors in lib/decidim/verify_wo_registration/version.rb + ## Version 0.0.3 - Make module compatible with Decidim 0.26 diff --git a/decidim-verify_wo_registration.gemspec b/decidim-verify_wo_registration.gemspec index 01ac546..a460708 100644 --- a/decidim-verify_wo_registration.gemspec +++ b/decidim-verify_wo_registration.gemspec @@ -18,11 +18,11 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,lib}/**/*', 'LICENSE-MIT.txt', 'Rakefile', 'README.md'] - DECIDIM_VER = '>= 0.26' - s.add_dependency 'decidim-budgets', DECIDIM_VER - s.add_dependency 'decidim-core', DECIDIM_VER - s.add_dependency 'decidim-proposals', DECIDIM_VER - s.add_development_dependency 'decidim', DECIDIM_VER - s.add_development_dependency 'decidim-dev', DECIDIM_VER - s.add_development_dependency 'decidim-participatory_processes', DECIDIM_VER + + s.add_dependency 'decidim-budgets', Decidim::VerifyWoRegistration.version + s.add_dependency 'decidim-core', Decidim::VerifyWoRegistration.version + s.add_dependency 'decidim-proposals', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim-dev', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim-participatory_processes', Decidim::VerifyWoRegistration.version end diff --git a/lib/decidim/verify_wo_registration/version.rb b/lib/decidim/verify_wo_registration/version.rb index 858c6c1..af80503 100644 --- a/lib/decidim/verify_wo_registration/version.rb +++ b/lib/decidim/verify_wo_registration/version.rb @@ -3,8 +3,15 @@ module Decidim # This holds the decidim-meetings version. module VerifyWoRegistration + VERSION = '0.0.4' + DECIDIM_VER = '>= 0.26' + def self.version - '0.0.3' + VERSION + end + + def self.decidim_version + DECIDIM_VER end end end From 46ee8e9ac83aa93a58865d2b7c69073507e952b3 Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:40:26 +0200 Subject: [PATCH 2/4] Refactor lib/decidim/verify_wo_registration/version.rb --- CHANGELOG.md | 4 ++++ decidim-verify_wo_registration.gemspec | 14 +++++++------- lib/decidim/verify_wo_registration/version.rb | 9 ++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b93d9d0..b2aa7cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog Current version is defined at `lib/decidim/verify_wo_registration/version.rb` +## Version 0.0.4 + +- Refactor lib/decidim/verify_wo_registration/version.rb + ## Version 0.0.3 - Make module compatible with Decidim 0.26 diff --git a/decidim-verify_wo_registration.gemspec b/decidim-verify_wo_registration.gemspec index 01ac546..a460708 100644 --- a/decidim-verify_wo_registration.gemspec +++ b/decidim-verify_wo_registration.gemspec @@ -18,11 +18,11 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,lib}/**/*', 'LICENSE-MIT.txt', 'Rakefile', 'README.md'] - DECIDIM_VER = '>= 0.26' - s.add_dependency 'decidim-budgets', DECIDIM_VER - s.add_dependency 'decidim-core', DECIDIM_VER - s.add_dependency 'decidim-proposals', DECIDIM_VER - s.add_development_dependency 'decidim', DECIDIM_VER - s.add_development_dependency 'decidim-dev', DECIDIM_VER - s.add_development_dependency 'decidim-participatory_processes', DECIDIM_VER + + s.add_dependency 'decidim-budgets', Decidim::VerifyWoRegistration.version + s.add_dependency 'decidim-core', Decidim::VerifyWoRegistration.version + s.add_dependency 'decidim-proposals', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim-dev', Decidim::VerifyWoRegistration.version + s.add_development_dependency 'decidim-participatory_processes', Decidim::VerifyWoRegistration.version end diff --git a/lib/decidim/verify_wo_registration/version.rb b/lib/decidim/verify_wo_registration/version.rb index 858c6c1..af80503 100644 --- a/lib/decidim/verify_wo_registration/version.rb +++ b/lib/decidim/verify_wo_registration/version.rb @@ -3,8 +3,15 @@ module Decidim # This holds the decidim-meetings version. module VerifyWoRegistration + VERSION = '0.0.4' + DECIDIM_VER = '>= 0.26' + def self.version - '0.0.3' + VERSION + end + + def self.decidim_version + DECIDIM_VER end end end From 4acf5087a7ac0d89079bee39278c3b13d3d21bca Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:55:58 +0200 Subject: [PATCH 3/4] Upgrade to Decidim v0.27 requirements --- .ruby-version | 2 +- CHANGELOG.md | 5 +++++ Gemfile | 6 +++--- .../do_verify_wo_registration.rb | 2 +- decidim-verify_wo_registration.gemspec | 14 +++++++------- lib/decidim/verify_wo_registration/version.rb | 4 ++-- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.ruby-version b/.ruby-version index a603bb5..d9c62ed 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.5 +3.0.2 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b2aa7cc..8a7f01e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog Current version is defined at `lib/decidim/verify_wo_registration/version.rb` +## Version 0.1.0 + +- Upgrade min Decidim version to v0.27. +- The rectify gem has been removed from the Decidim v0.27 stack. Thus, also removed from this module. + ## Version 0.0.4 - Refactor lib/decidim/verify_wo_registration/version.rb diff --git a/Gemfile b/Gemfile index dd4734f..3123504 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' ruby RUBY_VERSION -DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim', branch: "release/0.26-stable" }.freeze +DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim', branch: "release/0.27-stable" }.freeze gem 'decidim-budgets', DECIDIM_VERSION gem 'decidim-core', DECIDIM_VERSION gem 'decidim-proposals', DECIDIM_VERSION @@ -25,7 +25,7 @@ group :development do gem 'faker', '~> 2.14' gem 'letter_opener_web', '~> 1.3' gem 'listen', '~> 3.1' - gem 'spring', '~> 2.0' - gem 'spring-watcher-listen', '~> 2.0' + gem 'spring'#, '~> 2.0' + gem 'spring-watcher-listen'#, '~> 2.0' gem 'web-console', '~> 3.5' end diff --git a/app/commands/decidim/verify_wo_registration/do_verify_wo_registration.rb b/app/commands/decidim/verify_wo_registration/do_verify_wo_registration.rb index ec16ef5..4ffe1dc 100644 --- a/app/commands/decidim/verify_wo_registration/do_verify_wo_registration.rb +++ b/app/commands/decidim/verify_wo_registration/do_verify_wo_registration.rb @@ -3,7 +3,7 @@ module Decidim module VerifyWoRegistration # A command with all the business logic to verify and impersonate (managed user). - class DoVerifyWoRegistration < Rectify::Command + class DoVerifyWoRegistration < Decidim::Command # Public: Initializes the command. # # form - The form with the authorization info diff --git a/decidim-verify_wo_registration.gemspec b/decidim-verify_wo_registration.gemspec index a460708..a84b4b3 100644 --- a/decidim-verify_wo_registration.gemspec +++ b/decidim-verify_wo_registration.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |s| s.email = ['oliver.vh@coditramuntana.com'] s.license = 'MIT' s.homepage = 'https://github.com/CodiTramuntana/decidim-verify_wo_registration' - s.required_ruby_version = '>= 2.5' + s.required_ruby_version = '>= 3.0.2' s.name = 'decidim-verify_wo_registration' s.summary = 'Adds the hability for proposals and budgets components to allow users to give support without being registered.' @@ -19,10 +19,10 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,lib}/**/*', 'LICENSE-MIT.txt', 'Rakefile', 'README.md'] - s.add_dependency 'decidim-budgets', Decidim::VerifyWoRegistration.version - s.add_dependency 'decidim-core', Decidim::VerifyWoRegistration.version - s.add_dependency 'decidim-proposals', Decidim::VerifyWoRegistration.version - s.add_development_dependency 'decidim', Decidim::VerifyWoRegistration.version - s.add_development_dependency 'decidim-dev', Decidim::VerifyWoRegistration.version - s.add_development_dependency 'decidim-participatory_processes', Decidim::VerifyWoRegistration.version + s.add_dependency 'decidim-budgets', Decidim::VerifyWoRegistration.decidim_version + s.add_dependency 'decidim-core', Decidim::VerifyWoRegistration.decidim_version + s.add_dependency 'decidim-proposals', Decidim::VerifyWoRegistration.decidim_version + s.add_development_dependency 'decidim', Decidim::VerifyWoRegistration.decidim_version + s.add_development_dependency 'decidim-dev', Decidim::VerifyWoRegistration.decidim_version + s.add_development_dependency 'decidim-participatory_processes', Decidim::VerifyWoRegistration.decidim_version end diff --git a/lib/decidim/verify_wo_registration/version.rb b/lib/decidim/verify_wo_registration/version.rb index af80503..9805000 100644 --- a/lib/decidim/verify_wo_registration/version.rb +++ b/lib/decidim/verify_wo_registration/version.rb @@ -3,8 +3,8 @@ module Decidim # This holds the decidim-meetings version. module VerifyWoRegistration - VERSION = '0.0.4' - DECIDIM_VER = '>= 0.26' + VERSION = '0.1.0' + DECIDIM_VER = '>= 0.27' def self.version VERSION From be6fb5c319a87239d5e7e3627d7aa1aaee4a5773 Mon Sep 17 00:00:00 2001 From: Oliver Valls <199462+tramuntanal@users.noreply.github.com> Date: Thu, 15 Jun 2023 19:16:55 +0200 Subject: [PATCH 4/4] Make tests succeed --- Gemfile | 4 ++-- .../decidim/verify_wo_registration/extend_component_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 3123504..3909aa9 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ group :development do gem 'faker', '~> 2.14' gem 'letter_opener_web', '~> 1.3' gem 'listen', '~> 3.1' - gem 'spring'#, '~> 2.0' - gem 'spring-watcher-listen'#, '~> 2.0' + gem 'spring', '~> 4.0' + gem 'spring-watcher-listen', '~> 2.1' gem 'web-console', '~> 3.5' end diff --git a/spec/lib/decidim/verify_wo_registration/extend_component_spec.rb b/spec/lib/decidim/verify_wo_registration/extend_component_spec.rb index 8b64307..6cbea82 100644 --- a/spec/lib/decidim/verify_wo_registration/extend_component_spec.rb +++ b/spec/lib/decidim/verify_wo_registration/extend_component_spec.rb @@ -4,7 +4,7 @@ RSpec.shared_examples 'has global setting' do |attr_name, attr_type| it 'has attribute' do - attribute = global_settings.schema.attribute_set.find { |a| a.name == attr_name } + attribute = global_settings.attributes[attr_name] expect(attribute).to be_present expect(attribute.type).to eq(attr_type) end @@ -15,13 +15,13 @@ let!(:component_manifest) { Decidim.find_component_manifest :budgets } let(:global_settings) { component_manifest.settings(:global) } - it_behaves_like 'has global setting', :supports_without_registration, Axiom::Types::Boolean + it_behaves_like 'has global setting', :supports_without_registration, :boolean end context 'proposals settings' do let!(:component_manifest) { Decidim.find_component_manifest :proposals } let(:global_settings) { component_manifest.settings(:global) } - it_behaves_like 'has global setting', :supports_without_registration, Axiom::Types::Boolean + it_behaves_like 'has global setting', :supports_without_registration, :boolean end end