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

Remove consultations module #11171

Merged
merged 8 commits into from Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/brakeman.yml
Expand Up @@ -35,7 +35,6 @@ jobs:
- decidim-budgets
- decidim-comments
- decidim-conferences
- decidim-consultations
- decidim-core
- decidim-debates
- decidim-dev
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/ci_consultations.yml

This file was deleted.

1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -6,7 +6,6 @@ ruby RUBY_VERSION

gem "decidim", path: "."
gem "decidim-conferences", path: "."
gem "decidim-consultations", path: "."
gem "decidim-elections", path: "."
gem "decidim-initiatives", path: "."
gem "decidim-templates", path: "."
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Expand Up @@ -53,10 +53,6 @@ PATH
decidim-meetings (= 0.28.0.dev)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (~> 0.12)
decidim-consultations (0.28.0.dev)
decidim-admin (= 0.28.0.dev)
decidim-comments (= 0.28.0.dev)
decidim-core (= 0.28.0.dev)
decidim-core (0.28.0.dev)
active_link_to (~> 1.0)
acts_as_list (~> 1.0)
Expand Down Expand Up @@ -818,7 +814,6 @@ DEPENDENCIES
byebug (~> 11.0)
decidim!
decidim-conferences!
decidim-consultations!
decidim-dev!
decidim-elections!
decidim-initiatives!
Expand Down
3 changes: 0 additions & 3 deletions RELEASE_NOTES.md
Expand Up @@ -299,8 +299,6 @@ The transferred data can differ between the different modules but the official m
- **decidim-comments**
- Comments
- Comment votes
- **decidim-consultations**
- Consultation votes
- **decidim-debates**
- Debates
- Endorsements for debates (through endorsement transfers at `decidim-core`)
Expand Down Expand Up @@ -381,7 +379,6 @@ module DecidimYourCity
Decidim::AuthorizationTransfer.unregister(:blogs) # blog posts
Decidim::AuthorizationTransfer.unregister(:budgets) # budgets
Decidim::AuthorizationTransfer.unregister(:comments) # comments
Decidim::AuthorizationTransfer.unregister(:consultations) # consultation votes
Decidim::AuthorizationTransfer.unregister(:debates) # debates
Decidim::AuthorizationTransfer.unregister(:elections) # elections
Decidim::AuthorizationTransfer.unregister(:forms) # form answers, e.g. survey form answers or meeting registrations
Expand Down
5 changes: 0 additions & 5 deletions config/i18n-tasks.yml
Expand Up @@ -213,9 +213,6 @@ ignore_unused:
- decidim.budgets.projects.filters.*
- decidim.sortitions.admin_log.*
- decidim.sortitions.sortitions.orders.*
- decidim.consultations.admin_log.*
- decidim.consultations.consultations.orders.*
- decidim.consultations.show.badge_name.*
- decidim.votings.admin_log.*
- decidim.votings.votings.filters.*
- decidim.votings.votings.orders.*
Expand Down Expand Up @@ -244,7 +241,6 @@ ignore_unused:
- decidim.participatory_process_groups.content_blocks.*.name
- decidim.assemblies.content_blocks.*.name
- decidim.initiatives.content_blocks.*.name
- decidim.consultations.content_blocks.*.name
- decidim.meetings.content_blocks.*.name
- decidim.votings.content_blocks.*.name
- decidim.blogs.content_blocks.*.name
Expand Down Expand Up @@ -361,7 +357,6 @@ ignore_unused:
- layouts.decidim.votings.promoted_voting.vote
- versions.directions.*
- layouts.decidim.conferences.conference.*
- decidim.consultations.show.footer_button_text.*
- decidim.admin.conflicts.*
- decidim.profiles.show.badges
- decidim.profiles.show.conversations
Expand Down
Expand Up @@ -150,9 +150,6 @@ def user_localized_body(user)
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down Expand Up @@ -200,9 +197,6 @@ def user_localized_body(user)
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down Expand Up @@ -257,9 +251,6 @@ def user_localized_body(user)
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down Expand Up @@ -303,9 +294,6 @@ def user_localized_body(user)
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down
3 changes: 0 additions & 3 deletions decidim-admin/spec/forms/selective_newsletter_form_spec.rb
Expand Up @@ -58,9 +58,6 @@ module Admin
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down
3 changes: 1 addition & 2 deletions decidim-admin/spec/helpers/menu_helper_spec.rb
Expand Up @@ -18,13 +18,12 @@ module Admin

it "renders the default main menu" do
expect(default_main_menu).to \
have_selector("li", count: 14) &
have_selector("li", count: 13) &
have_link("Dashboard", href: "/admin/") &
have_link("Processes", href: "/admin/participatory_processes") &
have_link("Conferences", href: "/admin/conferences") &
have_link("Assemblies", href: "/admin/assemblies") &
have_link("Votings", href: "/admin/votings") &
have_link("Consultations", href: "/admin/consultations") &
have_link("Initiatives", href: "/admin/initiatives") &
have_link("Global moderation", href: "/admin/moderations") &
have_link("Pages", href: "/admin/static_pages") &
Expand Down
6 changes: 0 additions & 6 deletions decidim-admin/spec/queries/newsletter_recipients_spec.rb
Expand Up @@ -67,9 +67,6 @@ module Decidim::Admin
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] }
Expand Down Expand Up @@ -105,9 +102,6 @@ module Decidim::Admin
{ "id" => nil,
"manifest_name" => "conferences",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "consultations",
"ids" => [] },
{ "id" => nil,
"manifest_name" => "initiatives",
"ids" => [] },
Expand Down
6 changes: 2 additions & 4 deletions decidim-admin/spec/system/admin_manages_newsletters_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "spec_helper"
%w(conferences initiatives consultations).each do |space|
%w(conferences initiatives).each do |space|
require "decidim/#{space}/test/factories.rb"
end

Expand Down Expand Up @@ -175,11 +175,9 @@
let!(:participatory_process) { create(:participatory_process, organization:) }
let!(:assembly) { create(:assembly, organization:) }
let!(:conference) { create(:conference, organization:) }
let!(:consultation) { create(:consultation, organization:) }
let(:question) { create(:question, :published, consultation:) }
let!(:initiative) { create(:initiative, organization:) }
let!(:newsletter) { create(:newsletter, organization:) }
let(:spaces) { [participatory_process, assembly, conference, consultation, initiative] }
let(:spaces) { [participatory_process, assembly, conference, initiative] }
let!(:component) { create(:dummy_component, participatory_space: participatory_process) }

def select_all
Expand Down
6 changes: 3 additions & 3 deletions decidim-api/docs/usage.md
Expand Up @@ -119,7 +119,7 @@ Finally, note that the returned object is an array, each item of which is a repr
>
> There are two types of objects to filter and ordering collections in Decidim, they all work in a similar fashion. The type involved in filtering always have the suffix "Filter", for ordering it has the suffix "Sort".
>
> The types used to filter participatory spaces are: [ParticipatoryProcessFilter](#ParticipatoryProcessFilter), [AssemblyFilter](#AssemblyFilter), [ConsultationFilter](#ConsultationFilter) and so on.
> The types used to filter participatory spaces are: [ParticipatoryProcessFilter](#ParticipatoryProcessFilter), [AssemblyFilter](#AssemblyFilter), and so on.
>
> Other collections (or connections) may have their own filters (i.e. [ComponentFilter](#ComponentFilter)).
>
Expand Down Expand Up @@ -156,9 +156,9 @@ Finally, note that the returned object is an array, each item of which is a repr

Decidim has 2 main types of objects through which content is provided. These are Participatory Spaces and Components.

A participatory space is the first level, currently there are 5 officially supported: *Participatory Processes*, *Assemblies*, *Consultations*, *Conferences* and *Initiatives*. For each participatory process there will correspond a collection type and a "single item" type.
A participatory space is the first level, currently there are 5 officially supported: *Participatory Processes*, *Assemblies*, *Conferences* and *Initiatives*. For each participatory process there will correspond a collection type and a "single item" type.

The previous example uses the collection type for participatory processes. You can try `assemblies`, `conferences`, `consultations` or `initiatives` for the others. Note that each collection can implement their own filter and order types with different properties.
The previous example uses the collection type for participatory processes. You can try `assemblies`, `conferences`, or `initiatives` for the others. Note that each collection can implement their own filter and order types with different properties.

As an example for a single item query, you can run:

Expand Down
Expand Up @@ -191,7 +191,6 @@ def current_component

def vote_button_to(path, params, &)
# actions are linked to objects belonging to a component
# In consultations, a question belong to a participatory_space but it has comments
# To apply :comment permission, the modal authorizer should be refactored to allow participatory spaces-level comments
return button_to(path, params, &) unless current_component

Expand Down
Expand Up @@ -15,7 +15,7 @@ def show
private

def conference_spaces
[conference_participatory_processes, conference_assemblies, conference_consultations].compact
[conference_participatory_processes, conference_assemblies].compact
end

def conference_participatory_processes
Expand All @@ -36,15 +36,6 @@ def conference_assemblies
assemblies
end

def conference_consultations
return unless Decidim.participatory_space_manifests.map(&:name).include?(:consultations)

consultations = model.linked_participatory_space_resources(:consultations, "included_consultations")
return unless consultations.any?

consultations
end

def title(block_space)
block_space.first.class.name.demodulize.tableize
end
Expand Down
Expand Up @@ -26,7 +26,6 @@ def call
add_admins_as_followers(conference)
link_participatory_processes
link_assemblies
link_consultations

broadcast(:ok, conference)
else
Expand Down Expand Up @@ -96,15 +95,6 @@ def assemblies
def link_assemblies
conference.link_participatory_space_resources(assemblies, "included_assemblies")
end

def consultations
@consultations ||= conference.participatory_space_sibling_scope(:consultations)
.where(id: @form.consultations_ids)
end

def link_consultations
conference.link_participatory_space_resources(consultations, "included_consultations")
end
end
end
end
Expand Down
Expand Up @@ -29,7 +29,6 @@ def call
update_conference
link_participatory_processes
link_assemblies
link_consultations

if @conference.valid?
broadcast(:ok, @conference)
Expand Down Expand Up @@ -153,15 +152,6 @@ def assemblies
def link_assemblies
@conference.link_participatory_space_resources(assemblies, "included_assemblies")
end

def consultations
@consultations ||= @conference.participatory_space_sibling_scope(:consultations)
.where(id: @form.consultations_ids)
end

def link_consultations
@conference.link_participatory_space_resources(consultations, "included_consultations")
end
end
end
end
Expand Down
Expand Up @@ -37,7 +37,6 @@ class ConferenceForm < Form
attribute :location, String
attribute :participatory_processes_ids, Array[Integer]
attribute :assemblies_ids, Array[Integer]
attribute :consultations_ids, Array[Integer]

validates :weight, presence: true, numericality: { greater_than_or_equal_to: 0 }
validates :slug, presence: true, format: { with: Decidim::Conference.slug_format }
Expand Down Expand Up @@ -90,18 +89,6 @@ def assemblies_for_select
end
end

def consultations_for_select
return unless Decidim.participatory_space_manifests.map(&:name).include?(:consultations)

@consultations_for_select ||= Decidim.find_participatory_space_manifest(:consultations)
.participatory_spaces.call(current_organization)&.order(title: :asc)&.map do |consultation|
[
translated_attribute(consultation.title),
consultation.id
]
end
end

private

def available_slots_greater_than_or_equal_to_registrations_count
Expand Down
Expand Up @@ -18,10 +18,6 @@ def processes_selected
def assemblies_selected
@assemblies_selected ||= current_conference.linked_participatory_space_resources(:assemblies, "included_assemblies").pluck(:id) if current_conference.present?
end

def consultations_selected
@consultations_selected ||= current_conference.linked_participatory_space_resources("Consultations", "included_consultations").pluck(:id) if current_conference.present?
end
end
end
end
Expand Down
Expand Up @@ -108,16 +108,6 @@
{ multiple: true, class: "chosen-select" } %>
<% end %>
</div>

<div class="row column">
<% if @form.consultations_for_select %>
<%= form.select :consultations_ids,
options_for_select(@form.consultations_for_select, selected: consultations_selected ),
{ include_blank: true },
{ multiple: true, class: "chosen-select" } %>
<% end %>
</div>

</div>
</div>

Expand Down
2 changes: 0 additions & 2 deletions decidim-conferences/config/locales/en.yml
Expand Up @@ -6,7 +6,6 @@ en:
assemblies_ids: Related Assemblies
available_slots: Available slots
banner_image: Banner image
consultations_ids: Related Consultations
copy_categories: Copy categories
copy_components: Copy components
copy_features: Copy features
Expand Down Expand Up @@ -512,7 +511,6 @@ en:
introduction: Introduction
objectives: Objectives
related_assemblies: Related assemblies
related_consultations: Related Consultations
related_participatory_processes: Related participatory processes
events:
conferences:
Expand Down