From 756ab262cef71ca579a5cbde02eab14e4127b847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Thu, 31 Oct 2024 15:25:28 +0100 Subject: [PATCH 1/5] Bump decidim version from 6e50c98a52 to 09d0799e80 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d2d6bb368..5ca6917c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/AjuntamentdeBarcelona/decidim - revision: 6e50c98a52907d8e830301d8e2a02c27ec5246c6 + revision: 09d0799e802783c08154c70522e2edabc03aecab branch: release/0.28-stable-bcn specs: decidim (0.28.4) From 05f7a7e82a6a755fc98bc0fcdfb0aa834d7333f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Thu, 31 Oct 2024 15:46:51 +0100 Subject: [PATCH 2/5] Add and install migration --- ...il_on_assigned_proposals_to_users.decidim_proposals.rb | 8 ++++++++ db/schema.rb | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20241031144530_add_email_on_assigned_proposals_to_users.decidim_proposals.rb diff --git a/db/migrate/20241031144530_add_email_on_assigned_proposals_to_users.decidim_proposals.rb b/db/migrate/20241031144530_add_email_on_assigned_proposals_to_users.decidim_proposals.rb new file mode 100644 index 000000000..6c04835fe --- /dev/null +++ b/db/migrate/20241031144530_add_email_on_assigned_proposals_to_users.decidim_proposals.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20240617091140) + +class AddEmailOnAssignedProposalsToUsers < ActiveRecord::Migration[6.1] + def change + add_column :decidim_users, :email_on_assigned_proposals, :boolean, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 86d8e8a7e..498610a5d 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_10_15_093725) do +ActiveRecord::Schema.define(version: 2024_10_31_144530) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -1880,6 +1880,7 @@ t.datetime "digest_sent_at" t.datetime "password_updated_at" t.string "previous_passwords", default: [], array: true + t.boolean "email_on_assigned_proposals", default: true 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))" From 3f39b21a59905b2a8dfdbf6ab10a8cc97d054482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Thu, 31 Oct 2024 16:27:18 +0100 Subject: [PATCH 3/5] Adapt overrides --- .../decidim/initiatives/admin/permissions_override.rb | 4 ++-- spec/lib/overrides_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb b/app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb index aa227f763..d6d535853 100644 --- a/app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb +++ b/app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb @@ -10,8 +10,8 @@ def initiative_admin_user_action? return unless permission_action.subject == :initiative case permission_action.action - when :read - toggle_allow(Decidim::Initiatives.print_enabled) + when :print + toggle_allow(Decidim::Initiatives.print_enabled && user.admin?) when :publish, :discard toggle_allow(initiative.validating?) when :unpublish diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb index e13c9a5d3..26b3da048 100644 --- a/spec/lib/overrides_spec.rb +++ b/spec/lib/overrides_spec.rb @@ -93,7 +93,7 @@ files: { "/app/cells/decidim/initiatives/initiative_metadata_g_cell.rb" => "e41380534ae3c4c441530a6739e3746a", "/app/models/decidim/initiative.rb" => "77c9775fcff404b16e5a382915116fe1", - "/app/permissions/decidim/initiatives/admin/permissions.rb" => "805ba1e544cc3883baec90a357596320", + "/app/permissions/decidim/initiatives/admin/permissions.rb" => "c0f9bf5d9edaca545a7c931c0dc5c0e9", "/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb" => "849e1ad297a15bb00e34122d3b845ff9", "/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb" => "40c663fcb732743399b4fe79605e7823" } From 5bda72f10935348d03af2e46f08d43f7bfef9fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Thu, 31 Oct 2024 16:31:26 +0100 Subject: [PATCH 4/5] Ignore CC alert --- .codeclimate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codeclimate.yml b/.codeclimate.yml index 65826a4e1..87fc4371a 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -63,3 +63,4 @@ exclude_paths: - "decidim-ephemeral_participation/app/permissions/decidim/ephemeral_participation/ephemeral_participation_permissions.rb" - "app/services/decidim_legacy_routes.rb" - "app/helpers/concerns/decidim/paginate_helper_override.rb" +- "app/permissions/concerns/decidim/initiatives/admin/permissions_override.rb" From 2fa71c33bc2a07b7fa2e577aa556448d2ac6f71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Mon, 4 Nov 2024 15:36:09 +0100 Subject: [PATCH 5/5] Bump decidim from 09d0799 to 739d2cc --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ca6917c3..bbccfad20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/AjuntamentdeBarcelona/decidim - revision: 09d0799e802783c08154c70522e2edabc03aecab + revision: 739d2cc1c0faa65a7e8d0788944165debd416bd1 branch: release/0.28-stable-bcn specs: decidim (0.28.4)