decidim-accountability 0.30.2 → 0.31.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/milestones.erb +22 -0
- data/app/cells/decidim/accountability/project_cell.rb +9 -9
- data/app/commands/decidim/accountability/admin/{create_timeline_entry.rb → create_milestone.rb} +3 -3
- data/app/commands/decidim/accountability/admin/{update_timeline_entry.rb → update_milestone.rb} +2 -2
- data/app/controllers/decidim/accountability/admin/import_components_controller.rb +1 -1
- data/app/controllers/decidim/accountability/admin/import_results_controller.rb +1 -1
- data/app/controllers/decidim/accountability/admin/milestones_controller.rb +87 -0
- data/app/controllers/decidim/accountability/admin/results_controller.rb +2 -2
- data/app/controllers/decidim/accountability/admin/statuses_controller.rb +2 -2
- data/app/controllers/decidim/accountability/results_controller.rb +20 -4
- data/app/controllers/decidim/accountability/versions_controller.rb +1 -1
- data/app/forms/decidim/accountability/admin/{timeline_entry_form.rb → milestone_form.rb} +2 -2
- data/app/models/decidim/accountability/{timeline_entry.rb → milestone.rb} +4 -4
- data/app/models/decidim/accountability/result.rb +2 -2
- data/app/packs/entrypoints/decidim_accountability.js +0 -2
- data/app/packs/entrypoints/decidim_accountability_admin_imports.js +1 -1
- data/app/packs/src/decidim/accountability/admin/index.js +4 -1
- data/app/packs/src/decidim/accountability/admin/result_form.js +1 -1
- data/app/packs/src/decidim/accountability/controllers/.gitkeep +0 -0
- data/app/packs/stylesheets/accountability.scss +35 -5
- data/app/permissions/decidim/accountability/admin/permissions.rb +3 -3
- data/app/presenters/decidim/accountability/admin_log/{timeline_entry_presenter.rb → milestone_presenter.rb} +4 -4
- data/app/presenters/decidim/accountability/result_presenter.rb +2 -5
- data/app/views/decidim/accountability/admin/import_components/_form.html.erb +3 -3
- data/app/views/decidim/accountability/admin/import_results/new.html.erb +1 -1
- data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/edit.html.erb +1 -1
- data/app/views/decidim/accountability/admin/milestones/index.html.erb +66 -0
- data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/new.html.erb +1 -1
- data/app/views/decidim/accountability/admin/results/_actions.html.erb +102 -29
- data/app/views/decidim/accountability/admin/results/_form.html.erb +1 -1
- data/app/views/decidim/accountability/admin/results/_result-tr.html.erb +7 -7
- data/app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb +25 -29
- data/app/views/decidim/accountability/admin/results/index.html.erb +12 -12
- data/app/views/decidim/accountability/admin/results/manage_trash.html.erb +2 -1
- data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
- data/app/views/decidim/accountability/admin/statuses/index.html.erb +40 -12
- data/app/views/decidim/accountability/results/_filters.html.erb +4 -0
- data/app/views/decidim/accountability/results/_home_aside.html.erb +12 -0
- data/app/views/decidim/accountability/results/_home_taxonomies.html.erb +8 -31
- data/app/views/decidim/accountability/results/_one_level_taxonomies.html.erb +17 -0
- data/app/views/decidim/accountability/results/_projects_aside.html.erb +1 -3
- data/app/views/decidim/accountability/results/_root_taxonomies_selector.html.erb +17 -0
- data/app/views/decidim/accountability/results/_two_levels_taxonomies.html.erb +30 -0
- data/app/views/decidim/accountability/results/home.html.erb +11 -25
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +0 -42
- data/config/locales/bg.yml +0 -41
- data/config/locales/bs-BA.yml +4 -25
- data/config/locales/ca-IT.yml +42 -44
- data/config/locales/ca.yml +42 -44
- data/config/locales/cs.yml +42 -44
- data/config/locales/da.yml +0 -21
- data/config/locales/de.yml +42 -44
- data/config/locales/el.yml +0 -37
- data/config/locales/en.yml +42 -44
- data/config/locales/es-MX.yml +42 -44
- data/config/locales/es-PY.yml +42 -44
- data/config/locales/es.yml +42 -44
- data/config/locales/eu.yml +43 -45
- data/config/locales/fi-plain.yml +42 -44
- data/config/locales/fi.yml +42 -44
- data/config/locales/fr-CA.yml +42 -44
- data/config/locales/fr.yml +42 -44
- data/config/locales/ga-IE.yml +0 -11
- data/config/locales/gl.yml +0 -25
- data/config/locales/gn-PY.yml +0 -2
- data/config/locales/he-IL.yml +0 -41
- data/config/locales/hu.yml +0 -41
- data/config/locales/id-ID.yml +0 -23
- data/config/locales/is-IS.yml +0 -24
- data/config/locales/it.yml +40 -43
- data/config/locales/ja.yml +42 -44
- data/config/locales/kaa.yml +0 -5
- data/config/locales/ko.yml +0 -15
- data/config/locales/lb.yml +0 -25
- data/config/locales/lt.yml +0 -37
- data/config/locales/lv.yml +0 -23
- data/config/locales/nl.yml +0 -29
- data/config/locales/no.yml +0 -29
- data/config/locales/pl.yml +0 -41
- data/config/locales/pt-BR.yml +39 -43
- data/config/locales/pt.yml +0 -26
- data/config/locales/ro-RO.yml +6 -41
- data/config/locales/ru.yml +0 -23
- data/config/locales/si-LK.yml +0 -12
- data/config/locales/sk.yml +0 -23
- data/config/locales/sl.yml +0 -18
- data/config/locales/sq-AL.yml +0 -41
- data/config/locales/sr-CS.yml +0 -23
- data/config/locales/sv.yml +42 -44
- data/config/locales/th-TH.yml +0 -27
- data/config/locales/tr-TR.yml +0 -43
- data/config/locales/uk.yml +0 -21
- data/config/locales/zh-CN.yml +0 -23
- data/config/locales/zh-TW.yml +0 -37
- data/db/migrate/20250606155946_rename_timeline_table_to_milestone.rb +11 -0
- data/lib/decidim/accountability/admin_engine.rb +1 -1
- data/lib/decidim/accountability/api.rb +1 -1
- data/lib/decidim/accountability/component.rb +18 -1
- data/lib/decidim/accountability/engine.rb +5 -13
- data/lib/decidim/accountability/seeds.rb +9 -9
- data/lib/decidim/accountability/test/factories.rb +3 -3
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/accountability.rb +0 -7
- data/lib/decidim/api/{timeline_entry_type.rb → milestone_type.rb} +8 -7
- data/lib/decidim/api/result_type.rb +17 -3
- data/lib/decidim/api/status_type.rb +1 -0
- metadata +39 -35
- data/app/cells/decidim/accountability/project/timeline.erb +0 -22
- data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +0 -87
- data/app/packs/src/decidim/accountability/index.js +0 -11
- data/app/packs/src/decidim/accountability/version_diff.js +0 -33
- data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +0 -56
- data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +0 -42
- /data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/_form.html.erb +0 -0
data/config/locales/zh-TW.yml
CHANGED
@@ -17,9 +17,6 @@ zh-TW:
|
|
17
17
|
key: 金鑰
|
18
18
|
name: 名稱
|
19
19
|
progress: 進度
|
20
|
-
timeline_entry:
|
21
|
-
description: 說明
|
22
|
-
title: 標題
|
23
20
|
models:
|
24
21
|
decidim/accountability/proposal_linked_event: 在結果的建議
|
25
22
|
decidim/accountability/result_progress_updated_event: 結果程序已更新
|
@@ -30,13 +27,10 @@ zh-TW:
|
|
30
27
|
decidim:
|
31
28
|
accountability:
|
32
29
|
actions:
|
33
|
-
attachment_collections: 資料夾
|
34
|
-
attachments: 附件
|
35
30
|
confirm_destroy: 確定要刪除 %{name} ?
|
36
31
|
destroy: 刪除
|
37
32
|
edit: 編輯
|
38
33
|
preview: 預覽
|
39
|
-
timeline_entries: 專案評估
|
40
34
|
title: 操作
|
41
35
|
admin:
|
42
36
|
exports:
|
@@ -89,23 +83,6 @@ zh-TW:
|
|
89
83
|
update:
|
90
84
|
invalid: 更新狀態時發生錯誤.
|
91
85
|
success: 狀態成功更新.
|
92
|
-
timeline_entries:
|
93
|
-
create:
|
94
|
-
invalid: 建立資料時發生錯誤.
|
95
|
-
success: 資料成功建立.
|
96
|
-
destroy:
|
97
|
-
success: 資料成功刪除.
|
98
|
-
edit:
|
99
|
-
title: 編輯資料
|
100
|
-
update: 更新資料
|
101
|
-
index:
|
102
|
-
title: 專案時程資料
|
103
|
-
new:
|
104
|
-
create: 建立資料
|
105
|
-
title: 新資料
|
106
|
-
update:
|
107
|
-
invalid: 更新資料時發生錯誤.
|
108
|
-
success: 資料成功更新.
|
109
86
|
admin_log:
|
110
87
|
result:
|
111
88
|
create: "%{user_name} 建立結果 %{resource_name} 在 %{space_name}"
|
@@ -115,10 +92,6 @@ zh-TW:
|
|
115
92
|
create: "%{user_name} 建立了 %{resource_name} 狀態"
|
116
93
|
delete: "%{user_name} 刪除了 %{resource_name} 狀態"
|
117
94
|
update: "%{user_name} 更新了 %{resource_name} 狀態"
|
118
|
-
timeline_entry:
|
119
|
-
create: "%{user_name} 建立了 %{resource_name} 時間表資料"
|
120
|
-
delete: "%{user_name} 刪除了 %{resource_name} 時間表資料"
|
121
|
-
update: "%{user_name} 更新了 %{resource_name} 時間表資料"
|
122
95
|
value_types:
|
123
96
|
parent_presenter:
|
124
97
|
not_found: '資料庫中找不到上一層 (ID: %{id})'
|
@@ -156,9 +129,6 @@ zh-TW:
|
|
156
129
|
key: 金鑰
|
157
130
|
name: 名稱
|
158
131
|
progress: 進度
|
159
|
-
timeline_entry:
|
160
|
-
fields:
|
161
|
-
title: 標題
|
162
132
|
results:
|
163
133
|
count:
|
164
134
|
results_count:
|
@@ -170,8 +140,6 @@ zh-TW:
|
|
170
140
|
show:
|
171
141
|
stats:
|
172
142
|
back_to_resource: 返回至結果
|
173
|
-
timeline:
|
174
|
-
title: 專案評估
|
175
143
|
admin:
|
176
144
|
filters:
|
177
145
|
results:
|
@@ -202,11 +170,6 @@ zh-TW:
|
|
202
170
|
email_outro: 收到這個通知表示正在訂閱 "%{proposal_title}" ,而這個提案包含在結果 "%{resource_title}" ,透過下面連結可以停止接收通知。
|
203
171
|
email_subject: '%{resource_title} 的更新進度'
|
204
172
|
notification_title: 這個結果 <a href="%{resource_path}">%{resource_title}</a> 包含提案 <a href="%{proposal_path}">%{proposal_title}</a>,現在完成 %{progress}% 。
|
205
|
-
metrics:
|
206
|
-
results:
|
207
|
-
description: 產生的結果數量
|
208
|
-
object: 結果
|
209
|
-
title: 結果
|
210
173
|
participatory_spaces:
|
211
174
|
highlighted_results:
|
212
175
|
see_all: 檢視所有結果 (%{count})
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RenameTimelineTableToMilestone < ActiveRecord::Migration[7.2]
|
4
|
+
def change
|
5
|
+
rename_table :decidim_accountability_timeline_entries, :decidim_accountability_milestones
|
6
|
+
|
7
|
+
rename_index :decidim_accountability_milestones,
|
8
|
+
"index_decidim_accountability_timeline_entries_on_results_id",
|
9
|
+
"index_decidim_accountability_milestones_on_results_id"
|
10
|
+
end
|
11
|
+
end
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
|
31
31
|
resources :attachment_collections, except: [:show]
|
32
32
|
resources :attachments, except: [:show]
|
33
|
-
resources :
|
33
|
+
resources :milestones, except: [:show]
|
34
34
|
end
|
35
35
|
resources :import_components, only: [:new, :create] do
|
36
36
|
get :preview, on: :collection
|
@@ -5,6 +5,6 @@ module Decidim
|
|
5
5
|
autoload :AccountabilityType, "decidim/api/accountability_type"
|
6
6
|
autoload :ResultType, "decidim/api/result_type"
|
7
7
|
autoload :StatusType, "decidim/api/status_type"
|
8
|
-
autoload :
|
8
|
+
autoload :MilestoneType, "decidim/api/milestone_type"
|
9
9
|
end
|
10
10
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
Decidim.register_component(:accountability) do |component|
|
4
|
+
include Decidim::TranslatableAttributes
|
5
|
+
|
4
6
|
component.engine = Decidim::Accountability::Engine
|
5
7
|
component.admin_engine = Decidim::Accountability::AdminEngine
|
6
8
|
component.icon = "media/images/decidim_accountability.svg"
|
@@ -31,9 +33,24 @@ Decidim.register_component(:accountability) do |component|
|
|
31
33
|
settings.attribute :intro, type: :text, translated: true, editor: true
|
32
34
|
settings.attribute :display_progress_enabled, type: :boolean, default: true
|
33
35
|
settings.attribute :geocoding_enabled, type: :boolean, default: false
|
36
|
+
settings.attribute :default_taxonomy, type: :select, include_blank: true, raw_choices: true, choices: lambda { |context|
|
37
|
+
context[:component].available_root_taxonomies.map { |taxonomy| [translated_attribute(taxonomy.name), taxonomy.id] }
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
component.register_stat :results_count,
|
42
|
+
primary: true,
|
43
|
+
priority: Decidim::StatsRegistry::MEDIUM_PRIORITY,
|
44
|
+
icon_name: "briefcase-2-line",
|
45
|
+
tooltip_key: "results_count_tooltip" do |components, _start_at, _end_at|
|
46
|
+
Decidim::Accountability::Result.where(component: components).count
|
34
47
|
end
|
35
48
|
|
36
|
-
component.register_stat :
|
49
|
+
component.register_stat :comments_count,
|
50
|
+
priority: Decidim::StatsRegistry::HIGH_PRIORITY,
|
51
|
+
icon_name: "chat-1-line",
|
52
|
+
tooltip_key: "comments_count",
|
53
|
+
tag: :comments do |components, _start_at, _end_at|
|
37
54
|
Decidim::Accountability::Result.where(component: components).count
|
38
55
|
end
|
39
56
|
|
@@ -13,6 +13,10 @@ module Decidim
|
|
13
13
|
routes do
|
14
14
|
resources :results, only: [:index, :show] do
|
15
15
|
resources :versions, only: [:show]
|
16
|
+
|
17
|
+
collection do
|
18
|
+
get :home
|
19
|
+
end
|
16
20
|
end
|
17
21
|
root to: "results#home"
|
18
22
|
end
|
@@ -38,19 +42,7 @@ module Decidim
|
|
38
42
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Accountability::Engine.root}/app/views")
|
39
43
|
end
|
40
44
|
|
41
|
-
initializer "decidim_accountability.
|
42
|
-
Decidim.metrics_registry.register(:results) do |metric_registry|
|
43
|
-
metric_registry.manager_class = "Decidim::Accountability::Metrics::ResultsMetricManage"
|
44
|
-
|
45
|
-
metric_registry.settings do |settings|
|
46
|
-
settings.attribute :highlighted, type: :boolean, default: false
|
47
|
-
settings.attribute :scopes, type: :array, default: %w(home)
|
48
|
-
settings.attribute :weight, type: :integer, default: 4
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
initializer "decidim_accountability.webpacker.assets_path" do
|
45
|
+
initializer "decidim_accountability.shakapacker.assets_path" do
|
54
46
|
Decidim.register_assets_path File.expand_path("app/packs", root)
|
55
47
|
end
|
56
48
|
end
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
|
17
17
|
create_statuses!(component:)
|
18
18
|
|
19
|
-
|
19
|
+
number_of_records.times do
|
20
20
|
taxonomies = create_taxonomies!
|
21
21
|
|
22
22
|
taxonomies.each do |taxonomy|
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
|
28
28
|
def create_component!
|
29
29
|
params = {
|
30
|
-
name: Decidim::Components::Namer.new(
|
30
|
+
name: Decidim::Components::Namer.new(organization.available_locales, :accountability).i18n_name,
|
31
31
|
manifest_name: :accountability,
|
32
32
|
published_at: Time.current,
|
33
33
|
participatory_space:,
|
@@ -53,19 +53,19 @@ module Decidim
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def root_taxonomy
|
56
|
-
@root_taxonomy ||=
|
57
|
-
|
56
|
+
@root_taxonomy ||= organization.taxonomies.roots.find_by("name->>'#{I18n.locale}'= ?",
|
57
|
+
"Categories") || organization.taxonomies.roots.sample
|
58
58
|
end
|
59
59
|
|
60
60
|
def create_taxonomies!
|
61
|
-
parent_taxonomy = root_taxonomy.children.sample ||
|
61
|
+
parent_taxonomy = root_taxonomy.children.sample || create_taxonomy!(name: ::Faker::Lorem.sentence(word_count: 5), parent: root_taxonomy)
|
62
62
|
taxonomies = [parent_taxonomy]
|
63
63
|
|
64
64
|
2.times do
|
65
65
|
taxonomies << if parent_taxonomy.children.count > 1
|
66
66
|
parent_taxonomy.children.sample
|
67
67
|
else
|
68
|
-
|
68
|
+
create_taxonomy!(name: ::Faker::Lorem.sentence(word_count: 5), parent: parent_taxonomy)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -96,7 +96,7 @@ module Decidim
|
|
96
96
|
|
97
97
|
Decidim::Comments::Seed.comments_for(result)
|
98
98
|
|
99
|
-
|
99
|
+
number_of_records.times do
|
100
100
|
child_result = Decidim.traceability.create!(
|
101
101
|
Decidim::Accountability::Result,
|
102
102
|
admin_user,
|
@@ -115,8 +115,8 @@ module Decidim
|
|
115
115
|
visibility: "all"
|
116
116
|
)
|
117
117
|
|
118
|
-
|
119
|
-
child_result.
|
118
|
+
number_of_records.times do |i|
|
119
|
+
child_result.milestones.create!(
|
120
120
|
entry_date: child_result.start_date + i.days,
|
121
121
|
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
122
122
|
description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
|
@@ -50,13 +50,13 @@ FactoryBot.define do
|
|
50
50
|
longitude { Faker::Address.longitude }
|
51
51
|
end
|
52
52
|
|
53
|
-
factory :
|
53
|
+
factory :milestone, class: "Decidim::Accountability::Milestone" do
|
54
54
|
transient do
|
55
55
|
skip_injection { false }
|
56
56
|
end
|
57
57
|
result { create(:result, skip_injection:) }
|
58
58
|
entry_date { "12/7/2017" }
|
59
|
-
title { generate_localized_title(:
|
60
|
-
description { generate_localized_title(:
|
59
|
+
title { generate_localized_title(:milestone_title, skip_injection:) }
|
60
|
+
description { generate_localized_title(:milestone_description, skip_injection:) }
|
61
61
|
end
|
62
62
|
end
|
@@ -10,12 +10,5 @@ module Decidim
|
|
10
10
|
# Base module for this engine.
|
11
11
|
module Accountability
|
12
12
|
autoload :ResultSerializer, "decidim/accountability/result_serializer"
|
13
|
-
|
14
|
-
include ActiveSupport::Configurable
|
15
|
-
|
16
|
-
# Public Setting that defines whether proposals can be linked to meetings
|
17
|
-
config_accessor :enable_proposal_linking do
|
18
|
-
Decidim.const_defined?("Proposals")
|
19
|
-
end
|
20
13
|
end
|
21
14
|
end
|
@@ -2,16 +2,17 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
|
-
class
|
5
|
+
class MilestoneType < Decidim::Api::Types::BaseObject
|
6
6
|
implements Decidim::Core::TimestampsInterface
|
7
|
+
implements Decidim::Core::TraceableInterface
|
7
8
|
|
8
|
-
description "A
|
9
|
+
description "A Milestone"
|
9
10
|
|
10
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description for this
|
11
|
-
field :entry_date, Decidim::Core::DateType, "The entry date for this
|
12
|
-
field :id, GraphQL::Types::ID, "The internal ID for this
|
13
|
-
field :result, Decidim::Accountability::ResultType, "The result for this
|
14
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title for this
|
11
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description for this milestone", null: true
|
12
|
+
field :entry_date, Decidim::Core::DateType, "The entry date for this milestone", null: true
|
13
|
+
field :id, GraphQL::Types::ID, "The internal ID for this milestone", null: false
|
14
|
+
field :result, Decidim::Accountability::ResultType, "The result for this milestone", null: true
|
15
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this milestone", null: true
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -3,9 +3,14 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Accountability
|
5
5
|
class ResultType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::ReferableInterface
|
7
|
+
implements Decidim::Comments::CommentableInterface
|
8
|
+
implements Decidim::Core::AttachableInterface
|
9
|
+
implements Decidim::Core::AttachableCollectionInterface
|
10
|
+
implements Decidim::Core::LocalizableInterface
|
6
11
|
implements Decidim::Core::TaxonomizableInterface
|
7
12
|
implements Decidim::Core::TimestampsInterface
|
8
|
-
implements Decidim::
|
13
|
+
implements Decidim::Core::TraceableInterface
|
9
14
|
|
10
15
|
description "A result"
|
11
16
|
|
@@ -15,14 +20,23 @@ module Decidim
|
|
15
20
|
field :end_date, Decidim::Core::DateType, "The end date for this result", null: true
|
16
21
|
field :external_id, GraphQL::Types::String, "The external ID for this result", null: true
|
17
22
|
field :id, GraphQL::Types::ID, "The internal ID for this result", null: false
|
23
|
+
field :milestones, [Decidim::Accountability::MilestoneType, { null: true }], "The milestones for this result", null: true
|
18
24
|
field :parent, Decidim::Accountability::ResultType, "The parent result", null: true
|
19
25
|
field :progress, GraphQL::Types::Float, "The progress for this result", null: true
|
20
|
-
field :
|
26
|
+
field :proposals, [Decidim::Proposals::ProposalType, { null: true }], "The proposal URLs for this result", null: true
|
21
27
|
field :start_date, Decidim::Core::DateType, "The start date for this result", null: true
|
22
28
|
field :status, Decidim::Accountability::StatusType, "The status for this result", null: true
|
23
|
-
field :timeline_entries, [Decidim::Accountability::TimelineEntryType, { null: true }], "The timeline entries for this result", null: true
|
24
29
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this result", null: true
|
30
|
+
field :url, String, "The URL for this result", null: false
|
25
31
|
field :weight, GraphQL::Types::Int, "The order of this result", null: false
|
32
|
+
|
33
|
+
def url
|
34
|
+
Decidim::ResourceLocatorPresenter.new(object).url
|
35
|
+
end
|
36
|
+
|
37
|
+
def proposals
|
38
|
+
object.linked_resources(:proposals, "included_proposals").sort_by(&:id)
|
39
|
+
end
|
26
40
|
end
|
27
41
|
end
|
28
42
|
end
|