Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add budgets booth and half signup #487

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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!
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
28 changes: 27 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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))"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/tasks/decidim_app/k8s/dump_db_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/tasks/repair_data_translations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading