decidim-surveys 0.23.0 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/decidim/surveys/admin/surveys_controller.rb +4 -0
- data/app/controllers/decidim/surveys/surveys_controller.rb +1 -1
- data/app/models/decidim/surveys/survey.rb +18 -0
- data/config/locales/cs.yml +5 -1
- data/config/locales/de.yml +7 -3
- data/config/locales/en.yml +4 -0
- data/config/locales/fi-plain.yml +4 -0
- data/config/locales/fi.yml +4 -0
- data/config/locales/fr-CA.yml +4 -0
- data/config/locales/fr.yml +5 -1
- data/config/locales/gl.yml +7 -0
- data/config/locales/it.yml +4 -0
- data/config/locales/nl.yml +4 -0
- data/config/locales/pl.yml +5 -1
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/tr-TR.yml +23 -13
- data/lib/decidim/api/survey_type.rb +14 -0
- data/lib/decidim/api/surveys_type.rb +26 -0
- data/lib/decidim/surveys.rb +1 -0
- data/lib/decidim/surveys/api.rb +8 -0
- data/lib/decidim/surveys/component.rb +7 -4
- data/lib/decidim/surveys/version.rb +1 -1
- metadata +26 -23
- data/app/types/decidim/surveys/survey_type.rb +0 -15
- data/app/types/decidim/surveys/surveys_type.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4b91c9293ed9ea20b5c26d30fb39d737c3ac75c895a3a9f9cfd1de4faee968
|
4
|
+
data.tar.gz: dac349c2ca9f62d61bd6bd1032ce0f16d932390611a67468fc8f9fe7e6d123dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2ad1ff942b509f64df52d4062e2a03b54625be459e3c2d0106b61f0be3519ff87b161f9efe9c5ab9926b888605bb4f42cc136606957fdb0bb114bf6b36610c
|
7
|
+
data.tar.gz: 3b9346b7bcb2de0c6f16d03a66683a1621827e6419c2baeb24e4e1bd987f7bf8abc6bf4ef8291d7b86dc3cff708c44170e7f51a9844929f97e565c9c86d08623
|
@@ -22,6 +22,10 @@ module Decidim
|
|
22
22
|
Decidim::EngineRouter.admin_proxy(survey.component).show_survey_path(session_token: session_token)
|
23
23
|
end
|
24
24
|
|
25
|
+
def edit_questionnaire_title
|
26
|
+
t(:title, scope: "decidim.forms.admin.questionnaires.form", questionnaire_for: translated_attribute(current_component.name))
|
27
|
+
end
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
def i18n_flashes_scope
|
@@ -15,6 +15,24 @@ module Decidim
|
|
15
15
|
def clean_after_publish?
|
16
16
|
component.settings.clean_after_publish?
|
17
17
|
end
|
18
|
+
|
19
|
+
def starts_at
|
20
|
+
component.settings.starts_at
|
21
|
+
end
|
22
|
+
|
23
|
+
def ends_at
|
24
|
+
component.settings.ends_at
|
25
|
+
end
|
26
|
+
|
27
|
+
def open?
|
28
|
+
return true if starts_at.blank? && ends_at.blank?
|
29
|
+
return true if ends_at.blank? && starts_at.past?
|
30
|
+
return true if starts_at.blank? && ends_at.future?
|
31
|
+
|
32
|
+
return Time.zone.now.between?(starts_at, ends_at) if starts_at.present? && ends_at.present?
|
33
|
+
|
34
|
+
false
|
35
|
+
end
|
18
36
|
end
|
19
37
|
end
|
20
38
|
end
|
data/config/locales/cs.yml
CHANGED
@@ -25,8 +25,12 @@ cs:
|
|
25
25
|
global:
|
26
26
|
announcement: Oznámení
|
27
27
|
clean_after_publish: Odstranit odpovědi při publikování ankety
|
28
|
+
ends_at: Odpověď přijata do
|
29
|
+
ends_at_help: Ponechte prázdné pro žádné konkrétní datum
|
28
30
|
scope_id: Oblast působnosti
|
29
31
|
scopes_enabled: Oblasti působnosti povoleny
|
32
|
+
starts_at: Odpovědi přijaté od
|
33
|
+
starts_at_help: Ponechte prázdné pro žádné konkrétní datum
|
30
34
|
step:
|
31
35
|
allow_answers: Povolte odpovědi
|
32
36
|
allow_unregistered: Umožnit neregistrovaným uživatelům odpovědět na průzkum
|
@@ -52,7 +56,7 @@ cs:
|
|
52
56
|
surveys:
|
53
57
|
admin:
|
54
58
|
exports:
|
55
|
-
survey_user_answers:
|
59
|
+
survey_user_answers: Odpovědi účastníka na průzkum
|
56
60
|
surveys:
|
57
61
|
update:
|
58
62
|
invalid: Při ukládání průzkumu došlo k chybám.
|
data/config/locales/de.yml
CHANGED
@@ -21,8 +21,12 @@ de:
|
|
21
21
|
global:
|
22
22
|
announcement: Ankündigung
|
23
23
|
clean_after_publish: Antworten bei Veröffentlichung des Fragebogens löschen
|
24
|
+
ends_at: Antworten akzeptiert bis
|
25
|
+
ends_at_help: Leer lassen für kein bestimmtes Datum
|
24
26
|
scope_id: Bereich
|
25
27
|
scopes_enabled: Bereiche aktiviert
|
28
|
+
starts_at: Antworten akzeptiert von
|
29
|
+
starts_at_help: Leer lassen für kein bestimmtes Datum
|
26
30
|
step:
|
27
31
|
allow_answers: Erlaube Antworten
|
28
32
|
allow_unregistered: Nicht registrierten Benutzern die Beantwortung des Fragebogens erlauben
|
@@ -32,12 +36,12 @@ de:
|
|
32
36
|
surveys:
|
33
37
|
survey_closed:
|
34
38
|
email_intro: Die Umfrage %{resource_title} in %{participatory_space_title} wurde geschlossen.
|
35
|
-
email_outro: Sie haben diese Benachrichtigung erhalten, weil Sie %{participatory_space_title}. Sie
|
39
|
+
email_outro: Sie haben diese Benachrichtigung erhalten, weil Sie %{participatory_space_title} folgen. Falls Sie keine solchen Benachrichtigungen mehr erhalten möchten, besuchen Sie den obigen Link.
|
36
40
|
email_subject: Eine Umfrage ist in %{participatory_space_title}
|
37
41
|
notification_title: Die Umfrage <a href="%{resource_path}">%{resource_title}</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a> ist beendet.
|
38
42
|
survey_opened:
|
39
|
-
email_intro: 'Die Umfrage %{resource_title} in %{participatory_space_title} ist jetzt geöffnet. Sie können
|
40
|
-
email_outro: Sie haben diese Benachrichtigung erhalten, weil Sie %{participatory_space_title}. Sie
|
43
|
+
email_intro: 'Die Umfrage %{resource_title} in %{participatory_space_title} ist jetzt geöffnet. Sie können auf dieser Seite teilnehmen:'
|
44
|
+
email_outro: Sie haben diese Benachrichtigung erhalten, weil Sie %{participatory_space_title} folgen. Falls Sie keine solchen Benachrichtigungen mehr erhalten möchten, besuchen Sie den obigen Link.
|
41
45
|
email_subject: Eine neue Umfrage in %{participatory_space_title}
|
42
46
|
notification_title: Die Umfrage <a href="%{resource_path}">%{resource_title}</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a> ist jetzt geöffnet.
|
43
47
|
metrics:
|
data/config/locales/en.yml
CHANGED
@@ -22,8 +22,12 @@ en:
|
|
22
22
|
global:
|
23
23
|
announcement: Announcement
|
24
24
|
clean_after_publish: Delete answers when publishing the survey
|
25
|
+
ends_at: Answers accepted until
|
26
|
+
ends_at_help: Leave blank for no specific date
|
25
27
|
scope_id: Scope
|
26
28
|
scopes_enabled: Scopes enabled
|
29
|
+
starts_at: Answers accepted from
|
30
|
+
starts_at_help: Leave blank for no specific date
|
27
31
|
step:
|
28
32
|
allow_answers: Allow answers
|
29
33
|
allow_unregistered: Allow unregistered users to answer the survey
|
data/config/locales/fi-plain.yml
CHANGED
@@ -21,8 +21,12 @@ fi-pl:
|
|
21
21
|
global:
|
22
22
|
announcement: Ilmoitus
|
23
23
|
clean_after_publish: Poista vastaukset julkaistaessa kysely
|
24
|
+
ends_at: Vastausajan loppumisajankohta
|
25
|
+
ends_at_help: Jätä tyhjäksi, jos vastausaikaa ei ole rajattu
|
24
26
|
scope_id: Teema
|
25
27
|
scopes_enabled: Teemat käytössä
|
28
|
+
starts_at: Vastausajan alkamisajankohta
|
29
|
+
starts_at_help: Jätä tyhjäksi, jos vastausaikaa ei ole rajattu
|
26
30
|
step:
|
27
31
|
allow_answers: Salli vastaukset
|
28
32
|
allow_unregistered: Salli rekisteröitymättömien käyttäjien vastata tähän kyselyyn
|
data/config/locales/fi.yml
CHANGED
@@ -21,8 +21,12 @@ fi:
|
|
21
21
|
global:
|
22
22
|
announcement: Ilmoitus
|
23
23
|
clean_after_publish: Poista vastaukset julkaistaessa kysely
|
24
|
+
ends_at: Vastausajan loppumisajankohta
|
25
|
+
ends_at_help: Jätä tyhjäksi, jos vastausaikaa ei ole rajattu
|
24
26
|
scope_id: Teema
|
25
27
|
scopes_enabled: Teemat käytössä
|
28
|
+
starts_at: Vastausajan alkamisajankohta
|
29
|
+
starts_at_help: Jätä tyhjäksi, jos vastausaikaa ei ole rajattu
|
26
30
|
step:
|
27
31
|
allow_answers: Salli vastaukset
|
28
32
|
allow_unregistered: Salli rekisteröitymättömien käyttäjien vastata tähän kyselyyn
|
data/config/locales/fr-CA.yml
CHANGED
@@ -21,8 +21,12 @@ fr-CA:
|
|
21
21
|
global:
|
22
22
|
announcement: Annonce
|
23
23
|
clean_after_publish: Supprimer les réponses lors de la publication du sondage
|
24
|
+
ends_at: Réponses acceptées jusqu'au
|
25
|
+
ends_at_help: Laisser vide si aucune date spécifique
|
24
26
|
scope_id: Secteur
|
25
27
|
scopes_enabled: Secteurs activés
|
28
|
+
starts_at: Réponses acceptées du
|
29
|
+
starts_at_help: Laisser vide si aucune date spécifique
|
26
30
|
step:
|
27
31
|
allow_answers: Autoriser les réponses
|
28
32
|
allow_unregistered: Autoriser les utilisateurs non inscrits à répondre à l'enquête
|
data/config/locales/fr.yml
CHANGED
@@ -20,9 +20,13 @@ fr:
|
|
20
20
|
settings:
|
21
21
|
global:
|
22
22
|
announcement: Annonce
|
23
|
-
clean_after_publish: Supprimer les réponses lors de la publication de l'enquête
|
23
|
+
clean_after_publish: 'Supprimer les réponses lors de la publication de l''enquête - ATTENTION : décocher après avoir fini vos tests et avoir publié l''enquête'
|
24
|
+
ends_at: Réponses acceptées jusqu'au
|
25
|
+
ends_at_help: Laisser vide si aucune date spécifique
|
24
26
|
scope_id: Secteur
|
25
27
|
scopes_enabled: Secteurs activés
|
28
|
+
starts_at: Réponses acceptées du
|
29
|
+
starts_at_help: Laisser vide si aucune date spécifique
|
26
30
|
step:
|
27
31
|
allow_answers: Autoriser les réponses
|
28
32
|
allow_unregistered: Autoriser les utilisateurs non inscrits à répondre à l'enquête
|
data/config/locales/gl.yml
CHANGED
@@ -20,8 +20,15 @@ gl:
|
|
20
20
|
settings:
|
21
21
|
global:
|
22
22
|
announcement: Anuncio
|
23
|
+
clean_after_publish: Eliminar as respostas ao publicar a enquisa
|
24
|
+
ends_at: Respostas aceptadas até
|
25
|
+
ends_at_help: Deixar baleiro de non especificar unha data
|
26
|
+
scope_id: Ámbito
|
27
|
+
scopes_enabled: Ámbitos habilitados
|
28
|
+
starts_at_help: Deixar baleiro de non especificar unha data
|
23
29
|
step:
|
24
30
|
allow_answers: Permitir respostas
|
31
|
+
allow_unregistered: Permitir aos usuarios non rexistrados responder a enquisa
|
25
32
|
announcement: Anuncio
|
26
33
|
events:
|
27
34
|
surveys:
|
data/config/locales/it.yml
CHANGED
@@ -21,6 +21,10 @@ it:
|
|
21
21
|
global:
|
22
22
|
announcement: Annuncio
|
23
23
|
clean_after_publish: Eliminare le risposte quando si pubblica il sondaggio
|
24
|
+
ends_at: Risposte accettate fino al
|
25
|
+
ends_at_help: Lascia vuoto se nessuna data è specificata
|
26
|
+
starts_at: Risposte accettate da
|
27
|
+
starts_at_help: Lascia vuoto se nessuna data è specificata
|
24
28
|
step:
|
25
29
|
allow_answers: Consenti risposte
|
26
30
|
allow_unregistered: Consenti agli utenti non registrati di rispondere al sondaggio
|
data/config/locales/nl.yml
CHANGED
@@ -21,8 +21,12 @@ nl:
|
|
21
21
|
global:
|
22
22
|
announcement: Aankondiging
|
23
23
|
clean_after_publish: Verwijder antwoorden bij publicatie van de enquête
|
24
|
+
ends_at: Antwoorden geaccepteerd tot
|
25
|
+
ends_at_help: Laat leeg voor geen specifieke datum
|
24
26
|
scope_id: Scope
|
25
27
|
scopes_enabled: Scopes ingeschakeld
|
28
|
+
starts_at: Antwoorden geaccepteerd vanaf
|
29
|
+
starts_at_help: Laat leeg voor geen specifieke datum
|
26
30
|
step:
|
27
31
|
allow_answers: Antwoorden toestaan
|
28
32
|
allow_unregistered: Sta niet-geregistreerde gebruikers toe om de enquête te beantwoorden
|
data/config/locales/pl.yml
CHANGED
@@ -25,8 +25,12 @@ pl:
|
|
25
25
|
global:
|
26
26
|
announcement: Ogłoszenie
|
27
27
|
clean_after_publish: Usuń odpowiedzi podczas publikowania ankiety
|
28
|
+
ends_at: Odpowiedzi akceptowane do
|
29
|
+
ends_at_help: Pozostaw puste jeśli nie określono daty
|
28
30
|
scope_id: Zakres
|
29
31
|
scopes_enabled: Zakresy włączone
|
32
|
+
starts_at: Odpowiedzi akceptowane od
|
33
|
+
starts_at_help: Pozostaw puste jeśli nie określono daty
|
30
34
|
step:
|
31
35
|
allow_answers: Pozwól na wypełnianie
|
32
36
|
allow_unregistered: Pozwól niezarejestrowanym użytkownikom wypełnić ankietę
|
@@ -61,6 +65,6 @@ pl:
|
|
61
65
|
new_survey_at_html: "<span>Nowa ankieta %{link}</span>"
|
62
66
|
surveys:
|
63
67
|
answer:
|
64
|
-
invalid: Podczas wypełniania ankiety
|
68
|
+
invalid: Podczas wypełniania ankiety wystąpił błąd.
|
65
69
|
spam_detected: Wystąpił błąd podczas wypełniania formularza. Być może zostało to zrobione zbyt szybko, czy możesz spróbować ponownie?
|
66
70
|
success: Twoja ankieta została wypełniona.
|
@@ -0,0 +1 @@
|
|
1
|
+
si:
|
@@ -0,0 +1 @@
|
|
1
|
+
sw:
|
data/config/locales/tr-TR.yml
CHANGED
@@ -6,7 +6,7 @@ tr:
|
|
6
6
|
activerecord:
|
7
7
|
models:
|
8
8
|
decidim/surveys/survey:
|
9
|
-
one:
|
9
|
+
one: Anket
|
10
10
|
other: Anketler
|
11
11
|
decidim/surveys/survey_answer:
|
12
12
|
one: Cevap
|
@@ -16,25 +16,34 @@ tr:
|
|
16
16
|
surveys:
|
17
17
|
actions:
|
18
18
|
answer: Cevap
|
19
|
-
name:
|
19
|
+
name: Anket
|
20
20
|
settings:
|
21
21
|
global:
|
22
|
-
announcement:
|
22
|
+
announcement: Duyuru
|
23
|
+
clean_after_publish: Anketi yayınlarken cevapları sil
|
24
|
+
ends_at: Şu tarihe kadar kabul edilen cevaplar
|
25
|
+
ends_at_help: Belirli bir tarih için boş bırakın
|
26
|
+
scope_id: Kapsam
|
27
|
+
scopes_enabled: Kapsamlar etkinleştirildi
|
28
|
+
starts_at: Cevaplar kabul edildi
|
29
|
+
starts_at_help: Belirli bir tarih için boş bırakın
|
23
30
|
step:
|
24
31
|
allow_answers: Cevaplara izin ver
|
25
|
-
|
32
|
+
allow_unregistered: Kayıtlı olmayan kullanıcıların anketi yanıtlamasına izin verin
|
33
|
+
allow_unregistered_help: Etkinse, anketi cevaplamak için oturum açmanız gerekmeyecektir. Bu, zayıf veya güvenilmez verilere yol açabilir ve otomatik saldırılara karşı daha savunmasız hale gelir. Dikkatle kullanın!
|
34
|
+
announcement: Duyuru
|
26
35
|
events:
|
27
36
|
surveys:
|
28
37
|
survey_closed:
|
29
|
-
email_intro:
|
30
|
-
email_outro:
|
31
|
-
email_subject:
|
32
|
-
notification_title:
|
38
|
+
email_intro: '%{participatory_space_title} içindeki %{resource_title} anketi kapatıldı.'
|
39
|
+
email_outro: Bu bildirimi, %{participatory_space_title} adlı kişiyi takip ettiğiniz için aldınız. Önceki bağlantıyı izleyerek bildirim almayı durdurabilirsiniz.
|
40
|
+
email_subject: '%{participatory_space_title} içinde bir anket bitti'
|
41
|
+
notification_title: <a href="%{participatory_space_url}">%{participatory_space_title} </a> içindeki anket <a href="%{resource_path}">%{resource_title} </a> bitti.
|
33
42
|
survey_opened:
|
34
|
-
email_intro: '
|
35
|
-
email_outro:
|
36
|
-
email_subject: '%{participatory_space_title}yeni bir anket'
|
37
|
-
notification_title:
|
43
|
+
email_intro: '%{participatory_space_title} içindeki %{resource_title} anketi şimdi açık. Bu sayfadan katılabilirsiniz:'
|
44
|
+
email_outro: Bu bildirimi, %{participatory_space_title} adlı kişiyi takip ettiğiniz için aldınız. Önceki bağlantıyı izleyerek bildirim almayı durdurabilirsiniz.
|
45
|
+
email_subject: '%{participatory_space_title} içinde yeni bir anket'
|
46
|
+
notification_title: <a href="%{participatory_space_url}">%{participatory_space_title} </a> içindeki anket <a href="%{resource_path}">%{resource_title} </a> şimdi açık.
|
38
47
|
metrics:
|
39
48
|
survey_answers:
|
40
49
|
description: Katılımcılar tarafından cevaplanan anket sayısı
|
@@ -49,8 +58,9 @@ tr:
|
|
49
58
|
invalid: Anketi kaydederken bir sorun oluştu.
|
50
59
|
success: Anket başarıyla kaydedildi.
|
51
60
|
last_activity:
|
52
|
-
new_survey_at_html: "<span> %{link}</span>yeni anket"
|
61
|
+
new_survey_at_html: "<span> %{link}</span> linkinde yeni anket"
|
53
62
|
surveys:
|
54
63
|
answer:
|
55
64
|
invalid: Anketi cevaplarken bir sorun oluştu.
|
65
|
+
spam_detected: Formu yanıtlarken bir sorun oluştu. Belki çok hızlı davrandın, tekrar deneyebilir misin?
|
56
66
|
success: Anket başarıyla cevaplandı.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Surveys
|
5
|
+
class SurveyType < Decidim::Api::Types::BaseObject
|
6
|
+
description "A survey"
|
7
|
+
|
8
|
+
field :id, GraphQL::Types::ID, "The internal ID for this survey", null: false
|
9
|
+
field :created_at, Decidim::Core::DateTimeType, "The time this survey was created", null: true
|
10
|
+
field :updated_at, Decidim::Core::DateTimeType, "The time this survey was updated", null: true
|
11
|
+
field :questionnaire, Decidim::Forms::QuestionnaireType, "The questionnaire for this survey", null: true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Surveys
|
5
|
+
class SurveysType < Decidim::Api::Types::BaseObject
|
6
|
+
implements Decidim::Core::ComponentInterface
|
7
|
+
|
8
|
+
graphql_name "Surveys"
|
9
|
+
description "A surveys component of a participatory space."
|
10
|
+
|
11
|
+
field :surveys, Decidim::Surveys::SurveyType.connection_type, null: true, connection: true
|
12
|
+
|
13
|
+
def surveys
|
14
|
+
Survey.where(component: object).includes(:component)
|
15
|
+
end
|
16
|
+
|
17
|
+
field :survey, Decidim::Surveys::SurveyType, null: true do
|
18
|
+
argument :id, GraphQL::Types::ID, required: true
|
19
|
+
end
|
20
|
+
|
21
|
+
def survey(**args)
|
22
|
+
Survey.where(component: object).find_by(id: args[:id])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/decidim/surveys.rb
CHANGED
@@ -57,6 +57,8 @@ Decidim.register_component(:surveys) do |component|
|
|
57
57
|
component.settings(:global) do |settings|
|
58
58
|
settings.attribute :scopes_enabled, type: :boolean, default: false
|
59
59
|
settings.attribute :scope_id, type: :scope
|
60
|
+
settings.attribute :starts_at, type: :time
|
61
|
+
settings.attribute :ends_at, type: :time
|
60
62
|
settings.attribute :announcement, type: :text, translated: true, editor: true
|
61
63
|
settings.attribute :clean_after_publish, type: :boolean, default: true
|
62
64
|
end
|
@@ -103,10 +105,10 @@ Decidim.register_component(:surveys) do |component|
|
|
103
105
|
questionnaire = Decidim::Forms::Questionnaire.new(
|
104
106
|
title: Decidim::Faker::Localized.paragraph,
|
105
107
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
106
|
-
Decidim::Faker::Localized.paragraph(3)
|
108
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
107
109
|
end,
|
108
110
|
tos: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
109
|
-
Decidim::Faker::Localized.paragraph(2)
|
111
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 2)
|
110
112
|
end
|
111
113
|
)
|
112
114
|
|
@@ -151,11 +153,12 @@ Decidim.register_component(:surveys) do |component|
|
|
151
153
|
)
|
152
154
|
end
|
153
155
|
|
154
|
-
%w(matrix_single matrix_multiple).
|
156
|
+
%w(matrix_single matrix_multiple).each_with_index do |matrix_question_type, index|
|
155
157
|
question = Decidim::Forms::Question.create!(
|
156
158
|
questionnaire: questionnaire,
|
157
159
|
body: Decidim::Faker::Localized.paragraph,
|
158
|
-
question_type: matrix_question_type
|
160
|
+
question_type: matrix_question_type,
|
161
|
+
position: index
|
159
162
|
)
|
160
163
|
|
161
164
|
3.times do
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-surveys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
- Marc Riera Casals
|
9
9
|
- Oriol Gual Oliva
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,84 +18,84 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.24.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.
|
28
|
+
version: 0.24.0.rc1
|
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.
|
35
|
+
version: 0.24.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.
|
42
|
+
version: 0.24.0.rc1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-templates
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.24.0.rc1
|
50
50
|
type: :runtime
|
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.
|
56
|
+
version: 0.24.0.rc1
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-admin
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.24.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.
|
70
|
+
version: 0.24.0.rc1
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: decidim-dev
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.24.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.
|
84
|
+
version: 0.24.0.rc1
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: decidim-participatory_processes
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.24.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.
|
98
|
+
version: 0.24.0.rc1
|
99
99
|
description: A surveys component for decidim's participatory spaces.
|
100
100
|
email:
|
101
101
|
- josepjaume@gmail.com
|
@@ -127,8 +127,6 @@ files:
|
|
127
127
|
- app/queries/decidim/surveys/metrics/survey_participants_metric_measure.rb
|
128
128
|
- app/serializers/decidim/surveys/data_importer.rb
|
129
129
|
- app/serializers/decidim/surveys/data_serializer.rb
|
130
|
-
- app/types/decidim/surveys/survey_type.rb
|
131
|
-
- app/types/decidim/surveys/surveys_type.rb
|
132
130
|
- app/views/decidim/surveys/surveys/no_permission.html.erb
|
133
131
|
- config/locales/am-ET.yml
|
134
132
|
- config/locales/ar-SA.yml
|
@@ -183,12 +181,14 @@ files:
|
|
183
181
|
- config/locales/pt.yml
|
184
182
|
- config/locales/ro-RO.yml
|
185
183
|
- config/locales/ru.yml
|
184
|
+
- config/locales/si-LK.yml
|
186
185
|
- config/locales/sk-SK.yml
|
187
186
|
- config/locales/sk.yml
|
188
187
|
- config/locales/sl.yml
|
189
188
|
- config/locales/so-SO.yml
|
190
189
|
- config/locales/sr-CS.yml
|
191
190
|
- config/locales/sv.yml
|
191
|
+
- config/locales/sw-KE.yml
|
192
192
|
- config/locales/ti-ER.yml
|
193
193
|
- config/locales/tr-TR.yml
|
194
194
|
- config/locales/uk.yml
|
@@ -218,9 +218,12 @@ files:
|
|
218
218
|
- db/migrate/20200610090725_remove_survey_answers.rb
|
219
219
|
- db/migrate/20200610090845_remove_survey_questions.rb
|
220
220
|
- db/migrate/20200610105927_remove_survey_columns.rb
|
221
|
+
- lib/decidim/api/survey_type.rb
|
222
|
+
- lib/decidim/api/surveys_type.rb
|
221
223
|
- lib/decidim/surveys.rb
|
222
224
|
- lib/decidim/surveys/admin.rb
|
223
225
|
- lib/decidim/surveys/admin_engine.rb
|
226
|
+
- lib/decidim/surveys/api.rb
|
224
227
|
- lib/decidim/surveys/component.rb
|
225
228
|
- lib/decidim/surveys/engine.rb
|
226
229
|
- lib/decidim/surveys/test/factories.rb
|
@@ -230,7 +233,7 @@ homepage: https://github.com/decidim/decidim
|
|
230
233
|
licenses:
|
231
234
|
- AGPL-3.0
|
232
235
|
metadata: {}
|
233
|
-
post_install_message:
|
236
|
+
post_install_message:
|
234
237
|
rdoc_options: []
|
235
238
|
require_paths:
|
236
239
|
- lib
|
@@ -238,15 +241,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
238
241
|
requirements:
|
239
242
|
- - ">="
|
240
243
|
- !ruby/object:Gem::Version
|
241
|
-
version: '2.
|
244
|
+
version: '2.7'
|
242
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
246
|
requirements:
|
244
|
-
- - "
|
247
|
+
- - ">"
|
245
248
|
- !ruby/object:Gem::Version
|
246
|
-
version:
|
249
|
+
version: 1.3.1
|
247
250
|
requirements: []
|
248
|
-
rubygems_version: 3.
|
249
|
-
signing_key:
|
251
|
+
rubygems_version: 3.1.2
|
252
|
+
signing_key:
|
250
253
|
specification_version: 4
|
251
254
|
summary: Decidim surveys module
|
252
255
|
test_files: []
|
@@ -1,15 +0,0 @@
|
|
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 :createdAt, Decidim::Core::DateTimeType, "The time this survey was created", property: :created_at
|
11
|
-
field :updatedAt, Decidim::Core::DateTimeType, "The time this survey was updated", property: :updated_at
|
12
|
-
field :questionnaire, Decidim::Forms::QuestionnaireType, "The questionnaire for this survey"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,32 +0,0 @@
|
|
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
|