decidim-accountability 0.28.6 → 0.29.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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +0 -3
  3. data/app/cells/decidim/accountability/project_cell.rb +1 -6
  4. data/app/cells/decidim/accountability/result_l_cell.rb +1 -2
  5. data/app/cells/decidim/accountability/result_metadata_cell.rb +0 -6
  6. data/app/cells/decidim/accountability/results_cell.rb +0 -2
  7. data/app/cells/decidim/accountability/status_cell.rb +11 -8
  8. data/app/commands/decidim/accountability/admin/create_imported_result.rb +18 -85
  9. data/app/commands/decidim/accountability/admin/create_result.rb +12 -86
  10. data/app/commands/decidim/accountability/admin/create_status.rb +3 -31
  11. data/app/commands/decidim/accountability/admin/create_timeline_entry.rb +3 -30
  12. data/app/commands/decidim/accountability/admin/has_result_command.rb +54 -0
  13. data/app/commands/decidim/accountability/admin/update_imported_result.rb +16 -70
  14. data/app/commands/decidim/accountability/admin/update_result.rb +10 -72
  15. data/app/commands/decidim/accountability/admin/update_status.rb +3 -39
  16. data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +3 -38
  17. data/app/controllers/decidim/accountability/admin/results_controller.rb +1 -1
  18. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +7 -8
  19. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +8 -8
  20. data/app/controllers/decidim/accountability/results_controller.rb +1 -21
  21. data/app/forms/decidim/accountability/admin/result_form.rb +1 -1
  22. data/app/forms/decidim/accountability/admin/timeline_entry_form.rb +1 -1
  23. data/app/helpers/decidim/accountability/application_helper.rb +0 -34
  24. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +0 -4
  25. data/app/mailers/decidim/accountability/import_projects_mailer.rb +0 -3
  26. data/app/models/decidim/accountability/result.rb +1 -1
  27. data/app/models/decidim/accountability/status.rb +1 -1
  28. data/app/packs/src/decidim/accountability/index.js +1 -1
  29. data/app/services/decidim/accountability/results_csv_importer.rb +1 -1
  30. data/app/views/decidim/accountability/admin/results/index.html.erb +7 -15
  31. data/app/views/decidim/accountability/admin/statuses/index.html.erb +2 -2
  32. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +1 -1
  33. data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +1 -1
  34. data/app/views/decidim/accountability/results/_home_categories.html.erb +2 -2
  35. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +8 -8
  36. data/app/views/decidim/accountability/results/_project.html.erb +1 -1
  37. data/app/views/decidim/accountability/results/_scope_filters.html.erb +3 -3
  38. data/app/views/decidim/participatory_spaces/_result.html.erb +3 -3
  39. data/config/locales/ar.yml +13 -90
  40. data/config/locales/bg.yml +10 -15
  41. data/config/locales/ca.yml +0 -12
  42. data/config/locales/cs.yml +0 -13
  43. data/config/locales/da.yml +4 -27
  44. data/config/locales/de.yml +3 -15
  45. data/config/locales/el.yml +8 -12
  46. data/config/locales/en.yml +0 -12
  47. data/config/locales/es-MX.yml +0 -12
  48. data/config/locales/es-PY.yml +0 -12
  49. data/config/locales/es.yml +0 -12
  50. data/config/locales/eu.yml +34 -46
  51. data/config/locales/fi-plain.yml +4 -16
  52. data/config/locales/fi.yml +15 -27
  53. data/config/locales/fr-CA.yml +8 -21
  54. data/config/locales/fr.yml +5 -18
  55. data/config/locales/ga-IE.yml +3 -11
  56. data/config/locales/gl.yml +6 -18
  57. data/config/locales/gn-PY.yml +0 -11
  58. data/config/locales/he-IL.yml +8 -14
  59. data/config/locales/hu.yml +11 -16
  60. data/config/locales/id-ID.yml +3 -21
  61. data/config/locales/is-IS.yml +6 -18
  62. data/config/locales/it.yml +3 -72
  63. data/config/locales/ja.yml +1 -13
  64. data/config/locales/kaa.yml +2 -2
  65. data/config/locales/ko.yml +6 -12
  66. data/config/locales/lb.yml +7 -19
  67. data/config/locales/lt.yml +10 -12
  68. data/config/locales/lv.yml +3 -24
  69. data/config/locales/nl.yml +3 -15
  70. data/config/locales/no.yml +3 -15
  71. data/config/locales/pl.yml +9 -12
  72. data/config/locales/pt-BR.yml +10 -16
  73. data/config/locales/pt.yml +0 -18
  74. data/config/locales/ro-RO.yml +16 -22
  75. data/config/locales/ru.yml +4 -22
  76. data/config/locales/si-LK.yml +0 -19
  77. data/config/locales/sk.yml +3 -24
  78. data/config/locales/sl.yml +3 -17
  79. data/config/locales/sq-AL.yml +7 -12
  80. data/config/locales/sr-CS.yml +3 -21
  81. data/config/locales/sv.yml +29 -80
  82. data/config/locales/th-TH.yml +6 -6
  83. data/config/locales/tr-TR.yml +6 -19
  84. data/config/locales/uk.yml +3 -24
  85. data/config/locales/zh-CN.yml +3 -23
  86. data/config/locales/zh-TW.yml +7 -12
  87. data/decidim-accountability.gemspec +2 -2
  88. data/lib/decidim/accountability/component.rb +0 -4
  89. data/lib/decidim/accountability/seeds.rb +76 -67
  90. data/lib/decidim/accountability/test/factories.rb +0 -4
  91. data/lib/decidim/accountability/version.rb +1 -1
  92. data/lib/decidim/api/accountability_type.rb +3 -1
  93. data/lib/decidim/api/result_type.rb +1 -1
  94. metadata +26 -31
  95. data/app/commands/decidim/accountability/admin/destroy_result.rb +0 -43
  96. data/app/services/decidim/accountability/result_stats_calculator.rb +0 -49
  97. data/app/views/decidim/accountability/results/_stats_box.html.erb +0 -79
  98. data/config/locales/bn-BD.yml +0 -1
  99. data/config/locales/bs-BA.yml +0 -175
  100. data/config/locales/ca-IT.yml +0 -304
@@ -85,7 +85,11 @@ zh-TW:
85
85
  new:
86
86
  create: 匯入
87
87
  import_all_selected_projects: 匯入所有選擇的專案來實現
88
+ new_items:
89
+ other: "%{count} 個專案將匯入"
88
90
  no_components: 在這個參與空間沒有預算元件來匯入專案到結果
91
+ origin_component_id: 原始元件
92
+ select_component: 選擇一個元件
89
93
  success:
90
94
  other: "%{count} 個專案已經排程匯入,完成後會寄送 email 通知."
91
95
  results:
@@ -204,6 +208,9 @@ zh-TW:
204
208
  other: "%{count} 個結果"
205
209
  filters:
206
210
  all: 全部
211
+ home:
212
+ categories_label: 類別
213
+ subcategories_label: 子類別
207
214
  home_header:
208
215
  global_status: 全域執行狀態
209
216
  nav_breadcrumb:
@@ -212,15 +219,7 @@ zh-TW:
212
219
  search: 搜尋操作
213
220
  show:
214
221
  stats:
215
- attendees: 與會者
216
222
  back_to_resource: 返回至結果
217
- comments: 評論
218
- contributions: 貢獻
219
- last_edited_by: 最後編輯者
220
- last_updated_at: 更新時間
221
- meetings: 會議
222
- proposals: 提案
223
- votes: 支援
224
223
  timeline:
225
224
  title: 專案評估
226
225
  admin:
@@ -239,16 +238,12 @@ zh-TW:
239
238
  name: 問責
240
239
  settings:
241
240
  global:
242
- categories_label: 類別名稱
243
241
  comments_enabled: 已啟用留言
244
242
  comments_max_length: 留言字數上限 (0 表示使用預設)
245
243
  display_progress_enabled: 顯示進度
246
- heading_leaf_level_results: 專案名稱
247
- heading_parent_level_results: 結果名稱
248
244
  intro: 介紹
249
245
  scope_id: 範圍
250
246
  scopes_enabled: 啟用的範圍
251
- subcategories_label: 子類別名稱
252
247
  step:
253
248
  comments_blocked: 留言已封鎖
254
249
  events:
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.version = Decidim::Accountability.version
11
11
  s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
12
12
  s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
13
- s.license = "AGPL-3.0-or-later"
13
+ s.license = "AGPL-3.0"
14
14
  s.homepage = "https://decidim.org"
15
15
  s.metadata = {
16
16
  "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  "homepage_uri" => "https://decidim.org",
20
20
  "source_code_uri" => "https://github.com/decidim/decidim"
21
21
  }
22
- s.required_ruby_version = "~> 3.1.0"
22
+ s.required_ruby_version = "~> 3.2.0"
23
23
 
24
24
  s.name = "decidim-accountability"
25
25
  s.summary = "Decidim accountability module"
@@ -30,10 +30,6 @@ Decidim.register_component(:accountability) do |component|
30
30
  settings.attribute :comments_enabled, type: :boolean, default: true
31
31
  settings.attribute :comments_max_length, type: :integer, required: true
32
32
  settings.attribute :intro, type: :text, translated: true, editor: true
33
- settings.attribute :categories_label, type: :string, translated: true, editor: true
34
- settings.attribute :subcategories_label, type: :string, translated: true, editor: true
35
- settings.attribute :heading_parent_level_results, type: :string, translated: true, editor: true
36
- settings.attribute :heading_leaf_level_results, type: :string, translated: true, editor: true
37
33
  settings.attribute :display_progress_enabled, type: :boolean, default: true
38
34
  end
39
35
 
@@ -4,7 +4,7 @@ require "decidim/components/namer"
4
4
 
5
5
  module Decidim
6
6
  module Accountability
7
- class Seeds
7
+ class Seeds < Decidim::Seeds
8
8
  attr_reader :participatory_space
9
9
 
10
10
  def initialize(participatory_space:)
@@ -12,11 +12,20 @@ module Decidim
12
12
  end
13
13
 
14
14
  def call
15
- admin_user = Decidim::User.find_by(
16
- organization: participatory_space.organization,
17
- email: "admin@example.org"
18
- )
15
+ component = create_component!
16
+
17
+ create_statuses!(component:)
18
+
19
+ 3.times do
20
+ categories = create_categories!
21
+
22
+ categories.each do |category|
23
+ create_result!(component:, category:)
24
+ end
25
+ end
26
+ end
19
27
 
28
+ def create_component!
20
29
  params = {
21
30
  name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :accountability).i18n_name,
22
31
  manifest_name: :accountability,
@@ -24,19 +33,17 @@ module Decidim
24
33
  participatory_space:,
25
34
  settings: {
26
35
  intro: Decidim::Faker::Localized.wrapped("<p>", "</p>") { Decidim::Faker::Localized.sentence(word_count: 4) },
27
- categories_label: Decidim::Faker::Localized.word,
28
- subcategories_label: Decidim::Faker::Localized.word,
29
- heading_parent_level_results: Decidim::Faker::Localized.word,
30
- heading_leaf_level_results: Decidim::Faker::Localized.word,
31
36
  scopes_enabled: true,
32
37
  scope_id: participatory_space.scope&.id
33
38
  }
34
39
  }
35
40
 
36
- component = Decidim.traceability.perform_action!("publish", Decidim::Component, admin_user, visibility: "all") do
41
+ Decidim.traceability.perform_action!("publish", Decidim::Component, admin_user, visibility: "all") do
37
42
  Decidim::Component.create!(params)
38
43
  end
44
+ end
39
45
 
46
+ def create_statuses!(component:)
40
47
  5.times do |i|
41
48
  Decidim::Accountability::Status.create!(
42
49
  component:,
@@ -44,70 +51,72 @@ module Decidim
44
51
  key: "status_#{i}"
45
52
  )
46
53
  end
54
+ end
47
55
 
48
- 3.times do
49
- parent_category = participatory_space.categories.sample
50
- categories = [parent_category]
56
+ def create_categories!
57
+ parent_category = participatory_space.categories.sample
58
+ categories = [parent_category]
51
59
 
52
- 2.times do
53
- categories << Decidim::Category.create!(
54
- name: Decidim::Faker::Localized.sentence(word_count: 5),
55
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
56
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
57
- end,
58
- parent: parent_category,
59
- participatory_space:
60
- )
61
- end
60
+ 2.times do
61
+ categories << Decidim::Category.create!(
62
+ name: Decidim::Faker::Localized.sentence(word_count: 5),
63
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
64
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
65
+ end,
66
+ parent: parent_category,
67
+ participatory_space:
68
+ )
69
+ end
62
70
 
63
- categories.each do |category|
64
- result = Decidim.traceability.create!(
65
- Decidim::Accountability::Result,
66
- admin_user,
67
- {
68
- component:,
69
- scope: participatory_space.organization.scopes.sample,
70
- category:,
71
- title: Decidim::Faker::Localized.sentence(word_count: 2),
72
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
73
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
74
- end
75
- },
76
- visibility: "all"
77
- )
71
+ categories
72
+ end
73
+
74
+ def create_result!(component:, category:)
75
+ result = Decidim.traceability.create!(
76
+ Decidim::Accountability::Result,
77
+ admin_user,
78
+ {
79
+ component:,
80
+ scope: participatory_space.organization.scopes.sample,
81
+ category:,
82
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
83
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
84
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
85
+ end
86
+ },
87
+ visibility: "all"
88
+ )
78
89
 
79
- Decidim::Comments::Seed.comments_for(result)
80
-
81
- 3.times do
82
- child_result = Decidim.traceability.create!(
83
- Decidim::Accountability::Result,
84
- admin_user,
85
- {
86
- component:,
87
- parent: result,
88
- start_date: Time.zone.today,
89
- end_date: Time.zone.today + 10,
90
- status: Decidim::Accountability::Status.all.sample,
91
- progress: rand(1..100),
92
- title: Decidim::Faker::Localized.sentence(word_count: 2),
93
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
94
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
95
- end
96
- },
97
- visibility: "all"
98
- )
99
-
100
- rand(0..5).times do |i|
101
- child_result.timeline_entries.create!(
102
- entry_date: child_result.start_date + i.days,
103
- title: Decidim::Faker::Localized.sentence(word_count: 2),
104
- description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
105
- )
90
+ Decidim::Comments::Seed.comments_for(result)
91
+
92
+ 3.times do
93
+ child_result = Decidim.traceability.create!(
94
+ Decidim::Accountability::Result,
95
+ admin_user,
96
+ {
97
+ component:,
98
+ parent: result,
99
+ start_date: Time.zone.today,
100
+ end_date: Time.zone.today + 10,
101
+ status: Decidim::Accountability::Status.all.sample,
102
+ progress: rand(1..100),
103
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
104
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
105
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
106
106
  end
107
+ },
108
+ visibility: "all"
109
+ )
107
110
 
108
- Decidim::Comments::Seed.comments_for(child_result)
109
- end
111
+ rand(0..5).times do |i|
112
+ child_result.timeline_entries.create!(
113
+ entry_date: child_result.start_date + i.days,
114
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
115
+ description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
116
+ )
110
117
  end
118
+
119
+ Decidim::Comments::Seed.comments_for(child_result)
111
120
  end
112
121
  end
113
122
  end
@@ -18,10 +18,6 @@ FactoryBot.define do
18
18
  settings do
19
19
  {
20
20
  intro: generate_localized_description(:accountability_component_intro, skip_injection:),
21
- categories_label: generate_localized_word(:accountability_component_categories_label, skip_injection:),
22
- subcategories_label: generate_localized_word(:accountability_component_subcategories_label, skip_injection:),
23
- heading_parent_level_results: generate_localized_word(:accountability_component_heading_parent_level_results, skip_injection:),
24
- heading_leaf_level_results: generate_localized_word(:accountability_component_heading_leaf_level_results, skip_injection:),
25
21
  scopes_enabled: true,
26
22
  scope_id: participatory_space.scope&.id
27
23
  }
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-accountability version.
5
5
  module Accountability
6
6
  def self.version
7
- "0.28.6"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -2,7 +2,9 @@
2
2
 
3
3
  module Decidim
4
4
  module Accountability
5
- class AccountabilityType < Decidim::Core::ComponentType
5
+ class AccountabilityType < Decidim::Api::Types::BaseObject
6
+ implements Decidim::Core::ComponentInterface
7
+
6
8
  graphql_name "Accountability"
7
9
  description "An accountability component of a participatory space."
8
10
 
@@ -22,7 +22,7 @@ module Decidim
22
22
  field :weight, GraphQL::Types::Int, "The order of this result", null: false
23
23
  field :external_id, GraphQL::Types::String, "The external ID for this result", null: true
24
24
 
25
- field :children, [Decidim::Accountability::ResultType, { null: true }], "The childrens results", null: true
25
+ field :children, [Decidim::Accountability::ResultType, { null: true }], "The children's results", null: true
26
26
  field :parent, Decidim::Accountability::ResultType, "The parent result", null: true
27
27
  field :status, Decidim::Accountability::StatusType, "The status for this result", null: true
28
28
  field :timeline_entries, [Decidim::Accountability::TimelineEntryType, { null: true }], "The timeline entries for this result", null: true
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.28.6
4
+ version: 0.29.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-04-29 00:00:00.000000000 Z
13
+ date: 2024-07-16 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.28.6
21
+ version: 0.29.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.6
28
+ version: 0.29.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.28.6
35
+ version: 0.29.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.28.6
42
+ version: 0.29.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.28.6
49
+ version: 0.29.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.28.6
56
+ version: 0.29.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.28.6
63
+ version: 0.29.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.28.6
70
+ version: 0.29.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.28.6
77
+ version: 0.29.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.28.6
84
+ version: 0.29.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.28.6
91
+ version: 0.29.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.28.6
98
+ version: 0.29.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.28.6
105
+ version: 0.29.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.28.6
112
+ version: 0.29.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.28.6
119
+ version: 0.29.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.28.6
126
+ version: 0.29.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.28.6
133
+ version: 0.29.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.28.6
140
+ version: 0.29.0.rc1
141
141
  description: An accountability component for decidim's participatory spaces.
142
142
  email:
143
143
  - josepjaume@gmail.com
@@ -175,7 +175,7 @@ files:
175
175
  - app/commands/decidim/accountability/admin/create_result.rb
176
176
  - app/commands/decidim/accountability/admin/create_status.rb
177
177
  - app/commands/decidim/accountability/admin/create_timeline_entry.rb
178
- - app/commands/decidim/accountability/admin/destroy_result.rb
178
+ - app/commands/decidim/accountability/admin/has_result_command.rb
179
179
  - app/commands/decidim/accountability/admin/import_projects_to_accountability.rb
180
180
  - app/commands/decidim/accountability/admin/update_imported_result.rb
181
181
  - app/commands/decidim/accountability/admin/update_result.rb
@@ -232,7 +232,6 @@ files:
232
232
  - app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb
233
233
  - app/queries/decidim/accountability/metrics/results_metric_manage.rb
234
234
  - app/services/decidim/accountability/diff_renderer.rb
235
- - app/services/decidim/accountability/result_stats_calculator.rb
236
235
  - app/services/decidim/accountability/results_calculator.rb
237
236
  - app/services/decidim/accountability/results_csv_importer.rb
238
237
  - app/views/decidim/accountability/admin/import_results/new.html.erb
@@ -259,7 +258,6 @@ files:
259
258
  - app/views/decidim/accountability/results/_projects_aside.html.erb
260
259
  - app/views/decidim/accountability/results/_scope_filters.html.erb
261
260
  - app/views/decidim/accountability/results/_search.html.erb
262
- - app/views/decidim/accountability/results/_stats_box.html.erb
263
261
  - app/views/decidim/accountability/results/home.html.erb
264
262
  - app/views/decidim/accountability/results/index.html.erb
265
263
  - app/views/decidim/accountability/results/index.js.erb
@@ -272,9 +270,6 @@ files:
272
270
  - config/locales/ar.yml
273
271
  - config/locales/bg-BG.yml
274
272
  - config/locales/bg.yml
275
- - config/locales/bn-BD.yml
276
- - config/locales/bs-BA.yml
277
- - config/locales/ca-IT.yml
278
273
  - config/locales/ca.yml
279
274
  - config/locales/cs-CZ.yml
280
275
  - config/locales/cs.yml
@@ -381,7 +376,7 @@ files:
381
376
  - lib/decidim/api/timeline_entry_type.rb
382
377
  homepage: https://decidim.org
383
378
  licenses:
384
- - AGPL-3.0-or-later
379
+ - AGPL-3.0
385
380
  metadata:
386
381
  bug_tracker_uri: https://github.com/decidim/decidim/issues
387
382
  documentation_uri: https://docs.decidim.org/
@@ -396,14 +391,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
396
391
  requirements:
397
392
  - - "~>"
398
393
  - !ruby/object:Gem::Version
399
- version: 3.1.0
394
+ version: 3.2.0
400
395
  required_rubygems_version: !ruby/object:Gem::Requirement
401
396
  requirements:
402
- - - ">="
397
+ - - ">"
403
398
  - !ruby/object:Gem::Version
404
- version: '0'
399
+ version: 1.3.1
405
400
  requirements: []
406
- rubygems_version: 3.3.7
401
+ rubygems_version: 3.4.10
407
402
  signing_key:
408
403
  specification_version: 4
409
404
  summary: Decidim accountability module
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- module Admin
6
- # This command is executed when the user destroys a Result from the admin
7
- # panel.
8
- class DestroyResult < Decidim::Command
9
- # Initializes an UpdateResult Command.
10
- #
11
- # result - The current instance of the result to be destroyed.
12
- # current_user - the user performing the action
13
- def initialize(result, current_user)
14
- @result = result
15
- @current_user = current_user
16
- end
17
-
18
- # Destroys the result.
19
- #
20
- # Broadcasts :ok if successful, :invalid otherwise.
21
- def call
22
- destroy_result
23
-
24
- broadcast(:ok)
25
- end
26
-
27
- private
28
-
29
- attr_reader :result, :current_user
30
-
31
- def destroy_result
32
- Decidim.traceability.perform_action!(
33
- :delete,
34
- result,
35
- current_user
36
- ) do
37
- result.destroy!
38
- end
39
- end
40
- end
41
- end
42
- end
43
- end
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- # This class handles statistics of results. Needs a `result` in
6
- # order to find the stats.
7
- class ResultStatsCalculator
8
- # Public: Initializes the service.
9
- # result - The result from which to calculate the stats.
10
- def initialize(result)
11
- @result = result
12
- end
13
-
14
- delegate :count, to: :proposals, prefix: true
15
-
16
- def votes_count
17
- return 0 unless proposals
18
-
19
- proposals.sum { |proposal| proposal.votes.size }
20
- end
21
-
22
- def comments_count
23
- proposals.sum(:comments_count)
24
- end
25
-
26
- def attendees_count
27
- meetings.where("attendees_count > 0").sum(:attendees_count)
28
- end
29
-
30
- def contributions_count
31
- meetings.where("contributions_count > 0").sum(:contributions_count)
32
- end
33
-
34
- delegate :count, to: :meetings, prefix: true
35
-
36
- private
37
-
38
- attr_reader :result
39
-
40
- def proposals
41
- @proposals ||= result.linked_resources(:proposals, "included_proposals")
42
- end
43
-
44
- def meetings
45
- @meetings ||= result.linked_resources(:meetings, "meetings_through_proposals")
46
- end
47
- end
48
- end
49
- end