decidim-debates 0.23.6 → 0.24.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/admin/decidim_debates_manifest.js +1 -0
  3. data/app/assets/javascripts/decidim/debates/admin/debates.js.es6 +25 -0
  4. data/app/cells/decidim/debates/debate_activity_cell.rb +5 -13
  5. data/app/cells/decidim/debates/debate_m/open_date.erb +7 -0
  6. data/app/cells/decidim/debates/debate_m_cell.rb +1 -1
  7. data/app/cells/decidim/debates/reported_content/show.erb +4 -0
  8. data/app/cells/decidim/debates/reported_content_cell.rb +13 -0
  9. data/app/commands/decidim/debates/admin/create_debate.rb +3 -2
  10. data/app/commands/decidim/debates/admin/update_debate.rb +2 -1
  11. data/app/commands/decidim/debates/create_debate.rb +1 -0
  12. data/app/commands/decidim/debates/update_debate.rb +2 -1
  13. data/app/controllers/decidim/debates/debates_controller.rb +1 -5
  14. data/app/forms/decidim/debates/admin/close_debate_form.rb +1 -1
  15. data/app/forms/decidim/debates/admin/debate_form.rb +30 -2
  16. data/app/forms/decidim/debates/close_debate_form.rb +1 -1
  17. data/app/forms/decidim/debates/debate_form.rb +17 -0
  18. data/app/models/decidim/debates/debate.rb +11 -1
  19. data/app/permissions/decidim/debates/admin/permissions.rb +8 -1
  20. data/app/views/decidim/debates/admin/debates/_form.html.erb +15 -2
  21. data/app/views/decidim/debates/admin/debates/index.html.erb +10 -2
  22. data/app/views/decidim/debates/debates/_filters.html.erb +1 -1
  23. data/app/views/decidim/debates/debates/_form.html.erb +6 -0
  24. data/app/views/decidim/debates/debates/show.html.erb +5 -21
  25. data/config/locales/ca.yml +17 -5
  26. data/config/locales/cs.yml +18 -6
  27. data/config/locales/de.yml +18 -6
  28. data/config/locales/en.yml +17 -5
  29. data/config/locales/es-MX.yml +10 -5
  30. data/config/locales/es-PY.yml +10 -5
  31. data/config/locales/es.yml +10 -5
  32. data/config/locales/fi-plain.yml +17 -5
  33. data/config/locales/fi.yml +17 -5
  34. data/config/locales/fr-CA.yml +17 -5
  35. data/config/locales/fr.yml +17 -5
  36. data/config/locales/gl.yml +10 -5
  37. data/config/locales/ja.yml +10 -4
  38. data/config/locales/nl.yml +17 -5
  39. data/config/locales/no.yml +10 -4
  40. data/config/locales/pl.yml +17 -5
  41. data/config/locales/ro-RO.yml +8 -47
  42. data/config/locales/sv.yml +10 -18
  43. data/config/locales/tr-TR.yml +17 -4
  44. data/config/locales/zh-CN.yml +10 -4
  45. data/db/migrate/20200930145546_add_scope_to_debates_debate.rb +7 -0
  46. data/db/migrate/20201126112752_archive_debates.rb +8 -0
  47. data/db/migrate/20210125101735_revert_archive_debates.rb +8 -0
  48. data/lib/decidim/api/debate_type.rb +26 -0
  49. data/lib/decidim/api/debates_type.rb +26 -0
  50. data/lib/decidim/debates/admin_engine.rb +4 -0
  51. data/lib/decidim/debates/api.rb +8 -0
  52. data/lib/decidim/debates/component.rb +22 -10
  53. data/lib/decidim/debates/test/factories.rb +1 -1
  54. data/lib/decidim/debates/version.rb +1 -1
  55. data/lib/decidim/debates.rb +1 -0
  56. metadata +25 -16
  57. data/app/types/decidim/debates/debate_type.rb +0 -28
  58. data/app/types/decidim/debates/debates_type.rb +0 -32
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Debates
5
- DebatesType = GraphQL::ObjectType.define do
6
- interfaces [-> { Decidim::Core::ComponentInterface }]
7
-
8
- name "Debates"
9
- description "A debates component of a participatory space."
10
-
11
- connection :debates, DebateType.connection_type do
12
- resolve ->(component, _args, _ctx) {
13
- DebatesTypeHelper.base_scope(component).includes(:component)
14
- }
15
- end
16
-
17
- field(:debate, DebateType) do
18
- argument :id, !types.ID
19
-
20
- resolve ->(component, args, _ctx) {
21
- DebatesTypeHelper.base_scope(component).find_by(id: args[:id])
22
- }
23
- end
24
- end
25
-
26
- module DebatesTypeHelper
27
- def self.base_scope(component)
28
- Debate.where(component: component)
29
- end
30
- end
31
- end
32
- end