decidim-consultations 0.23.0 → 0.24.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/consultations/consultation_m_cell.rb +2 -0
  3. data/app/cells/decidim/consultations/content_blocks/highlighted_consultations/show.erb +4 -9
  4. data/app/commands/decidim/consultations/admin/update_consultation.rb +3 -0
  5. data/app/commands/decidim/consultations/admin/update_question.rb +13 -5
  6. data/app/helpers/decidim/consultations/admin/consultation_menu_helper.rb +15 -0
  7. data/app/helpers/decidim/consultations/questions_helper.rb +2 -0
  8. data/app/views/decidim/consultations/admin/consultations/index.html.erb +4 -0
  9. data/app/views/decidim/consultations/admin/questions/index.html.erb +4 -0
  10. data/app/views/decidim/consultations/admin/response_groups/index.html.erb +2 -0
  11. data/app/views/decidim/consultations/admin/responses/index.html.erb +2 -0
  12. data/app/views/decidim/consultations/consultations/_consultation_details.html.erb +1 -1
  13. data/app/views/layouts/decidim/admin/consultation.html.erb +8 -23
  14. data/app/views/layouts/decidim/admin/consultations.html.erb +4 -0
  15. data/config/locales/ar.yml +0 -2
  16. data/config/locales/ca.yml +0 -2
  17. data/config/locales/cs.yml +9 -8
  18. data/config/locales/de.yml +8 -7
  19. data/config/locales/el.yml +0 -2
  20. data/config/locales/en.yml +3 -2
  21. data/config/locales/es-MX.yml +2 -2
  22. data/config/locales/es-PY.yml +2 -2
  23. data/config/locales/es.yml +2 -2
  24. data/config/locales/eu.yml +0 -2
  25. data/config/locales/fi-plain.yml +4 -3
  26. data/config/locales/fi.yml +6 -5
  27. data/config/locales/fr-CA.yml +3 -2
  28. data/config/locales/fr.yml +3 -2
  29. data/config/locales/gl.yml +0 -2
  30. data/config/locales/hu.yml +0 -2
  31. data/config/locales/id-ID.yml +0 -2
  32. data/config/locales/it.yml +2 -2
  33. data/config/locales/ja.yml +0 -2
  34. data/config/locales/lv.yml +0 -2
  35. data/config/locales/nl.yml +7 -8
  36. data/config/locales/no.yml +0 -2
  37. data/config/locales/pl.yml +6 -5
  38. data/config/locales/pt-BR.yml +0 -2
  39. data/config/locales/pt.yml +0 -2
  40. data/config/locales/ro-RO.yml +0 -2
  41. data/config/locales/si-LK.yml +1 -0
  42. data/config/locales/sk.yml +0 -2
  43. data/config/locales/sv.yml +0 -2
  44. data/config/locales/sw-KE.yml +1 -0
  45. data/config/locales/tr-TR.yml +117 -42
  46. data/config/locales/zh-CN.yml +0 -2
  47. data/lib/decidim/api/consultation_question_type.rb +52 -0
  48. data/lib/decidim/api/consultation_type.rb +29 -0
  49. data/lib/decidim/consultations.rb +1 -0
  50. data/lib/decidim/consultations/admin_engine.rb +25 -1
  51. data/lib/decidim/consultations/api.rb +8 -0
  52. data/lib/decidim/consultations/engine.rb +7 -1
  53. data/lib/decidim/consultations/participatory_space.rb +24 -24
  54. data/lib/decidim/consultations/query_extensions.rb +43 -0
  55. data/lib/decidim/consultations/test/factories.rb +2 -2
  56. data/lib/decidim/consultations/version.rb +1 -1
  57. metadata +24 -19
  58. data/app/types/decidim/consultations/consultation_question_type.rb +0 -57
  59. data/app/types/decidim/consultations/consultation_type.rb +0 -32
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Consultations
5
- # This type represents a consultation.
6
- ConsultationQuestionType = GraphQL::ObjectType.define do
7
- interfaces [
8
- -> { Decidim::Core::ScopableInterface },
9
- -> { Decidim::Core::AttachableInterface },
10
- -> { Decidim::Comments::CommentableInterface }
11
- ]
12
-
13
- name "ConsultationQuestion"
14
- description "A consultation question"
15
-
16
- field :id, !types.ID, "Internal ID of the question"
17
- field :title, Decidim::Core::TranslatedFieldType, "Title of the question"
18
- field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this question"
19
- field :slug, !types.String, "Slug of the question"
20
- field :createdAt, !Decidim::Core::DateTimeType, "The time this question was created", property: :created_at
21
- field :updatedAt, !Decidim::Core::DateTimeType, "The time this question was updated", property: :updated_at
22
- field :publishedAt, !Decidim::Core::DateTimeType, "The time this question was published", property: :published_at
23
-
24
- field :components, types[Decidim::Core::ComponentInterface] do
25
- description "Lists the components this space contains."
26
-
27
- resolve ->(participatory_space, _args, _ctx) {
28
- Decidim::Component.where(
29
- participatory_space: participatory_space
30
- ).published
31
- }
32
- end
33
-
34
- field :bannerImage, types.String, "The banner image for this question", property: :banner_image
35
- field :heroImage, types.String, "The hero image for this question", property: :hero_image
36
-
37
- field :whatIsDecided, Decidim::Core::TranslatedFieldType, "What is decided in this question", property: :what_is_decided
38
- field :promoterGroup, Decidim::Core::TranslatedFieldType, "The promoter group of this question", property: :promoter_group
39
- field :participatoryScope, Decidim::Core::TranslatedFieldType, "The participatory scope of this question", property: :participatory_scope
40
- field :questionContext, Decidim::Core::TranslatedFieldType, "The context for this question", property: :question_context
41
- field :reference, types.String, "The reference for this question", property: :reference
42
- field :hashtag, types.String, "The hashtag of this question", property: :hashtag
43
- field :votesCount, types.Int, "The number of votes in this question", property: :votes_count
44
- field :originScope, Decidim::Core::TranslatedFieldType, "The origin scope of this question", property: :origin_scope
45
- field :originTitle, Decidim::Core::TranslatedFieldType, "The origin title of this question", property: :origin_title
46
- field :originUrl, types.String, "The origin URL for this question", property: :origin_url
47
- field :iFrameUrl, types.String, "The iframe URL for this question", property: :i_frame_url
48
- field :externalVoting, types.Boolean, "If the question has external voting", property: :external_voting
49
- field :responsesCount, types.Int, "The number of responses for this question", property: :responses_count
50
- field :order, types.Int, "The order in which the question should be represented", property: :order
51
- field :maxVotes, types.Int, "The maximum number of votes in this question", property: :max_votes
52
- field :minVotes, types.Int, "The minimum number of votes in this question", property: :min_votes
53
- field :responseGroupsCount, types.Int, "The number of group responses for this question", property: :response_groups_count
54
- field :instructions, Decidim::Core::TranslatedFieldType, "Instructions for this question", property: :instructions
55
- end
56
- end
57
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Consultations
5
- # This type represents a consultation.
6
- ConsultationType = GraphQL::ObjectType.define do
7
- interfaces [
8
- -> { Decidim::Core::ParticipatorySpaceInterface }
9
- ]
10
-
11
- name "Consultation"
12
- description "A consultation"
13
-
14
- field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this consultation"
15
- field :description, Decidim::Core::TranslatedFieldType, "The description of this consultation"
16
- field :slug, !types.String, "Slug of this consultation"
17
- field :createdAt, !Decidim::Core::DateTimeType, "The time this consultation was created", property: :created_at
18
- field :updatedAt, !Decidim::Core::DateTimeType, "The time this consultation was updated", property: :updated_at
19
- field :publishedAt, !Decidim::Core::DateTimeType, "The time this consultation was published", property: :published_at
20
-
21
- field :introductoryVideoUrl, types.String, "The introductory video url for this consultation", property: :introductory_video_url
22
- field :introductoryImage, types.String, "The introductory image for this consultation", property: :introductory_image
23
- field :bannerImage, types.String, "The banner image for this consultation", property: :banner_image
24
- field :highlightedScope, Decidim::Core::ScopeApiType, "This is the highlighted scope of this consultation", property: :highlighted_scope
25
- field :startVotingDate, Decidim::Core::DateType, "Start date of the voting for this consultation", property: :start_voting_date
26
- field :endVotingDate, Decidim::Core::DateType, "End date of the voting for this consultation", property: :end_voting_date
27
- field :resultsPublishedAt, Decidim::Core::DateType, "Date when the results have been published", property: :results_published_at
28
-
29
- field :questions, types[Decidim::Consultations::ConsultationQuestionType], ""
30
- end
31
- end
32
- end