Skip to content

Commit

Permalink
Develop into Master (#100)
Browse files Browse the repository at this point in the history
* feat: Add custom proposal states

* fix: Default filter params on proposals controller

* lint: Fix rubocop offenses

* fix: PP specs

* fix: Explore meetings system specs

* feat Bump Modules and add migrations

* Bump homepage proposals

* Update Gemfile.lock

* fix: downgrade net-imap

* fix: Add missing decidim-awesome migrations

* lint: Fix rubocop offenses

---------

Co-authored-by: Quentin Champenois <[email protected]>

* revert: Downgrade Decidim version (#95)

* Revert "feat Bump Modules and add migrations"

This reverts commit 8b406ee.

* fix: Bump homepage proposals and custom proposal states

* fix: Add db/schema.rb

* fix: Make the Half Signup TOS configurable with env var

* fix: Button budgets projects focus on click

* fix: Add Rails secret for half signup TOS

* fix: Remove Google translate bar when loaded

* fix: Change budgets_booth upstream branch

* fix: Bump module budgets booth

* fix: Update budgets booth revision

* fix: Fix button add vote in modal

* fix: warning on gems dependencies (#99)

* fix: warning on gems dependencies

* update bundler to 2.4.22

---------

Co-authored-by: quentinchampenois <[email protected]>
Co-authored-by: moustachu <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent fc33d5b commit 3c3ccba
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 20 deletions.
1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ TRANSLATION_SWITCH_REGEXP=
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_SENDER=
HALF_SIGNUP_TOS=false
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ gem "decidim-slider", git: "https://github.com/alecslupu-pfa/decidim-module-slid
gem "decidim-spam_detection"
gem "decidim-term_customizer", git: "https://github.com/opensourcepolitics/decidim-module-term_customizer.git", branch: "fix/multi-threading-compliant-0.26"

# PTP_MODULE_VERSION = { github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting" }
gem "decidim-budgets_booth", github: "OpenSourcePolitics/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-smsauth", github: "OpenSourcePolitics/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-sms-twilio", github: "OpenSourcePolitics/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"

# NOTE: Custom proposal states must be before simple_proposal
gem "decidim-custom_proposal_states", git: "https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states", branch: "chore/fix-module-dependency"
gem "decidim-simple_proposal", git: "https://github.com/mainio/decidim-module-simple_proposal", branch: DECIDIM_BRANCH
Expand All @@ -36,7 +41,9 @@ gem "uglifier", "~> 4.1"

gem "faker", "~> 2.14"

gem "net-http"
gem "nokogiri", "1.13.4"
gem "uri", "0.10.0"

gem "activejob-uniqueness", require: "active_job/uniqueness/sidekiq_patch"
gem "aws-sdk-s3", require: false
Expand All @@ -46,11 +53,6 @@ gem "sys-filesystem"
gem "omniauth-rails_csrf_protection"
gem "omniauth-saml"

# PTP_MODULE_VERSION = { github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting" }
gem "decidim-budgets_booth", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-smsauth", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-sms-twilio", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"

group :development, :test do
gem "brakeman", "~> 5.1"
gem "byebug", "~> 11.0", platform: :mri
Expand Down
31 changes: 18 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ GIT
rgeo-proj4 (~> 3.1)

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler
revision: 488cc8827845ec1c5266aa499df2ebf9b20e02a3
branch: release/0.26-stable
specs:
decidim-phone_authorization_handler (1.0.0)
decidim-core (~> 0.26)

GIT
remote: https://github.com/Pipeline-to-Power/decidim-module-ptp.git
revision: 79f07fee09671661ab23e8a8c18e464a78d29966
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)
Expand All @@ -42,9 +34,17 @@ GIT
countries (~> 5.1, >= 5.1.2)
decidim-core (~> 0.26.0)

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler
revision: 488cc8827845ec1c5266aa499df2ebf9b20e02a3
branch: release/0.26-stable
specs:
decidim-phone_authorization_handler (1.0.0)
decidim-core (~> 0.26)

GIT
remote: https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states
revision: 92b02c1ed2311547b9b4688d16411b4d9be99af6
revision: 5a01dcd0c61f7760adb929d53a6ccdbe6af5b050
branch: chore/fix-module-dependency
specs:
decidim-custom_proposal_states (0.26.8)
Expand All @@ -62,7 +62,7 @@ GIT

GIT
remote: https://github.com/alecslupu-pfa/decidim-module_homepage_proposals
revision: 498631e9a5c2fa1628b25c6d6fecbedd8fc507f9
revision: 1e5753b2db6caaba5b38c7de7865de8cf22c11db
branch: feature/reset-filters
specs:
decidim-homepage_proposals (1.0.2)
Expand Down Expand Up @@ -642,6 +642,8 @@ GEM
multi_json (1.15.0)
multi_xml (0.6.0)
mustache (1.1.1)
net-http (0.4.1)
uri
net-imap (0.3.4)
date
net-protocol
Expand Down Expand Up @@ -933,6 +935,7 @@ GEM
execjs (>= 0.3.0, < 3)
unaccent (0.4.0)
unicode-display_width (1.8.0)
uri (0.10.0)
valid_email2 (2.3.1)
activemodel (>= 3.2)
mail (~> 2.5)
Expand Down Expand Up @@ -1014,6 +1017,7 @@ DEPENDENCIES
letter_opener_web (~> 1.3)
listen (~> 3.1)
lograge
net-http
nokogiri (= 1.13.4)
omniauth-rails_csrf_protection
omniauth-saml
Expand All @@ -1032,10 +1036,11 @@ DEPENDENCIES
spring-watcher-listen (~> 2.0)
sys-filesystem
uglifier (~> 4.1)
uri (= 0.10.0)
web-console (= 4.0.4)

RUBY VERSION
ruby 2.7.7p221

BUNDLED WITH
2.3.4
2.4.22
20 changes: 20 additions & 0 deletions app/cells/decidim/budgets/project_vote_button/show.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<%= action_authorized_button_to(
"vote",
budget_order_line_item_path(model.budget, project_id: model),
method: vote_button_method,
remote: true,
class: "button #{scale_up} #{selected_budget} customized-budget display-block project-vote-button",
data: {
add: !resource_added?,
disable: true,
budget: model.budget_amount,
project_id: model.id,
allocation: resource_allocation,
"redirect-url": budget_voting_index_path
},
disabled: vote_button_disabled?,
title: vote_button_label
) do %>
<%= resource_added? ? t("remove_from_vote", scope: "decidim.budgets.project_vote_button") :t("add_to_vote", scope: "decidim.budgets.project_vote_button") %>
<% end %>

6 changes: 6 additions & 0 deletions app/views/layouts/decidim/_head_extra.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
});
</script>
<% end %>

<% if translation_mode?(:google) %>
<script>

Expand Down Expand Up @@ -39,6 +40,11 @@
},
'google_translate_element'
);

waitForElm("iframe.skiptranslate").then((elm) => {
$(elm).hide();
$("body").attr("style", "");
});
}
</script>
<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/half_signup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Decidim::HalfSignup.configure do |config|
config.show_tos_page_after_signup = Rails.application.secrets.dig(:decidim, :module, :half_signup, :show_tos_page_after_signup)
end
3 changes: 3 additions & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ default: &default
google_tag_manager_id: <%= ENV["GOOGLE_TAG_MANAGER_ID"] %>
decidim:
currency: <%= ENV["CURRENCY"] || "€" %>
module:
half_signup:
show_tos_page_after_signup: <%= ENV["HALF_SIGNUP_TOS"] == "true" %>
throttling_max_requests: <%= ENV["THROTTLING_MAX_REQUESTS"] || 100 %>
throttling_period: <%= ENV["THROTTLING_PERIOD"] || 1 %>
translation_mode: <%= ENV["TRANSLATION_MODE"] || "none" %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

# This migration comes from decidim (originally 20231027142329)

class ChangeDefaultValueForDecidimEndorsements < ActiveRecord::Migration[6.0]
def up
change_column_default :decidim_endorsements, :decidim_user_group_id, 0
end

def down
change_column_default :decidim_endorsements, :decidim_user_group_id, nil
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

# This migration comes from decidim_decidim_awesome (originally 20231006113837)

class CreateDecidimAwesomeVoteWeights < ActiveRecord::Migration[6.0]
def change
create_table :decidim_awesome_vote_weights do |t|
# this might be polymorphic in the future (if other types of votes are supported)
t.references :proposal_vote, null: false, index: { name: "decidim_awesome_proposals_weights_vote" }

t.integer :weight, null: false, default: 1
t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

# This migration comes from decidim_decidim_awesome (originally 20231006113841)

class CreateDecidimAwesomeProposalExtraFields < ActiveRecord::Migration[6.0]
def change
create_table :decidim_awesome_proposal_extra_fields do |t|
# this might be polymorphic in the future (if other types of votes are supported)
t.references :decidim_proposal, null: false, index: { name: "decidim_awesome_extra_fields_on_proposal" }

t.jsonb :vote_weight_totals
t.integer :weight_total, default: 0
t.timestamps
end
end
end
21 changes: 19 additions & 2 deletions 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_12_21_231806) do
ActiveRecord::Schema.define(version: 2024_01_03_110736) do

# These are extensions that must be enabled in order to support this database
enable_extension "ltree"
Expand Down Expand Up @@ -315,6 +315,23 @@
t.index ["decidim_organization_id"], name: "decidim_awesome_editor_images_constraint_organization"
end

create_table "decidim_awesome_proposal_extra_fields", force: :cascade do |t|
t.bigint "decidim_proposal_id", null: false
t.jsonb "vote_weight_totals"
t.integer "weight_total", default: 0
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["decidim_proposal_id"], name: "decidim_awesome_extra_fields_on_proposal"
end

create_table "decidim_awesome_vote_weights", force: :cascade do |t|
t.bigint "proposal_vote_id", null: false
t.integer "weight", default: 1, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["proposal_vote_id"], name: "decidim_awesome_proposals_weights_vote"
end

create_table "decidim_blogs_posts", id: :serial, force: :cascade do |t|
t.jsonb "title"
t.jsonb "body"
Expand Down Expand Up @@ -731,7 +748,7 @@
t.bigint "resource_id"
t.string "decidim_author_type"
t.bigint "decidim_author_id"
t.integer "decidim_user_group_id"
t.integer "decidim_user_group_id", default: 0
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["decidim_author_type", "decidim_author_id"], name: "idx_endorsements_authors"
Expand Down

0 comments on commit 3c3ccba

Please sign in to comment.