decidim-accountability 0.29.4 → 0.30.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/cells/decidim/accountability/project/show.erb +6 -0
- data/app/cells/decidim/accountability/project_cell.rb +23 -42
- data/app/cells/decidim/accountability/result_history_cell.rb +57 -0
- data/app/cells/decidim/accountability/result_metadata_cell.rb +17 -17
- data/app/cells/decidim/accountability/status_cell.rb +9 -13
- data/app/commands/decidim/accountability/admin/create_imported_result.rb +1 -1
- data/app/commands/decidim/accountability/admin/create_result.rb +3 -2
- data/app/commands/decidim/accountability/admin/import_component_to_accountability.rb +47 -0
- data/app/commands/decidim/accountability/admin/update_imported_result.rb +1 -1
- data/app/commands/decidim/accountability/admin/update_result.rb +3 -2
- data/app/commands/decidim/accountability/admin/update_result_dates.rb +56 -0
- data/app/commands/decidim/accountability/admin/update_result_status.rb +61 -0
- data/app/commands/decidim/accountability/admin/update_result_taxonomies.rb +18 -0
- data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +8 -6
- data/app/controllers/decidim/accountability/admin/import_components_controller.rb +36 -0
- data/app/controllers/decidim/accountability/admin/results_bulk_actions_controller.rb +102 -0
- data/app/controllers/decidim/accountability/admin/results_controller.rb +21 -11
- data/app/controllers/decidim/accountability/results_controller.rb +10 -7
- data/app/forms/decidim/accountability/admin/import_component_form.rb +98 -0
- data/app/forms/decidim/accountability/admin/result_bulk_actions_form.rb +18 -0
- data/app/forms/decidim/accountability/admin/result_form.rb +17 -23
- data/app/helpers/decidim/accountability/admin/application_helper.rb +0 -1
- data/app/helpers/decidim/accountability/application_helper.rb +1 -32
- data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -14
- data/app/jobs/decidim/accountability/admin/import_projects_job.rb +5 -3
- data/app/jobs/decidim/accountability/admin/import_proposals_job.rb +70 -0
- data/app/mailers/decidim/accountability/import_proposals_mailer.rb +28 -0
- data/app/models/decidim/accountability/result.rb +23 -1
- data/app/models/decidim/accountability/status.rb +4 -0
- data/app/packs/entrypoints/decidim_accountability_admin_form.js +1 -0
- data/app/packs/src/decidim/accountability/admin/imports.js +37 -14
- data/app/packs/src/decidim/accountability/admin/index/action_button.js +42 -0
- data/app/packs/src/decidim/accountability/admin/index/action_form.js +46 -0
- data/app/packs/src/decidim/accountability/admin/index/action_selector.js +37 -0
- data/app/packs/src/decidim/accountability/admin/index/counter.js +40 -0
- data/app/packs/src/decidim/accountability/admin/index/select_all.js +29 -0
- data/app/packs/src/decidim/accountability/admin/index.js +17 -7
- data/app/packs/src/decidim/accountability/admin/result_form.js +21 -0
- data/app/packs/stylesheets/accountability.scss +5 -0
- data/app/permissions/decidim/accountability/admin/permissions.rb +3 -2
- data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +1 -1
- data/app/presenters/decidim/accountability/result_presenter.rb +30 -0
- data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +6 -6
- data/app/services/decidim/accountability/results_calculator.rb +4 -6
- data/app/services/decidim/accountability/results_csv_importer.rb +1 -1
- data/app/views/decidim/accountability/admin/import_components/_filters.html.erb +26 -0
- data/app/views/decidim/accountability/admin/import_components/_form.html.erb +26 -0
- data/app/views/decidim/accountability/admin/import_components/new.html.erb +14 -0
- data/app/views/decidim/accountability/admin/results/_actions.html.erb +29 -0
- data/app/views/decidim/accountability/admin/results/_form.html.erb +15 -8
- data/app/views/decidim/accountability/admin/results/_result-tr.html.erb +32 -0
- data/app/views/decidim/accountability/admin/results/_results-thead.html.erb +26 -0
- data/app/views/decidim/accountability/admin/results/bulk_actions/_dates_form.html.erb +19 -0
- data/app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb +40 -0
- data/app/views/decidim/accountability/admin/results/bulk_actions/_status_form.html.erb +16 -0
- data/app/views/decidim/accountability/admin/results/bulk_actions/_submit_buttons.html.erb +4 -0
- data/app/views/decidim/accountability/admin/results/bulk_actions/_taxonomies_form.html.erb +18 -0
- data/app/views/decidim/accountability/admin/results/edit.html.erb +2 -2
- data/app/views/decidim/accountability/admin/results/index.html.erb +50 -111
- data/app/views/decidim/accountability/admin/results/manage_trash.html.erb +26 -0
- data/app/views/decidim/accountability/admin/results/new.html.erb +2 -2
- data/app/views/decidim/accountability/import_proposals_mailer/import.html.erb +2 -0
- data/app/views/decidim/accountability/results/{_home_categories.html.erb → _home_taxonomies.html.erb} +6 -8
- data/app/views/decidim/accountability/results/_project.html.erb +1 -3
- data/app/views/decidim/accountability/results/_projects_aside.html.erb +9 -7
- data/app/views/decidim/accountability/results/home.html.erb +18 -6
- data/app/views/decidim/accountability/results/index.html.erb +8 -2
- data/app/views/decidim/accountability/results/show.html.erb +5 -5
- data/config/assets.rb +3 -2
- data/config/locales/ar.yml +97 -55
- data/config/locales/bg.yml +0 -50
- data/config/locales/bs-BA.yml +0 -16
- data/config/locales/ca.yml +128 -40
- data/config/locales/cs.yml +147 -56
- data/config/locales/da.yml +0 -23
- data/config/locales/de.yml +126 -39
- data/config/locales/el.yml +0 -48
- data/config/locales/en.yml +128 -40
- data/config/locales/es-MX.yml +129 -41
- data/config/locales/es-PY.yml +129 -41
- data/config/locales/es.yml +129 -41
- data/config/locales/eu.yml +141 -54
- data/config/locales/fi-plain.yml +136 -49
- data/config/locales/fi.yml +136 -49
- data/config/locales/fr-CA.yml +112 -58
- data/config/locales/fr.yml +112 -58
- data/config/locales/ga-IE.yml +0 -13
- data/config/locales/gl.yml +0 -17
- data/config/locales/gn-PY.yml +0 -11
- data/config/locales/he-IL.yml +45 -54
- data/config/locales/hu.yml +0 -50
- data/config/locales/id-ID.yml +0 -16
- data/config/locales/is-IS.yml +0 -17
- data/config/locales/it.yml +0 -75
- data/config/locales/ja.yml +132 -47
- data/config/locales/kaa.yml +0 -8
- data/config/locales/ko.yml +0 -47
- data/config/locales/lb.yml +1 -18
- data/config/locales/lt.yml +0 -50
- data/config/locales/lv.yml +0 -19
- data/config/locales/nl.yml +0 -17
- data/config/locales/no.yml +0 -17
- data/config/locales/pl.yml +0 -47
- data/config/locales/pt-BR.yml +6 -50
- data/config/locales/pt.yml +35 -23
- data/config/locales/ro-RO.yml +2 -31
- data/config/locales/ru.yml +1 -17
- data/config/locales/si-LK.yml +0 -14
- data/config/locales/sk.yml +0 -19
- data/config/locales/sl.yml +0 -17
- data/config/locales/sq-AL.yml +0 -50
- data/config/locales/sr-CS.yml +0 -16
- data/config/locales/sv.yml +125 -37
- data/config/locales/th-TH.yml +0 -50
- data/config/locales/tr-TR.yml +0 -53
- data/config/locales/uk.yml +0 -19
- data/config/locales/zh-CN.yml +0 -20
- data/config/locales/zh-TW.yml +0 -47
- data/db/migrate/20200827154103_add_commentable_counter_cache_to_results.rb +1 -1
- data/db/migrate/20240828103202_add_deleted_at_to_decidim_accountability_results.rb +8 -0
- data/db/migrate/20240916112128_add_geolocation_fields_to_results.rb +9 -0
- data/decidim-accountability.gemspec +1 -1
- data/lib/decidim/accountability/admin_engine.rb +16 -2
- data/lib/decidim/accountability/component.rb +3 -3
- data/lib/decidim/accountability/result_serializer.rb +9 -13
- data/lib/decidim/accountability/seeds.rb +28 -21
- data/lib/decidim/accountability/test/factories.rb +6 -4
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/api/accountability_type.rb +4 -5
- data/lib/decidim/api/result_type.rb +10 -13
- data/lib/decidim/api/status_type.rb +3 -4
- data/lib/decidim/api/timeline_entry_type.rb +5 -6
- metadata +58 -31
- data/app/commands/decidim/accountability/admin/import_projects_to_accountability.rb +0 -37
- data/app/controllers/decidim/accountability/admin/projects_import_controller.rb +0 -31
- data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +0 -51
- data/app/views/decidim/accountability/admin/projects_import/new.html.erb +0 -45
- data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +0 -37
- data/app/views/decidim/accountability/results/_scope_filters.html.erb +0 -31
- data/config/locales/ca-IT.yml +0 -292
- /data/app/packs/entrypoints/{decidim_accountability_admin.js → decidim_accountability_admin_index.js} +0 -0
@@ -17,10 +17,10 @@ module Decidim
|
|
17
17
|
create_statuses!(component:)
|
18
18
|
|
19
19
|
3.times do
|
20
|
-
|
20
|
+
taxonomies = create_taxonomies!
|
21
21
|
|
22
|
-
|
23
|
-
create_result!(component:,
|
22
|
+
taxonomies.each do |taxonomy|
|
23
|
+
create_result!(component:, taxonomy:)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -33,8 +33,7 @@ module Decidim
|
|
33
33
|
participatory_space:,
|
34
34
|
settings: {
|
35
35
|
intro: Decidim::Faker::Localized.wrapped("<p>", "</p>") { Decidim::Faker::Localized.sentence(word_count: 4) },
|
36
|
-
|
37
|
-
scope_id: participatory_space.scope&.id
|
36
|
+
taxonomy_filters: create_filters!.pluck(:id)
|
38
37
|
}
|
39
38
|
}
|
40
39
|
|
@@ -53,36 +52,44 @@ module Decidim
|
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
55
|
+
def root_taxonomy
|
56
|
+
@root_taxonomy ||= participatory_space.organization.taxonomies.roots.find_by("name->>'#{I18n.locale}'= ?",
|
57
|
+
"Categories") || participatory_space.organization.taxonomies.roots.sample
|
58
|
+
end
|
59
|
+
|
60
|
+
def create_taxonomies!
|
61
|
+
parent_taxonomy = root_taxonomy.children.sample || root_taxonomy.children.create!(name: Decidim::Faker::Localized.sentence(word_count: 5))
|
62
|
+
taxonomies = [parent_taxonomy]
|
59
63
|
|
60
64
|
2.times do
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
parent: parent_category,
|
67
|
-
participatory_space:
|
68
|
-
)
|
65
|
+
taxonomies << if parent_taxonomy.children.count > 1
|
66
|
+
parent_taxonomy.children.sample
|
67
|
+
else
|
68
|
+
parent_taxonomy.children.create!(name: Decidim::Faker::Localized.sentence(word_count: 5))
|
69
|
+
end
|
69
70
|
end
|
70
71
|
|
71
|
-
|
72
|
+
taxonomies
|
73
|
+
end
|
74
|
+
|
75
|
+
def create_filters!
|
76
|
+
root_taxonomy.taxonomy_filters || [create_taxonomy_filter!(root_taxonomy:, taxonomies: root_taxonomy.all_children)]
|
72
77
|
end
|
73
78
|
|
74
|
-
def create_result!(component:,
|
79
|
+
def create_result!(component:, taxonomy:)
|
75
80
|
result = Decidim.traceability.create!(
|
76
81
|
Decidim::Accountability::Result,
|
77
82
|
admin_user,
|
78
83
|
{
|
79
84
|
component:,
|
80
|
-
|
81
|
-
category:,
|
85
|
+
taxonomies: [taxonomy],
|
82
86
|
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
83
87
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
84
88
|
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
85
|
-
end
|
89
|
+
end,
|
90
|
+
address: "#{::Faker::Address.street_address} #{::Faker::Address.zip} #{::Faker::Address.city}",
|
91
|
+
latitude: ::Faker::Address.latitude,
|
92
|
+
longitude: ::Faker::Address.longitude
|
86
93
|
},
|
87
94
|
visibility: "all"
|
88
95
|
)
|
@@ -17,9 +17,7 @@ FactoryBot.define do
|
|
17
17
|
participatory_space { create(:participatory_process, :with_steps, organization:, skip_injection:) }
|
18
18
|
settings do
|
19
19
|
{
|
20
|
-
intro: generate_localized_description(:accountability_component_intro, skip_injection:)
|
21
|
-
scopes_enabled: true,
|
22
|
-
scope_id: participatory_space.scope&.id
|
20
|
+
intro: generate_localized_description(:accountability_component_intro, skip_injection:)
|
23
21
|
}
|
24
22
|
end
|
25
23
|
end
|
@@ -44,8 +42,12 @@ FactoryBot.define do
|
|
44
42
|
description { generate_localized_description(:result_description, skip_injection:) }
|
45
43
|
start_date { "12/7/2017" }
|
46
44
|
end_date { "30/9/2017" }
|
47
|
-
status { create
|
45
|
+
status { create(:status, component:, skip_injection:) }
|
48
46
|
progress { rand(1..100) }
|
47
|
+
deleted_at { nil }
|
48
|
+
address { Faker::Lorem.sentence(word_count: 3) }
|
49
|
+
latitude { Faker::Address.latitude }
|
50
|
+
longitude { Faker::Address.longitude }
|
49
51
|
end
|
50
52
|
|
51
53
|
factory :timeline_entry, class: "Decidim::Accountability::TimelineEntry" do
|
@@ -6,16 +6,15 @@ module Decidim
|
|
6
6
|
graphql_name "Accountability"
|
7
7
|
description "An accountability component of a participatory space."
|
8
8
|
|
9
|
-
field :
|
9
|
+
field :result, Decidim::Accountability::ResultType, "A single Result object", null: true do
|
10
|
+
argument :id, ID, "The id of the Result requested", required: true
|
11
|
+
end
|
12
|
+
field :results, Decidim::Accountability::ResultType.connection_type, "A collection of Results", null: true, connection: true
|
10
13
|
|
11
14
|
def results
|
12
15
|
Result.where(component: object).includes(:component)
|
13
16
|
end
|
14
17
|
|
15
|
-
field :result, Decidim::Accountability::ResultType, null: true do
|
16
|
-
argument :id, ID, required: true
|
17
|
-
end
|
18
|
-
|
19
18
|
def result(**args)
|
20
19
|
Result.where(component: object).find_by(id: args[:id])
|
21
20
|
end
|
@@ -3,29 +3,26 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
class ResultType < Decidim::Api::Types::BaseObject
|
6
|
-
implements Decidim::Core::
|
6
|
+
implements Decidim::Core::TaxonomizableInterface
|
7
|
+
implements Decidim::Core::TimestampsInterface
|
7
8
|
implements Decidim::Comments::CommentableInterface
|
8
|
-
implements Decidim::Core::ScopableInterface
|
9
9
|
|
10
10
|
description "A result"
|
11
11
|
|
12
|
-
field :
|
13
|
-
field :
|
12
|
+
field :children, [Decidim::Accountability::ResultType, { null: true }], "The children's results", null: true
|
13
|
+
field :children_count, GraphQL::Types::Int, "The number of children results", null: true
|
14
14
|
field :description, Decidim::Core::TranslatedFieldType, "The description for this result", null: true
|
15
|
-
field :reference, GraphQL::Types::String, "The reference for this result", null: true
|
16
|
-
field :start_date, Decidim::Core::DateType, "The start date for this result", null: true
|
17
15
|
field :end_date, Decidim::Core::DateType, "The end date for this result", null: true
|
18
|
-
field :progress, GraphQL::Types::Float, "The progress for this result", null: true
|
19
|
-
field :created_at, Decidim::Core::DateTimeType, "When this result was created", null: true
|
20
|
-
field :updated_at, Decidim::Core::DateTimeType, "When this result was updated", null: true
|
21
|
-
field :children_count, GraphQL::Types::Int, "The number of children results", null: true
|
22
|
-
field :weight, GraphQL::Types::Int, "The order of this result", null: false
|
23
16
|
field :external_id, GraphQL::Types::String, "The external ID for this result", null: true
|
24
|
-
|
25
|
-
field :children, [Decidim::Accountability::ResultType, { null: true }], "The children's results", null: true
|
17
|
+
field :id, GraphQL::Types::ID, "The internal ID for this result", null: false
|
26
18
|
field :parent, Decidim::Accountability::ResultType, "The parent result", null: true
|
19
|
+
field :progress, GraphQL::Types::Float, "The progress for this result", null: true
|
20
|
+
field :reference, GraphQL::Types::String, "The reference for this result", null: true
|
21
|
+
field :start_date, Decidim::Core::DateType, "The start date for this result", null: true
|
27
22
|
field :status, Decidim::Accountability::StatusType, "The status for this result", null: true
|
28
23
|
field :timeline_entries, [Decidim::Accountability::TimelineEntryType, { null: true }], "The timeline entries for this result", null: true
|
24
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this result", null: true
|
25
|
+
field :weight, GraphQL::Types::Int, "The order of this result", null: false
|
29
26
|
end
|
30
27
|
end
|
31
28
|
end
|
@@ -3,16 +3,15 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
class StatusType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::TimestampsInterface
|
7
|
+
|
6
8
|
description "A status"
|
7
9
|
|
10
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description for this status", null: true
|
8
11
|
field :id, GraphQL::Types::ID, "The internal ID for this status", null: false
|
9
12
|
field :key, GraphQL::Types::String, "The key for this status", null: true
|
10
13
|
field :name, Decidim::Core::TranslatedFieldType, "The name for this status", null: true
|
11
|
-
field :created_at, Decidim::Core::DateType, "When this status was created", null: true
|
12
|
-
field :updated_at, Decidim::Core::DateType, "When this status was updated", null: true
|
13
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description for this status", null: true
|
14
14
|
field :progress, GraphQL::Types::Int, "The progress for this status", null: true
|
15
|
-
|
16
15
|
field :results, [Decidim::Accountability::ResultType, { null: true }], "The results for this status", null: true
|
17
16
|
end
|
18
17
|
end
|
@@ -3,16 +3,15 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
class TimelineEntryType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::TimestampsInterface
|
7
|
+
|
6
8
|
description "A Timeline Entry"
|
7
9
|
|
8
|
-
field :id, GraphQL::Types::ID, "The internal ID for this timeline entry", null: false
|
9
|
-
field :entry_date, Decidim::Core::DateType, "The entry date for this timeline entry", null: true
|
10
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title for this timeline entry", null: true
|
11
10
|
field :description, Decidim::Core::TranslatedFieldType, "The description for this timeline entry", null: true
|
12
|
-
field :
|
13
|
-
field :
|
14
|
-
|
11
|
+
field :entry_date, Decidim::Core::DateType, "The entry date for this timeline entry", null: true
|
12
|
+
field :id, GraphQL::Types::ID, "The internal ID for this timeline entry", null: false
|
15
13
|
field :result, Decidim::Accountability::ResultType, "The result for this timeline entry", null: true
|
14
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this timeline entry", null: true
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-accountability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-comments
|
@@ -18,126 +18,126 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.30.0.rc1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.
|
28
|
+
version: 0.30.0.rc1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-core
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.30.0.rc1
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.30.0.rc1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-admin
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.30.0.rc1
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.30.0.rc1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-assemblies
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.30.0.rc1
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.30.0.rc1
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: decidim-comments
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.30.0.rc1
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - '='
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 0.
|
84
|
+
version: 0.30.0.rc1
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: decidim-dev
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.30.0.rc1
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - '='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
98
|
+
version: 0.30.0.rc1
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: decidim-meetings
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
105
|
+
version: 0.30.0.rc1
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - '='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.
|
112
|
+
version: 0.30.0.rc1
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: decidim-participatory_processes
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - '='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
119
|
+
version: 0.30.0.rc1
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
124
|
- - '='
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
126
|
+
version: 0.30.0.rc1
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
128
|
name: decidim-proposals
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - '='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.30.0.rc1
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - '='
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 0.
|
140
|
+
version: 0.30.0.rc1
|
141
141
|
description: An accountability component for decidim's participatory spaces.
|
142
142
|
email:
|
143
143
|
- josepjaume@gmail.com
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- app/cells/decidim/accountability/result_activity_cell.rb
|
161
161
|
- app/cells/decidim/accountability/result_card_cell.rb
|
162
162
|
- app/cells/decidim/accountability/result_cell.rb
|
163
|
+
- app/cells/decidim/accountability/result_history_cell.rb
|
163
164
|
- app/cells/decidim/accountability/result_l/extra_data.erb
|
164
165
|
- app/cells/decidim/accountability/result_l_cell.rb
|
165
166
|
- app/cells/decidim/accountability/result_metadata/project_aside.erb
|
@@ -176,17 +177,21 @@ files:
|
|
176
177
|
- app/commands/decidim/accountability/admin/create_status.rb
|
177
178
|
- app/commands/decidim/accountability/admin/create_timeline_entry.rb
|
178
179
|
- app/commands/decidim/accountability/admin/has_result_command.rb
|
179
|
-
- app/commands/decidim/accountability/admin/
|
180
|
+
- app/commands/decidim/accountability/admin/import_component_to_accountability.rb
|
180
181
|
- app/commands/decidim/accountability/admin/update_imported_result.rb
|
181
182
|
- app/commands/decidim/accountability/admin/update_result.rb
|
183
|
+
- app/commands/decidim/accountability/admin/update_result_dates.rb
|
184
|
+
- app/commands/decidim/accountability/admin/update_result_status.rb
|
185
|
+
- app/commands/decidim/accountability/admin/update_result_taxonomies.rb
|
182
186
|
- app/commands/decidim/accountability/admin/update_status.rb
|
183
187
|
- app/commands/decidim/accountability/admin/update_timeline_entry.rb
|
184
188
|
- app/controllers/concerns/decidim/accountability/admin/filterable.rb
|
185
189
|
- app/controllers/decidim/accountability/admin/application_controller.rb
|
186
190
|
- app/controllers/decidim/accountability/admin/attachment_collections_controller.rb
|
187
191
|
- app/controllers/decidim/accountability/admin/attachments_controller.rb
|
192
|
+
- app/controllers/decidim/accountability/admin/import_components_controller.rb
|
188
193
|
- app/controllers/decidim/accountability/admin/import_results_controller.rb
|
189
|
-
- app/controllers/decidim/accountability/admin/
|
194
|
+
- app/controllers/decidim/accountability/admin/results_bulk_actions_controller.rb
|
190
195
|
- app/controllers/decidim/accountability/admin/results_controller.rb
|
191
196
|
- app/controllers/decidim/accountability/admin/statuses_controller.rb
|
192
197
|
- app/controllers/decidim/accountability/admin/timeline_entries_controller.rb
|
@@ -196,9 +201,10 @@ files:
|
|
196
201
|
- app/events/decidim/accountability/base_result_event.rb
|
197
202
|
- app/events/decidim/accountability/proposal_linked_event.rb
|
198
203
|
- app/events/decidim/accountability/result_progress_updated_event.rb
|
204
|
+
- app/forms/decidim/accountability/admin/import_component_form.rb
|
199
205
|
- app/forms/decidim/accountability/admin/import_results_form.rb
|
206
|
+
- app/forms/decidim/accountability/admin/result_bulk_actions_form.rb
|
200
207
|
- app/forms/decidim/accountability/admin/result_form.rb
|
201
|
-
- app/forms/decidim/accountability/admin/result_import_projects_form.rb
|
202
208
|
- app/forms/decidim/accountability/admin/status_form.rb
|
203
209
|
- app/forms/decidim/accountability/admin/timeline_entry_form.rb
|
204
210
|
- app/helpers/decidim/accountability/admin/application_helper.rb
|
@@ -207,20 +213,29 @@ files:
|
|
207
213
|
- app/helpers/decidim/accountability/breadcrumb_helper.rb
|
208
214
|
- app/jobs/application_job.rb
|
209
215
|
- app/jobs/decidim/accountability/admin/import_projects_job.rb
|
216
|
+
- app/jobs/decidim/accountability/admin/import_proposals_job.rb
|
210
217
|
- app/jobs/decidim/accountability/admin/import_results_csv_job.rb
|
211
218
|
- app/mailers/decidim/accountability/import_mailer.rb
|
212
219
|
- app/mailers/decidim/accountability/import_projects_mailer.rb
|
220
|
+
- app/mailers/decidim/accountability/import_proposals_mailer.rb
|
213
221
|
- app/models/decidim/accountability/application_record.rb
|
214
222
|
- app/models/decidim/accountability/result.rb
|
215
223
|
- app/models/decidim/accountability/status.rb
|
216
224
|
- app/models/decidim/accountability/timeline_entry.rb
|
217
225
|
- app/packs/entrypoints/decidim_accountability.js
|
218
|
-
- app/packs/entrypoints/
|
226
|
+
- app/packs/entrypoints/decidim_accountability_admin_form.js
|
219
227
|
- app/packs/entrypoints/decidim_accountability_admin_imports.js
|
228
|
+
- app/packs/entrypoints/decidim_accountability_admin_index.js
|
220
229
|
- app/packs/images/decidim/accountability/breadcrumb_arrow.svg
|
221
230
|
- app/packs/images/decidim/accountability/decidim_accountability.svg
|
222
231
|
- app/packs/src/decidim/accountability/admin/imports.js
|
223
232
|
- app/packs/src/decidim/accountability/admin/index.js
|
233
|
+
- app/packs/src/decidim/accountability/admin/index/action_button.js
|
234
|
+
- app/packs/src/decidim/accountability/admin/index/action_form.js
|
235
|
+
- app/packs/src/decidim/accountability/admin/index/action_selector.js
|
236
|
+
- app/packs/src/decidim/accountability/admin/index/counter.js
|
237
|
+
- app/packs/src/decidim/accountability/admin/index/select_all.js
|
238
|
+
- app/packs/src/decidim/accountability/admin/result_form.js
|
224
239
|
- app/packs/src/decidim/accountability/index.js
|
225
240
|
- app/packs/src/decidim/accountability/version_diff.js
|
226
241
|
- app/packs/stylesheets/accountability.scss
|
@@ -230,15 +245,27 @@ files:
|
|
230
245
|
- app/presenters/decidim/accountability/admin_log/status_presenter.rb
|
231
246
|
- app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb
|
232
247
|
- app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb
|
248
|
+
- app/presenters/decidim/accountability/result_presenter.rb
|
233
249
|
- app/queries/decidim/accountability/metrics/results_metric_manage.rb
|
234
250
|
- app/services/decidim/accountability/diff_renderer.rb
|
235
251
|
- app/services/decidim/accountability/results_calculator.rb
|
236
252
|
- app/services/decidim/accountability/results_csv_importer.rb
|
253
|
+
- app/views/decidim/accountability/admin/import_components/_filters.html.erb
|
254
|
+
- app/views/decidim/accountability/admin/import_components/_form.html.erb
|
255
|
+
- app/views/decidim/accountability/admin/import_components/new.html.erb
|
237
256
|
- app/views/decidim/accountability/admin/import_results/new.html.erb
|
238
|
-
- app/views/decidim/accountability/admin/
|
257
|
+
- app/views/decidim/accountability/admin/results/_actions.html.erb
|
239
258
|
- app/views/decidim/accountability/admin/results/_form.html.erb
|
259
|
+
- app/views/decidim/accountability/admin/results/_result-tr.html.erb
|
260
|
+
- app/views/decidim/accountability/admin/results/_results-thead.html.erb
|
261
|
+
- app/views/decidim/accountability/admin/results/bulk_actions/_dates_form.html.erb
|
262
|
+
- app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb
|
263
|
+
- app/views/decidim/accountability/admin/results/bulk_actions/_status_form.html.erb
|
264
|
+
- app/views/decidim/accountability/admin/results/bulk_actions/_submit_buttons.html.erb
|
265
|
+
- app/views/decidim/accountability/admin/results/bulk_actions/_taxonomies_form.html.erb
|
240
266
|
- app/views/decidim/accountability/admin/results/edit.html.erb
|
241
267
|
- app/views/decidim/accountability/admin/results/index.html.erb
|
268
|
+
- app/views/decidim/accountability/admin/results/manage_trash.html.erb
|
242
269
|
- app/views/decidim/accountability/admin/results/new.html.erb
|
243
270
|
- app/views/decidim/accountability/admin/shared/_subnav.html.erb
|
244
271
|
- app/views/decidim/accountability/admin/statuses/_form.html.erb
|
@@ -251,12 +278,11 @@ files:
|
|
251
278
|
- app/views/decidim/accountability/admin/timeline_entries/new.html.erb
|
252
279
|
- app/views/decidim/accountability/import_mailer/import.html.erb
|
253
280
|
- app/views/decidim/accountability/import_projects_mailer/import.html.erb
|
254
|
-
- app/views/decidim/accountability/
|
281
|
+
- app/views/decidim/accountability/import_proposals_mailer/import.html.erb
|
282
|
+
- app/views/decidim/accountability/results/_home_taxonomies.html.erb
|
255
283
|
- app/views/decidim/accountability/results/_linked_results.html.erb
|
256
|
-
- app/views/decidim/accountability/results/_nav_breadcrumb.html.erb
|
257
284
|
- app/views/decidim/accountability/results/_project.html.erb
|
258
285
|
- app/views/decidim/accountability/results/_projects_aside.html.erb
|
259
|
-
- app/views/decidim/accountability/results/_scope_filters.html.erb
|
260
286
|
- app/views/decidim/accountability/results/_search.html.erb
|
261
287
|
- app/views/decidim/accountability/results/home.html.erb
|
262
288
|
- app/views/decidim/accountability/results/index.html.erb
|
@@ -272,7 +298,6 @@ files:
|
|
272
298
|
- config/locales/bg.yml
|
273
299
|
- config/locales/bn-BD.yml
|
274
300
|
- config/locales/bs-BA.yml
|
275
|
-
- config/locales/ca-IT.yml
|
276
301
|
- config/locales/ca.yml
|
277
302
|
- config/locales/cs-CZ.yml
|
278
303
|
- config/locales/cs.yml
|
@@ -362,6 +387,8 @@ files:
|
|
362
387
|
- db/migrate/20200827154103_add_commentable_counter_cache_to_results.rb
|
363
388
|
- db/migrate/20220331150008_add_title_to_timeline_entries.rb
|
364
389
|
- db/migrate/20220331150155_move_legacy_description_to_title_of_timeline_entries.rb
|
390
|
+
- db/migrate/20240828103202_add_deleted_at_to_decidim_accountability_results.rb
|
391
|
+
- db/migrate/20240916112128_add_geolocation_fields_to_results.rb
|
365
392
|
- decidim-accountability.gemspec
|
366
393
|
- lib/decidim/accountability.rb
|
367
394
|
- lib/decidim/accountability/admin.rb
|
@@ -394,14 +421,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
394
421
|
requirements:
|
395
422
|
- - "~>"
|
396
423
|
- !ruby/object:Gem::Version
|
397
|
-
version: 3.
|
424
|
+
version: 3.3.0
|
398
425
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
399
426
|
requirements:
|
400
427
|
- - ">="
|
401
428
|
- !ruby/object:Gem::Version
|
402
429
|
version: '0'
|
403
430
|
requirements: []
|
404
|
-
rubygems_version: 3.
|
431
|
+
rubygems_version: 3.5.11
|
405
432
|
signing_key:
|
406
433
|
specification_version: 4
|
407
434
|
summary: Decidim accountability module
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Accountability
|
5
|
-
module Admin
|
6
|
-
# A command with all the business logic when an admin imports projects from
|
7
|
-
# one component to accountability.
|
8
|
-
class ImportProjectsToAccountability < Decidim::Command
|
9
|
-
# Public: Initializes the command.
|
10
|
-
#
|
11
|
-
# form - A form object with the params.
|
12
|
-
def initialize(form)
|
13
|
-
@form = form
|
14
|
-
end
|
15
|
-
|
16
|
-
def call
|
17
|
-
return broadcast(:invalid) unless @form.valid?
|
18
|
-
|
19
|
-
ImportProjectsJob.perform_later(projects.pluck(:id), @form.current_component, @form.current_user)
|
20
|
-
broadcast(:ok, projects.count)
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def projects
|
26
|
-
Decidim::Budgets::Project.joins(:budget).selected.where(
|
27
|
-
budget: { component: origin_component }
|
28
|
-
).reject { |item| @form.project_already_copied?(item) }
|
29
|
-
end
|
30
|
-
|
31
|
-
def origin_component
|
32
|
-
@form.origin_component
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Accountability
|
5
|
-
module Admin
|
6
|
-
# This controller allows an admin to import results from a csv file for the Accountability component
|
7
|
-
class ProjectsImportController < Admin::ApplicationController
|
8
|
-
def new
|
9
|
-
enforce_permission_to :create, :import_projects
|
10
|
-
@form = form(Admin::ResultImportProjectsForm).instance
|
11
|
-
end
|
12
|
-
|
13
|
-
def create
|
14
|
-
enforce_permission_to :create, :import_projects
|
15
|
-
@form = form(Admin::ResultImportProjectsForm).from_params(params, accountability_component: current_component)
|
16
|
-
Admin::ImportProjectsToAccountability.call(@form) do
|
17
|
-
on(:ok) do |projects|
|
18
|
-
flash[:notice] = I18n.t("projects_import.new.success", scope: "decidim.accountability.admin", count: projects)
|
19
|
-
redirect_to results_path
|
20
|
-
end
|
21
|
-
|
22
|
-
on(:invalid) do
|
23
|
-
flash[:alert] = I18n.t("projects_import.create.invalid", scope: "decidim.accountability.admin")
|
24
|
-
render action: "new"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Accountability
|
5
|
-
module Admin
|
6
|
-
# A form object to be used when admin users want to import a collection of projects
|
7
|
-
# from another component into Accountability component.
|
8
|
-
class ResultImportProjectsForm < Decidim::Form
|
9
|
-
attribute :origin_component_id, Integer
|
10
|
-
attribute :import_all_selected_projects, Boolean
|
11
|
-
|
12
|
-
validates :origin_component_id, presence: true
|
13
|
-
validates :import_all_selected_projects, allow_nil: false, acceptance: true
|
14
|
-
validates :origin_projects_count, numericality: { greater_than: 0 }, if: ->(form) { form.origin_component_id }
|
15
|
-
|
16
|
-
def origin_component
|
17
|
-
@origin_component ||= origin_components.find_by(id: origin_component_id)
|
18
|
-
end
|
19
|
-
|
20
|
-
def origin_components_collection
|
21
|
-
origin_components.map do |component|
|
22
|
-
[component.name[I18n.locale.to_s], component.id]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def origin_components
|
27
|
-
@budgets_component ||= current_participatory_space.components.where(manifest_name: "budgets")
|
28
|
-
end
|
29
|
-
|
30
|
-
def selected_projects_count(component)
|
31
|
-
projects = Decidim::Budgets::Project.joins(:budget).selected.where(
|
32
|
-
budget: { component: }
|
33
|
-
)
|
34
|
-
projects.reject { |project| project_already_copied?(project) }.count
|
35
|
-
end
|
36
|
-
|
37
|
-
def project_already_copied?(original_project)
|
38
|
-
original_project.linked_resources(:results, "included_projects").any? do |result|
|
39
|
-
result.component == current_component
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def origin_projects_count
|
46
|
-
selected_projects_count(origin_component_id)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|