diff --git a/Gemfile b/Gemfile index 75704d83a2..c348f89dab 100644 --- a/Gemfile +++ b/Gemfile @@ -16,10 +16,12 @@ gem "decidim-conferences", "~> #{DECIDIM_VERSION}.0" gem "decidim-templates", "~> #{DECIDIM_VERSION}.0" # External Decidim gems +gem "decidim-budgets_booth", github: "OpenSourcePolitics/decidim-module-ptp", branch: "feature/0.26/zip-code-voting" gem "decidim-cache_cleaner" gem "decidim-decidim_awesome" gem "decidim-friendly_signup", git: "https://github.com/OpenSourcePolitics/decidim-module-friendly_signup.git" gem "decidim-gallery" +gem "decidim-half_signup", github: "OpenSourcePolitics/decidim-module-half_sign_up", branch: DECIDIM_BRANCH gem "decidim-homepage_interactive_map", git: "https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git", branch: DECIDIM_BRANCH gem "decidim-ludens", git: "https://github.com/OpenSourcePolitics/decidim-ludens.git", branch: DECIDIM_BRANCH gem "decidim-phone_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler", branch: DECIDIM_BRANCH diff --git a/Gemfile.lock b/Gemfile.lock index f5c3111b4b..baddc9b11e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,6 +13,15 @@ GIT decidim-friendly_signup (0.4.4) decidim-core (~> 0.26.0) +GIT + remote: https://github.com/OpenSourcePolitics/decidim-module-half_sign_up.git + revision: a105c5815be7f1ca18cd827b5a475318ada08dfb + branch: release/0.26-stable + specs: + decidim-half_signup (0.26.0) + countries (~> 5.1, >= 5.1.2) + decidim-core (~> 0.26.0) + GIT remote: https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git revision: 4e6b7a1a5fcfa0661ba93d1bedb2e09da66d5326 @@ -25,6 +34,15 @@ GIT rgeo (~> 2.4) rgeo-proj4 (~> 3.1) +GIT + remote: https://github.com/OpenSourcePolitics/decidim-module-ptp.git + revision: 6148a817251256d6f536f1f3478c8be895a518b0 + branch: feature/0.26/zip-code-voting + specs: + decidim-budgets_booth (0.26.0) + decidim-budgets (~> 0.26.0) + decidim-core (~> 0.26.0) + GIT remote: https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler revision: 488cc8827845ec1c5266aa499df2ebf9b20e02a3 @@ -228,6 +246,8 @@ GEM coffee-script-source (1.12.2) concurrent-ruby (1.2.2) connection_pool (2.4.1) + countries (5.7.1) + unaccent (~> 0.3) crack (0.4.5) rexml crass (1.0.6) @@ -564,7 +584,7 @@ GEM bindata faraday (~> 2.0) faraday-follow_redirects - jwt (2.7.1) + jwt (2.5.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -938,6 +958,7 @@ GEM tzinfo (1.2.11) thread_safe (~> 0.1) uber (0.1.0) + unaccent (0.4.0) unicode-display_width (1.8.0) valid_email2 (2.3.1) activemodel (>= 3.2) @@ -1011,12 +1032,14 @@ DEPENDENCIES climate_control (~> 1.2) dalli decidim (~> 0.26.0) + decidim-budgets_booth! decidim-cache_cleaner decidim-conferences (~> 0.26.0) decidim-decidim_awesome decidim-dev (~> 0.26.0) decidim-friendly_signup! decidim-gallery + decidim-half_signup! decidim-homepage_interactive_map! decidim-ludens! decidim-phone_authorization_handler! diff --git a/db/migrate/20240206101716_create_auth_settings.decidim_half_signup.rb b/db/migrate/20240206101716_create_auth_settings.decidim_half_signup.rb new file mode 100644 index 0000000000..cee337ec59 --- /dev/null +++ b/db/migrate/20240206101716_create_auth_settings.decidim_half_signup.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This migration comes from decidim_half_signup (originally 20230214091207) + +class CreateAuthSettings < ActiveRecord::Migration[6.0] + def change + create_table :decidim_half_signup_auth_settings do |t| + t.boolean :enable_partial_sms_signup, default: false + t.boolean :enable_partial_email_signup, default: false + t.string :slug + t.references :decidim_organization, foreign_key: true, index: { name: :index_half_signup_auth_settings_on_organization_id } + + t.timestamps + end + end +end diff --git a/db/migrate/20240206101717_add_phone_number_to_decidim_user.decidim_half_signup.rb b/db/migrate/20240206101717_add_phone_number_to_decidim_user.decidim_half_signup.rb new file mode 100644 index 0000000000..084693913e --- /dev/null +++ b/db/migrate/20240206101717_add_phone_number_to_decidim_user.decidim_half_signup.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# This migration comes from decidim_half_signup (originally 20230215093510) + +class AddPhoneNumberToDecidimUser < ActiveRecord::Migration[6.0] + def change + add_column :decidim_users, :phone_number, :string + add_column :decidim_users, :phone_country, :string + end +end diff --git a/db/migrate/20240206102829_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb b/db/migrate/20240206102829_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb new file mode 100644 index 0000000000..5c02f634f6 --- /dev/null +++ b/db/migrate/20240206102829_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This migration comes from decidim_budgets_booth (originally 20230301155948) + +class AddMainImageToDecidimBudgetsBudgets < ActiveRecord::Migration[6.0] + def change + add_column :decidim_budgets_budgets, :main_image, :string + end +end diff --git a/db/migrate/20240206102830_create_decidim_budgets_user_data.decidim_budgets_booth.rb b/db/migrate/20240206102830_create_decidim_budgets_user_data.decidim_budgets_booth.rb new file mode 100644 index 0000000000..0d53f9a431 --- /dev/null +++ b/db/migrate/20240206102830_create_decidim_budgets_user_data.decidim_budgets_booth.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This migration comes from decidim_budgets_booth (originally 20230303144938) + +class CreateDecidimBudgetsUserData < ActiveRecord::Migration[6.0] + def change + create_table :decidim_budgets_user_data do |t| + t.jsonb :metadata + t.boolean :affirm_statements_are_correct, default: false + t.references :decidim_component, null: false, indec: true + t.references :decidim_user, null: false, index: true + + t.timestamps + end + + add_index :decidim_budgets_user_data, [:decidim_component_id, :decidim_user_id], unique: true, name: "decidim_budgets_user_data_unique_user_and_component" + end +end diff --git a/db/schema.rb b/db/schema.rb index ca5b7830fb..c20134f147 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_06_12_152044) do +ActiveRecord::Schema.define(version: 2024_02_06_102830) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -341,6 +341,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "decidim_scope_id" + t.string "main_image" t.index ["decidim_component_id"], name: "index_decidim_budgets_budgets_on_decidim_component_id" t.index ["decidim_scope_id"], name: "index_decidim_budgets_budgets_on_decidim_scope_id" end @@ -382,6 +383,18 @@ t.index ["decidim_scope_id"], name: "index_decidim_budgets_projects_on_decidim_scope_id" end + create_table "decidim_budgets_user_data", force: :cascade do |t| + t.jsonb "metadata" + t.boolean "affirm_statements_are_correct", default: false + t.bigint "decidim_component_id", null: false + t.bigint "decidim_user_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["decidim_component_id", "decidim_user_id"], name: "decidim_budgets_user_data_unique_user_and_component", unique: true + t.index ["decidim_component_id"], name: "index_decidim_budgets_user_data_on_decidim_component_id" + t.index ["decidim_user_id"], name: "index_decidim_budgets_user_data_on_decidim_user_id" + end + create_table "decidim_calendar_external_events", force: :cascade do |t| t.jsonb "title", null: false t.datetime "start_at", null: false @@ -838,6 +851,16 @@ t.index ["user_id"], name: "index_decidim_gamification_badge_scores_on_user_id" end + create_table "decidim_half_signup_auth_settings", force: :cascade do |t| + t.boolean "enable_partial_sms_signup", default: false + t.boolean "enable_partial_email_signup", default: false + t.string "slug" + t.bigint "decidim_organization_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["decidim_organization_id"], name: "index_half_signup_auth_settings_on_organization_id" + end + create_table "decidim_hashtags", force: :cascade do |t| t.bigint "decidim_organization_id" t.string "name" @@ -1792,6 +1815,8 @@ t.boolean "email_on_moderations", default: true t.integer "follows_count", default: 0, null: false t.boolean "enable_ludens" + t.string "phone_number" + t.string "phone_country" t.index ["confirmation_token"], name: "index_decidim_users_on_confirmation_token", unique: true t.index ["decidim_organization_id"], name: "index_decidim_users_on_decidim_organization_id" t.index ["email", "decidim_organization_id"], name: "index_decidim_users_on_email_and_decidim_organization_id", unique: true, where: "((deleted_at IS NULL) AND (managed = false) AND ((type)::text = 'Decidim::User'::text))" @@ -1922,6 +1947,7 @@ add_foreign_key "decidim_debates_debates", "decidim_scopes" add_foreign_key "decidim_editor_images", "decidim_organizations" add_foreign_key "decidim_editor_images", "decidim_users", column: "decidim_author_id" + add_foreign_key "decidim_half_signup_auth_settings", "decidim_organizations" add_foreign_key "decidim_identities", "decidim_organizations" add_foreign_key "decidim_newsletters", "decidim_users", column: "author_id" add_foreign_key "decidim_participatory_process_steps", "decidim_participatory_processes" diff --git a/spec/lib/tasks/decidim_app/k8s/dump_db_tasks_spec.rb b/spec/lib/tasks/decidim_app/k8s/dump_db_tasks_spec.rb index d4a4733881..8e54062fc1 100644 --- a/spec/lib/tasks/decidim_app/k8s/dump_db_tasks_spec.rb +++ b/spec/lib/tasks/decidim_app/k8s/dump_db_tasks_spec.rb @@ -8,7 +8,7 @@ end it "invokes the configuration exporter" do - expect(DecidimApp::K8s::ConfigurationExporter).to receive(:dump_db).and_return(true) + expect(DecidimApp::K8s::ConfigurationExporter).to receive(:dump_db).at_least(:once).and_return(true) task.execute end diff --git a/spec/lib/tasks/decidim_app/k8s/export_configuration_tasks_spec.rb b/spec/lib/tasks/decidim_app/k8s/export_configuration_tasks_spec.rb index 0212645985..c4012f6d28 100644 --- a/spec/lib/tasks/decidim_app/k8s/export_configuration_tasks_spec.rb +++ b/spec/lib/tasks/decidim_app/k8s/export_configuration_tasks_spec.rb @@ -11,7 +11,7 @@ it "invokes the configuration exporter" do with_modified_env IMAGE: image do - expect(DecidimApp::K8s::ConfigurationExporter).to receive(:export!).with(image).and_return(true) + expect(DecidimApp::K8s::ConfigurationExporter).to receive(:export!).with(image).at_least(:once).and_return(true) task.execute end diff --git a/spec/lib/tasks/repair_data_translations_spec.rb b/spec/lib/tasks/repair_data_translations_spec.rb index f58fa03878..cccbd8a6eb 100644 --- a/spec/lib/tasks/repair_data_translations_spec.rb +++ b/spec/lib/tasks/repair_data_translations_spec.rb @@ -23,7 +23,7 @@ end it "calls the service" do - expect(Decidim::RepairTranslationsService).to receive(:run).and_return([[Decidim::Comments::Comment, comment.id]]) + expect(Decidim::RepairTranslationsService).to receive(:run).at_least(:once).and_return([[Decidim::Comments::Comment, comment.id]]) task.execute end diff --git a/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb b/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb index 786b7f5f01..480fc2b18e 100644 --- a/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb +++ b/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb @@ -8,7 +8,7 @@ end it "invokes the migrator" do - expect(ActiveStorage::Migrator).to receive(:migrate!).with(:local, :scaleway).and_return(true) + expect(ActiveStorage::Migrator).to receive(:migrate!).with(:local, :scaleway).at_least(:once).and_return(true) task.execute end