decidim-participatory_processes 0.29.1 → 0.30.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/participatory_process_groups/process_filters_cell.rb +4 -5
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_settings_form/show.erb +1 -1
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata_cell.rb +7 -0
- data/app/cells/decidim/participatory_processes/process_filters/show.erb +0 -1
- data/app/cells/decidim/participatory_processes/process_filters_cell.rb +6 -32
- data/app/commands/decidim/participatory_processes/admin/copy_participatory_process.rb +2 -23
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +3 -3
- data/app/commands/decidim/participatory_processes/admin/import_participatory_process.rb +0 -1
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +3 -3
- data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_share_tokens_controller.rb +16 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +15 -3
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +2 -4
- data/app/controllers/decidim/participatory_processes/participatory_space_private_users_controller.rb +27 -0
- data/app/forms/decidim/participatory_processes/admin/participatory_process_copy_form.rb +0 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +6 -36
- data/app/forms/decidim/participatory_processes/admin/participatory_process_import_form.rb +0 -1
- data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +28 -20
- data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +1 -1
- data/app/models/decidim/participatory_process.rb +19 -3
- data/app/permissions/decidim/participatory_processes/permissions.rb +15 -14
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_presenter.rb +1 -1
- data/app/presenters/decidim/participatory_processes/participatory_process_group_presenter.rb +1 -1
- data/app/presenters/decidim/participatory_processes/participatory_process_presenter.rb +1 -1
- data/app/queries/decidim/participatory_processes/metrics/participatory_process_followers_metric_measure.rb +2 -2
- data/app/queries/decidim/participatory_processes/metrics/participatory_processes_metric_manage.rb +2 -2
- data/app/serializers/decidim/participatory_processes/open_data_participatory_process_serializer.rb +47 -0
- data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +1 -43
- data/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +17 -126
- data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +0 -4
- data/app/views/decidim/participatory_processes/admin/participatory_process_imports/_form.html.erb +0 -3
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +25 -60
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_process_row.html.erb +83 -0
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_processes_thead.html.erb +19 -0
- data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +16 -84
- data/app/views/decidim/participatory_processes/admin/participatory_processes/manage_trash.html.erb +20 -0
- data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +3 -1
- data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +3 -1
- data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +6 -6
- data/app/views/decidim/participatory_processes/participatory_space_private_users/index.html.erb +22 -0
- data/config/assets.rb +1 -2
- data/config/locales/ar.yml +3 -7
- data/config/locales/bg.yml +0 -36
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +23 -0
- data/config/locales/ca.yml +61 -36
- data/config/locales/cs.yml +61 -36
- data/config/locales/de.yml +60 -35
- data/config/locales/el.yml +0 -36
- data/config/locales/en.yml +61 -36
- data/config/locales/es-MX.yml +60 -35
- data/config/locales/es-PY.yml +60 -35
- data/config/locales/es.yml +60 -35
- data/config/locales/eu.yml +103 -78
- data/config/locales/fi-plain.yml +61 -36
- data/config/locales/fi.yml +67 -42
- data/config/locales/fr-CA.yml +24 -35
- data/config/locales/fr.yml +24 -35
- data/config/locales/ga-IE.yml +0 -4
- data/config/locales/gl.yml +0 -7
- data/config/locales/hu.yml +0 -36
- data/config/locales/id-ID.yml +0 -7
- data/config/locales/is-IS.yml +0 -3
- data/config/locales/it.yml +0 -10
- data/config/locales/ja.yml +61 -36
- data/config/locales/lb.yml +0 -9
- data/config/locales/lt.yml +0 -36
- data/config/locales/lv.yml +0 -10
- data/config/locales/nl.yml +0 -10
- data/config/locales/no.yml +0 -36
- data/config/locales/pl.yml +0 -36
- data/config/locales/pt-BR.yml +0 -25
- data/config/locales/pt.yml +6 -10
- data/config/locales/ro-RO.yml +6 -36
- data/config/locales/ru.yml +0 -4
- data/config/locales/sk.yml +0 -10
- data/config/locales/sr-CS.yml +0 -9
- data/config/locales/sv.yml +62 -43
- data/config/locales/tr-TR.yml +0 -10
- data/config/locales/uk.yml +0 -4
- data/config/locales/zh-CN.yml +0 -10
- data/config/locales/zh-TW.yml +0 -36
- data/db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb +1 -1
- data/db/migrate/20240822161355_add_deleted_at_to_decidim_participatory_processes.rb +8 -0
- data/db/migrate/20241108141423_remove_column_show_metrics_from_participatory_processes.rb +7 -0
- data/db/migrate/20241108141514_remove_column_banner_image_from_participatory_processes.rb +7 -0
- data/db/migrate/20241108141605_remove_column_show_statistics_from_participatory_processes.rb +7 -0
- data/decidim-participatory_processes.gemspec +2 -2
- data/lib/decidim/api/participatory_process_group_type.rb +3 -3
- data/lib/decidim/api/participatory_process_step_type.rb +7 -9
- data/lib/decidim/api/participatory_process_type.rb +18 -23
- data/lib/decidim/api/participatory_process_type_type.rb +3 -3
- data/lib/decidim/participatory_processes/admin_engine.rb +85 -59
- data/lib/decidim/participatory_processes/content_blocks/registry_manager.rb +11 -0
- data/lib/decidim/participatory_processes/engine.rb +7 -0
- data/lib/decidim/participatory_processes/menu.rb +9 -17
- data/lib/decidim/participatory_processes/participatory_space.rb +5 -2
- data/lib/decidim/participatory_processes/query_extensions.rb +26 -0
- data/lib/decidim/participatory_processes/seeds.rb +8 -16
- data/lib/decidim/participatory_processes/test/factories.rb +14 -14
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +27 -26
- data/app/cells/decidim/participatory_processes/process_filters/type_filter.erb +0 -17
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_type.rb +0 -17
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_type.rb +0 -13
- data/app/controllers/decidim/participatory_processes/admin/categories_controller.rb +0 -13
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_types_controller.rb +0 -117
- data/app/forms/decidim/participatory_processes/admin/participatory_process_type_form.rb +0 -20
- data/app/helpers/decidim/participatory_processes/admin/participatory_process_helper.rb +0 -24
- data/app/packs/entrypoints/decidim_participatory_processes_admin.js +0 -1
- data/app/packs/src/decidim/participatory_processes/admin/participatory_processes.js +0 -18
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/_form.html.erb +0 -9
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/edit.html.erb +0 -18
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/index.html.erb +0 -58
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/new.html.erb +0 -18
@@ -6,42 +6,37 @@ module Decidim
|
|
6
6
|
class ParticipatoryProcessType < Decidim::Api::Types::BaseObject
|
7
7
|
implements Decidim::Core::ParticipatorySpaceInterface
|
8
8
|
implements Decidim::Core::ParticipatorySpaceResourceableInterface
|
9
|
-
implements Decidim::Core::
|
9
|
+
implements Decidim::Core::TaxonomizableInterface
|
10
|
+
implements Decidim::Core::TimestampsInterface
|
10
11
|
implements Decidim::Core::AttachableInterface
|
11
12
|
implements Decidim::Core::CategoriesContainerInterface
|
12
13
|
|
13
14
|
description "A participatory process"
|
14
15
|
|
15
|
-
field :
|
16
|
-
field :slug, GraphQL::Types::String, null: false
|
17
|
-
field :hashtag, GraphQL::Types::String, "The hashtag for this participatory process", null: true
|
18
|
-
field :created_at, Decidim::Core::DateTimeType, "The time this page was created", null: false
|
19
|
-
field :updated_at, Decidim::Core::DateTimeType, "The time this page was updated", null: false
|
20
|
-
field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
|
21
|
-
field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process.", null: true
|
16
|
+
field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process.", null: true
|
22
17
|
field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process.", null: true
|
23
|
-
field :
|
24
|
-
field :start_date, Decidim::Core::DateType, "This participatory process' start date.", null: true
|
18
|
+
field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this participatory process.", null: true
|
25
19
|
field :end_date, Decidim::Core::DateType, "This participatory process' end date.", null: true
|
26
|
-
|
20
|
+
field :hashtag, GraphQL::Types::String, "The hashtag for this participatory process", null: true
|
27
21
|
field :hero_image, GraphQL::Types::String, "The hero image for this participatory process", null: true
|
28
|
-
field :
|
29
|
-
field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this participatory process.", null: true
|
30
|
-
field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this participatory process.", null: true
|
22
|
+
field :id, GraphQL::Types::ID, "The internal ID for this participatory process", null: false
|
31
23
|
field :local_area, Decidim::Core::TranslatedFieldType, "The organization area of this participatory process.", null: true
|
32
|
-
field :
|
24
|
+
field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this participatory process.", null: true
|
25
|
+
field :participatory_process_group, Decidim::ParticipatoryProcesses::ParticipatoryProcessGroupType,
|
26
|
+
null: true,
|
27
|
+
description: "The participatory process group in which this process belong to"
|
33
28
|
field :participatory_scope, Decidim::Core::TranslatedFieldType, "What is decided on this participatory process.", null: true
|
34
29
|
field :participatory_structure, Decidim::Core::TranslatedFieldType, "How it is decided on this participatory process.", null: true
|
35
|
-
field :
|
36
|
-
|
37
|
-
field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process.", null: true
|
38
|
-
|
30
|
+
field :promoted, GraphQL::Types::Boolean, "If this participatory process is promoted (therefore in the homepage)", null: true
|
31
|
+
field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
|
39
32
|
field :reference, GraphQL::Types::String, "Reference prefix for this participatory process", null: true
|
33
|
+
field :scopes_enabled, GraphQL::Types::Boolean, "If this participatory process has scopes enabled", null: true
|
34
|
+
field :short_description, Decidim::Core::TranslatedFieldType, "The short description of this participatory process.", null: true
|
35
|
+
field :slug, GraphQL::Types::String, "The slug of the Participatory Process", null: false
|
36
|
+
field :start_date, Decidim::Core::DateType, "This participatory process' start date.", null: true
|
40
37
|
field :steps, [Decidim::ParticipatoryProcesses::ParticipatoryProcessStepType, { null: true }], "All the steps of this process.", null: false
|
41
|
-
|
42
|
-
field :
|
43
|
-
null: true,
|
44
|
-
description: "The participatory process group in which this process belong to"
|
38
|
+
field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process.", null: true
|
39
|
+
field :target, Decidim::Core::TranslatedFieldType, "Who participates in this participatory process.", null: true
|
45
40
|
|
46
41
|
def hero_image
|
47
42
|
object.attached_uploader(:hero_image).url
|
@@ -4,14 +4,14 @@ module Decidim
|
|
4
4
|
module ParticipatoryProcesses
|
5
5
|
# This type represents a ParticipatoryProcessType.
|
6
6
|
class ParticipatoryProcessTypeType < Decidim::Api::Types::BaseObject
|
7
|
+
implements Decidim::Core::TimestampsInterface
|
8
|
+
|
7
9
|
description "A participatory process type"
|
8
10
|
|
9
11
|
field :id, GraphQL::Types::ID, "Unique ID of this participatory process type", null: false
|
10
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process type", null: true
|
11
|
-
field :created_at, Decidim::Core::DateTimeType, "The time this participatory process type was created", null: false
|
12
|
-
field :updated_at, Decidim::Core::DateTimeType, "The time this participatory process type was updated", null: false
|
13
12
|
field :processes, [Decidim::ParticipatoryProcesses::ParticipatoryProcessType, { null: true }],
|
14
13
|
description: "Lists all the participatory processes belonging to this type", null: false
|
14
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process type", null: true
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -16,89 +16,115 @@ module Decidim
|
|
16
16
|
paths["lib/tasks"] = nil
|
17
17
|
|
18
18
|
routes do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
resources :participatory_process_types
|
25
|
-
resources :participatory_processes, param: :slug, except: [:show, :destroy] do
|
26
|
-
resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]
|
27
|
-
resources :copies, controller: "participatory_process_copies", only: [:new, :create]
|
28
|
-
|
29
|
-
resources :steps, controller: "participatory_process_steps" do
|
30
|
-
resource :activate, controller: "participatory_process_step_activations", only: [:create, :destroy]
|
31
|
-
collection do
|
32
|
-
post :ordering, to: "participatory_process_step_ordering#create"
|
19
|
+
constraints(->(request) { Decidim::Admin::OrganizationDashboardConstraint.new(request).matches? }) do
|
20
|
+
resources :participatory_process_groups do
|
21
|
+
resource :landing_page, only: [:edit, :update], controller: "participatory_process_group_landing_page" do
|
22
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "participatory_process_group_landing_page_content_blocks"
|
33
23
|
end
|
34
24
|
end
|
35
|
-
resources :
|
25
|
+
resources :participatory_processes, param: :slug, except: [:show, :destroy] do
|
26
|
+
resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]
|
27
|
+
resources :copies, controller: "participatory_process_copies", only: [:new, :create]
|
28
|
+
|
36
29
|
member do
|
37
|
-
|
30
|
+
patch :soft_delete
|
31
|
+
patch :restore
|
38
32
|
end
|
39
|
-
end
|
40
|
-
resources :attachment_collections, controller: "participatory_process_attachment_collections", except: [:show]
|
41
|
-
resources :attachments, controller: "participatory_process_attachments", except: [:show]
|
42
|
-
|
43
|
-
resource :export, controller: "participatory_process_exports", only: :create
|
44
33
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
34
|
+
resources :steps, controller: "participatory_process_steps" do
|
35
|
+
resource :activate, controller: "participatory_process_step_activations", only: [:create, :destroy]
|
36
|
+
collection do
|
37
|
+
post :ordering, to: "participatory_process_step_ordering#create"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
resources :user_roles, controller: "participatory_process_user_roles" do
|
41
|
+
member do
|
42
|
+
post :resend_invitation, to: "participatory_process_user_roles#resend_invitation"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
resources :attachment_collections, controller: "participatory_process_attachment_collections", except: [:show]
|
46
|
+
resources :attachments, controller: "participatory_process_attachments", except: [:show]
|
52
47
|
|
53
|
-
|
54
|
-
resources :categories, except: [:show]
|
48
|
+
resource :export, controller: "participatory_process_exports", only: :create
|
55
49
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
put :publish
|
60
|
-
put :unpublish
|
61
|
-
get :share
|
50
|
+
collection do
|
51
|
+
get :manage_trash, to: "participatory_processes#manage_trash"
|
52
|
+
resources :imports, controller: "participatory_process_imports", only: [:new, :create]
|
62
53
|
end
|
63
|
-
|
64
|
-
|
65
|
-
get :example, on: :collection
|
54
|
+
resource :landing_page, only: [:edit, :update], controller: "participatory_process_landing_page" do
|
55
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "participatory_process_landing_page_content_blocks"
|
66
56
|
end
|
67
|
-
resources :reminders, only: [:new, :create]
|
68
57
|
end
|
69
58
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
59
|
+
scope "/participatory_processes/:participatory_process_slug" do
|
60
|
+
resources :components do
|
61
|
+
collection do
|
62
|
+
put :reorder
|
63
|
+
end
|
64
|
+
resource :permissions, controller: "component_permissions"
|
65
|
+
member do
|
66
|
+
put :publish
|
67
|
+
put :unpublish
|
68
|
+
get :share
|
69
|
+
patch :soft_delete
|
70
|
+
patch :restore
|
71
|
+
end
|
72
|
+
collection do
|
73
|
+
get :manage_trash, to: "components#manage_trash"
|
74
|
+
put :hide
|
75
|
+
end
|
76
|
+
resources :component_share_tokens, except: [:show], path: "share_tokens", as: "share_tokens"
|
77
|
+
resources :exports, only: :create
|
78
|
+
resources :imports, only: [:new, :create] do
|
79
|
+
get :example, on: :collection
|
80
|
+
end
|
81
|
+
resources :reminders, only: [:new, :create]
|
75
82
|
end
|
76
|
-
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
77
|
-
end
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
84
|
+
resources :moderations do
|
85
|
+
member do
|
86
|
+
put :unreport
|
87
|
+
put :hide
|
88
|
+
put :unhide
|
89
|
+
end
|
90
|
+
patch :bulk_action, on: :collection
|
91
|
+
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
82
92
|
end
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
|
94
|
+
resources :participatory_space_private_users, controller: "participatory_space_private_users" do
|
95
|
+
member do
|
96
|
+
post :resend_invitation, to: "participatory_space_private_users#resend_invitation"
|
97
|
+
end
|
98
|
+
collection do
|
99
|
+
resource :participatory_space_private_users_csv_imports, only: [:new, :create], path: "csv_import" do
|
100
|
+
delete :destroy_all
|
101
|
+
end
|
102
|
+
post :publish_all
|
103
|
+
post :unpublish_all
|
86
104
|
end
|
87
105
|
end
|
106
|
+
|
107
|
+
resources :participatory_process_share_tokens, except: [:show], path: "share_tokens"
|
88
108
|
end
|
89
|
-
end
|
90
109
|
|
91
|
-
|
92
|
-
|
93
|
-
|
110
|
+
scope "/participatory_processes/:participatory_process_slug/components/:component_id/manage" do
|
111
|
+
Decidim.component_manifests.each do |manifest|
|
112
|
+
next unless manifest.admin_engine
|
94
113
|
|
95
|
-
|
96
|
-
|
114
|
+
constraints CurrentComponent.new(manifest) do
|
115
|
+
mount manifest.admin_engine, at: "/", as: "decidim_admin_participatory_process_#{manifest.name}"
|
116
|
+
end
|
97
117
|
end
|
98
118
|
end
|
99
119
|
end
|
100
120
|
end
|
101
121
|
|
122
|
+
initializer "decidim_participatory_processes_admin.mount_routes" do
|
123
|
+
Decidim::Core::Engine.routes do
|
124
|
+
mount Decidim::ParticipatoryProcesses::AdminEngine, at: "/admin", as: "decidim_admin_participatory_processes"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
102
128
|
initializer "decidim_participatory_processes_admin.menu" do
|
103
129
|
Decidim::ParticipatoryProcesses::Menu.register_admin_menu_modules!
|
104
130
|
Decidim::ParticipatoryProcesses::Menu.register_admin_participatory_processes_menu!
|
@@ -166,6 +166,7 @@ module Decidim
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
+
register_highlighted_debates
|
169
170
|
register_highlighted_meetings
|
170
171
|
register_highlighted_posts
|
171
172
|
register_highlighted_proposals
|
@@ -173,6 +174,16 @@ module Decidim
|
|
173
174
|
register_related_assemblies
|
174
175
|
end
|
175
176
|
|
177
|
+
def self.register_highlighted_debates
|
178
|
+
return unless Decidim.module_installed?(:debates)
|
179
|
+
|
180
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_debates) do |content_block|
|
181
|
+
content_block.cell = "decidim/debates/content_blocks/highlighted_debates"
|
182
|
+
content_block.public_name_key = "decidim.debates.content_blocks.highlighted_debates.name"
|
183
|
+
content_block.component_manifest_name = "debates"
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
176
187
|
def self.register_highlighted_meetings
|
177
188
|
return unless Decidim.module_installed?(:meetings)
|
178
189
|
|
@@ -33,6 +33,7 @@ module Decidim
|
|
33
33
|
resources :participatory_process_groups, only: :show, path: "processes_groups"
|
34
34
|
resources :participatory_processes, only: [:index, :show], param: :slug, path: "processes" do
|
35
35
|
get "all-metrics", on: :member
|
36
|
+
resources :participatory_space_private_users, only: :index, path: "members"
|
36
37
|
end
|
37
38
|
|
38
39
|
scope "/processes/:participatory_process_slug/f/:component_id" do
|
@@ -46,6 +47,12 @@ module Decidim
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
50
|
+
initializer "decidim_participatory_processes.mount_routes" do
|
51
|
+
Decidim::Core::Engine.routes do
|
52
|
+
mount Decidim::ParticipatoryProcesses::Engine, at: "/", as: "decidim_participatory_processes"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
49
56
|
initializer "decidim_participatory_processes.register_icons" do
|
50
57
|
Decidim.icons.register(name: "Decidim::ParticipatoryProcess", icon: "treasure-map-line", description: "Participatory Process", category: "activity",
|
51
58
|
engine: :participatory_process)
|
@@ -44,8 +44,7 @@ module Decidim
|
|
44
44
|
icon_name: "treasure-map-line",
|
45
45
|
position: 2,
|
46
46
|
active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path, :inclusive) ||
|
47
|
-
is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive)
|
48
|
-
is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path),
|
47
|
+
is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive),
|
49
48
|
if: allowed_to?(:enter, :space_area, space_name: :processes) || allowed_to?(:enter, :space_area, space_name: :process_groups)
|
50
49
|
end
|
51
50
|
end
|
@@ -100,6 +99,7 @@ module Decidim
|
|
100
99
|
active: is_active_link?(manage_component_path(component)) ||
|
101
100
|
is_active_link?(decidim_admin_participatory_processes.edit_component_path(current_participatory_space, component)) ||
|
102
101
|
is_active_link?(decidim_admin_participatory_processes.edit_component_permissions_path(current_participatory_space, component)) ||
|
102
|
+
is_active_link?(decidim_admin_participatory_processes.component_share_tokens_path(current_participatory_space, component)) ||
|
103
103
|
participatory_space_active_link?(component),
|
104
104
|
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
105
105
|
end
|
@@ -138,13 +138,6 @@ module Decidim
|
|
138
138
|
if: allowed_to?(:read, :component),
|
139
139
|
submenu: { target_menu: :admin_participatory_process_components_menu }
|
140
140
|
|
141
|
-
menu.add_item :categories,
|
142
|
-
I18n.t("categories", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
143
|
-
decidim_admin_participatory_processes.categories_path(current_participatory_space),
|
144
|
-
active: is_active_link?(decidim_admin_participatory_processes.categories_path(current_participatory_space)),
|
145
|
-
icon_name: "price-tag-3-line",
|
146
|
-
if: allowed_to?(:read, :category)
|
147
|
-
|
148
141
|
menu.add_item :attachments,
|
149
142
|
I18n.t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
150
143
|
decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space),
|
@@ -173,6 +166,13 @@ module Decidim
|
|
173
166
|
active: is_active_link?(decidim_admin_participatory_processes.moderations_path(current_participatory_space)),
|
174
167
|
icon_name: "flag-line",
|
175
168
|
if: allowed_to?(:read, :moderation, current_participatory_space:)
|
169
|
+
|
170
|
+
menu.add_item :participatory_process_share_tokens,
|
171
|
+
I18n.t("menu.share_tokens", scope: "decidim.admin"),
|
172
|
+
decidim_admin_participatory_processes.participatory_process_share_tokens_path(current_participatory_space),
|
173
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_share_tokens_path(current_participatory_space)),
|
174
|
+
icon_name: "share-line",
|
175
|
+
if: allowed_to?(:read, :share_tokens, current_participatory_space:)
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
@@ -212,14 +212,6 @@ module Decidim
|
|
212
212
|
icon_name: "upload-line",
|
213
213
|
if: allowed_to?(:import, :process),
|
214
214
|
active: is_active_link?(decidim_admin_participatory_processes.new_import_path)
|
215
|
-
|
216
|
-
menu.add_item :participatory_process_types,
|
217
|
-
I18n.t("menu.participatory_process_types", scope: "decidim.admin"),
|
218
|
-
decidim_admin_participatory_processes.participatory_process_types_path,
|
219
|
-
position: 3,
|
220
|
-
icon_name: "price-tag-3-line",
|
221
|
-
if: allowed_to?(:manage, :participatory_process_type),
|
222
|
-
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path)
|
223
215
|
end
|
224
216
|
end
|
225
217
|
end
|
@@ -45,11 +45,14 @@ Decidim.register_participatory_space(:participatory_processes) do |participatory
|
|
45
45
|
end
|
46
46
|
|
47
47
|
participatory_space.exports :participatory_processes do |export|
|
48
|
-
export.collection do
|
49
|
-
Decidim::ParticipatoryProcess.
|
48
|
+
export.collection do
|
49
|
+
Decidim::ParticipatoryProcess.public_spaces
|
50
50
|
end
|
51
51
|
|
52
|
+
export.include_in_open_data = true
|
53
|
+
|
52
54
|
export.serializer Decidim::ParticipatoryProcesses::ParticipatoryProcessSerializer
|
55
|
+
export.open_data_serializer Decidim::ParticipatoryProcesses::OpenDataParticipatoryProcessSerializer
|
53
56
|
end
|
54
57
|
|
55
58
|
participatory_space.register_on_destroy_account do |user|
|
@@ -11,6 +11,22 @@ module Decidim
|
|
11
11
|
#
|
12
12
|
# Returns nothing.
|
13
13
|
def self.included(type)
|
14
|
+
type.field :participatory_processes,
|
15
|
+
[Decidim::ParticipatoryProcesses::ParticipatoryProcessType],
|
16
|
+
null: true,
|
17
|
+
description: "Lists all participatory_processes" do
|
18
|
+
argument :filter, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputFilter, "This argument lets you filter the results", required: false
|
19
|
+
argument :order, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputSort, "This argument lets you order the results", required: false
|
20
|
+
end
|
21
|
+
|
22
|
+
type.field :participatory_process,
|
23
|
+
Decidim::ParticipatoryProcesses::ParticipatoryProcessType,
|
24
|
+
null: true,
|
25
|
+
description: "Finds a participatory_process" do
|
26
|
+
argument :id, GraphQL::Types::ID, "The ID of the participatory space", required: false
|
27
|
+
argument :slug, String, "The slug of the participatory process", required: false
|
28
|
+
end
|
29
|
+
|
14
30
|
type.field :participatory_process_groups, [ParticipatoryProcessGroupType],
|
15
31
|
null: false,
|
16
32
|
description: "Lists all participatory process groups"
|
@@ -30,6 +46,16 @@ module Decidim
|
|
30
46
|
end
|
31
47
|
end
|
32
48
|
|
49
|
+
def participatory_processes(filter: {}, order: {})
|
50
|
+
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :participatory_processes }.first
|
51
|
+
Decidim::Core::ParticipatorySpaceListBase.new(manifest:).call(object, { filter:, order: }, context)
|
52
|
+
end
|
53
|
+
|
54
|
+
def participatory_process(id: nil, slug: nil)
|
55
|
+
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :participatory_processes }.first
|
56
|
+
Decidim::Core::ParticipatorySpaceFinderBase.new(manifest:).call(object, { id:, slug: }, context)
|
57
|
+
end
|
58
|
+
|
33
59
|
def participatory_process_groups(*)
|
34
60
|
Decidim::ParticipatoryProcessGroup.where(
|
35
61
|
organization: context[:current_organization]
|
@@ -18,13 +18,17 @@ module Decidim
|
|
18
18
|
Decidim::ContentBlocksCreator.new(process_group).create_default!
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
taxonomy = create_taxonomy!(name: "Process Types", parent: nil)
|
22
22
|
2.times do
|
23
|
-
|
23
|
+
create_taxonomy!(name: ::Faker::Lorem.word, parent: taxonomy)
|
24
24
|
end
|
25
|
+
# filters for processes only
|
26
|
+
create_taxonomy_filter!(root_taxonomy: taxonomy,
|
27
|
+
taxonomies: taxonomy.all_children,
|
28
|
+
participatory_space_manifests: [:participatory_processes])
|
25
29
|
|
26
30
|
2.times do |_n|
|
27
|
-
process = create_process!(process_group: process_groups.sample
|
31
|
+
process = create_process!(process_group: process_groups.sample)
|
28
32
|
|
29
33
|
create_follow!(Decidim::User.where(organization:, admin: true).first, process)
|
30
34
|
create_follow!(Decidim::User.where(organization:, admin: false).first, process)
|
@@ -37,10 +41,6 @@ module Decidim
|
|
37
41
|
|
38
42
|
create_attachments!(attached_to: process)
|
39
43
|
|
40
|
-
2.times do
|
41
|
-
create_category!(participatory_space: process)
|
42
|
-
end
|
43
|
-
|
44
44
|
seed_components_manifests!(participatory_space: process)
|
45
45
|
end
|
46
46
|
end
|
@@ -74,14 +74,7 @@ module Decidim
|
|
74
74
|
)
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
78
|
-
Decidim::ParticipatoryProcessType.create!(
|
79
|
-
title: Decidim::Faker::Localized.word,
|
80
|
-
organization:
|
81
|
-
)
|
82
|
-
end
|
83
|
-
|
84
|
-
def create_process!(process_group: nil, process_type: nil)
|
77
|
+
def create_process!(process_group: nil)
|
85
78
|
n = rand(2)
|
86
79
|
params = {
|
87
80
|
title: Decidim::Faker::Localized.sentence(word_count: 5),
|
@@ -107,7 +100,6 @@ module Decidim
|
|
107
100
|
start_date: Date.current,
|
108
101
|
end_date: 2.months.from_now,
|
109
102
|
participatory_process_group: process_group,
|
110
|
-
participatory_process_type: process_type,
|
111
103
|
scope: n.positive? ? nil : Decidim::Scope.all.sample
|
112
104
|
}
|
113
105
|
|
@@ -23,6 +23,7 @@ FactoryBot.define do
|
|
23
23
|
organization
|
24
24
|
hero_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after organization
|
25
25
|
published_at { Time.current }
|
26
|
+
deleted_at { nil }
|
26
27
|
meta_scope { generate_localized_word(:participatory_process_meta_scope, skip_injection:) }
|
27
28
|
developer_group { generate_localized_title(:participatory_process_developer_group, skip_injection:) }
|
28
29
|
local_area { generate_localized_title(:participatory_process_local_area, skip_injection:) }
|
@@ -47,6 +48,10 @@ FactoryBot.define do
|
|
47
48
|
published_at { Time.current }
|
48
49
|
end
|
49
50
|
|
51
|
+
trait :trashed do
|
52
|
+
deleted_at { Time.current }
|
53
|
+
end
|
54
|
+
|
50
55
|
trait :private do
|
51
56
|
private_space { true }
|
52
57
|
end
|
@@ -80,11 +85,6 @@ FactoryBot.define do
|
|
80
85
|
end_date { 2.weeks.from_now }
|
81
86
|
end
|
82
87
|
|
83
|
-
trait :with_scope do
|
84
|
-
scopes_enabled { true }
|
85
|
-
scope { create :scope, organization:, skip_injection: }
|
86
|
-
end
|
87
|
-
|
88
88
|
trait :with_content_blocks do
|
89
89
|
transient { blocks_manifests { [:hero] } }
|
90
90
|
|
@@ -186,10 +186,10 @@ FactoryBot.define do
|
|
186
186
|
admin_terms_accepted_at { Time.current }
|
187
187
|
|
188
188
|
after(:create) do |user, evaluator|
|
189
|
-
create
|
189
|
+
create(:participatory_process_user_role,
|
190
190
|
user:,
|
191
191
|
participatory_process: evaluator.participatory_process,
|
192
|
-
role: :admin, skip_injection: evaluator.skip_injection
|
192
|
+
role: :admin, skip_injection: evaluator.skip_injection)
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
@@ -203,10 +203,10 @@ FactoryBot.define do
|
|
203
203
|
admin_terms_accepted_at { Time.current }
|
204
204
|
|
205
205
|
after(:create) do |user, evaluator|
|
206
|
-
create
|
206
|
+
create(:participatory_process_user_role,
|
207
207
|
user:,
|
208
208
|
participatory_process: evaluator.participatory_process,
|
209
|
-
role: :collaborator, skip_injection: evaluator.skip_injection
|
209
|
+
role: :collaborator, skip_injection: evaluator.skip_injection)
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
@@ -220,10 +220,10 @@ FactoryBot.define do
|
|
220
220
|
admin_terms_accepted_at { Time.current }
|
221
221
|
|
222
222
|
after(:create) do |user, evaluator|
|
223
|
-
create
|
223
|
+
create(:participatory_process_user_role,
|
224
224
|
user:,
|
225
225
|
participatory_process: evaluator.participatory_process,
|
226
|
-
role: :moderator, skip_injection: evaluator.skip_injection
|
226
|
+
role: :moderator, skip_injection: evaluator.skip_injection)
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
@@ -237,10 +237,10 @@ FactoryBot.define do
|
|
237
237
|
admin_terms_accepted_at { Time.current }
|
238
238
|
|
239
239
|
after(:create) do |user, evaluator|
|
240
|
-
create
|
240
|
+
create(:participatory_process_user_role,
|
241
241
|
user:,
|
242
242
|
participatory_process: evaluator.participatory_process,
|
243
|
-
role: :valuator, skip_injection: evaluator.skip_injection
|
243
|
+
role: :valuator, skip_injection: evaluator.skip_injection)
|
244
244
|
end
|
245
245
|
end
|
246
246
|
|
@@ -249,7 +249,7 @@ FactoryBot.define do
|
|
249
249
|
skip_injection { false }
|
250
250
|
end
|
251
251
|
user
|
252
|
-
participatory_process { create
|
252
|
+
participatory_process { create(:participatory_process, organization: user.organization, skip_injection:) }
|
253
253
|
role { "admin" }
|
254
254
|
end
|
255
255
|
end
|