decidim-verifications 0.21.0 → 0.23.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -3
  3. data/app/cells/decidim/verifications/authorization_metadata/show.erb +13 -0
  4. data/app/cells/decidim/verifications/authorization_metadata_cell.rb +22 -0
  5. data/app/cells/decidim/verifications/revocations/show.erb +40 -0
  6. data/app/cells/decidim/verifications/revocations_cell.rb +19 -0
  7. data/app/commands/decidim/verifications/confirm_user_authorization.rb +49 -9
  8. data/app/commands/decidim/verifications/destroy_user_authorization.rb +24 -0
  9. data/app/commands/decidim/verifications/revoke_all_authorizations.rb +48 -0
  10. data/app/commands/decidim/verifications/revoke_by_condition_authorizations.rb +68 -0
  11. data/app/controllers/concerns/decidim/verifications/renewable.rb +37 -0
  12. data/app/controllers/decidim/verifications/admin/verifications_controller.rb +40 -0
  13. data/app/controllers/decidim/verifications/application_controller.rb +5 -1
  14. data/app/controllers/decidim/verifications/authorizations_controller.rb +19 -2
  15. data/app/controllers/decidim/verifications/csv_census/authorizations_controller.rb +3 -1
  16. data/app/controllers/decidim/verifications/id_documents/admin/confirmations_controller.rb +1 -1
  17. data/app/controllers/decidim/verifications/id_documents/authorizations_controller.rb +2 -0
  18. data/app/controllers/decidim/verifications/postal_letter/authorizations_controller.rb +3 -1
  19. data/app/controllers/decidim/verifications/sms/authorizations_controller.rb +3 -1
  20. data/app/forms/decidim/verifications/admin/revocations_before_date_form.rb +16 -0
  21. data/app/forms/decidim/verifications/id_documents/upload_form.rb +1 -2
  22. data/app/queries/decidim/verifications/authorizations_before_date.rb +51 -0
  23. data/app/services/decidim/authorization_handler.rb +4 -0
  24. data/app/views/decidim/verifications/authorizations/_granted_authorization.html.erb +29 -24
  25. data/app/views/decidim/verifications/authorizations/first_login.html.erb +2 -2
  26. data/app/views/decidim/verifications/authorizations/index.html.erb +22 -12
  27. data/app/views/decidim/verifications/authorizations/new.html.erb +2 -2
  28. data/app/views/decidim/verifications/authorizations/renew_modal.html.erb +38 -0
  29. data/app/views/decidim/verifications/id_documents/admin/pending_authorizations/index.html.erb +4 -4
  30. data/app/views/decidim/verifications/id_documents/authorizations/_form.html.erb +2 -0
  31. data/app/views/decidim/verifications/postal_letter/authorizations/edit.html.erb +2 -0
  32. data/app/views/decidim/verifications/postal_letter/authorizations/new.html.erb +2 -0
  33. data/app/views/decidim/verifications/sms/authorizations/edit.html.erb +2 -0
  34. data/app/views/decidim/verifications/sms/authorizations/new.html.erb +2 -0
  35. data/app/views/dummy_authorization/_form.html.erb +23 -4
  36. data/config/locales/am-ET.yml +1 -0
  37. data/config/locales/ar.yml +9 -6
  38. data/config/locales/bg-BG.yml +18 -0
  39. data/config/locales/bg.yml +18 -0
  40. data/config/locales/ca.yml +34 -2
  41. data/config/locales/cs.yml +56 -24
  42. data/config/locales/da-DK.yml +1 -0
  43. data/config/locales/da.yml +1 -0
  44. data/config/locales/de.yml +36 -3
  45. data/config/locales/el.yml +258 -0
  46. data/config/locales/en.yml +34 -2
  47. data/config/locales/eo.yml +1 -0
  48. data/config/locales/es-MX.yml +34 -2
  49. data/config/locales/es-PY.yml +34 -2
  50. data/config/locales/es.yml +34 -2
  51. data/config/locales/et-EE.yml +1 -0
  52. data/config/locales/et.yml +1 -0
  53. data/config/locales/eu.yml +5 -2
  54. data/config/locales/fi-plain.yml +34 -2
  55. data/config/locales/fi.yml +44 -12
  56. data/config/locales/fr-CA.yml +260 -0
  57. data/config/locales/fr.yml +34 -2
  58. data/config/locales/ga-IE.yml +1 -0
  59. data/config/locales/gl.yml +43 -10
  60. data/config/locales/hr-HR.yml +1 -0
  61. data/config/locales/hr.yml +1 -0
  62. data/config/locales/hu.yml +26 -2
  63. data/config/locales/id-ID.yml +4 -1
  64. data/config/locales/is.yml +120 -0
  65. data/config/locales/it.yml +34 -2
  66. data/config/locales/ja-JP.yml +259 -0
  67. data/config/locales/ja.yml +259 -0
  68. data/config/locales/ko-KR.yml +1 -0
  69. data/config/locales/ko.yml +1 -0
  70. data/config/locales/lt-LT.yml +1 -0
  71. data/config/locales/lt.yml +1 -0
  72. data/config/locales/lv.yml +250 -0
  73. data/config/locales/mt-MT.yml +1 -0
  74. data/config/locales/mt.yml +1 -0
  75. data/config/locales/nl.yml +34 -2
  76. data/config/locales/no.yml +5 -2
  77. data/config/locales/om-ET.yml +1 -0
  78. data/config/locales/pl.yml +91 -58
  79. data/config/locales/pt-BR.yml +6 -3
  80. data/config/locales/pt.yml +127 -94
  81. data/config/locales/ro-RO.yml +261 -0
  82. data/config/locales/ru.yml +5 -4
  83. data/config/locales/si-LK.yml +1 -0
  84. data/config/locales/sk-SK.yml +258 -0
  85. data/config/locales/sk.yml +259 -0
  86. data/config/locales/sl.yml +5 -0
  87. data/config/locales/so-SO.yml +1 -0
  88. data/config/locales/sr-CS.yml +1 -0
  89. data/config/locales/sv.yml +34 -2
  90. data/config/locales/sw-KE.yml +1 -0
  91. data/config/locales/ti-ER.yml +1 -0
  92. data/config/locales/tr-TR.yml +71 -38
  93. data/config/locales/uk.yml +5 -4
  94. data/config/locales/vi-VN.yml +1 -0
  95. data/config/locales/vi.yml +1 -0
  96. data/config/locales/zh-CN.yml +257 -0
  97. data/config/locales/zh-TW.yml +1 -0
  98. data/lib/decidim/verifications/adapter.rb +12 -0
  99. data/lib/decidim/verifications/csv_census/engine.rb +3 -1
  100. data/lib/decidim/verifications/engine.rb +13 -0
  101. data/lib/decidim/verifications/id_documents/engine.rb +1 -0
  102. data/lib/decidim/verifications/postal_letter/engine.rb +3 -1
  103. data/lib/decidim/verifications/sms/engine.rb +3 -1
  104. data/lib/decidim/verifications/version.rb +1 -1
  105. data/lib/decidim/verifications/workflow_manifest.rb +3 -0
  106. data/lib/decidim/verifications/workflows.rb +1 -1
  107. metadata +60 -12
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -63,6 +63,18 @@ module Decidim
63
63
  main_engine.send(:edit_authorization_path, redirect_params(redirect_url: redirect_url))
64
64
  end
65
65
 
66
+ #
67
+ # In the case of renewable authorizations, route to renew an authorization
68
+ # process.
69
+ #
70
+ def renew_path(redirect_url: nil)
71
+ if manifest.type == "direct"
72
+ decidim_verifications.renew_authorizations_path(redirect_params(handler: name, redirect_url: redirect_url))
73
+ else
74
+ main_engine.send(:renew_authorization_path, redirect_params(redirect_url: redirect_url))
75
+ end
76
+ end
77
+
66
78
  #
67
79
  # Administrational entry point for the verification engine
68
80
  #
@@ -10,7 +10,9 @@ module Decidim
10
10
  paths["lib/tasks"] = nil
11
11
 
12
12
  routes do
13
- resource :authorization, only: [:new], as: :authorization
13
+ resource :authorization, only: [:new], as: :authorization do
14
+ get :renew, on: :collection
15
+ end
14
16
  root to: "authorizations#new"
15
17
  end
16
18
  end
@@ -11,6 +11,8 @@ module Decidim
11
11
  resources :authorizations, only: [:new, :create, :index] do
12
12
  collection do
13
13
  get :first_login
14
+ get :renew_modal
15
+ get :renew
14
16
  end
15
17
  end
16
18
 
@@ -18,6 +20,17 @@ module Decidim
18
20
  mount manifest.engine, at: "/#{manifest.name}", as: "decidim_#{manifest.name}"
19
21
  end
20
22
  end
23
+
24
+ namespace :admin do
25
+ # Revocations - Two options: 1) Revoke all (without params) 2) Revoke before date (when date params exist)
26
+ post "verifications_before_date", to: "verifications#destroy_before_date", as: "verifications/destroy_before_date"
27
+ delete "verifications_all", to: "verifications#destroy_all", as: "verifications/destroy_all"
28
+ end
29
+ end
30
+
31
+ # Initializer to include cells views paths
32
+ initializer "decidim_verifications.add_cells_view_paths" do
33
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Verifications::Engine.root}/app/cells")
21
34
  end
22
35
  end
23
36
  end
@@ -14,6 +14,7 @@ module Decidim
14
14
  resource :authorizations, only: [:new, :create, :edit, :update], as: :authorization do
15
15
  collection do
16
16
  get :choose
17
+ get :renew
17
18
  end
18
19
  end
19
20
 
@@ -11,7 +11,9 @@ module Decidim
11
11
  paths["lib/tasks"] = nil
12
12
 
13
13
  routes do
14
- resource :authorizations, only: [:new, :create, :edit, :update], as: :authorization
14
+ resource :authorizations, only: [:new, :create, :edit, :update], as: :authorization do
15
+ get :renew, on: :collection
16
+ end
15
17
 
16
18
  root to: "authorizations#new"
17
19
  end
@@ -11,7 +11,9 @@ module Decidim
11
11
  paths["lib/tasks"] = nil
12
12
 
13
13
  routes do
14
- resource :authorizations, only: [:new, :create, :edit, :update, :destroy], as: :authorization
14
+ resource :authorizations, only: [:new, :create, :edit, :update, :destroy], as: :authorization do
15
+ get :renew, on: :collection
16
+ end
15
17
 
16
18
  root to: "authorizations#new"
17
19
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-verifications version.
5
5
  module Verifications
6
6
  def self.version
7
- "0.21.0"
7
+ "0.23.2"
8
8
  end
9
9
  end
10
10
  end
@@ -34,6 +34,9 @@ module Decidim
34
34
  attribute :form, String
35
35
  attribute :expires_in, ActiveSupport::Duration, default: 0.minutes
36
36
  attribute :action_authorizer, String
37
+ attribute :renewable, Boolean, default: true
38
+ attribute :time_between_renewals, ActiveSupport::Duration, default: 1.day
39
+ attribute :metadata_cell, String, default: "decidim/verifications/authorization_metadata"
37
40
 
38
41
  validate :engine_or_form
39
42
 
@@ -28,7 +28,7 @@ module Decidim
28
28
  end
29
29
 
30
30
  #
31
- # Registers a verification workflow using the workflow manifest API
31
+ # Unregisters a verification workflow using the workflow manifest API
32
32
  #
33
33
  def unregister_workflow(name)
34
34
  manifest = find_workflow_manifest(name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-verifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rodriguez
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.0
19
+ version: 0.23.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.21.0
26
+ version: 0.23.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-admin
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.21.0
33
+ version: 0.23.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.21.0
40
+ version: 0.23.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-dev
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.21.0
47
+ version: 0.23.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.21.0
54
+ version: 0.23.2
55
55
  description: Several verification methods for your decidim instance
56
56
  email:
57
57
  - deivid.rodriguez@riseup.net
@@ -61,13 +61,22 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - README.md
63
63
  - Rakefile
64
+ - app/cells/decidim/verifications/authorization_metadata/show.erb
65
+ - app/cells/decidim/verifications/authorization_metadata_cell.rb
66
+ - app/cells/decidim/verifications/revocations/show.erb
67
+ - app/cells/decidim/verifications/revocations_cell.rb
64
68
  - app/commands/decidim/verifications/authorize_user.rb
65
69
  - app/commands/decidim/verifications/confirm_user_authorization.rb
66
70
  - app/commands/decidim/verifications/csv_census/admin/create_census_data.rb
67
71
  - app/commands/decidim/verifications/csv_census/confirm_census_authorization.rb
72
+ - app/commands/decidim/verifications/destroy_user_authorization.rb
68
73
  - app/commands/decidim/verifications/id_documents/admin/confirm_user_offline_authorization.rb
69
74
  - app/commands/decidim/verifications/id_documents/admin/update_config.rb
70
75
  - app/commands/decidim/verifications/perform_authorization_step.rb
76
+ - app/commands/decidim/verifications/revoke_all_authorizations.rb
77
+ - app/commands/decidim/verifications/revoke_by_condition_authorizations.rb
78
+ - app/controllers/concerns/decidim/verifications/renewable.rb
79
+ - app/controllers/decidim/verifications/admin/verifications_controller.rb
71
80
  - app/controllers/decidim/verifications/application_controller.rb
72
81
  - app/controllers/decidim/verifications/authorizations_controller.rb
73
82
  - app/controllers/decidim/verifications/csv_census/admin/census_controller.rb
@@ -82,6 +91,7 @@ files:
82
91
  - app/controllers/decidim/verifications/postal_letter/admin/postages_controller.rb
83
92
  - app/controllers/decidim/verifications/postal_letter/authorizations_controller.rb
84
93
  - app/controllers/decidim/verifications/sms/authorizations_controller.rb
94
+ - app/forms/decidim/verifications/admin/revocations_before_date_form.rb
85
95
  - app/forms/decidim/verifications/csv_census/admin/census_data_form.rb
86
96
  - app/forms/decidim/verifications/csv_census/census_form.rb
87
97
  - app/forms/decidim/verifications/id_documents/admin/config_form.rb
@@ -103,12 +113,14 @@ files:
103
113
  - app/presenters/decidim/verifications/id_documents/authorization_presenter.rb
104
114
  - app/presenters/decidim/verifications/postal_letter/authorization_presenter.rb
105
115
  - app/queries/decidim/verifications/authorizations.rb
116
+ - app/queries/decidim/verifications/authorizations_before_date.rb
106
117
  - app/services/decidim/authorization_handler.rb
107
118
  - app/uploaders/decidim/verifications/attachment_uploader.rb
108
119
  - app/views/decidim/verifications/authorizations/_granted_authorization.html.erb
109
120
  - app/views/decidim/verifications/authorizations/first_login.html.erb
110
121
  - app/views/decidim/verifications/authorizations/index.html.erb
111
122
  - app/views/decidim/verifications/authorizations/new.html.erb
123
+ - app/views/decidim/verifications/authorizations/renew_modal.html.erb
112
124
  - app/views/decidim/verifications/csv_census/admin/census/index.html.erb
113
125
  - app/views/decidim/verifications/csv_census/admin/census/instructions.html.erb
114
126
  - app/views/decidim/verifications/id_documents/admin/config/edit.html.erb
@@ -125,38 +137,74 @@ files:
125
137
  - app/views/decidim/verifications/sms/authorizations/edit.html.erb
126
138
  - app/views/decidim/verifications/sms/authorizations/new.html.erb
127
139
  - app/views/dummy_authorization/_form.html.erb
140
+ - config/locales/am-ET.yml
128
141
  - config/locales/ar-SA.yml
129
142
  - config/locales/ar.yml
143
+ - config/locales/bg-BG.yml
144
+ - config/locales/bg.yml
130
145
  - config/locales/ca.yml
131
146
  - config/locales/cs-CZ.yml
132
147
  - config/locales/cs.yml
148
+ - config/locales/da-DK.yml
149
+ - config/locales/da.yml
133
150
  - config/locales/de.yml
134
151
  - config/locales/el-GR.yml
135
152
  - config/locales/el.yml
136
153
  - config/locales/en.yml
137
154
  - config/locales/eo-UY.yml
155
+ - config/locales/eo.yml
138
156
  - config/locales/es-MX.yml
139
157
  - config/locales/es-PY.yml
140
158
  - config/locales/es.yml
159
+ - config/locales/et-EE.yml
160
+ - config/locales/et.yml
141
161
  - config/locales/eu.yml
142
162
  - config/locales/fi-pl.yml
143
163
  - config/locales/fi-plain.yml
144
164
  - config/locales/fi.yml
165
+ - config/locales/fr-CA.yml
145
166
  - config/locales/fr.yml
167
+ - config/locales/ga-IE.yml
146
168
  - config/locales/gl.yml
169
+ - config/locales/hr-HR.yml
170
+ - config/locales/hr.yml
147
171
  - config/locales/hu.yml
148
172
  - config/locales/id-ID.yml
149
173
  - config/locales/is-IS.yml
174
+ - config/locales/is.yml
150
175
  - config/locales/it.yml
176
+ - config/locales/ja-JP.yml
177
+ - config/locales/ja.yml
178
+ - config/locales/ko-KR.yml
179
+ - config/locales/ko.yml
180
+ - config/locales/lt-LT.yml
181
+ - config/locales/lt.yml
182
+ - config/locales/lv.yml
183
+ - config/locales/mt-MT.yml
184
+ - config/locales/mt.yml
151
185
  - config/locales/nl.yml
152
186
  - config/locales/no.yml
187
+ - config/locales/om-ET.yml
153
188
  - config/locales/pl.yml
154
189
  - config/locales/pt-BR.yml
155
190
  - config/locales/pt.yml
191
+ - config/locales/ro-RO.yml
156
192
  - config/locales/ru.yml
193
+ - config/locales/si-LK.yml
194
+ - config/locales/sk-SK.yml
195
+ - config/locales/sk.yml
196
+ - config/locales/sl.yml
197
+ - config/locales/so-SO.yml
198
+ - config/locales/sr-CS.yml
157
199
  - config/locales/sv.yml
200
+ - config/locales/sw-KE.yml
201
+ - config/locales/ti-ER.yml
158
202
  - config/locales/tr-TR.yml
159
203
  - config/locales/uk.yml
204
+ - config/locales/vi-VN.yml
205
+ - config/locales/vi.yml
206
+ - config/locales/zh-CN.yml
207
+ - config/locales/zh-TW.yml
160
208
  - db/migrate/20171030133426_move_authorizations_to_new_api.rb
161
209
  - db/migrate/20181227135423_create_decidim_verifications_csv_data.rb
162
210
  - lib/decidim/verifications.rb
@@ -190,7 +238,7 @@ homepage: https://github.com/decidim/decidim
190
238
  licenses:
191
239
  - AGPL-3.0
192
240
  metadata: {}
193
- post_install_message:
241
+ post_install_message:
194
242
  rdoc_options: []
195
243
  require_paths:
196
244
  - lib
@@ -205,8 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
253
  - !ruby/object:Gem::Version
206
254
  version: '0'
207
255
  requirements: []
208
- rubygems_version: 3.1.2
209
- signing_key:
256
+ rubygems_version: 3.0.3
257
+ signing_key:
210
258
  specification_version: 4
211
259
  summary: Decidim verifications module
212
260
  test_files: []