diff --git a/Gemfile b/Gemfile index ce9e15d6..68c00411 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem "decidim", DECIDIM_VERSION gem "decidim-calendar", github: "decidim-ice/decidim-module-calendar", branch: "release/0.27-stable" gem "decidim-civicrm", github: "openpoke/decidim-module-civicrm" gem "decidim-conferences", DECIDIM_VERSION -gem "decidim-decidim_awesome", github: "decidim-ice/decidim-module-decidim_awesome", branch: "main" +gem "decidim-decidim_awesome", github: "decidim-ice/decidim-module-decidim_awesome", branch: "release/0.27-stable" # gem "decidim-direct_verifications", github: "Platoniq/decidim-verifications-direct_verifications", branch: "release/0.27-stable" gem "decidim-templates", DECIDIM_VERSION gem "decidim-term_customizer", github: "mainio/decidim-module-term_customizer", branch: "release/0.27-stable" diff --git a/Gemfile.lock b/Gemfile.lock index 7d9fd37d..bcc42cc6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,10 +9,10 @@ GIT GIT remote: https://github.com/decidim-ice/decidim-module-decidim_awesome.git - 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) @@ -284,22 +284,22 @@ GEM public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) aws-eventstream (1.3.0) - aws-partitions (1.951.0) - aws-sdk-core (3.201.0) + aws-partitions (1.977.0) + aws-sdk-core (3.207.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.88.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-kms (1.92.0) + aws-sdk-core (~> 3, >= 3.207.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.156.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-s3 (1.164.0) + aws-sdk-core (~> 3, >= 3.207.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.8.0) + aws-sigv4 (1.10.0) aws-eventstream (~> 1, >= 1.0.2) - axe-core-api (4.9.1) + axe-core-api (4.10.0) dumb_delegator virtus axe-core-rspec (4.1.0) @@ -323,7 +323,7 @@ GEM smart_properties bigdecimal (3.1.8) bindex (0.8.1) - bootsnap (1.18.3) + bootsnap (1.18.4) msgpack (~> 1.2) browser (2.7.1) builder (3.3.0) @@ -356,8 +356,8 @@ GEM cells-rails (0.1.5) actionpack (>= 5.0) cells (>= 4.1.6, < 5.0.0) - charlock_holmes (0.7.8) - chef-utils (18.4.12) + charlock_holmes (0.7.9) + chef-utils (18.5.0) concurrent-ruby childprocess (4.1.0) coercible (1.0.0) @@ -370,13 +370,13 @@ GEM execjs coffee-script-source (1.12.2) commonmarker (0.23.10) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crack (1.0.0) bigdecimal rexml crass (1.0.6) - css_parser (1.17.1) + css_parser (1.19.0) addressable csv (3.3.0) date (3.3.4) @@ -389,7 +389,7 @@ GEM declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) - deepl-rb (2.5.3) + deepl-rb (3.0.0) deface (1.9.0) actionview (>= 5.2) nokogiri (>= 1.6) @@ -414,7 +414,7 @@ GEM doc2text (0.4.7) nokogiri (>= 1.13.2, < 1.17.0) rubyzip (~> 2.3.0) - docile (1.4.0) + docile (1.4.1) doorkeeper (5.7.1) railties (>= 5) doorkeeper-i18n (4.0.1) @@ -433,7 +433,7 @@ GEM escape_utils (1.3.0) et-orbi (1.2.11) tzinfo - excon (0.110.0) + excon (0.111.0) execjs (2.9.1) extended-markdown-filter (0.7.0) html-pipeline (~> 2.9) @@ -442,17 +442,19 @@ GEM factory_bot_rails (4.11.1) factory_bot (~> 4.11.1) railties (>= 3.0.0) - faker (3.4.1) + faker (3.4.2) i18n (>= 1.8.11, < 2) - faraday (2.9.2) - faraday-net_http (>= 2.0, < 3.2) - faraday-net_http (3.1.0) + faraday (2.12.0) + faraday-net_http (>= 2.0, < 3.4) + json + logger + faraday-net_http (3.3.0) net-http ffi (1.17.0) file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-core (2.4.0) + fog-core (2.5.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) @@ -465,7 +467,7 @@ GEM activemodel (>= 4.1, < 7.1) activesupport (>= 4.1, < 7.1) railties (>= 4.1, < 7.1) - fugit (1.11.0) + fugit (1.11.1) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) gemoji (3.0.1) @@ -483,16 +485,17 @@ GEM graphql (~> 1.12) html-pipeline (~> 2.9) sass (~> 3.4) - hashdiff (1.1.0) + hashdiff (1.1.1) hashie (5.0.0) - highline (3.0.1) + highline (3.1.1) + reline hkdf (0.3.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) html_tokenizer (0.0.8) htmlentities (4.3.4) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) i18n-tasks (0.9.37) activesupport (>= 4.0.2) @@ -504,18 +507,19 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.1) + icalendar (2.10.2) ice_cube (~> 0.16) - ice_cube (0.16.4) + ice_cube (0.17.0) ice_nine (0.11.2) - image_processing (1.12.2) + image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) + io-console (0.7.2) jmespath (1.6.2) json (2.7.2) - jwt (2.8.2) + jwt (2.9.0) base64 kaminari (1.2.2) activesupport (>= 4.1.0) @@ -545,7 +549,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.0) + logger (1.6.1) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -565,10 +569,10 @@ GEM method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0702) - mini_magick (4.13.1) + mime-types-data (3.2024.0903) + mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.24.1) + minitest (5.25.1) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb @@ -578,7 +582,7 @@ GEM multi_xml (0.6.0) net-http (0.4.1) uri - net-imap (0.4.14) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) @@ -588,7 +592,7 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.6-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -609,14 +613,15 @@ GEM rack-protection omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (1.1.2) - jwt (>= 2.0) + omniauth-google-oauth2 (1.2.0) + jwt (>= 2.9) oauth2 (~> 2.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-oauth (1.2.0) + omniauth-oauth (1.2.1) oauth omniauth (>= 1.0, < 3) + rack (>= 1.6.2, < 4) omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) @@ -630,30 +635,30 @@ GEM paper_trail (12.3.0) activerecord (>= 5.2) request_store (~> 1.1) - parallel (1.25.1) + parallel (1.26.3) parallel_tests (3.13.0) parallel - parser (3.3.3.0) + parser (3.3.5.0) ast (~> 2.4.1) racc pg (1.1.4) - pg_search (2.3.6) - activerecord (>= 5.2) - activesupport (>= 5.2) + pg_search (2.3.7) + activerecord (>= 6.1) + activesupport (>= 6.1) polyglot (0.3.5) - premailer (1.23.0) + premailer (1.27.0) addressable - css_parser (>= 1.12.0) + css_parser (>= 1.19.0) htmlentities (>= 4.0.0) premailer-rails (1.12.0) actionmailer (>= 3) net-smtp premailer (~> 1.7, >= 1.7.9) - public_suffix (6.0.0) - puma (5.6.8) + public_suffix (6.0.1) + puma (5.6.9) nio4r (~> 2.0) raabro (1.4.0) - racc (1.8.0) + racc (1.8.1) rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) @@ -714,13 +719,14 @@ GEM redis-client (0.22.2) connection_pool regexp_parser (2.9.2) + reline (0.5.10) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.1) - strscan + rexml (3.3.7) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -728,9 +734,9 @@ GEM rspec-cells (0.3.9) cells (>= 4.0.0, < 6.0.0) rspec-rails (>= 3.0.0, < 6.2.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-html-matchers (0.9.4) @@ -761,7 +767,7 @@ GEM rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) rubocop-faker (1.1.0) faker (>= 2.12.0) @@ -773,8 +779,9 @@ GEM rubocop-rspec (2.11.1) rubocop (~> 1.19) ruby-progressbar (1.13.0) - ruby-vips (2.2.1) + ruby-vips (2.2.2) ffi (~> 1.12) + logger rubyXL (3.4.27) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) @@ -792,7 +799,7 @@ GEM rubyzip (>= 1.2.2) semantic_range (3.0.0) seven_zip_ruby (1.3.0) - sidekiq (7.3.0) + sidekiq (7.3.2) concurrent-ruby (< 2) connection_pool (>= 2.3.0) logger @@ -809,7 +816,7 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) smart_properties (1.17.0) snaky_hash (2.0.1) @@ -824,16 +831,15 @@ GEM sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) ssrf_filter (1.1.2) - strscan (3.1.0) temple (0.10.3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.1) + thor (1.3.2) thread_safe (0.3.6) tilt (2.4.0) timeout (0.4.1) @@ -841,8 +847,8 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (2.5.0) - uri (0.13.0) + unicode-display_width (2.6.0) + uri (0.13.1) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) @@ -881,14 +887,14 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.8.0) + wicked_pdf (2.8.1) activesupport wisper (2.0.1) wisper-rspec (1.1.0) - wkhtmltopdf-binary (0.12.6.7) + wkhtmltopdf-binary (0.12.6.8) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.16) + zeitwerk (2.6.18) PLATFORMS x86_64-linux diff --git a/app/forms/concerns/answer_questionnaire_override.rb b/app/forms/concerns/answer_questionnaire_override.rb index 489eae34..95743d76 100644 --- a/app/forms/concerns/answer_questionnaire_override.rb +++ b/app/forms/concerns/answer_questionnaire_override.rb @@ -40,7 +40,7 @@ def send_notifications end emails.each do |email| - QuestionnaireSubmitMailer.notify(current_user, email, questionnaire, answers).deliver_later + QuestionnaireSubmitMailer.notify(current_organization, email, questionnaire, answers).deliver_later end end end diff --git a/app/mailers/questionnaire_submit_mailer.rb b/app/mailers/questionnaire_submit_mailer.rb index 4f9b6eaf..cb3ac631 100644 --- a/app/mailers/questionnaire_submit_mailer.rb +++ b/app/mailers/questionnaire_submit_mailer.rb @@ -3,15 +3,13 @@ class QuestionnaireSubmitMailer < Decidim::ApplicationMailer include Decidim::TranslatableAttributes - def notify(user, email, questionnaire, answers) - @organization = user.organization + def notify(organization, email, questionnaire, answers) + @organization = organization @title = translated_attribute(questionnaire.title) @subject = I18n.t("gpc.emails.questionnaire_submit.subject", title: @title) @url = ::Decidim::EngineRouter.main_proxy(questionnaire.questionnaire_for.component).root_path @answers = answers - with_user(user) do - mail(to: email, subject: @subject) - end + mail(to: email, subject: @subject) end end diff --git a/db/migrate/20201119033426_move_organization_fields_to_hero_content_block.decidim.rb b/db/migrate/20201119033426_move_organization_fields_to_hero_content_block.decidim.rb index 095150f7..0bce9045 100644 --- a/db/migrate/20201119033426_move_organization_fields_to_hero_content_block.decidim.rb +++ b/db/migrate/20201119033426_move_organization_fields_to_hero_content_block.decidim.rb @@ -2,10 +2,13 @@ # This migration comes from decidim (originally 20180810092428) class MoveOrganizationFieldsToHeroContentBlock < ActiveRecord::Migration[5.2] + # This migration made use CarrierWave, which in future will be eliminated. + # The organization homepage image was moved to the content block background + # image using CarrierWave. This operation has been removed, so if there is + # an existing homepage image previous to this migration the content block + # background image should be loaded manually class Organization < ApplicationRecord self.table_name = :decidim_organizations - - mount_uploader :homepage_image, ::Decidim::HomepageImageUploader end def change @@ -17,9 +20,7 @@ def change settings = welcome_text.inject(settings) { |acc, (k, v)| acc.update("welcome_text_#{k}" => v) } content_block.settings = settings - content_block.images_container.background_image = organization.homepage_image.file content_block.settings_will_change! - content_block.images_will_change! content_block.save! end diff --git a/db/migrate/20201119033493_create_decidim_forms_answers.decidim_forms.rb b/db/migrate/20201119033493_create_decidim_forms_answers.decidim_forms.rb index a1abec26..2c594102 100644 --- a/db/migrate/20201119033493_create_decidim_forms_answers.decidim_forms.rb +++ b/db/migrate/20201119033493_create_decidim_forms_answers.decidim_forms.rb @@ -4,7 +4,6 @@ class CreateDecidimFormsAnswers < ActiveRecord::Migration[5.0] def change create_table :decidim_forms_answers do |t| - t.jsonb :body, default: [] t.references :decidim_user, index: true t.references :decidim_questionnaire, index: true t.references :decidim_question, index: { name: "index_decidim_forms_answers_question_id" } diff --git a/db/migrate/20201119033398_fix_reference_for_all_resources.decidim.rb b/db/migrate/20201119040398_fix_reference_for_all_resources.decidim.rb similarity index 100% rename from db/migrate/20201119033398_fix_reference_for_all_resources.decidim.rb rename to db/migrate/20201119040398_fix_reference_for_all_resources.decidim.rb diff --git a/db/migrate/20240921124027_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb b/db/migrate/20240921124027_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb new file mode 100644 index 00000000..8ebac802 --- /dev/null +++ b/db/migrate/20240921124027_add_decidim_awesome_proposal_private_fields.decidim_decidim_awesome.rb @@ -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 diff --git a/db/migrate/20240921124028_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb b/db/migrate/20240921124028_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb new file mode 100644 index 00000000..fddad737 --- /dev/null +++ b/db/migrate/20240921124028_add_decidim_awesome_proposal_private_fields_date.decidim_decidim_awesome.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 8e549506..850abe6b 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: 2024_07_05_123825) do +ActiveRecord::Schema.define(version: 2024_09_21_124028) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -323,13 +323,16 @@ t.index ["decidim_organization_id"], name: "decidim_awesome_editor_images_constraint_organization" end - create_table "decidim_awesome_proposal_extra_fields", id: :bigint, default: -> { "nextval('decidim_awesome_weight_caches_id_seq'::regclass)" }, force: :cascade do |t| + 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" + t.string "private_body" + t.string "decidim_proposal_type", null: false + t.datetime "private_body_updated_at" + t.index ["decidim_proposal_id", "decidim_proposal_type"], name: "index_decidim_awesome_proposal_extra_fields_on_decidim_proposal" end create_table "decidim_awesome_vote_weights", force: :cascade do |t| @@ -860,10 +863,10 @@ end create_table "decidim_forms_answers", id: :serial, force: :cascade do |t| - t.text "body" t.integer "decidim_user_id" t.integer "decidim_questionnaire_id" t.integer "decidim_question_id" + t.text "body" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "session_token", default: "", null: false