decidim-accountability 0.30.1 → 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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/project/milestones.erb +22 -0
  3. data/app/cells/decidim/accountability/project_cell.rb +9 -9
  4. data/app/commands/decidim/accountability/admin/{create_timeline_entry.rb → create_milestone.rb} +3 -3
  5. data/app/commands/decidim/accountability/admin/{update_timeline_entry.rb → update_milestone.rb} +2 -2
  6. data/app/controllers/decidim/accountability/admin/import_components_controller.rb +1 -1
  7. data/app/controllers/decidim/accountability/admin/import_results_controller.rb +1 -1
  8. data/app/controllers/decidim/accountability/admin/milestones_controller.rb +87 -0
  9. data/app/controllers/decidim/accountability/admin/results_controller.rb +2 -2
  10. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +2 -2
  11. data/app/controllers/decidim/accountability/results_controller.rb +20 -4
  12. data/app/controllers/decidim/accountability/versions_controller.rb +1 -1
  13. data/app/forms/decidim/accountability/admin/{timeline_entry_form.rb → milestone_form.rb} +2 -2
  14. data/app/models/decidim/accountability/{timeline_entry.rb → milestone.rb} +4 -4
  15. data/app/models/decidim/accountability/result.rb +2 -2
  16. data/app/packs/entrypoints/decidim_accountability.js +0 -2
  17. data/app/packs/entrypoints/decidim_accountability_admin_imports.js +1 -1
  18. data/app/packs/src/decidim/accountability/admin/index.js +4 -1
  19. data/app/packs/src/decidim/accountability/admin/result_form.js +1 -1
  20. data/app/packs/src/decidim/accountability/controllers/.gitkeep +0 -0
  21. data/app/packs/stylesheets/accountability.scss +35 -5
  22. data/app/permissions/decidim/accountability/admin/permissions.rb +3 -3
  23. data/app/presenters/decidim/accountability/admin_log/{timeline_entry_presenter.rb → milestone_presenter.rb} +4 -4
  24. data/app/presenters/decidim/accountability/result_presenter.rb +2 -5
  25. data/app/views/decidim/accountability/admin/import_components/_form.html.erb +3 -3
  26. data/app/views/decidim/accountability/admin/import_results/new.html.erb +1 -1
  27. data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/edit.html.erb +1 -1
  28. data/app/views/decidim/accountability/admin/milestones/index.html.erb +66 -0
  29. data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/new.html.erb +1 -1
  30. data/app/views/decidim/accountability/admin/results/_actions.html.erb +102 -29
  31. data/app/views/decidim/accountability/admin/results/_form.html.erb +1 -1
  32. data/app/views/decidim/accountability/admin/results/_result-tr.html.erb +7 -7
  33. data/app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb +25 -29
  34. data/app/views/decidim/accountability/admin/results/index.html.erb +12 -12
  35. data/app/views/decidim/accountability/admin/results/manage_trash.html.erb +2 -1
  36. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
  37. data/app/views/decidim/accountability/admin/statuses/index.html.erb +40 -12
  38. data/app/views/decidim/accountability/results/_filters.html.erb +4 -0
  39. data/app/views/decidim/accountability/results/_home_aside.html.erb +12 -0
  40. data/app/views/decidim/accountability/results/_home_taxonomies.html.erb +8 -31
  41. data/app/views/decidim/accountability/results/_one_level_taxonomies.html.erb +17 -0
  42. data/app/views/decidim/accountability/results/_projects_aside.html.erb +1 -3
  43. data/app/views/decidim/accountability/results/_root_taxonomies_selector.html.erb +17 -0
  44. data/app/views/decidim/accountability/results/_two_levels_taxonomies.html.erb +30 -0
  45. data/app/views/decidim/accountability/results/home.html.erb +11 -25
  46. data/config/assets.rb +2 -2
  47. data/config/locales/ar.yml +0 -44
  48. data/config/locales/bg.yml +0 -43
  49. data/config/locales/bs-BA.yml +4 -23
  50. data/config/locales/ca-IT.yml +42 -44
  51. data/config/locales/ca.yml +42 -44
  52. data/config/locales/cs.yml +42 -44
  53. data/config/locales/da.yml +0 -21
  54. data/config/locales/de.yml +46 -48
  55. data/config/locales/el.yml +0 -39
  56. data/config/locales/en.yml +42 -44
  57. data/config/locales/es-MX.yml +42 -44
  58. data/config/locales/es-PY.yml +42 -44
  59. data/config/locales/es.yml +42 -44
  60. data/config/locales/eu.yml +43 -45
  61. data/config/locales/fi-plain.yml +42 -44
  62. data/config/locales/fi.yml +42 -44
  63. data/config/locales/fr-CA.yml +42 -44
  64. data/config/locales/fr.yml +42 -44
  65. data/config/locales/ga-IE.yml +0 -11
  66. data/config/locales/gl.yml +0 -25
  67. data/config/locales/gn-PY.yml +0 -2
  68. data/config/locales/he-IL.yml +0 -43
  69. data/config/locales/hu.yml +0 -43
  70. data/config/locales/id-ID.yml +0 -23
  71. data/config/locales/is-IS.yml +0 -24
  72. data/config/locales/it.yml +40 -40
  73. data/config/locales/ja.yml +42 -44
  74. data/config/locales/kaa.yml +0 -10
  75. data/config/locales/ko.yml +0 -17
  76. data/config/locales/lb.yml +0 -25
  77. data/config/locales/lt.yml +0 -39
  78. data/config/locales/lv.yml +0 -23
  79. data/config/locales/nl.yml +0 -31
  80. data/config/locales/no.yml +0 -31
  81. data/config/locales/pl.yml +0 -43
  82. data/config/locales/pt-BR.yml +165 -43
  83. data/config/locales/pt.yml +0 -27
  84. data/config/locales/ro-RO.yml +10 -43
  85. data/config/locales/ru.yml +0 -23
  86. data/config/locales/si-LK.yml +0 -12
  87. data/config/locales/sk.yml +0 -23
  88. data/config/locales/sl.yml +0 -18
  89. data/config/locales/sq-AL.yml +0 -43
  90. data/config/locales/sr-CS.yml +0 -23
  91. data/config/locales/sv.yml +42 -44
  92. data/config/locales/th-TH.yml +0 -24
  93. data/config/locales/tr-TR.yml +0 -45
  94. data/config/locales/uk.yml +0 -21
  95. data/config/locales/zh-CN.yml +0 -23
  96. data/config/locales/zh-TW.yml +0 -39
  97. data/db/migrate/20250606155946_rename_timeline_table_to_milestone.rb +11 -0
  98. data/lib/decidim/accountability/admin_engine.rb +1 -1
  99. data/lib/decidim/accountability/api.rb +1 -1
  100. data/lib/decidim/accountability/component.rb +18 -1
  101. data/lib/decidim/accountability/engine.rb +5 -13
  102. data/lib/decidim/accountability/seeds.rb +9 -9
  103. data/lib/decidim/accountability/test/factories.rb +3 -3
  104. data/lib/decidim/accountability/version.rb +1 -1
  105. data/lib/decidim/accountability.rb +0 -7
  106. data/lib/decidim/api/{timeline_entry_type.rb → milestone_type.rb} +8 -7
  107. data/lib/decidim/api/result_type.rb +17 -3
  108. data/lib/decidim/api/status_type.rb +1 -0
  109. metadata +39 -35
  110. data/app/cells/decidim/accountability/project/timeline.erb +0 -22
  111. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +0 -87
  112. data/app/packs/src/decidim/accountability/index.js +0 -11
  113. data/app/packs/src/decidim/accountability/version_diff.js +0 -33
  114. data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +0 -56
  115. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +0 -42
  116. /data/app/views/decidim/accountability/admin/{timeline_entries → milestones}/_form.html.erb +0 -0
@@ -18,10 +18,6 @@ tr:
18
18
  key: anahtar
19
19
  name: isim
20
20
  progress: İlerleme
21
- timeline_entry:
22
- description: Açıklama
23
- entry_date: tarih
24
- title: Başlik / Unvani
25
21
  models:
26
22
  decidim/accountability/proposal_linked_event: Teklif bir sonuca dahil edildi
27
23
  decidim/accountability/result_progress_updated_event: Sonuç ilerlemesi güncellendi
@@ -41,8 +37,6 @@ tr:
41
37
  decidim:
42
38
  accountability:
43
39
  actions:
44
- attachment_collections: Klasörler
45
- attachments: Ekler
46
40
  confirm_delete_result: Bu sonucu silmek istediğinizden emin misiniz?
47
41
  confirm_destroy: Bu %{name}silmek istediğinize emin misiniz?
48
42
  deleted_results_info: Silinen sonuçlar çöp kutusundan geri yüklenebilir.
@@ -52,9 +46,7 @@ tr:
52
46
  import_csv: Sonuçları CSV dosyasından içe aktarın
53
47
  new_result: Yeni sonuç
54
48
  new_status: Yeni Durum
55
- new_timeline_entry: Yeni Zaman çizelgesi Kaydı
56
49
  preview: Ön izleme
57
- timeline_entries: Proje evrimi
58
50
  title: Eylemler
59
51
  view_deleted_results: Silinmiş sonuçları görüntüle
60
52
  admin:
@@ -162,23 +154,6 @@ tr:
162
154
  update:
163
155
  invalid: Güncellemede Sorun Oluştu.
164
156
  success: Kayıt başarıyla güncellendi.
165
- timeline_entries:
166
- create:
167
- invalid: Bu kaydı oluştururken hata oluştu.
168
- success: Giriş basarıyla tamamlandı.
169
- destroy:
170
- success: Kayıt Başarıyla silindi.
171
- edit:
172
- title: Girişi düzenle
173
- update: Girişi güncelle
174
- index:
175
- title: Proje zaman çizelgesi girişleri
176
- new:
177
- create: Giriş oluştur
178
- title: Yeni giriş
179
- update:
180
- invalid: Kayıt güncellenirken hata oluştu.
181
- success: Kayıt Başarıyla Güncellendi.
182
157
  admin_log:
183
158
  result:
184
159
  create: "%{user_name} sonuç yaratmıştır %{resource_name} içinde %{space_name}"
@@ -188,10 +163,6 @@ tr:
188
163
  create: "48 / 5.000\nÇeviri sonuçları\nÇeviri sonucu\n%{user_name}, %{resource_name} kaydını oluşturdu"
189
164
  delete: "%{user_name}, %{resource_name} kaydını sildi"
190
165
  update: "%{user_name}, %{resource_name} kaydını Güncelledi"
191
- timeline_entry:
192
- create: "%{user_name}, %{resource_name} zaman çizelgesi girişini oluşturdu"
193
- delete: "%{user_name}, %{resource_name} zaman çizelgesi girişini sildi"
194
- update: "%{user_name}, %{resource_name} zaman çizelgesi girişini güncelledi"
195
166
  value_types:
196
167
  parent_presenter:
197
168
  not_found: 'Üst veritabanında bulunamadı (ID: %{id})'
@@ -227,18 +198,11 @@ tr:
227
198
  key: anahtar
228
199
  name: isim
229
200
  progress: İlerleme
230
- timeline_entry:
231
- fields:
232
- entry_date: tarih
233
- title: Başlık
234
201
  results:
235
202
  count:
236
203
  results_count:
237
204
  one: 1 sonuç
238
205
  other: "%{count} sonuç"
239
- home:
240
- empty: Henüz sonuç yok.
241
- empty_filters: Bu kriterlere uyan sonuç bulunamamıştır.
242
206
  home_header:
243
207
  global_status: Genel yürütme durumu
244
208
  no_results: Proje Bulunamadı
@@ -247,8 +211,6 @@ tr:
247
211
  show:
248
212
  stats:
249
213
  back_to_resource: Sonuca geri dön
250
- timeline:
251
- title: Proje gelişimi
252
214
  admin:
253
215
  filters:
254
216
  results:
@@ -279,15 +241,8 @@ tr:
279
241
  email_outro: '"%{proposal_title}" izlemekte olduğunuz için bu bildirimi aldınız ve bu teklif "%{resource_title}" sonucuna dahil edildi. Önceki bağlantıyı takip ederek bildirim almayı durdurabilirsiniz.'
280
242
  email_subject: '%{resource_title} için bir güncelleme'
281
243
  notification_title: '<a href="%{proposal_path}">%{proposal_title}</a> teklifini içeren <a href="%{resource_path}">%{resource_title}</a> sonucu: %{progress} tamamlandı.'
282
- metrics:
283
- results:
284
- description: Üretilen sonuç sayısı
285
- object: sonuçlar
286
- title: Sonuçlar
287
244
  open_data:
288
245
  help:
289
- result_comments:
290
- user_group: Bu yorumu yapan kullanıcı grubu (varsa)
291
246
  results:
292
247
  created_at: Sonucun oluşturulma tarihi
293
248
  participatory_spaces:
@@ -17,9 +17,6 @@ uk:
17
17
  key: Ключ
18
18
  name: Ім'я
19
19
  progress: Перебіг
20
- timeline_entry:
21
- description: Опис
22
- entry_date: Дата
23
20
  models:
24
21
  decidim/accountability/proposal_linked_event: Пропозиція, включена до підсумку
25
22
  activerecord:
@@ -36,7 +33,6 @@ uk:
36
33
  destroy: Видалити
37
34
  edit: Редагувати
38
35
  preview: Попередній перегляд
39
- timeline_entries: Розвиток проекту
40
36
  title: Дії
41
37
  admin:
42
38
  exports:
@@ -67,15 +63,6 @@ uk:
67
63
  new:
68
64
  create: Створити стан
69
65
  title: Додати стан
70
- timeline_entries:
71
- edit:
72
- title: Редагувати запис
73
- update: Оновити запис
74
- index:
75
- title: Записи на лінії часу проекту
76
- new:
77
- create: Створити запис
78
- title: Додати запис
79
66
  admin_log:
80
67
  result:
81
68
  create: "%{user_name} створив підсумок %{resource_name} у %{space_name}"
@@ -98,9 +85,6 @@ uk:
98
85
  key: Ключ
99
86
  name: Назва
100
87
  progress: Перебіг
101
- timeline_entry:
102
- fields:
103
- entry_date: Дата
104
88
  results:
105
89
  count:
106
90
  results_count:
@@ -115,8 +99,6 @@ uk:
115
99
  show:
116
100
  stats:
117
101
  back_to_resource: Повернутися до підсумків
118
- timeline:
119
- title: Розвиток проекту
120
102
  components:
121
103
  accountability:
122
104
  name: Звітність
@@ -134,9 +116,6 @@ uk:
134
116
  email_outro: Ви отримали це сповіщення, тому що ви стежите за "%{proposal_title}". Ви можете відписатися від цих сповіщень, перейшовши за наведеним вище посиланням.
135
117
  email_subject: Оновлення до %{proposal_title}
136
118
  notification_title: Пропозиція <a href="%{proposal_path}">%{proposal_title}</a> була включена до підсумку <a href="%{resource_path}">%{resource_title}</a>.
137
- metrics:
138
- results:
139
- title: Підсумки
140
119
  resource_links:
141
120
  included_projects:
142
121
  result_project: Проекти, включені до цих підсумків
@@ -17,9 +17,6 @@ zh-CN:
17
17
  key: 关键字
18
18
  name: 名称
19
19
  progress: 进展情况
20
- timeline_entry:
21
- description: 描述
22
- entry_date: 日期
23
20
  models:
24
21
  decidim/accountability/proposal_linked_event: 结果中包括的提案
25
22
  decidim/accountability/result_progress_updated_event: 结果进度更新
@@ -34,7 +31,6 @@ zh-CN:
34
31
  destroy: 删除
35
32
  edit: 编辑
36
33
  preview: 预览
37
- timeline_entries: 项目进化
38
34
  title: 行动
39
35
  admin:
40
36
  exports:
@@ -68,15 +64,6 @@ zh-CN:
68
64
  new:
69
65
  create: 创建状态
70
66
  title: 新状态
71
- timeline_entries:
72
- edit:
73
- title: 编辑条目
74
- update: 更新条目
75
- index:
76
- title: 项目时间表条目
77
- new:
78
- create: 创建条目
79
- title: 新建条目
80
67
  admin_log:
81
68
  result:
82
69
  create: "%{user_name} 在 %{resource_name} 创建了结果 %{space_name}"
@@ -105,9 +92,6 @@ zh-CN:
105
92
  key: 关键字
106
93
  name: 名称
107
94
  progress: 进展情况
108
- timeline_entry:
109
- fields:
110
- entry_date: 日期
111
95
  results:
112
96
  count:
113
97
  results_count:
@@ -119,8 +103,6 @@ zh-CN:
119
103
  show:
120
104
  stats:
121
105
  back_to_resource: 返回结果
122
- timeline:
123
- title: 项目进化
124
106
  components:
125
107
  accountability:
126
108
  name: 问责制
@@ -144,11 +126,6 @@ zh-CN:
144
126
  email_outro: 您收到此通知是因为您正在关注"%{proposal_title}",此建议包含在结果"%{resource_title}"中。 您可以停止接收跟随上一个链接的通知。
145
127
  email_subject: 更新到 %{resource_title} 进度
146
128
  notification_title: 结果 <a href="%{resource_path}">%{resource_title}</a>, 其中包括提议 <a href="%{proposal_path}">%{proposal_title}</a>, 现在已完成 %{progress}%。
147
- metrics:
148
- results:
149
- description: 生成的结果数
150
- object: 结果
151
- title: 成果
152
129
  participatory_spaces:
153
130
  highlighted_results:
154
131
  see_all: 查看所有结果 (%{count})
@@ -17,10 +17,6 @@ zh-TW:
17
17
  key: 金鑰
18
18
  name: 名稱
19
19
  progress: 進度
20
- timeline_entry:
21
- description: 說明
22
- entry_date: 日期
23
- title: 標題
24
20
  models:
25
21
  decidim/accountability/proposal_linked_event: 在結果的建議
26
22
  decidim/accountability/result_progress_updated_event: 結果程序已更新
@@ -31,13 +27,10 @@ zh-TW:
31
27
  decidim:
32
28
  accountability:
33
29
  actions:
34
- attachment_collections: 資料夾
35
- attachments: 附件
36
30
  confirm_destroy: 確定要刪除 %{name} ?
37
31
  destroy: 刪除
38
32
  edit: 編輯
39
33
  preview: 預覽
40
- timeline_entries: 專案評估
41
34
  title: 操作
42
35
  admin:
43
36
  exports:
@@ -90,23 +83,6 @@ zh-TW:
90
83
  update:
91
84
  invalid: 更新狀態時發生錯誤.
92
85
  success: 狀態成功更新.
93
- timeline_entries:
94
- create:
95
- invalid: 建立資料時發生錯誤.
96
- success: 資料成功建立.
97
- destroy:
98
- success: 資料成功刪除.
99
- edit:
100
- title: 編輯資料
101
- update: 更新資料
102
- index:
103
- title: 專案時程資料
104
- new:
105
- create: 建立資料
106
- title: 新資料
107
- update:
108
- invalid: 更新資料時發生錯誤.
109
- success: 資料成功更新.
110
86
  admin_log:
111
87
  result:
112
88
  create: "%{user_name} 建立結果 %{resource_name} 在 %{space_name}"
@@ -116,10 +92,6 @@ zh-TW:
116
92
  create: "%{user_name} 建立了 %{resource_name} 狀態"
117
93
  delete: "%{user_name} 刪除了 %{resource_name} 狀態"
118
94
  update: "%{user_name} 更新了 %{resource_name} 狀態"
119
- timeline_entry:
120
- create: "%{user_name} 建立了 %{resource_name} 時間表資料"
121
- delete: "%{user_name} 刪除了 %{resource_name} 時間表資料"
122
- update: "%{user_name} 更新了 %{resource_name} 時間表資料"
123
95
  value_types:
124
96
  parent_presenter:
125
97
  not_found: '資料庫中找不到上一層 (ID: %{id})'
@@ -157,10 +129,6 @@ zh-TW:
157
129
  key: 金鑰
158
130
  name: 名稱
159
131
  progress: 進度
160
- timeline_entry:
161
- fields:
162
- entry_date: 日期
163
- title: 標題
164
132
  results:
165
133
  count:
166
134
  results_count:
@@ -172,8 +140,6 @@ zh-TW:
172
140
  show:
173
141
  stats:
174
142
  back_to_resource: 返回至結果
175
- timeline:
176
- title: 專案評估
177
143
  admin:
178
144
  filters:
179
145
  results:
@@ -204,11 +170,6 @@ zh-TW:
204
170
  email_outro: 收到這個通知表示正在訂閱 "%{proposal_title}" ,而這個提案包含在結果 "%{resource_title}" ,透過下面連結可以停止接收通知。
205
171
  email_subject: '%{resource_title} 的更新進度'
206
172
  notification_title: 這個結果 <a href="%{resource_path}">%{resource_title}</a> 包含提案 <a href="%{proposal_path}">%{proposal_title}</a>,現在完成 %{progress}% 。
207
- metrics:
208
- results:
209
- description: 產生的結果數量
210
- object: 結果
211
- title: 結果
212
173
  participatory_spaces:
213
174
  highlighted_results:
214
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 :timeline_entries, except: [:show]
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 :TimelineEntryType, "decidim/api/timeline_entry_type"
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 :results_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |components, _start_at, _end_at|
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.register_metrics" do
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
- 3.times do
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(participatory_space.organization.available_locales, :accountability).i18n_name,
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 ||= participatory_space.organization.taxonomies.roots.find_by("name->>'#{I18n.locale}'= ?",
57
- "Categories") || participatory_space.organization.taxonomies.roots.sample
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 || root_taxonomy.children.create!(name: Decidim::Faker::Localized.sentence(word_count: 5))
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
- parent_taxonomy.children.create!(name: Decidim::Faker::Localized.sentence(word_count: 5))
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
- 3.times do
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
- rand(0..5).times do |i|
119
- child_result.timeline_entries.create!(
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 :timeline_entry, class: "Decidim::Accountability::TimelineEntry" do
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(:timeline_entry_title, skip_injection:) }
60
- description { generate_localized_title(:timeline_entry_description, skip_injection:) }
59
+ title { generate_localized_title(:milestone_title, skip_injection:) }
60
+ description { generate_localized_title(:milestone_description, skip_injection:) }
61
61
  end
62
62
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-accountability version.
5
5
  module Accountability
6
6
  def self.version
7
- "0.30.1"
7
+ "0.31.0.rc1"
8
8
  end
9
9
  end
10
10
  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 TimelineEntryType < Decidim::Api::Types::BaseObject
5
+ class MilestoneType < Decidim::Api::Types::BaseObject
6
6
  implements Decidim::Core::TimestampsInterface
7
+ implements Decidim::Core::TraceableInterface
7
8
 
8
- description "A Timeline Entry"
9
+ description "A Milestone"
9
10
 
10
- field :description, Decidim::Core::TranslatedFieldType, "The description for this timeline entry", null: true
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
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
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::Comments::CommentableInterface
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 :reference, GraphQL::Types::String, "The reference for this result", null: true
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
@@ -4,6 +4,7 @@ module Decidim
4
4
  module Accountability
5
5
  class StatusType < Decidim::Api::Types::BaseObject
6
6
  implements Decidim::Core::TimestampsInterface
7
+ implements Decidim::Core::TraceableInterface
7
8
 
8
9
  description "A status"
9
10