decidim-dev 0.21.0 → 0.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/dummy.svg +1 -4
  3. data/app/assets/images/decidim/gamification/badges/test.svg +1 -145
  4. data/app/commands/decidim/dummy_resources/create_dummy_resource.rb +48 -0
  5. data/app/controllers/decidim/dummy_resources/dummy_resources_controller.rb +1 -0
  6. data/app/forms/decidim/dummy_resources/dummy_resource_form.rb +3 -0
  7. data/app/mailers/decidim/dummy_resources/dummy_resource_mailer.rb +17 -0
  8. data/app/views/decidim/dummy_resources/dummy_resources/show.html.erb +4 -0
  9. data/config/locales/am-ET.yml +1 -0
  10. data/config/locales/bg-BG.yml +56 -0
  11. data/config/locales/bg.yml +56 -0
  12. data/config/locales/ca.yml +15 -0
  13. data/config/locales/cs.yml +16 -1
  14. data/config/locales/da-DK.yml +1 -0
  15. data/config/locales/da.yml +1 -0
  16. data/config/locales/de.yml +17 -1
  17. data/config/locales/el.yml +55 -0
  18. data/config/locales/en.yml +15 -0
  19. data/config/locales/eo.yml +1 -0
  20. data/config/locales/es-MX.yml +15 -0
  21. data/config/locales/es-PY.yml +15 -0
  22. data/config/locales/es.yml +15 -0
  23. data/config/locales/et-EE.yml +1 -0
  24. data/config/locales/et.yml +1 -0
  25. data/config/locales/fi-plain.yml +15 -0
  26. data/config/locales/fi.yml +15 -0
  27. data/config/locales/fr-CA.yml +56 -0
  28. data/config/locales/fr.yml +15 -0
  29. data/config/locales/ga-IE.yml +1 -0
  30. data/config/locales/hr-HR.yml +1 -0
  31. data/config/locales/hr.yml +1 -0
  32. data/config/locales/hu.yml +9 -0
  33. data/config/locales/is.yml +21 -0
  34. data/config/locales/it.yml +17 -2
  35. data/config/locales/ja-JP.yml +56 -0
  36. data/config/locales/ja.yml +56 -0
  37. data/config/locales/ko-KR.yml +1 -0
  38. data/config/locales/ko.yml +1 -0
  39. data/config/locales/lt-LT.yml +1 -0
  40. data/config/locales/lt.yml +1 -0
  41. data/config/locales/lv.yml +54 -0
  42. data/config/locales/mt-MT.yml +1 -0
  43. data/config/locales/mt.yml +1 -0
  44. data/config/locales/nl.yml +15 -0
  45. data/config/locales/om-ET.yml +1 -0
  46. data/config/locales/pl.yml +26 -10
  47. data/config/locales/pt-BR.yml +1 -1
  48. data/config/locales/pt.yml +26 -10
  49. data/config/locales/ro-RO.yml +56 -0
  50. data/config/locales/si-LK.yml +1 -0
  51. data/config/locales/sk-SK.yml +47 -0
  52. data/config/locales/sk.yml +47 -0
  53. data/config/locales/sl.yml +5 -0
  54. data/config/locales/so-SO.yml +1 -0
  55. data/config/locales/sr-CS.yml +8 -0
  56. data/config/locales/sv.yml +15 -0
  57. data/config/locales/sw-KE.yml +1 -0
  58. data/config/locales/ti-ER.yml +1 -0
  59. data/config/locales/tr-TR.yml +25 -9
  60. data/config/locales/vi-VN.yml +1 -0
  61. data/config/locales/vi.yml +1 -0
  62. data/config/locales/zh-CN.yml +56 -0
  63. data/config/locales/zh-TW.yml +1 -0
  64. data/lib/decidim/dev.rb +2 -0
  65. data/lib/decidim/dev/assets/5000x5000.png +0 -0
  66. data/lib/decidim/dev/assets/assemblies.json +816 -0
  67. data/lib/decidim/dev/assets/assemblies_with_null.json +135 -0
  68. data/lib/decidim/dev/assets/city.jpeg +0 -0
  69. data/lib/decidim/dev/assets/city2.jpeg +0 -0
  70. data/lib/decidim/dev/assets/city3.jpeg +0 -0
  71. data/lib/decidim/dev/assets/geocoder_result_here.json +72 -0
  72. data/lib/decidim/dev/assets/geocoder_result_osm.json +150 -0
  73. data/lib/decidim/dev/assets/import_participatory_space_private_users_nok.csv +2 -0
  74. data/lib/decidim/dev/dummy_translator.rb +32 -0
  75. data/lib/decidim/dev/test/rspec_support/authorization.rb +3 -0
  76. data/lib/decidim/dev/test/rspec_support/capybara.rb +5 -1
  77. data/lib/decidim/dev/test/rspec_support/capybara_data_picker.rb +15 -5
  78. data/lib/decidim/dev/test/rspec_support/capybara_scopes_picker.rb +5 -5
  79. data/lib/decidim/dev/test/rspec_support/component.rb +111 -9
  80. data/lib/decidim/dev/test/rspec_support/component_context.rb +1 -2
  81. data/lib/decidim/dev/test/rspec_support/confirmation_helpers.rb +60 -0
  82. data/lib/decidim/dev/test/rspec_support/content_processing.rb +2 -2
  83. data/lib/decidim/dev/test/rspec_support/frontend.rb +20 -0
  84. data/lib/decidim/dev/test/rspec_support/geocoder.rb +150 -6
  85. data/lib/decidim/dev/test/rspec_support/helpers.rb +2 -2
  86. data/lib/decidim/dev/test/rspec_support/organization.rb +7 -0
  87. data/lib/decidim/dev/test/rspec_support/rake_tasks.rb +75 -0
  88. data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +2 -0
  89. data/lib/decidim/dev/version.rb +1 -1
  90. data/lib/tasks/generators.rake +2 -1
  91. data/lib/tasks/locale_checker.rake +1 -1
  92. metadata +62 -14
  93. data/lib/decidim/dev/test/rspec_support/capybara_proposals_picker.rb +0 -51
@@ -0,0 +1,135 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "slug": "quae-a",
5
+ "hashtag": "id",
6
+ "decidim_organization_id": 1,
7
+ "title": {
8
+ "ca": "Eius iure laborum hic et.",
9
+ "en": "Deserunt sed est quas rerum.",
10
+ "es": "Est architecto voluptas est nobis."
11
+ },
12
+ "subtitle": {
13
+ "ca": "Necessitatibus repellat.",
14
+ "en": "Porro ipsam.",
15
+ "es": "Qui quia."
16
+ },
17
+ "short_description": {
18
+ "ca": "<p>Sed et voluptatem.</p>",
19
+ "en": "<p>Provident ab et.</p>",
20
+ "es": "<p>Molestias aliquam rerum.</p>"
21
+ },
22
+ "description": {
23
+ "ca": "<p>In incidunt harum. Sit laboriosam molestiae. Officia qui quo.</p>",
24
+ "en": "<p>Occaecati nulla deserunt. Sequi voluptatem quam. Qui eligendi quod.</p>",
25
+ "es": "<p>Accusamus dolorem vitae. Et reprehenderit accusantium. Expedita consequatur nesciunt.</p>"
26
+ },
27
+ "remote_hero_image_url": "http://localhost/uploads/decidim/assembly/hero_image/1/city.jpeg",
28
+ "remote_banner_image_url": "http://localhost/uploads/decidim/assembly/banner_image/1/city2.jpeg",
29
+ "promoted": true,
30
+ "developer_group": {
31
+ "ca": "Nesciunt.",
32
+ "en": "Ad.",
33
+ "es": "Sint."
34
+ },
35
+ "meta_scope": {
36
+ "ca": "eum",
37
+ "en": "explicabo",
38
+ "es": "quas"
39
+ },
40
+ "local_area": {
41
+ "ca": "Ad ut.",
42
+ "en": "Illum nihil.",
43
+ "es": "Adipisci ut."
44
+ },
45
+ "target": {
46
+ "ca": "Sit et ea.",
47
+ "en": "Ut libero qui.",
48
+ "es": "Incidunt provident doloremque."
49
+ },
50
+ "decidim_scope_id": null,
51
+ "paticipatory_scope": {
52
+ "ca": "Assumenda.",
53
+ "en": "Quidem.",
54
+ "es": "Aspernatur."
55
+ },
56
+ "participatory_structure": {
57
+ "ca": "Voluptatem in.",
58
+ "en": "Vel qui.",
59
+ "es": "Et molestiae."
60
+ },
61
+ "show_statistics": false,
62
+ "scopes_enabled": true,
63
+ "private_space": false,
64
+ "reference": "PhD-ASSE-2020-01-1",
65
+ "purpose_of_action": {
66
+ "ca": "<p>Velit a qui. Debitis rem occaecati. Id minus est.</p>",
67
+ "en": "<p>Perspiciatis voluptas et. Officiis ratione corporis. Voluptas iusto qui.</p>",
68
+ "es": "<p>Sit pariatur et. Modi ea earum. Suscipit labore ipsum.</p>"
69
+ },
70
+ "composition": {
71
+ "ca": "<p>Quos libero nobis. Fugiat quia et. Nam non quae.</p>",
72
+ "en": "<p>Ex optio illo. Dolor sunt quam. Et fugit molestiae.</p>",
73
+ "es": "<p>Incidunt sint veniam. Illum repellendus quos. Et tenetur voluptatum.</p>"
74
+ },
75
+ "duration": "2020-01-24",
76
+ "participatory_scope": {
77
+ "ca": "Assumenda.",
78
+ "en": "Quidem.",
79
+ "es": "Aspernatur."
80
+ },
81
+ "included_at": "2020-01-27",
82
+ "closing_date": "2020-01-27",
83
+ "created_by": "others",
84
+ "creation_date": "2020-01-23",
85
+ "closing_date_reason": {
86
+ "ca": "Dolorum id voluptate.",
87
+ "en": "Voluptatibus quasi omnis.",
88
+ "es": "Similique et expedita."
89
+ },
90
+ "internal_organisation": {
91
+ "ca": "<p>Reprehenderit nisi non. Unde quia cum. Ea saepe deleniti.</p>",
92
+ "en": "<p>Optio ducimus velit. Facilis omnis asperiores. Corporis ipsa non.</p>",
93
+ "es": "<p>Est dolorum et. Quo sed ut. Corporis quos sit.</p>"
94
+ },
95
+ "is_transparent": true,
96
+ "special_features": {
97
+ "ca": "<p>Dolor et reprehenderit. Unde soluta eum. Omnis occaecati omnis.</p>",
98
+ "en": "<p>Et atque perspiciatis. Quas impedit corporis. Nesciunt blanditiis ipsa.</p>",
99
+ "es": "<p>Rerum eligendi hic. Iure aut expedita. Sapiente ut corrupti.</p>"
100
+ },
101
+ "twitter_handler": "aliquam",
102
+ "instagram_handler": "corrupti",
103
+ "facebook_handler": "velit",
104
+ "youtube_handler": "ducimus",
105
+ "github_handler": "in",
106
+ "created_by_other": {
107
+ "ca": "vitae",
108
+ "en": "ut",
109
+ "es": "rerum"
110
+ },
111
+ "decidim_assemblies_type_id": 1,
112
+ "area": {
113
+ "id": null,
114
+ "name": {
115
+ "en": "",
116
+ "ca": "",
117
+ "es": ""
118
+ }
119
+ },
120
+ "scope": {
121
+ "id": null,
122
+ "name": {
123
+ "en": "",
124
+ "ca": "",
125
+ "es": ""
126
+ }
127
+ },
128
+ "assembly_categories": null,
129
+ "attachments": {
130
+ "attachment_collections": null,
131
+ "files": null
132
+ },
133
+ "components": null
134
+ }
135
+ ]
Binary file
Binary file
Binary file
@@ -0,0 +1,72 @@
1
+ {
2
+ "Response": {
3
+ "MetaInfo": {
4
+ "Timestamp": "2013-02-08T16:26:39.382+0000"
5
+ },
6
+ "View": [
7
+ {
8
+ "_type": "SearchResultsViewType",
9
+ "ViewId": 0,
10
+ "Result": [
11
+ {
12
+ "Relevance": 1.0,
13
+ "MatchLevel": "houseNumber",
14
+ "MatchQuality": {
15
+ "State": 1.0,
16
+ "City": 1.0,
17
+ "Street": [
18
+ 1.0
19
+ ],
20
+ "HouseNumber": 1.0
21
+ },
22
+ "MatchType": "pointAddress",
23
+ "Location": {
24
+ "LocationId": "NT_ArsGdYbpo6dqjPQel9gTID_4",
25
+ "LocationType": "point",
26
+ "DisplayPosition": {
27
+ "Latitude": 40.7504692,
28
+ "Longitude": -73.9933777
29
+ },
30
+ "NavigationPosition": [
31
+ {
32
+ "Latitude": 40.7500305,
33
+ "Longitude": -73.9942398
34
+ }
35
+ ],
36
+ "MapView": {
37
+ "TopLeft": {
38
+ "Latitude": 40.7515934,
39
+ "Longitude": -73.9948616
40
+ },
41
+ "BottomRight": {
42
+ "Latitude": 40.7493451,
43
+ "Longitude": -73.9918938
44
+ }
45
+ },
46
+ "Address": {
47
+ "Label": "4 Penn Plz, New York, NY 10001, United States",
48
+ "Country": "USA",
49
+ "State": "NY",
50
+ "County": "New York",
51
+ "City": "New York",
52
+ "Street": "Penn Plz",
53
+ "HouseNumber": "4",
54
+ "PostalCode": "10001",
55
+ "AdditionalData": [
56
+ {
57
+ "value": "United States",
58
+ "key": "CountryName"
59
+ },
60
+ {
61
+ "value": "New York",
62
+ "key": "StateName"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ }
72
+ }
@@ -0,0 +1,150 @@
1
+ [
2
+
3
+ {
4
+ "place_id": "30632629",
5
+ "licence": "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.",
6
+ "osm_type": "way",
7
+ "osm_id": "24801588",
8
+ "boundingbox": [
9
+ "40.749828338623",
10
+ "40.7511596679688",
11
+ "-73.9943389892578",
12
+ "-73.9926528930664"
13
+ ],
14
+ "polygonpoints": [
15
+ [
16
+ "-73.9943346",
17
+ "40.7503638"
18
+ ],
19
+ [
20
+ "-73.9942745",
21
+ "40.7504158"
22
+ ],
23
+ [
24
+ "-73.9942593",
25
+ "40.750629"
26
+ ],
27
+ [
28
+ "-73.9941343",
29
+ "40.7508432"
30
+ ],
31
+ [
32
+ "-73.9939794",
33
+ "40.7509703"
34
+ ],
35
+ [
36
+ "-73.9938042",
37
+ "40.7510532"
38
+ ],
39
+ [
40
+ "-73.9938025",
41
+ "40.7511311"
42
+ ],
43
+ [
44
+ "-73.9936051",
45
+ "40.7511571"
46
+ ],
47
+ [
48
+ "-73.9935673",
49
+ "40.751105"
50
+ ],
51
+ [
52
+ "-73.9934095",
53
+ "40.7511089"
54
+ ],
55
+ [
56
+ "-73.9931235",
57
+ "40.7510548"
58
+ ],
59
+ [
60
+ "-73.9928863",
61
+ "40.7509311"
62
+ ],
63
+ [
64
+ "-73.9928068",
65
+ "40.750949"
66
+ ],
67
+ [
68
+ "-73.992721",
69
+ "40.7508515"
70
+ ],
71
+ [
72
+ "-73.9927444",
73
+ "40.7507889"
74
+ ],
75
+ [
76
+ "-73.9926693",
77
+ "40.7506457"
78
+ ],
79
+ [
80
+ "-73.9926597",
81
+ "40.7503657"
82
+ ],
83
+ [
84
+ "-73.9928305",
85
+ "40.7500953"
86
+ ],
87
+ [
88
+ "-73.9929757",
89
+ "40.7499911"
90
+ ],
91
+ [
92
+ "-73.9931281",
93
+ "40.7499238"
94
+ ],
95
+ [
96
+ "-73.993133",
97
+ "40.7498631"
98
+ ],
99
+ [
100
+ "-73.9932961",
101
+ "40.7498306"
102
+ ],
103
+ [
104
+ "-73.9933664",
105
+ "40.7498742"
106
+ ],
107
+ [
108
+ "-73.993471",
109
+ "40.7498701"
110
+ ],
111
+ [
112
+ "-73.9938023",
113
+ "40.7499263"
114
+ ],
115
+ [
116
+ "-73.9940703",
117
+ "40.7500756"
118
+ ],
119
+ [
120
+ "-73.9941876",
121
+ "40.7502038"
122
+ ],
123
+ [
124
+ "-73.9942831",
125
+ "40.7502142"
126
+ ],
127
+ [
128
+ "-73.9943346",
129
+ "40.7503638"
130
+ ]
131
+ ],
132
+ "lat": "40.7504928941818",
133
+ "lon": "-73.993466492276",
134
+ "display_name": "Madison Square Garden, West 31st Street, Long Island City, New York City, New York, 10001, United States of America",
135
+ "class": "leisure",
136
+ "type": "stadium",
137
+ "address": {
138
+ "stadium": "Madison Square Garden",
139
+ "road": "West 31st Street",
140
+ "suburb": "Long Island City",
141
+ "city": "New York City",
142
+ "county": "New York",
143
+ "state": "New York",
144
+ "postcode": "10001",
145
+ "country": "United States of America",
146
+ "country_code": "us"
147
+ }
148
+ }
149
+
150
+ ]
@@ -0,0 +1,2 @@
1
+ my_user@example.org,My User (Name)
2
+ my_private_user@example.org,My Private User Name
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Dev
5
+ # This Dummy translator recieves the field value
6
+ # and the locale of the field which has to be
7
+ # translated. It returns the appended value for both.
8
+ # This is for testing only.
9
+ class DummyTranslator
10
+ attr_reader :text, :source_locale, :target_locale, :resource, :field_name
11
+
12
+ def initialize(resource, field_name, text, target_locale, source_locale)
13
+ @resource = resource
14
+ @field_name = field_name
15
+ @text = text
16
+ @target_locale = target_locale
17
+ @source_locale = source_locale
18
+ end
19
+
20
+ def translate
21
+ translated_text = "#{target_locale} - #{text}"
22
+
23
+ MachineTranslationSaveJob.perform_later(
24
+ resource,
25
+ field_name,
26
+ target_locale,
27
+ translated_text
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -14,6 +14,7 @@ module Decidim
14
14
  routes do
15
15
  root to: proc { [200, {}, ["DUMMY VERIFICATION ENGINE"]] }
16
16
  get :edit_authorization, to: proc { [200, {}, ["CONTINUE YOUR VERIFICATION"]] }
17
+ get :renew_authorization, to: proc { [200, {}, ["RENEW YOUR VERIFICATION"]] }
17
18
  end
18
19
  end
19
20
  end
@@ -23,6 +24,8 @@ end
23
24
  Decidim::Verifications.register_workflow(:dummy_authorization_workflow) do |workflow|
24
25
  workflow.engine = Decidim::Verifications::DummyVerification::Engine
25
26
  workflow.expires_in = 1.hour
27
+ workflow.renewable = true
28
+ workflow.time_between_renewals = 5.minutes
26
29
  end
27
30
 
28
31
  RSpec.configure do |config|
@@ -23,7 +23,11 @@ Capybara.register_driver :headless_chrome do |app|
23
23
  options = ::Selenium::WebDriver::Chrome::Options.new
24
24
  options.args << "--headless"
25
25
  options.args << "--no-sandbox"
26
- options.args << "--window-size=1024,768"
26
+ options.args << if ENV["BIG_SCREEN_SIZE"].present?
27
+ "--window-size=1920,3000"
28
+ else
29
+ "--window-size=1024,768"
30
+ end
27
31
 
28
32
  Capybara::Selenium::Driver.new(
29
33
  app,
@@ -6,15 +6,13 @@ module Capybara
6
6
  Struct.new(:data_picker, :global_value).new(find_data_picker(id, multiple: multiple), global_value)
7
7
  end
8
8
 
9
- private
10
-
11
9
  def find_data_picker(id, multiple: nil)
12
10
  if multiple.nil?
13
- expect(page).to have_selector("div.data-picker##{id}")
11
+ expect(page).to have_selector("div.data-picker[id$='#{id}']")
14
12
  else
15
- expect(page).to have_selector("div.data-picker.picker-#{multiple ? "multiple" : "single"}##{id}")
13
+ expect(page).to have_selector("div.data-picker.picker-#{multiple ? "multiple" : "single"}[id$='#{id}']")
16
14
  end
17
- find("div.data-picker##{id}")
15
+ first("div.data-picker[id$='#{id}']")
18
16
  end
19
17
 
20
18
  def data_picker_pick_current
@@ -22,5 +20,17 @@ module Capybara
22
20
  expect(body).to have_selector("#data_picker-modal .picker-footer a[data-picker-choose]")
23
21
  body.find("#data_picker-modal .picker-footer a[data-picker-choose]").click
24
22
  end
23
+
24
+ def data_picker_choose_value(value)
25
+ body = find(:xpath, "//body")
26
+ expect(body).to have_selector("#data_picker-modal input[data-picker-choose][type=checkbox][value=\"#{value}\"]")
27
+ body.find("#data_picker-modal input[data-picker-choose][type=checkbox][value=\"#{value}\"]").click
28
+ end
29
+
30
+ def data_picker_close
31
+ body = find(:xpath, "//body")
32
+ expect(body).to have_selector("#data_picker-modal .picker-footer a[data-close]")
33
+ body.find("#data_picker-modal .picker-footer a[data-close]").click
34
+ end
25
35
  end
26
36
  end