decidim-accountability 0.26.0 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +13 -1
  3. data/app/commands/decidim/accountability/admin/create_imported_result.rb +1 -1
  4. data/app/commands/decidim/accountability/admin/create_result.rb +1 -1
  5. data/app/commands/decidim/accountability/admin/create_status.rb +6 -3
  6. data/app/commands/decidim/accountability/admin/create_timeline_entry.rb +11 -7
  7. data/app/commands/decidim/accountability/admin/destroy_result.rb +1 -1
  8. data/app/commands/decidim/accountability/admin/update_imported_result.rb +1 -1
  9. data/app/commands/decidim/accountability/admin/update_result.rb +1 -1
  10. data/app/commands/decidim/accountability/admin/update_status.rb +6 -3
  11. data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +9 -5
  12. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +5 -3
  13. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +5 -3
  14. data/app/controllers/decidim/accountability/results_controller.rb +12 -12
  15. data/app/forms/decidim/accountability/admin/result_form.rb +2 -2
  16. data/app/forms/decidim/accountability/admin/timeline_entry_form.rb +2 -1
  17. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +2 -2
  18. data/app/models/decidim/accountability/result.rb +9 -5
  19. data/app/models/decidim/accountability/status.rb +6 -2
  20. data/app/models/decidim/accountability/timeline_entry.rb +6 -0
  21. data/app/packs/images/decidim/accountability/{decidim_accountability_icon.svg → decidim_accountability.svg} +0 -0
  22. data/app/presenters/decidim/accountability/admin_log/status_presenter.rb +38 -0
  23. data/app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb +37 -0
  24. data/app/services/decidim/accountability/results_calculator.rb +10 -6
  25. data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +5 -1
  26. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +2 -2
  27. data/app/views/decidim/accountability/results/_home_categories.html.erb +2 -2
  28. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +3 -3
  29. data/app/views/decidim/accountability/results/_results_leaf.html.erb +3 -3
  30. data/app/views/decidim/accountability/results/_results_parent.html.erb +1 -1
  31. data/app/views/decidim/accountability/results/_scope_filters.html.erb +3 -3
  32. data/app/views/decidim/accountability/results/_search.html.erb +1 -1
  33. data/app/views/decidim/accountability/results/_timeline.html.erb +7 -1
  34. data/app/views/decidim/accountability/results/home.html.erb +3 -1
  35. data/app/views/decidim/accountability/versions/show.html.erb +3 -1
  36. data/config/locales/am-ET.yml +1 -0
  37. data/config/locales/ar.yml +52 -4
  38. data/config/locales/bg.yml +1 -1
  39. data/config/locales/ca.yml +11 -1
  40. data/config/locales/cs.yml +11 -1
  41. data/config/locales/da.yml +1 -1
  42. data/config/locales/de.yml +11 -1
  43. data/config/locales/el.yml +1 -1
  44. data/config/locales/en.yml +10 -1
  45. data/config/locales/eo.yml +1 -0
  46. data/config/locales/es-MX.yml +11 -1
  47. data/config/locales/es-PY.yml +11 -1
  48. data/config/locales/es.yml +11 -1
  49. data/config/locales/et.yml +1 -0
  50. data/config/locales/eu.yml +1 -1
  51. data/config/locales/fi-plain.yml +11 -1
  52. data/config/locales/fi.yml +12 -2
  53. data/config/locales/fr-CA.yml +11 -1
  54. data/config/locales/fr.yml +13 -3
  55. data/config/locales/ga-IE.yml +1 -0
  56. data/config/locales/gl.yml +1 -1
  57. data/config/locales/hr.yml +1 -0
  58. data/config/locales/hu.yml +3 -1
  59. data/config/locales/id-ID.yml +1 -1
  60. data/config/locales/is-IS.yml +2 -2
  61. data/config/locales/it.yml +1 -1
  62. data/config/locales/ja.yml +11 -1
  63. data/config/locales/ko.yml +1 -0
  64. data/config/locales/lb.yml +1 -1
  65. data/config/locales/lt.yml +263 -0
  66. data/config/locales/lv.yml +1 -1
  67. data/config/locales/mt.yml +1 -0
  68. data/config/locales/nl.yml +1 -1
  69. data/config/locales/no.yml +1 -1
  70. data/config/locales/om-ET.yml +1 -0
  71. data/config/locales/pl.yml +11 -1
  72. data/config/locales/pt-BR.yml +2 -2
  73. data/config/locales/pt.yml +1 -1
  74. data/config/locales/ro-RO.yml +1 -1
  75. data/config/locales/ru.yml +1 -1
  76. data/config/locales/si-LK.yml +1 -0
  77. data/config/locales/sk.yml +1 -1
  78. data/config/locales/sl.yml +1 -1
  79. data/config/locales/so-SO.yml +1 -0
  80. data/config/locales/sr-CS.yml +1 -1
  81. data/config/locales/sv.yml +3 -1
  82. data/config/locales/sw-KE.yml +1 -0
  83. data/config/locales/ti-ER.yml +1 -0
  84. data/config/locales/tr-TR.yml +1 -1
  85. data/config/locales/uk.yml +1 -1
  86. data/config/locales/val-ES.yml +1 -0
  87. data/config/locales/vi.yml +1 -0
  88. data/config/locales/zh-CN.yml +1 -1
  89. data/config/locales/zh-TW.yml +1 -0
  90. data/db/migrate/20220331150008_add_title_to_timeline_entries.rb +7 -0
  91. data/db/migrate/20220331150155_move_legacy_description_to_title_of_timeline_entries.rb +13 -0
  92. data/lib/decidim/accountability/component.rb +2 -1
  93. data/lib/decidim/accountability/test/factories.rb +1 -0
  94. data/lib/decidim/accountability/version.rb +1 -1
  95. data/lib/decidim/api/timeline_entry_type.rb +1 -0
  96. metadata +29 -26
  97. data/app/services/decidim/accountability/result_search.rb +0 -48
@@ -1 +1,2 @@
1
+ ---
1
2
  sw:
@@ -1 +1,2 @@
1
+ ---
1
2
  ti:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  tr:
2
3
  activemodel:
3
4
  attributes:
@@ -156,7 +157,6 @@ tr:
156
157
  progress: İlerleme
157
158
  timeline_entry:
158
159
  fields:
159
- description: Açıklama
160
160
  entry_date: tarih
161
161
  result_m:
162
162
  executed: Yürütüldü
@@ -1,3 +1,4 @@
1
+ ---
1
2
  uk:
2
3
  activemodel:
3
4
  attributes:
@@ -128,7 +129,6 @@ uk:
128
129
  progress: Перебіг
129
130
  timeline_entry:
130
131
  fields:
131
- description: Опис
132
132
  entry_date: Дата
133
133
  results:
134
134
  count:
@@ -1 +1,2 @@
1
+ ---
1
2
  val:
@@ -1 +1,2 @@
1
+ ---
1
2
  vi:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  zh-CN:
2
3
  activemodel:
3
4
  attributes:
@@ -144,7 +145,6 @@ zh-CN:
144
145
  progress: 进展情况
145
146
  timeline_entry:
146
147
  fields:
147
- description: 描述
148
148
  entry_date: 日期
149
149
  results:
150
150
  count:
@@ -1 +1,2 @@
1
+ ---
1
2
  zh-TW:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddTitleToTimelineEntries < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column :decidim_accountability_timeline_entries, :title, :jsonb
6
+ end
7
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MoveLegacyDescriptionToTitleOfTimelineEntries < ActiveRecord::Migration[6.1]
4
+ class TimelineEntry < ApplicationRecord
5
+ self.table_name = :decidim_accountability_timeline_entries
6
+ end
7
+
8
+ def up
9
+ TimelineEntry.find_each do |timeline_entry|
10
+ timeline_entry.update!(title: timeline_entry.description, description: nil)
11
+ end
12
+ end
13
+ end
@@ -159,7 +159,8 @@ Decidim.register_component(:accountability) do |component|
159
159
  rand(0..5).times do |i|
160
160
  child_result.timeline_entries.create!(
161
161
  entry_date: child_result.start_date + i.days,
162
- description: Decidim::Faker::Localized.sentence(word_count: 2)
162
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
163
+ description: Decidim::Faker::Localized.paragraph(sentence_count: 1)
163
164
  )
164
165
  end
165
166
 
@@ -45,6 +45,7 @@ FactoryBot.define do
45
45
  factory :timeline_entry, class: "Decidim::Accountability::TimelineEntry" do
46
46
  result { create(:result) }
47
47
  entry_date { "12/7/2017" }
48
+ title { generate_localized_title }
48
49
  description { generate_localized_title }
49
50
  end
50
51
  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.26.0"
7
+ "0.27.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -7,6 +7,7 @@ module Decidim
7
7
 
8
8
  field :id, GraphQL::Types::ID, "The internal ID for this timeline entry", null: false
9
9
  field :entry_date, Decidim::Core::DateType, "The entry date for this timeline entry", null: true
10
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this timeline entry", null: true
10
11
  field :description, Decidim::Core::TranslatedFieldType, "The description for this timeline entry", null: true
11
12
  field :created_at, Decidim::Core::DateTimeType, "When this timeline entry was created", null: true
12
13
  field :updated_at, Decidim::Core::DateTimeType, "When this timeline entry was updated", 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.26.0
4
+ version: 0.27.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: 2022-02-22 00:00:00.000000000 Z
13
+ date: 2022-06-27 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.26.0
21
+ version: 0.27.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.26.0
28
+ version: 0.27.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.26.0
35
+ version: 0.27.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.26.0
42
+ version: 0.27.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.26.0
49
+ version: 0.27.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.26.0
56
+ version: 0.27.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.26.0
63
+ version: 0.27.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.26.0
70
+ version: 0.27.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.26.0
77
+ version: 0.27.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.26.0
84
+ version: 0.27.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.26.0
91
+ version: 0.27.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.26.0
98
+ version: 0.27.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.26.0
105
+ version: 0.27.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.26.0
112
+ version: 0.27.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.26.0
119
+ version: 0.27.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.26.0
126
+ version: 0.27.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.26.0
133
+ version: 0.27.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.26.0
140
+ version: 0.27.0.rc1
141
141
  description: An accountability component for decidim's participatory spaces.
142
142
  email:
143
143
  - josepjaume@gmail.com
@@ -200,7 +200,7 @@ files:
200
200
  - app/models/decidim/accountability/timeline_entry.rb
201
201
  - app/packs/entrypoints/decidim_accountability.js
202
202
  - app/packs/entrypoints/decidim_accountability_admin.js
203
- - app/packs/images/decidim/accountability/decidim_accountability_icon.svg
203
+ - app/packs/images/decidim/accountability/decidim_accountability.svg
204
204
  - app/packs/src/decidim/accountability/admin/index.js
205
205
  - app/packs/src/decidim/accountability/index.js
206
206
  - app/packs/src/decidim/accountability/version_diff.js
@@ -212,10 +212,11 @@ files:
212
212
  - app/permissions/decidim/accountability/admin/permissions.rb
213
213
  - app/permissions/decidim/accountability/permissions.rb
214
214
  - app/presenters/decidim/accountability/admin_log/result_presenter.rb
215
+ - app/presenters/decidim/accountability/admin_log/status_presenter.rb
216
+ - app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb
215
217
  - app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb
216
218
  - app/queries/decidim/accountability/metrics/results_metric_manage.rb
217
219
  - app/services/decidim/accountability/diff_renderer.rb
218
- - app/services/decidim/accountability/result_search.rb
219
220
  - app/services/decidim/accountability/result_stats_calculator.rb
220
221
  - app/services/decidim/accountability/results_calculator.rb
221
222
  - app/services/decidim/accountability/results_csv_importer.rb
@@ -340,6 +341,8 @@ files:
340
341
  - db/migrate/20180508170647_add_external_id_to_results.rb
341
342
  - db/migrate/20200320105903_index_foreign_keys_in_decidim_accountability_results.rb
342
343
  - db/migrate/20200827154103_add_commentable_counter_cache_to_results.rb
344
+ - db/migrate/20220331150008_add_title_to_timeline_entries.rb
345
+ - db/migrate/20220331150155_move_legacy_description_to_title_of_timeline_entries.rb
343
346
  - lib/decidim/accountability.rb
344
347
  - lib/decidim/accountability/admin.rb
345
348
  - lib/decidim/accountability/admin_engine.rb
@@ -365,14 +368,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
365
368
  requirements:
366
369
  - - ">="
367
370
  - !ruby/object:Gem::Version
368
- version: '2.7'
371
+ version: '3.0'
369
372
  required_rubygems_version: !ruby/object:Gem::Requirement
370
373
  requirements:
371
- - - ">="
374
+ - - ">"
372
375
  - !ruby/object:Gem::Version
373
- version: '0'
376
+ version: 1.3.1
374
377
  requirements: []
375
- rubygems_version: 3.1.6
378
+ rubygems_version: 3.2.22
376
379
  signing_key:
377
380
  specification_version: 4
378
381
  summary: Decidim accountability module
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- # This class handles search and filtering of results. Needs a
6
- # `current_component` param with a `Decidim::Component` in order to
7
- # find the results.
8
- class ResultSearch < ResourceSearch
9
- text_search_fields :title, :description
10
-
11
- # Public: Initializes the service.
12
- #
13
- # options - A hash of options to modify the search. These options will be
14
- # converted to methods by SearchLight so they can be used on filter
15
- # methods. (Default {})
16
- # * component - A Decidim::Component to get the results from.
17
- # * organization - A Decidim::Organization object.
18
- # * parent_id - The parent ID of the result. The value is forced to false to force
19
- # the filter execution when the value is nil
20
- # * deep_search - Whether to perform the search on all children levels or just the
21
- # first one. True by default.
22
- def initialize(options = {})
23
- options = options.dup
24
- options[:deep_search] = true if options[:deep_search].nil?
25
- options[:parent_id] = "root" if options[:parent_id].nil?
26
- super(Result.all, options)
27
- end
28
-
29
- # Handle parent_id filter
30
- def search_parent_id
31
- parent_id = options[:parent_id]
32
- parent_id = nil if parent_id == "root"
33
-
34
- if options[:deep_search]
35
- query.where(parent_id: [parent_id] + children_ids(parent_id))
36
- else
37
- query.where(parent_id: parent_id)
38
- end
39
- end
40
-
41
- private
42
-
43
- def children_ids(parent_id)
44
- Result.where(parent_id: parent_id).pluck(:id)
45
- end
46
- end
47
- end
48
- end