Skip to content

Commit

Permalink
Merge branch 'develop' into feat/add_sendethics_provider
Browse files Browse the repository at this point in the history
  • Loading branch information
luciegrau authored Nov 7, 2024
2 parents 2937e89 + be3a496 commit f034550
Show file tree
Hide file tree
Showing 28 changed files with 1,142 additions and 522 deletions.
17 changes: 16 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SMS_GATEWAY_MB_API_KEY=
SMS_GATEWAY_MB_ACCOUNT_ID=

#Timeout for the unsubscribe link of the newsletter
#NEWSLETTERS_UNSUBSCRIBE_TIMEOUT=
# NEWSLETTERS_UNSUBSCRIBE_TIMEOUT=

# Redirect to the TOS page after signup (default: true)
# DECIDIM_HALF_SIGNUP_SHOW_TOS_PAGE_AFTER_SIGNUP=true
Expand All @@ -107,5 +107,20 @@ SMS_GATEWAY_MB_ACCOUNT_ID=
# Format : comma separated list of auhtorization handler names
# AUTO_EXPORT_AUTHORIZATIONS_DATA_TO_USER_DATA_ENABLED_FOR="authorization1,authorization2"

# Delay until a user is considered inactive and receive a warning email (in days, default: 365)
# DECIDIM_CLEANER_INACTIVE_USERS_MAIL=

# Delay until a user is deleted after receiving an email (in days, default: 30)
# DECIDIM_CLEANER_DELETE_INACTIVE_USERS=

# Delay until an admin log is deleted (in days, default: 365)
# DECIDIM_CLEANER_DELETE_ADMIN_LOGS=

# Delay until user's versions are deleted after the user deletion (in days, default: 30)
# DECIDIM_CLEANER_DELETE_DELETED_USERS_DATA=

# Delay until deleted authorization's versions are deleted after the authorization creation (in days, default: 30)
# DECIDIM_CLEANER_DELETE_DELETED_AUTHORIZATIONS_DATA=

# Sort participatory processes by date
SORT_PROCESSES_BY_DATE=false
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ gem "decidim-anonymous_proposals", DECIDIM_ANONYMOUS_PROPOSALS_VERSION
gem "decidim-budget_category_voting", git: "https://github.com/alecslupu-pfa/decidim-budget_category_voting.git", branch: DECIDIM_BRANCH
gem "decidim-cache_cleaner"
gem "decidim-category_enhanced", "~> 0.0.1"
gem "decidim-cleaner"
gem "decidim-custom_proposal_states", git: "https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states", branch: DECIDIM_BRANCH
gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome", branch: "main"
gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome", branch: DECIDIM_BRANCH
gem "decidim-extended_socio_demographic_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module-extended_socio_demographic_authorization_handler.git",
branch: DECIDIM_BRANCH
gem "decidim-extra_user_fields", git: "https://github.com/OpenSourcePolitics/decidim-module-extra_user_fields.git", branch: "temp/twilio-compatibility-0.27"
Expand All @@ -34,10 +35,11 @@ gem "decidim-half_signup", git: "https://github.com/OpenSourcePolitics/decidim-m
gem "decidim-homepage_interactive_map", git: "https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git", branch: DECIDIM_BRANCH
gem "decidim-phone_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler", branch: "release/0.27-stable"
gem "decidim-simple_proposal", git: "https://github.com/OpenSourcePolitics/decidim-module-simple_proposal", branch: DECIDIM_BRANCH
gem "decidim-spam_detection"
gem "decidim-spam_detection", git: "https://github.com/OpenSourcePolitics/decidim-spam_detection.git", tag: "4.1.1"
gem "decidim-survey_multiple_answers", git: "https://github.com/OpenSourcePolitics/decidim-module-survey_multiple_answers"
gem "decidim-term_customizer", git: "https://github.com/OpenSourcePolitics/decidim-module-term_customizer.git", branch: "fix/email_with_precompile"

gem "decidim-guest_meeting_registration", git: "https://github.com/alecslupu-pfa/guest-meeting-registration.git", branch: DECIDIM_BRANCH, ref: "532de9e"
# Omniauth gems
gem "omniauth-france_connect", git: "https://github.com/OpenSourcePolitics/omniauth-france_connect"
gem "omniauth_openid_connect"
Expand Down
35 changes: 28 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ GIT
decidim-phone_authorization_handler (1.0.0)
decidim-core (~> 0.27)

GIT
remote: https://github.com/OpenSourcePolitics/decidim-spam_detection.git
revision: fb2ee4624b728ce6f73603bfb84eda1d9b4e04d4
tag: 4.1.1
specs:
decidim-spam_detection (4.1.1)
decidim-core (~> 0.27.0)

GIT
remote: https://github.com/OpenSourcePolitics/omniauth-france_connect
revision: 14a53ad31928c8a83742360cfbdb90938d0a057e
Expand Down Expand Up @@ -143,12 +151,23 @@ GIT
decidim-proposals (~> 0.27)
deface (>= 1.9)

GIT
remote: https://github.com/alecslupu-pfa/guest-meeting-registration.git
revision: 532de9e87ecb8b2959c0013c6408d4c092abce87
ref: 532de9e
branch: release/0.27-stable
specs:
decidim-guest_meeting_registration (0.27.7)
decidim-core (~> 0.27)
decidim-meetings (~> 0.27)
deface (>= 1.9)

GIT
remote: https://github.com/decidim-ice/decidim-module-decidim_awesome
revision: 058af7db47737e3ca108ac8e08efd5ec55d67a44
branch: main
revision: 51bc593da8fb72d14c2e5b5df55dbb686be1fbbe
branch: release/0.27-stable
specs:
decidim-decidim_awesome (0.10.2)
decidim-decidim_awesome (0.10.3)
decidim-admin (>= 0.26.0, < 0.28)
decidim-core (>= 0.26.0, < 0.28)
deface (>= 1.5)
Expand Down Expand Up @@ -408,6 +427,8 @@ GEM
decidim-admin (~> 0.27.0)
decidim-core (~> 0.27.0)
deface (>= 1.9)
decidim-cleaner (3.1.0)
decidim-core (~> 0.27.0)
decidim-comments (0.27.4)
decidim-core (= 0.27.4)
redcarpet (~> 3.5, >= 3.5.1)
Expand Down Expand Up @@ -532,8 +553,6 @@ GEM
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-proposals (= 0.27.4)
decidim-spam_detection (4.0.0)
decidim-core (~> 0.27.0)
decidim-surveys (0.27.4)
decidim-core (= 0.27.4)
decidim-forms (= 0.27.4)
Expand Down Expand Up @@ -1164,6 +1183,7 @@ DEPENDENCIES
decidim-budgets_booth!
decidim-cache_cleaner
decidim-category_enhanced (~> 0.0.1)
decidim-cleaner
decidim-conferences (~> 0.27.0)
decidim-custom_proposal_states!
decidim-decidim_awesome!
Expand All @@ -1172,12 +1192,13 @@ DEPENDENCIES
decidim-extra_user_fields!
decidim-friendly_signup!
decidim-gallery!
decidim-guest_meeting_registration!
decidim-half_signup!
decidim-homepage_interactive_map!
decidim-initiatives (~> 0.27.0)
decidim-phone_authorization_handler!
decidim-simple_proposal!
decidim-spam_detection
decidim-spam_detection!
decidim-survey_multiple_answers!
decidim-templates (~> 0.27.0)
decidim-term_customizer!
Expand Down Expand Up @@ -1217,4 +1238,4 @@ RUBY VERSION
ruby 3.0.6p216

BUNDLED WITH
2.4.9
2.4.6
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def create
enforce_permission_to :create, :proposal
@step = Decidim::Proposals::ProposalsController::STEP1
@form = form(Decidim::Proposals::ProposalForm).from_params(proposal_creation_params)
if proposal_limit_reached?
@form.errors.add(:base, I18n.t("decidim.proposals.new.limit_reached"))
flash.now[:alert] = I18n.t("proposals.create.error", scope: "decidim")
render :new
return
end

@proposal = Decidim::Proposals::Proposal.new(@form.attributes.except(
:user_group_id,
Expand Down Expand Up @@ -186,6 +192,17 @@ def map_attachment_objects(attachments)
end
end
end

def proposal_limit_reached?(form = form_proposal_params)
proposal_limit = form.current_component.settings.proposal_limit
return false if proposal_limit.zero?

current_user_proposals(form).count >= proposal_limit
end

def current_user_proposals(form)
Decidim::Proposals::Proposal.from_author(current_user).where(component: form.current_component).except_withdrawn
end
end
end
end
Expand Down
5 changes: 4 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class Application < Rails::Application
config.action_dispatch.default_headers = {
"X-Frame-Options" => "SAMEORIGIN",
"X-XSS-Protection" => "1; mode=block",
"X-Content-Type-Options" => "nosniff"
"X-Content-Type-Options" => "nosniff",
"X-Download-Options" => "noopen",
"X-Permitted-Cross-Domain-Policies" => "none",
"Referrer-Policy" => "strict-origin-when-cross-origin"
}

# Settings in config/environments/* take precedence over those specified here.
Expand Down
2 changes: 2 additions & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ ignore_missing:
- decidim.term_customizer.admin.actions.*
- decidim.term_customizer.admin.add_translations.index.*
- decidim.term_customizer.admin.models.translations.fields.*
- decidim.proposals.new.limit_reached
- decidim.proposals.create.error

# Consider these keys used:
ignore_unused:
Expand Down
11 changes: 11 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
de:
decidim:
notifications_digest_mailer:
subject: Dies ist E-Mail-Zusammenfassung
participatory_processes:
pages:
home:
highlighted_processes:
active_processes: Aktive Prozesse
see_all_processes: Alle Prozesse anzeigen
17 changes: 17 additions & 0 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
cron: '0 <%= Random.rand(0..59) %> <%= Random.rand(6..8) %> * * *' # Run randomly between 06:00 and 08:59
class: Decidim::SpamDetection::MarkUsersJob
queue: scheduled
SpamBotBlockUsers:
cron: '0 <%= Random.rand(0..59) %> <%= Random.rand(6..8) %> * * *' # Run randomly between 06:00 and 08:59
class: Decidim::SpamDetection::BlockUsersJob
queue: default
enabled: false
Backup:
cron: '0 <%= Random.rand(0..59) %> <%= Random.rand(2..3) %> * * *' # Run randomly between 02:00 and 03:59
class: BackupJob
Expand All @@ -58,3 +63,15 @@
cron: '0 1 * * *'
class: NotifyProgressInitiatives
queue: initiatives
CleanAdminLogs:
cron: "0 9 0 * * *"
class: Decidim::Cleaner::CleanAdminLogsJob
queue: scheduled
CleanInactiveUsers:
cron: "0 9 0 * * *"
class: Decidim::Cleaner::CleanInactiveUsersJob
queue: scheduled
CleanDeletedUsersData:
cron: "0 9 0 * * *"
class: Decidim::Cleaner::CleanDeletedUsersDataJob
queue: scheduled
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_cleaner (originally 20230328094652)

class AddWarningDateToUsers < ActiveRecord::Migration[6.1]
def change
add_column :decidim_users, :warning_date, :datetime
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20240531224204)

class AddDecidimAwesomeProposalPrivateFields < ActiveRecord::Migration[6.0]
class ProposalExtraField < ApplicationRecord
self.table_name = :decidim_awesome_proposal_extra_fields
end

def change
add_column :decidim_awesome_proposal_extra_fields, :private_body, :string
add_column :decidim_awesome_proposal_extra_fields, :decidim_proposal_type, :string
reversible do |direction|
direction.up do
execute <<~SQL.squish
UPDATE decidim_awesome_proposal_extra_fields
SET decidim_proposal_type = 'Decidim::Proposals::Proposal'
SQL
end
end

remove_index :decidim_awesome_proposal_extra_fields, name: "decidim_awesome_extra_fields_on_proposal"
add_index :decidim_awesome_proposal_extra_fields,
[:decidim_proposal_id, :decidim_proposal_type],
name: "index_decidim_awesome_proposal_extra_fields_on_decidim_proposal"

change_column_null :decidim_awesome_proposal_extra_fields, :decidim_proposal_id, false
change_column_null :decidim_awesome_proposal_extra_fields, :decidim_proposal_type, false
ProposalExtraField.reset_column_information
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true
# This migration comes from decidim_decidim_awesome (originally 20240729164227)

class AddDecidimAwesomeProposalPrivateFieldsDate < ActiveRecord::Migration[6.0]
class ProposalExtraField < ApplicationRecord
self.table_name = :decidim_awesome_proposal_extra_fields
end

def change
add_column :decidim_awesome_proposal_extra_fields, :private_body_updated_at, :datetime

reversible do |direction|
direction.up do
execute <<~SQL.squish
UPDATE decidim_awesome_proposal_extra_fields
SET private_body_updated_at = updated_at
SQL
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# frozen_string_literal: true

# This migration comes from decidim (originally 20180206143340)

class FixReferenceForAllResources < ActiveRecord::Migration[5.1]
def up
models = ActiveRecord::Base.descendants.select { |c| c.included_modules.include?(Decidim::HasReference) }

models.each do |model|
next unless model.table_exists?

model.find_each(&:touch)
end
end
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_guest_meeting_registration (originally 20240820021907)

class CreateGuestMeetingRegistrationSettings < ActiveRecord::Migration[6.0]
def change
create_table :decidim_guest_meeting_registration_settings do |t|
t.boolean :enable_guest_registration, default: false
t.references :decidim_organization, foreign_key: true, index: { name: :index_guest_meeting_registration_settings_on_organization_id }

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_guest_meeting_registration (originally 20240820021908)

class AddConfirmationSettings < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_settings, :enable_registration_confirmation, :boolean, default: false, after: :enable_guest_registration
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_guest_meeting_registration (originally 20240820021909)

class CreateGuestMeetingRegistrationRegistrationRequests < ActiveRecord::Migration[6.0]
def change
create_table :decidim_guest_meeting_registration_registration_requests do |t|
t.references :decidim_organization, foreign_key: true, index: { name: :index_guest_meeting_registration_rr_on_organization_id }
t.references :decidim_meetings_meetings, foreign_key: true, index: { name: :index_guest_meeting_registration_mm_on_organization_id }
t.integer :decidim_user_id, index: { name: :index_guest_meeting_registration_uid_on_organization_id }

t.jsonb :form_data
t.string :email, null: false
t.string :name

t.timestamps
end
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_guest_meeting_registration (originally 20240820021910)

class AddConfirmationToRegisterRequests < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_registration_requests, :confirmation_token, :string, after: :name
add_column :decidim_guest_meeting_registration_registration_requests, :confirmed_at, :datetime, after: :confirmation_token
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_guest_meeting_registration (originally 20240820021911)

class AddCancellationSettings < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_settings, :enable_cancellation, :boolean, default: false, after: :enable_guest_registration
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_guest_meeting_registration (originally 20240820021912)

class AddCancellationToRegisterRequests < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_registration_requests, :cancellation_token, :string, after: :name
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_guest_meeting_registration (originally 20240820021913)

class AddSessionTokenToRegisterRequests < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_registration_requests, :session_token, :string, after: :name, unique: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_guest_meeting_registration (originally 20240820021914)

class AddDisableNormalAccountToRegisterSettings < ActiveRecord::Migration[6.0]
def change
add_column :decidim_guest_meeting_registration_settings, :disable_account_confirmation, :boolean, default: false
end
end
Loading

0 comments on commit f034550

Please sign in to comment.