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

[pull] develop from decidim:develop #163

Merged
merged 14 commits into from
Jul 31, 2023
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
111 changes: 79 additions & 32 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ bin/rails db:migrate

### 1.3. Follow the steps and commands detailed in these notes

#### 1.3.1 Configuration parameter change

Prior to 0.28, there was the possibility of configuring a list of disallowed passwords using the configuration parameter `Decidim.password_blacklist` or the environment variable `DECIDIM_PASSWORD_BLACKLIST`. These methods have been renamed as follows:

- `Decidim.password_blacklist` becomes `Decidim.denied_passwords`
- `DECIDIM_PASSWORD_BLACKLIST` becomes `DECIDIM_DENIED_PASSWORDS`

You can read more about this change on PR [\#10288](https://github.com/decidim/decidim/pull/10288).

## 2. General notes

## 2.1. Redesign
Expand All @@ -50,6 +41,53 @@ If you're not using it, then you don't need to do anything.

If you're maintaining a version of this module, please share the URL of the git repository by [creating an issue on the decidim.org website repository](https://github.com/decidim/decidim.org) so that we can update the [Modules page](https://decidim.org/modules).

There's an error with the migrations after you've removed this module, you'd need to change them like this:

### db/migrate/*_add_commentable_counter_cache_to_consultations.decidim_consultations.rb

```ruby
# frozen_string_literal: true
# This migration comes from decidim_consultations (originally 20200827154143)

class AddCommentableCounterCacheToConsultations < ActiveRecord::Migration[5.2]
class Question < ApplicationRecord
self.table_name = :decidim_consultations_questions
end

def change
add_column :decidim_consultations_questions, :comments_count, :integer, null: false, default: 0, index: true
Question.reset_column_information
Question.find_each(&:update_comments_count)
end
end
```

### db/migrate/*_add_followable_counter_cache_to_consultations.decidim_consultations.rb

```ruby
# frozen_string_literal: true
# This migration comes from decidim_consultations (originally 20210310120626)

class AddFollowableCounterCacheToConsultations < ActiveRecord::Migration[5.2]
class Question < ApplicationRecord
self.table_name = :decidim_consultations_questions
end

def change
add_column :decidim_consultations_questions, :follows_count, :integer, null: false, default: 0, index: true

reversible do |dir|
dir.up do
Question.reset_column_information
Question.find_each do |record|
record.class.reset_counters(record.id, :follows)
end
end
end
end
end
```

You can read more about this change on PR [#11171](https://github.com/decidim/decidim/pull/11171).

## 3. One time actions
Expand Down Expand Up @@ -100,7 +138,7 @@ In some other cases when you run your application on a custom port (other than 3

You can read more about this change on PR [\#10519](https://github.com/decidim/decidim/pull/10519).

### 3.3. User moderation panel changes
### 3.4. User moderation panel changes

In older Decidim installations, when blocking an user directly from the participants menu, without being previously reported, it will hide that user, making it unavailable in the Reported Participants section. You will need to run this command once to make sure there are no users or entities that got blocked but are not visible in the participants listing.

Expand All @@ -110,7 +148,7 @@ bundle exec rake decidim:upgrade:moderation:fix_blocked_user_panel

You can read more about this change on PR [\#10521](https://github.com/decidim/decidim/pull/10521).

### 3.4. Change Webpacker to Shakapacker
### 3.5. Change Webpacker to Shakapacker

Since the Rails team has retired the Webpacker in favour or importmap-rails or js-bundling, we got ouserlves in a situation where performance improvements could not be performed.
In order to continue having support for Webpacker like syntax, we have switched to Shakapacker.
Expand All @@ -136,7 +174,23 @@ bundle exec rake decidim:webpacker:install

This will make the necessary changes in the `config/webpacker.yml`, but also in the `config/webpack/` folder.

### 3.5. Initialize content blocks on spaces or resources with landing page
#### Note for development

If you are using the `Procfile.dev` file, you will need to make sure that you have the following line in your configuration. If you have not altered the `Procfile.dev` file, you will not need to do anything, as we covered that part:

```console
webpacker: ./bin/webpacker-dev-server
```

In order to run your development server, you will need to run the following command:

```console
./bin/dev
```

You can read more about this change on PR [\#10389](https://github.com/decidim/decidim/pull/10389).

### 3.6. Initialize content blocks on spaces or resources with landing page

The processes and assemblies participatory spaces have changed the show page and now is composed using content blocks. For the new spaces created in this version a callback is executed creating the content blocks marked as `default!` in the engine for the corresponding homepage scope. To have the same initialization in the existing spaces there is a task to generate those blocks if not present already. Run the below command to generate default content blocks when not present for all spaces and resources with content blocks homepage (participatory processes, participatory process groups and assemblies):

Expand All @@ -156,29 +210,13 @@ For example, to generate the default content blocks and also the components bloc
bundle exec rake decidim:content_blocks:initialize_default_content_blocks[,,true]
```

#### Note for development

If you are using the `Procfile.dev` file, you will need to make sure that you have the following line in your configuration. If you have not altered the `Procfile.dev` file, you will not need to do anything, as we covered that part:

```console
webpacker: ./bin/webpacker-dev-server
```

In order to run your development server, you will need to run the following command:

```console
./bin/dev
```

You can read more about this change on PR [\#10389](https://github.com/decidim/decidim/pull/10389).

### 3.5. Graphql upgrade
### 3.7. Graphql upgrade

In [\#10606](https://github.com/decidim/decidim/pull/10606) we have upgraded the GraphQL gem to version 2.0.19. This upgrade introduces some breaking changes, so you will need to update your GraphQL queries to match the new API. This change should be transparent for most of the users, but if you have custom GraphQL queries, you will need to update them. Also, please note, there might be some issues with community plugins that offer support for GraphQL, so you might need to update them as well.

Please see the [change log](https://github.com/rmosolgo/graphql-ruby/blob/master/CHANGELOG.md) for graphql gem for more information.

### 3.6. Orphans valuator assignments cleanup
### 3.8. Orphans valuator assignments cleanup

We have added a new task that helps you clean the valuator assignements records of roles that have been deleted.

Expand All @@ -190,7 +228,7 @@ bundle exec rake decidim:proposals:upgrade:remove_valuator_orphan_records

You can see more details about this change on PR [\#10607](https://github.com/decidim/decidim/pull/10607)

### 3.7. Initiatives pages exception fix
### 3.9. Initiatives pages exception fix

We have added a new tasks to fix a bug related to the pages component inside of the Initiatives module (`decidim-initiatives`).

Expand All @@ -202,7 +240,7 @@ bundle exec rake decidim:initiatives:upgrade:fix_broken_pages

You can see more details about this change on PR [\#10928](https://github.com/decidim/decidim/pull/10928)

### 3.7. Add Content Security Policy (CSP) support
### 3.10. Add Content Security Policy (CSP) support

We have introduced support for Content Security Policy (CSP). This is a security feature that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks.
By default, the CSP is enabled, and is configured to be as restrictive as possible, having the following default configuration:
Expand Down Expand Up @@ -659,3 +697,12 @@ end
```

You can read more about this change at PR [\#10760](https://github.com/decidim/decidim/pull/10760).

### 5.5. Configuration parameter change

Prior to 0.28, there was the possibility of configuring a list of disallowed passwords using the configuration parameter `Decidim.password_blacklist` or the environment variable `DECIDIM_PASSWORD_BLACKLIST`. These methods have been renamed as follows:

- `Decidim.password_blacklist` becomes `Decidim.denied_passwords`
- `DECIDIM_PASSWORD_BLACKLIST` becomes `DECIDIM_DENIED_PASSWORDS`

You can read more about this change on PR [\#10288](https://github.com/decidim/decidim/pull/10288).
1 change: 1 addition & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ ignore_unused:
- versions.dropdown.option_*
- decidim.meetings.meetings.filters.*
- decidim.meetings.directory.meetings.index.space_type
- decidim.authorization_modals.content.*

## Exclude these keys from the `i18n-tasks eq-base' report:
# ignore_eq_base:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Accountability
# Note that it inherits from `Decidim::Components::BaseController`, which
# override its layout and provide all kinds of useful methods.
class ApplicationController < Decidim::Components::BaseController
redesign_participatory_space_layout
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ def initialize(role, current_user)
#
# Returns nothing.
def call
destroy_role!
dispatch_system_event
with_events do
destroy_role!
end

broadcast(:ok)
end

private

attr_reader :role, :current_user

def dispatch_system_event
ActiveSupport::Notifications.publish("decidim.system.participatory_space.admin.destroyed", role.class.name, role.id)
def event_arguments
{
class_name: role.class.name,
role: role.id
}
end

def destroy_role!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="small reveal confirm-reveal" id="confirm-modal" aria-hidden="true" role="dialog" aria-labelledby="confirm-modal-title" data-reveal data-multiple-opened="true">
<div class="reveal__header">
<h2 class="reveal__title" id="confirm-modal-title"><%= t("title", scope: "decidim.shared.confirm_modal") %></h2>
<button class="close-button" data-close aria-label="<%= t("close_modal", scope: "decidim.shared.confirm_modal") %>"
type="button">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="confirm-content">
<div class="confirm-modal-content"></div>
</div>
<div class="confirm-modal-footer reveal__footer">
<div class="buttons button--double">
<a class="button" role="button" href="#" data-confirm-ok aria-label="<%= t("ok", scope: "decidim.shared.confirm_modal") %>"><%= t("ok", scope: "decidim.shared.confirm_modal") %></a>
<a class="button clear" role="button" href="#" data-confirm-cancel aria-label="<%= t("cancel", scope: "decidim.shared.confirm_modal") %>"><%= t("cancel", scope: "decidim.shared.confirm_modal") %></a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<% if current_user && !current_user.remember_created_at %>
<% timeout_time_seconds = Decidim.config.expire_session_after.to_i %>
<% prevent_timeout_for = try(:prevent_timeout_seconds) || 0 %>
<div class="reveal" id="timeoutModal" data-close-on-click="false" data-close-on-esc="false"
data-seconds-until-timeout-path="<%= decidim.seconds_until_timeout_path %>"
data-heartbeat-path="<%= decidim.heartbeat_path %>"
data-session-timeout="<%= timeout_time_seconds %>"
data-prevent-timeout-seconds="<%= prevent_timeout_for %>"
data-session-timeout-interval="<%= Decidim.config.session_timeout_interval.to_i * 1000 %>" data-reveal>
<h2><%= t("title", scope: "layouts.decidim.timeout_modal") %></h2>
<p><%= t("body", scope: "layouts.decidim.timeout_modal", minutes: (timeout_time_seconds / 60) - 2) %></p>

<div class="reveal__buttons">
<%= link_to t("sign_out", scope: "layouts.decidim.timeout_modal"), decidim.destroy_user_session_path, method: :delete, class: "button warning" %>
<%= link_to "", decidim.destroy_user_session_path(translation_suffix: :timed_out), method: :delete, id: "reveal-hidden-sign-out", class: "hide" %>
<%= button_to t("continue_session", scope: "layouts.decidim.timeout_modal"),
decidim.heartbeat_path,
id: "continueSession",
class: "button primary",
remote: true,
method: :post %>
</div>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<%= render partial: "layouts/decidim/admin/header" %>
</head>
<body>
<%= render partial: "layouts/decidim/timeout_modal" %>
<%= render partial: "layouts/decidim/admin/admin_timeout_modal" %>
<%= render partial: "layouts/decidim/admin/template_top" %>
<div class="layout-nav">
<%= main_menu.render %>
Expand All @@ -26,7 +26,7 @@
</div>
</div>
<%= render partial: "layouts/decidim/admin/template_bottom" %>
<%= render partial: "decidim/shared/confirm_modal" %>
<%= render partial: "decidim/admin/shared/admin_confirm_modal" %>
<%= render partial: "layouts/decidim/admin/js_configuration" %>
<%= render partial: "layouts/decidim/cors" if Decidim.cors_enabled %>

Expand Down
13 changes: 5 additions & 8 deletions decidim-admin/lib/decidim/admin/test/destroy_admin_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
expect(action_log.version.event).to eq "destroy"
end

it "fires an event" do
expect(ActiveSupport::Notifications).to receive(:publish).with(
"decidim.system.participatory_space.admin.destroyed",
role.class.name,
role.id
)

subject.call
it_behaves_like "fires an ActiveSupport::Notification event", "decidim.admin.participatory_space.destroy_admin:before" do
let(:command) { subject }
end
it_behaves_like "fires an ActiveSupport::Notification event", "decidim.admin.participatory_space.destroy_admin:after" do
let(:command) { subject }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

within ".edit_content_blocks" do
within first("ul.js-list-actives li") do
find(".icon--x").click
find("a[data-method='delete']").click
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class ApplicationController < Decidim::ApplicationController
helper Decidim::Assemblies::AssembliesHelper
include NeedsPermission

include RedesignLayout
redesign active: true

register_permissions(Decidim::Assemblies::ApplicationController,
::Decidim::Assemblies::Permissions,
::Decidim::Admin::Permissions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AssembliesController < Decidim::Assemblies::ApplicationController
include ParticipatorySpaceContext
include AssemblyBreadcrumb

redesign_participatory_space_layout only: :show
participatory_space_layout only: :show

include FilterResource
include Paginable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class AssemblyMembersController < Decidim::Assemblies::ApplicationController
include ParticipatorySpaceContext
include AssemblyBreadcrumb

redesign_participatory_space_layout only: :index
participatory_space_layout only: :index

helper_method :collection

Expand Down
18 changes: 5 additions & 13 deletions decidim-assemblies/app/views/layouts/decidim/assembly.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@
description: translated_attribute(current_participatory_space.short_description)
) %>

<%= append_javascript_pack_tag "decidim_assemblies" %>
<%= append_stylesheet_pack_tag "decidim_assemblies", media: "all" %>

<%= render "layouts/decidim/application" do %>
<%= render partial: "layouts/decidim/assembly_header" %>
<%= cell "decidim/translation_bar", current_organization %>
<div class="wrapper">
<main>
<%= yield %>
</div>
<% if content_for? :expanded %>
<div class="expanded">
<div class="wrapper wrapper--inner">
<div class="row">
<%= yield :expanded %>
</div>
</div>
</div>
<% end %>
</main>
<% end %>

<% provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ module Blogs
# override its layout and provide all kinds of useful methods.
class ApplicationController < Decidim::Components::BaseController
helper Decidim::Blogs::ApplicationHelper

redesign_participatory_space_layout
end
end
end
Loading