decidim-surveys 0.20.1 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c5bf91f820fae1aa0658a10675ad0359f30e4ff0f268069a69cd8b1d343a48
4
- data.tar.gz: 3e884806464aef65341f16f91a8c347131edae3f504088dbbb0dde7592831a9e
3
+ metadata.gz: 1f920ed00a41af1c6ca47f27976d067c7f569e4c5420a33b3560a32db87ba4fd
4
+ data.tar.gz: c5b68eb93b4df1518f1f914e38968a60ad784506ad79476538874683638bcc56
5
5
  SHA512:
6
- metadata.gz: 9b9e81b494126675c3389e9e3814a945003794962a3b1c2533683547ef0aab8dece3c19d0251892841e656d9b56e56b19a007732f39878236a89b03cc812ad9d
7
- data.tar.gz: 89ff3025d180d4e42cadf62b36cc194d9b6a01b48bd3ff5c5b625cae0ae051d5291208c3c4a9938c6c4c0cf762d1b1292f3aea47c7ed102fc2556b2467902cb8
6
+ metadata.gz: a51c4bf33bf8e9aa717e81c5ede240b9f6427699c7cd6954435c4687f3ed6df660496427cf54cbf631622d5e810dd52887a78ae3936252fb1f790b8497714c51
7
+ data.tar.gz: 541ffb6c00902abc8e37df0cdf70e2602842dafdbb4a9dd36587b5ac3107f7dc58abf873bcd3dfb8fe8dbaa828161518027d99e8852089c33c28c8c0edf8039d
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Surveys
5
+ SurveyType = GraphQL::ObjectType.define do
6
+ name "Survey"
7
+ description "A survey"
8
+
9
+ field :id, !types.ID, "The internal ID for this survey"
10
+ field :publishedAt, Decidim::Core::DateTimeType, "The time this survey was published", property: :published_at
11
+ field :createdAt, Decidim::Core::DateTimeType, "The time this survey was created", property: :created_at
12
+ field :updatedAt, Decidim::Core::DateTimeType, "The time this survey was updated", property: :updated_at
13
+ field :questionnaire, Decidim::Forms::QuestionnaireType, "The questionnaire for this survey"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Surveys
5
+ SurveysType = GraphQL::ObjectType.define do
6
+ interfaces [-> { Decidim::Core::ComponentInterface }]
7
+
8
+ name "Surveys"
9
+ description "A surveys component of a participatory space."
10
+
11
+ connection :surveys, SurveyType.connection_type do
12
+ resolve ->(component, _args, _ctx) {
13
+ SurveysTypeHelper.base_scope(component).includes(:component)
14
+ }
15
+ end
16
+
17
+ field(:survey, SurveyType) do
18
+ argument :id, !types.ID
19
+
20
+ resolve ->(component, args, _ctx) {
21
+ SurveysTypeHelper.base_scope(component).find_by(id: args[:id])
22
+ }
23
+ end
24
+ end
25
+
26
+ module SurveysTypeHelper
27
+ def self.base_scope(component)
28
+ Survey.where(component: component)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1 @@
1
+ el:
@@ -11,6 +11,7 @@ Decidim.register_component(:surveys) do |component|
11
11
  component.serializes_specific_data = true
12
12
  component.specific_data_serializer_class_name = "Decidim::Surveys::DataSerializer"
13
13
  component.specific_data_importer_class_name = "Decidim::Surveys::DataImporter"
14
+ component.query_type = "Decidim::Surveys::SurveysType"
14
15
 
15
16
  component.on(:copy) do |context|
16
17
  Decidim::Surveys::CreateSurvey.call(context[:new_component]) do
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-surveys version.
5
5
  module Surveys
6
6
  def self.version
7
- "0.20.1"
7
+ "0.21.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-surveys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.21.0
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: 2020-03-27 00:00:00.000000000 Z
13
+ date: 2020-04-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.20.1
21
+ version: 0.21.0
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.20.1
28
+ version: 0.21.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-forms
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.20.1
35
+ version: 0.21.0
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.20.1
42
+ version: 0.21.0
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.20.1
49
+ version: 0.21.0
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.20.1
56
+ version: 0.21.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-dev
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.20.1
63
+ version: 0.21.0
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.20.1
70
+ version: 0.21.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-participatory_processes
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.20.1
77
+ version: 0.21.0
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.20.1
84
+ version: 0.21.0
85
85
  description: A surveys component for decidim's participatory spaces.
86
86
  email:
87
87
  - josepjaume@gmail.com
@@ -112,6 +112,8 @@ files:
112
112
  - app/queries/decidim/surveys/metrics/survey_participants_metric_measure.rb
113
113
  - app/serializers/decidim/surveys/data_importer.rb
114
114
  - app/serializers/decidim/surveys/data_serializer.rb
115
+ - app/types/decidim/surveys/survey_type.rb
116
+ - app/types/decidim/surveys/surveys_type.rb
115
117
  - app/views/decidim/surveys/surveys/no_permission.html.erb
116
118
  - config/locales/ar-SA.yml
117
119
  - config/locales/ar.yml
@@ -120,6 +122,7 @@ files:
120
122
  - config/locales/cs.yml
121
123
  - config/locales/de.yml
122
124
  - config/locales/el-GR.yml
125
+ - config/locales/el.yml
123
126
  - config/locales/en.yml
124
127
  - config/locales/eo-UY.yml
125
128
  - config/locales/es-MX.yml