decidim-accountability 0.10.1 → 0.11.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/decidim/accountability/accountability.js.es6 +2 -2
  4. data/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6 +11 -11
  5. data/app/commands/decidim/accountability/admin/create_result.rb +1 -1
  6. data/app/commands/decidim/accountability/admin/create_status.rb +1 -1
  7. data/app/commands/decidim/accountability/admin/destroy_result.rb +43 -0
  8. data/app/controllers/decidim/accountability/admin/application_controller.rb +2 -2
  9. data/app/controllers/decidim/accountability/admin/results_controller.rb +12 -10
  10. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +1 -1
  11. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +1 -1
  12. data/app/controllers/decidim/accountability/application_controller.rb +2 -2
  13. data/app/controllers/decidim/accountability/result_widgets_controller.rb +1 -1
  14. data/app/controllers/decidim/accountability/results_controller.rb +3 -3
  15. data/app/controllers/decidim/accountability/versions_controller.rb +1 -1
  16. data/app/events/decidim/accountability/proposal_linked_event.rb +1 -1
  17. data/app/forms/decidim/accountability/admin/result_form.rb +5 -5
  18. data/app/helpers/decidim/accountability/application_helper.rb +4 -4
  19. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +1 -1
  20. data/app/models/decidim/accountability/result.rb +10 -5
  21. data/app/models/decidim/accountability/status.rb +3 -3
  22. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +5 -4
  23. data/app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb +29 -0
  24. data/app/services/decidim/accountability/result_search.rb +2 -2
  25. data/app/services/decidim/accountability/results_calculator.rb +4 -4
  26. data/app/views/decidim/accountability/admin/results/_form.html.erb +5 -6
  27. data/app/views/decidim/accountability/admin/results/_proposals.html.erb +2 -2
  28. data/app/views/decidim/accountability/admin/results/edit.html.erb +2 -2
  29. data/app/views/decidim/accountability/admin/results/index.html.erb +5 -5
  30. data/app/views/decidim/accountability/admin/results/new.html.erb +2 -2
  31. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
  32. data/app/views/decidim/accountability/admin/statuses/edit.html.erb +2 -3
  33. data/app/views/decidim/accountability/admin/statuses/index.html.erb +3 -3
  34. data/app/views/decidim/accountability/admin/statuses/new.html.erb +2 -3
  35. data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +2 -3
  36. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +4 -4
  37. data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +2 -3
  38. data/app/views/decidim/accountability/results/_home_categories.html.erb +3 -3
  39. data/app/views/decidim/accountability/results/_home_header.html.erb +2 -2
  40. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +4 -4
  41. data/app/views/decidim/accountability/results/_results_leaf.html.erb +2 -2
  42. data/app/views/decidim/accountability/results/_results_parent.html.erb +2 -4
  43. data/app/views/decidim/accountability/results/_scope_filters.html.erb +1 -1
  44. data/app/views/decidim/accountability/results/_search.html.erb +2 -2
  45. data/app/views/decidim/accountability/results/_show_leaf.html.erb +2 -2
  46. data/app/views/decidim/accountability/results/_show_parent.html.erb +2 -2
  47. data/app/views/decidim/accountability/results/_stats_box.html.erb +1 -1
  48. data/app/views/decidim/accountability/versions/index.html.erb +1 -1
  49. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb +1 -1
  50. data/app/views/decidim/participatory_processes/participatory_process_groups/_result.html.erb +1 -1
  51. data/app/views/decidim/participatory_spaces/_highlighted_results.html.erb +2 -2
  52. data/app/views/decidim/participatory_spaces/_result.html.erb +1 -1
  53. data/config/locales/ca.yml +12 -8
  54. data/config/locales/en.yml +13 -9
  55. data/config/locales/es.yml +13 -9
  56. data/config/locales/eu.yml +13 -9
  57. data/config/locales/fi.yml +13 -9
  58. data/config/locales/fr.yml +14 -10
  59. data/config/locales/gl.yml +13 -9
  60. data/config/locales/it.yml +13 -9
  61. data/config/locales/nl.yml +22 -18
  62. data/config/locales/pl.yml +13 -9
  63. data/config/locales/pt-BR.yml +13 -9
  64. data/config/locales/pt.yml +13 -9
  65. data/config/locales/ru.yml +0 -1
  66. data/config/locales/sv.yml +13 -9
  67. data/config/locales/uk.yml +0 -1
  68. data/db/migrate/20180305133145_rename_features_to_components_at_accountability.rb +16 -0
  69. data/lib/decidim/accountability.rb +1 -1
  70. data/lib/decidim/accountability/{feature.rb → component.rb} +25 -25
  71. data/lib/decidim/accountability/engine.rb +4 -4
  72. data/lib/decidim/accountability/result_serializer.rb +3 -3
  73. data/lib/decidim/accountability/test/factories.rb +5 -5
  74. data/lib/decidim/accountability/version.rb +1 -1
  75. metadata +26 -23
@@ -2,7 +2,7 @@ nl:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: staat
5
+ decidim_accountability_status_id: Status
6
6
  decidim_category_id: Categorie
7
7
  decidim_scope_id: Scope
8
8
  description: Beschrijving
@@ -10,9 +10,9 @@ nl:
10
10
  progress: Vooruitgang
11
11
  project_ids: Opgenomen projecten
12
12
  proposals: Inbegrepen voorstellen
13
- start_date: Begin datum
13
+ start_date: Startdatum
14
14
  title: Titel
15
- updated_at: Bijgewerkt om
15
+ updated_at: Bijgewerkt op
16
16
  status:
17
17
  description: Beschrijving
18
18
  key: sleutel
@@ -58,9 +58,9 @@ nl:
58
58
  create: Maak resultaat
59
59
  title: Nieuw resultaat
60
60
  proposals:
61
- close: Dichtbij
61
+ close: Sluit
62
62
  current_selection: Huidige selectie
63
- select: kiezen
63
+ select: Selecteer
64
64
  update:
65
65
  invalid: Er is een probleem opgetreden bij het bijwerken van dit resultaat
66
66
  success: Resultaat met succes bijgewerkt
@@ -103,14 +103,18 @@ nl:
103
103
  success: Item succesvol bijgewerkt
104
104
  admin_log:
105
105
  result:
106
- create: "%{user_name} gemaakt resultaat %{resource_name} in %{space_name}"
106
+ create: "%{user_name} heeft het resultaat %{resource_name} gemaakt in %{space_name}"
107
+ delete: "%{user_name} verwijderde het resultaat %{resource_name} in %{space_name}"
107
108
  update: "%{user_name} bijgewerkt resultaat %{resource_name} in %{space_name}"
109
+ value_types:
110
+ parent_presenter:
111
+ not_found: 'Het bovenliggende element is niet gevonden in de database (ID: %{id})'
108
112
  models:
109
113
  result:
110
114
  fields:
111
115
  end_date: Einddatum
112
116
  progress: Vooruitgang
113
- start_date: Begin datum
117
+ start_date: Startdatum
114
118
  status: Status
115
119
  title: Titel
116
120
  status:
@@ -148,7 +152,7 @@ nl:
148
152
  contributions: Bijdrage
149
153
  last_edited_by: Laatst bewerkt door
150
154
  last_updated_at: Laatst bijgewerkt om
151
- meetings: Vergaderingen
155
+ meetings: Events
152
156
  number_of_versions: versies
153
157
  proposals: Voorstellen
154
158
  show_all_versions: Toon alle versies
@@ -167,16 +171,9 @@ nl:
167
171
  changes_at_title: Veranderingen bij "%{title}"
168
172
  version:
169
173
  version_index: Versie %{index}
170
- events:
171
- accountability:
172
- proposal_linked:
173
- email_intro: 'Het voorstel "%{proposal_title}" is in een resultaat opgenomen. Je kunt het vanaf deze pagina bekijken:'
174
- email_outro: Je hebt deze melding ontvangen omdat je "%{proposal_title}" volgt. Je kunt stoppen met het ontvangen van meldingen na de vorige link.
175
- email_subject: Een update voor %{proposal_title}
176
- notification_title: Het voorstel <a href="%{proposal_path}">%{proposal_title}</a> is opgenomen in het <a href="%{resource_path}">%{resource_title}</a> resultaat.
177
- features:
174
+ components:
178
175
  accountability:
179
- name: Verantwoording
176
+ name: Verantwoordelijkheid
180
177
  settings:
181
178
  global:
182
179
  categories_label: Naam voor "Categorieën"
@@ -184,10 +181,17 @@ nl:
184
181
  display_progress_enabled: Geef de voortgang weer
185
182
  heading_leaf_level_results: Naam voor "Projecten"
186
183
  heading_parent_level_results: Naam voor "Resultaten"
187
- intro: Intro
184
+ intro: Inleiding
188
185
  subcategories_label: Naam voor 'Subcategorieën'
189
186
  step:
190
187
  comments_blocked: Reacties geblokkeerd
188
+ events:
189
+ accountability:
190
+ proposal_linked:
191
+ email_intro: 'Het voorstel "%{proposal_title}" is in een resultaat opgenomen. Je kan het vanaf deze pagina bekijken:'
192
+ email_outro: Je hebt deze melding ontvangen omdat je "%{proposal_title}" volgt. Je kan de meldingen deactiveren door te klikken op de vorige link.
193
+ email_subject: Een update voor %{proposal_title}
194
+ notification_title: Het voorstel <a href="%{proposal_path}">%{proposal_title}</a> is opgenomen in het <a href="%{resource_path}">%{resource_title}</a> resultaat.
191
195
  participatory_processes:
192
196
  participatory_process_groups:
193
197
  highlighted_results:
@@ -2,7 +2,7 @@ pl:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: status
5
+ decidim_accountability_status_id: Status
6
6
  decidim_category_id: Kategoria
7
7
  decidim_scope_id: Zakres
8
8
  description: Opis
@@ -104,7 +104,11 @@ pl:
104
104
  admin_log:
105
105
  result:
106
106
  create: "%{user_name} utworzony wynik %{resource_name} w %{space_name}"
107
+ delete: "%{user_name} usunął %{resource_name} wynik w %{space_name}"
107
108
  update: "%{user_name} zaktualizowany wynik %{resource_name} w %{space_name}"
109
+ value_types:
110
+ parent_presenter:
111
+ not_found: 'Nie znaleziono elementu nadrzędnego w bazie danych (ID: %{id})'
108
112
  models:
109
113
  result:
110
114
  fields:
@@ -163,14 +167,7 @@ pl:
163
167
  changes_at_title: Zmiany w "%{title}"
164
168
  version:
165
169
  version_index: Wersja %{index}
166
- events:
167
- accountability:
168
- proposal_linked:
169
- email_intro: 'Wniosek "%{proposal_title}" został uwzględniony w wyniku. Możesz go zobaczyć na tej stronie:'
170
- email_outro: Otrzymałeś to powiadomienie, ponieważ obserwujesz "%{proposal_title}". Możesz przestać otrzymywać powiadomienia po poprzednim linku.
171
- email_subject: Aktualizacja do %{proposal_title}
172
- notification_title: Wniosek <a href="%{proposal_path}">%{proposal_title}</a> został uwzględniony w wyniku <a href="%{resource_path}">%{resource_title}</a>.
173
- features:
170
+ components:
174
171
  accountability:
175
172
  name: Odpowiedzialność
176
173
  settings:
@@ -184,6 +181,13 @@ pl:
184
181
  subcategories_label: Nazwa dla "podkategorii"
185
182
  step:
186
183
  comments_blocked: Komentarze zablokowane
184
+ events:
185
+ accountability:
186
+ proposal_linked:
187
+ email_intro: 'Wniosek "%{proposal_title}" został uwzględniony w wyniku. Możesz go zobaczyć na tej stronie:'
188
+ email_outro: Otrzymałeś to powiadomienie, ponieważ obserwujesz "%{proposal_title}". Możesz przestać otrzymywać powiadomienia po poprzednim linku.
189
+ email_subject: Aktualizacja do %{proposal_title}
190
+ notification_title: Wniosek <a href="%{proposal_path}">%{proposal_title}</a> został uwzględniony w wyniku <a href="%{resource_path}">%{resource_title}</a>.
187
191
  participatory_processes:
188
192
  participatory_process_groups:
189
193
  highlighted_results:
@@ -2,7 +2,7 @@ pt-BR:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: status
5
+ decidim_accountability_status_id: Status
6
6
  decidim_category_id: Categoria
7
7
  decidim_scope_id: Âmbito
8
8
  description: Descrição
@@ -104,7 +104,11 @@ pt-BR:
104
104
  admin_log:
105
105
  result:
106
106
  create: "%{user_name} resultado criado %{resource_name} em %{space_name}"
107
+ delete: "%{user_name} eliminou o resultado %{resource_name} em %{space_name}"
107
108
  update: "%{user_name} resultado atualizado %{resource_name} em %{space_name}"
109
+ value_types:
110
+ parent_presenter:
111
+ not_found: 'O pai não foi encontrado no banco de dados (ID: %{id})'
108
112
  models:
109
113
  result:
110
114
  fields:
@@ -167,14 +171,7 @@ pt-BR:
167
171
  changes_at_title: Alterações em "%{title}"
168
172
  version:
169
173
  version_index: Versão %{index}
170
- events:
171
- accountability:
172
- proposal_linked:
173
- email_intro: 'A proposta "%{proposal_title}" foi incluída em um resultado. Você pode vê-lo a partir desta página:'
174
- email_outro: Você recebeu esta notificação porque está seguindo "%{proposal_title}". Você pode parar de receber notificações após o link anterior.
175
- email_subject: Uma atualização para %{proposal_title}
176
- notification_title: A proposta <a href="%{proposal_path}">%{proposal_title}</a> foi incluída no resultado <a href="%{resource_path}">%{resource_title}</a>.
177
- features:
174
+ components:
178
175
  accountability:
179
176
  name: Prestação de contas
180
177
  settings:
@@ -188,6 +185,13 @@ pt-BR:
188
185
  subcategories_label: Nome para "Subcategorias"
189
186
  step:
190
187
  comments_blocked: Comentários bloqueados
188
+ events:
189
+ accountability:
190
+ proposal_linked:
191
+ email_intro: 'A proposta "%{proposal_title}" foi incluída em um resultado. Você pode vê-lo a partir desta página:'
192
+ email_outro: Você recebeu esta notificação porque está seguindo "%{proposal_title}". Você pode parar de receber notificações após o link anterior.
193
+ email_subject: Uma atualização para %{proposal_title}
194
+ notification_title: A proposta <a href="%{proposal_path}">%{proposal_title}</a> foi incluída no resultado <a href="%{resource_path}">%{resource_title}</a>.
191
195
  participatory_processes:
192
196
  participatory_process_groups:
193
197
  highlighted_results:
@@ -2,7 +2,7 @@ pt:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: status
5
+ decidim_accountability_status_id: Status
6
6
  decidim_category_id: Categoria
7
7
  decidim_scope_id: Âmbito
8
8
  description: Descrição
@@ -104,7 +104,11 @@ pt:
104
104
  admin_log:
105
105
  result:
106
106
  create: "%{user_name} resultado criado %{resource_name} em %{space_name}"
107
+ delete: "%{user_name} eliminou o resultado %{resource_name} em %{space_name}"
107
108
  update: "%{user_name} resultado atualizado %{resource_name} em %{space_name}"
109
+ value_types:
110
+ parent_presenter:
111
+ not_found: 'O pai não foi encontrado no banco de dados (ID: %{id})'
108
112
  models:
109
113
  result:
110
114
  fields:
@@ -167,14 +171,7 @@ pt:
167
171
  changes_at_title: Alterações em "%{title}"
168
172
  version:
169
173
  version_index: Versão %{index}
170
- events:
171
- accountability:
172
- proposal_linked:
173
- email_intro: 'A proposta "%{proposal_title}" foi incluída em um resultado. Você pode vê-lo a partir desta página:'
174
- email_outro: Você recebeu esta notificação porque está seguindo "%{proposal_title}". Você pode parar de receber notificações após o link anterior.
175
- email_subject: Uma atualização para %{proposal_title}
176
- notification_title: A proposta <a href="%{proposal_path}">%{proposal_title}</a> foi incluída no resultado <a href="%{resource_path}">%{resource_title}</a>.
177
- features:
174
+ components:
178
175
  accountability:
179
176
  name: Prestação de contas
180
177
  settings:
@@ -188,6 +185,13 @@ pt:
188
185
  subcategories_label: Nome para "Subcategorias"
189
186
  step:
190
187
  comments_blocked: Comentários bloqueados
188
+ events:
189
+ accountability:
190
+ proposal_linked:
191
+ email_intro: 'A proposta "%{proposal_title}" foi incluída em um resultado. Você pode vê-lo a partir desta página:'
192
+ email_outro: Você recebeu esta notificação porque está seguindo "%{proposal_title}". Você pode parar de receber notificações após o link anterior.
193
+ email_subject: Uma atualização para %{proposal_title}
194
+ notification_title: A proposta <a href="%{proposal_path}">%{proposal_title}</a> foi incluída no resultado <a href="%{resource_path}">%{resource_title}</a>.
191
195
  participatory_processes:
192
196
  participatory_process_groups:
193
197
  highlighted_results:
@@ -2,7 +2,6 @@ ru:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: состояние
6
5
  decidim_category_id: Категория
7
6
  decidim_scope_id: Охват
8
7
  description: Описание
@@ -2,7 +2,7 @@ sv:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: status
5
+ decidim_accountability_status_id: Status
6
6
  decidim_category_id: Kategori
7
7
  decidim_scope_id: Omfattning
8
8
  description: Beskrivning
@@ -104,7 +104,11 @@ sv:
104
104
  admin_log:
105
105
  result:
106
106
  create: "%{user_name} skapat resultat %{resource_name} i %{space_name}"
107
+ delete: "%{user_name} raderade resultatet %{resource_name} i %{space_name}"
107
108
  update: "%{user_name} uppdaterat resultat %{resource_name} i %{space_name}"
109
+ value_types:
110
+ parent_presenter:
111
+ not_found: 'Föräldern hittades inte i databasen (ID: %{id})'
108
112
  models:
109
113
  result:
110
114
  fields:
@@ -167,14 +171,7 @@ sv:
167
171
  changes_at_title: Ändringar vid "%{title}"
168
172
  version:
169
173
  version_index: Version %{index}
170
- events:
171
- accountability:
172
- proposal_linked:
173
- email_intro: 'Förslaget "%{proposal_title}" har inkluderats i ett resultat. Du kan se den från den här sidan:'
174
- email_outro: Du har fått den här meddelandet eftersom du följer "%{proposal_title}". Du kan sluta ta emot meddelanden efter föregående länk.
175
- email_subject: En uppdatering till %{proposal_title}
176
- notification_title: Förslaget <a href="%{proposal_path}">%{proposal_title}</a> har inkluderats i <a href="%{resource_path}">%{resource_title}</a> resultat.
177
- features:
174
+ components:
178
175
  accountability:
179
176
  name: Ansvarighet
180
177
  settings:
@@ -188,6 +185,13 @@ sv:
188
185
  subcategories_label: Namn på "Underkategorier"
189
186
  step:
190
187
  comments_blocked: Kommentarer blockerade
188
+ events:
189
+ accountability:
190
+ proposal_linked:
191
+ email_intro: 'Förslaget "%{proposal_title}" har inkluderats i ett resultat. Du kan se den från den här sidan:'
192
+ email_outro: Du har fått den här meddelandet eftersom du följer "%{proposal_title}". Du kan sluta ta emot meddelanden efter föregående länk.
193
+ email_subject: En uppdatering till %{proposal_title}
194
+ notification_title: Förslaget <a href="%{proposal_path}">%{proposal_title}</a> har inkluderats i <a href="%{resource_path}">%{resource_title}</a> resultat.
191
195
  participatory_processes:
192
196
  participatory_process_groups:
193
197
  highlighted_results:
@@ -2,7 +2,6 @@ uk:
2
2
  activemodel:
3
3
  attributes:
4
4
  result:
5
- decidim_accountability_status_id: стан
6
5
  decidim_category_id: Розділ
7
6
  decidim_scope_id: Терен
8
7
  description: Опис
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameFeaturesToComponentsAtAccountability < ActiveRecord::Migration[5.1]
4
+ def change
5
+ rename_column :decidim_accountability_statuses, :decidim_feature_id, :decidim_component_id
6
+ rename_column :decidim_accountability_results, :decidim_feature_id, :decidim_component_id
7
+
8
+ if index_name_exists?(:decidim_accountability_results, "index_decidim_accountability_results_on_decidim_feature_id")
9
+ rename_index :decidim_accountability_results, "index_decidim_accountability_results_on_decidim_feature_id", "index_decidim_accountability_results_on_decidim_component_id"
10
+ end
11
+
12
+ if index_name_exists?(:decidim_accountability_statuses, "index_decidim_accountability_statuses_on_decidim_feature_id")
13
+ rename_index :decidim_accountability_statuses, "index_decidim_accountability_statuses_on_decidim_feature_id", "index_decidim_accountability_statuses_on_decidim_component_id"
14
+ end
15
+ end
16
+ end
@@ -3,7 +3,7 @@
3
3
  require "decidim/accountability/admin"
4
4
  require "decidim/accountability/engine"
5
5
  require "decidim/accountability/admin_engine"
6
- require "decidim/accountability/feature"
6
+ require "decidim/accountability/component"
7
7
 
8
8
  module Decidim
9
9
  # Base module for this engine.
@@ -1,23 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_dependency "decidim/features/namer"
3
+ require_dependency "decidim/components/namer"
4
4
 
5
- Decidim.register_feature(:accountability) do |feature|
6
- feature.engine = Decidim::Accountability::Engine
7
- feature.admin_engine = Decidim::Accountability::AdminEngine
8
- feature.icon = "decidim/accountability/icon.svg"
9
- feature.stylesheet = "decidim/accountability/accountability"
5
+ Decidim.register_component(:accountability) do |component|
6
+ component.engine = Decidim::Accountability::Engine
7
+ component.admin_engine = Decidim::Accountability::AdminEngine
8
+ component.icon = "decidim/accountability/icon.svg"
9
+ component.stylesheet = "decidim/accountability/accountability"
10
10
 
11
- feature.on(:before_destroy) do |instance|
12
- raise StandardError, "Can't remove this feature" if Decidim::Accountability::Result.where(feature: instance).any?
11
+ component.on(:before_destroy) do |instance|
12
+ raise StandardError, "Can't remove this component" if Decidim::Accountability::Result.where(component: instance).any?
13
13
  end
14
14
 
15
- feature.register_resource do |resource|
15
+ component.register_resource do |resource|
16
16
  resource.model_class_name = "Decidim::Accountability::Result"
17
17
  resource.template = "decidim/accountability/results/linked_results"
18
18
  end
19
19
 
20
- feature.settings(:global) do |settings|
20
+ component.settings(:global) do |settings|
21
21
  settings.attribute :comments_enabled, type: :boolean, default: true
22
22
  settings.attribute :intro, type: :text, translated: true, editor: true
23
23
  settings.attribute :categories_label, type: :string, translated: true, editor: true
@@ -27,32 +27,32 @@ Decidim.register_feature(:accountability) do |feature|
27
27
  settings.attribute :display_progress_enabled, type: :boolean, default: true
28
28
  end
29
29
 
30
- feature.register_stat :results_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |features, _start_at, _end_at|
31
- Decidim::Accountability::Result.where(feature: features).count
30
+ component.register_stat :results_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |components, _start_at, _end_at|
31
+ Decidim::Accountability::Result.where(component: components).count
32
32
  end
33
33
 
34
- feature.settings(:step) do |settings|
34
+ component.settings(:step) do |settings|
35
35
  settings.attribute :comments_blocked, type: :boolean, default: false
36
36
  end
37
37
 
38
- feature.exports :results do |exports|
39
- exports.collection do |feature_instance|
38
+ component.exports :results do |exports|
39
+ exports.collection do |component_instance|
40
40
  Decidim::Accountability::Result
41
- .where(feature: feature_instance)
42
- .includes(:category, feature: { participatory_space: :organization })
41
+ .where(component: component_instance)
42
+ .includes(:category, component: { participatory_space: :organization })
43
43
  end
44
44
 
45
45
  exports.serializer Decidim::Accountability::ResultSerializer
46
46
  end
47
47
 
48
- feature.seeds do |participatory_space|
49
- admin_user = Decidim::User.where(
48
+ component.seeds do |participatory_space|
49
+ admin_user = Decidim::User.find_by(
50
50
  organization: participatory_space.organization,
51
51
  email: "admin@example.org"
52
- ).first
52
+ )
53
53
 
54
- feature = Decidim::Feature.create!(
55
- name: Decidim::Features::Namer.new(participatory_space.organization.available_locales, :accountability).i18n_name,
54
+ component = Decidim::Component.create!(
55
+ name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :accountability).i18n_name,
56
56
  manifest_name: :accountability,
57
57
  published_at: Time.current,
58
58
  participatory_space: participatory_space,
@@ -67,7 +67,7 @@ Decidim.register_feature(:accountability) do |feature|
67
67
 
68
68
  5.times do |i|
69
69
  Decidim::Accountability::Status.create!(
70
- feature: feature,
70
+ component: component,
71
71
  name: Decidim::Faker::Localized.word,
72
72
  key: "status_#{i}"
73
73
  )
@@ -92,7 +92,7 @@ Decidim.register_feature(:accountability) do |feature|
92
92
  result = Decidim.traceability.create!(
93
93
  Decidim::Accountability::Result,
94
94
  admin_user,
95
- feature: feature,
95
+ component: component,
96
96
  scope: participatory_space.organization.scopes.sample,
97
97
  category: category,
98
98
  title: Decidim::Faker::Localized.sentence(2),
@@ -107,7 +107,7 @@ Decidim.register_feature(:accountability) do |feature|
107
107
  child_result = Decidim.traceability.create!(
108
108
  Decidim::Accountability::Result,
109
109
  admin_user,
110
- feature: feature,
110
+ component: component,
111
111
  parent: result,
112
112
  start_date: Time.zone.today,
113
113
  end_date: Time.zone.today + 10,