egov_utils 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/egov_utils/current_users_controller.rb +26 -0
  3. data/app/controllers/egov_utils/groups_controller.rb +33 -7
  4. data/app/controllers/egov_utils/passwords_controller.rb +4 -1
  5. data/app/controllers/egov_utils/people_controller.rb +1 -1
  6. data/app/controllers/egov_utils/registration_requests_controller.rb +59 -0
  7. data/app/controllers/egov_utils/users_controller.rb +56 -33
  8. data/app/jobs/egov_utils/registration_requests/check_auto_accept_job.rb +12 -0
  9. data/app/mailers/egov_utils/registration_request_mailer.rb +31 -0
  10. data/app/models/egov_utils/group.rb +1 -3
  11. data/app/models/egov_utils/registration_request.rb +21 -0
  12. data/app/models/egov_utils/user.rb +12 -0
  13. data/app/services/egov_utils/archive_users.rb +12 -0
  14. data/app/services/egov_utils/refresh_groups.rb +28 -0
  15. data/app/services/egov_utils/refresh_user_groups.rb +3 -4
  16. data/app/services/egov_utils/registration_requests/check_auto_accept.rb +31 -0
  17. data/app/services/egov_utils/registration_requests/create.rb +25 -0
  18. data/app/services/egov_utils/registration_requests/handle_request.rb +57 -0
  19. data/app/views/egov_utils/current_users/edit.html.haml +12 -0
  20. data/app/views/egov_utils/groups/_form.html.haml +5 -0
  21. data/app/views/egov_utils/groups/_groups_tab.html.haml +0 -5
  22. data/app/views/egov_utils/groups/edit.html.haml +4 -0
  23. data/app/views/egov_utils/groups/index.html.haml +28 -19
  24. data/app/views/egov_utils/groups/new.html.haml +4 -0
  25. data/app/views/egov_utils/registration_request_mailer/accepted.html.erb +12 -0
  26. data/app/views/egov_utils/registration_request_mailer/auto_accepted.html.erb +8 -0
  27. data/app/views/egov_utils/registration_request_mailer/created.html.erb +12 -0
  28. data/app/views/egov_utils/registration_request_mailer/rejected.html.erb +6 -0
  29. data/app/views/egov_utils/registration_requests/index.html.haml +29 -0
  30. data/app/views/egov_utils/registration_requests/new.html.haml +9 -0
  31. data/app/views/egov_utils/registration_requests/show.html.haml +51 -0
  32. data/app/views/egov_utils/sessions/new.html.haml +3 -0
  33. data/app/views/egov_utils/users/edit.html.haml +9 -0
  34. data/app/views/egov_utils/users/index.html.haml +42 -25
  35. data/config/locales/cs.yml +81 -3
  36. data/config/routes.rb +6 -1
  37. data/db/migrate/20230407114921_add_deleted_at_to_egov_utils_users.rb +6 -0
  38. data/db/migrate/20230408123813_create_egov_utils_registration_requests.rb +16 -0
  39. data/db/migrate/20230412063325_add_days_before_archive_to_egov_utils_users.rb +5 -0
  40. data/lib/egov_utils/version.rb +1 -1
  41. metadata +39 -2
@@ -1,21 +1,30 @@
1
- %ul.nav.nav-tabs{role: 'tablist'}
2
- %li.nav-item
3
- = link_to(EgovUtils::User.model_name.human(count: :other), users_path, id: 'users_tab', class: 'nav-link', 'data-toggle'=>'tab', 'aria-controls'=>'users_container')
4
- %li.nav-item
5
- = link_to(EgovUtils::Group.model_name.human(count: :other), groups_path, id: 'groups_tab', class: 'nav-link active', 'data-toggle'=>'tab', 'aria-controls'=>'groups_container')
1
+ %h1= EgovUtils::Group.model_name.human(count: 2)
6
2
 
7
- .tab-content
8
- #users_container.tab-pane.fade{role: 'tabpanel', 'aria-labelledby'=>'users_tab'}
9
- = render 'egov_utils/users/users_tab', users: @users
10
- #groups_container.tab-pane.fade.show.active{role: 'tabpanel', 'aria-labelledby'=>'groups_tab'}
11
- = render 'egov_utils/groups/groups_tab', groups: @groups
12
- #create_container.tab-pane.fade{role: 'tabpanel', 'aria-labelledby'=>'create_tab'}
13
- %h3= t('label_ldap')
14
- = render 'egov_utils/users/ldap_search'
15
- %h3= t('label_new')
16
- = bootstrap_form_for(EgovUtils::User.new) do |f|
17
- = render 'egov_utils/users/form', form: f
3
+ = link_to t('helpers.action.egov_utils.group.new'), egov_utils.new_group_path, class: 'btn btn-primary'
18
4
 
19
- $.ajax('url').done(function(response){
20
- $('#cast-2-rizeni-pred-soudem-prvniho-stupne').html(response);
21
- });
5
+ %table.table.table-striped
6
+ %thead
7
+ %tr
8
+ %th= EgovUtils::Group.human_attribute_name('name')
9
+ %th= EgovUtils::Group.human_attribute_name('provider')
10
+ %th= EgovUtils::Group.human_attribute_name('roles')
11
+ %th= t('label_actions')
12
+ %tbody
13
+ - if @groups.empty?
14
+ %tr
15
+ %td{colspan: 4}= t('label_no_entries')
16
+ - @groups.each do |group|
17
+ %tr
18
+ %td= link_to(group.name, group)
19
+ %td= group.provider
20
+ %td= group.roles.map { I18n.t("roles.#{_1}") }.join(', ')
21
+ %td
22
+ - if can?(:manage, group)
23
+ = link_to(t('label_edit'), edit_group_path(group), class: 'btn btn-secondary btn-sm')
24
+
25
+ .row
26
+ .col-md-4
27
+ = page_entries_info @groups
28
+ .col-md-4
29
+ = paginate @groups
30
+ .col-md-4
@@ -0,0 +1,4 @@
1
+ %h1= t('.title')
2
+
3
+ = render 'form'
4
+
@@ -0,0 +1,12 @@
1
+ <p>
2
+ v aplikaci <%= t(:app_name) %> Vám byl vytvořen přístup.
3
+ Vaše přístupové údaje jsou:
4
+ </p>
5
+ <ul>
6
+ <li>login: <%= @user.login %></li>
7
+ <li>heslo: <%= @password %></li>
8
+ </ul>
9
+
10
+ <p>
11
+ Po prvním přihlášení budete vyzváni ke změně hesla.
12
+ </p>
@@ -0,0 +1,8 @@
1
+ <p>
2
+ Vaše žádost o registraci do aplikace <%= t(:app_name) %> byla automaticky schválena.
3
+ </p>
4
+
5
+ <p>
6
+ Do aplikace se můžete přihlásit za pomoci vašeho emailu, který jste zadali při žádosti a hesla, které používáte do jiných systémů MSp.
7
+ </p>
8
+
@@ -0,0 +1,12 @@
1
+ <p>
2
+ Vaše žádost o registraci do aplikace <%= t(:app_name) %> byla přijata.
3
+ </p>
4
+
5
+ <ul>
6
+ <li>E-mail: <%= @request.mail %></li>
7
+ <li>Jméno: <%= @request.firstname %></li>
8
+ <li>Příjmení: <%= @request.lastname %></li>
9
+ <li>Organizace: <%= @request.organization %></li>
10
+ <li>Poznámka: <%= @request.note %></li>
11
+ </ul>
12
+
@@ -0,0 +1,6 @@
1
+ <p>
2
+ vaše žádost o registraci do aplikace <%= t(:app_name) %> byla zamítnuta.
3
+ </p>
4
+
5
+ <p>Odůvodnění: <%= @request.note %></p>
6
+
@@ -0,0 +1,29 @@
1
+ %h1= t('.title')
2
+
3
+ %table.table.table-striped
4
+ %thead
5
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('fullname')
6
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('created_at')
7
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('status')
8
+ %th= t('label_actions')
9
+ %tbody
10
+ - if @registration_requests.empty?
11
+ %tr
12
+ %td{colspan: 4}= t('label_no_entries')
13
+ - @registration_requests.each do |request|
14
+ %tr
15
+ %td
16
+ %div= request.fullname
17
+ %small= request.mail
18
+ %td= l(request.created_at)
19
+ %td= t("registration_request.statuses.#{request.status}")
20
+ %td
21
+ = link_to t('.show'), egov_utils.registration_request_path(request), class: 'btn btn-secondary btn-sm'
22
+
23
+ .row
24
+ .col-md-4
25
+ = page_entries_info @registration_requests
26
+ .col-md-4
27
+ = paginate @registration_requests
28
+ .col-md-4
29
+
@@ -0,0 +1,9 @@
1
+ %h1= t('.title')
2
+
3
+ = bootstrap_form_for(@registration_request) do |f|
4
+ = f.text_field(:mail)
5
+ = f.text_field(:firstname)
6
+ = f.text_field(:lastname)
7
+ = f.text_field(:organization)
8
+ = f.text_field(:note)
9
+ = f.submit t(:label_registration_request)
@@ -0,0 +1,51 @@
1
+ %h1= t('.title', name: @registration_request.fullname)
2
+
3
+ %table.table.table-striped
4
+ %tbody
5
+ %tr
6
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('mail')
7
+ %td= @registration_request.mail
8
+ %tr
9
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('firstname')
10
+ %td= @registration_request.firstname
11
+ %tr
12
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('lastname')
13
+ %td= @registration_request.lastname
14
+ %tr
15
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('organization')
16
+ %td= @registration_request.organization
17
+ %tr
18
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('note')
19
+ %td= @registration_request.note
20
+ %tr
21
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('created_at')
22
+ %td= l(@registration_request.created_at)
23
+ %tr
24
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('status')
25
+ %td= t("registration_request.statuses.#{@registration_request.status}")
26
+ - if @registration_request.status != 'pending'
27
+ %tr
28
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('reason')
29
+ %td= @registration_request.reason
30
+ %tr
31
+ %th= EgovUtils::RegistrationRequest.human_attribute_name('internal_reason')
32
+ %td= @registration_request.internal_reason
33
+
34
+ - if @registration_request.status == 'pending'
35
+ = bootstrap_form_for(@registration_request, url: '#') do |f|
36
+ = f.text_area(:reason)
37
+ = f.text_area(:internal_reason)
38
+ = f.hidden_field(:status, value: nil)
39
+ = f.collection_check_boxes :roles, EgovUtils::UserUtils::Role.roles, :first, ->(role) { I18n.t("roles.#{role.first}") }
40
+
41
+ = f.submit t('.accept'), class: 'btn btn-success', data: { value: 'accepted' }
42
+ = f.submit t('.reject'), class: 'btn btn-danger', data: { value: 'rejected' }
43
+
44
+ :javascript
45
+ $(function() {
46
+ $('input[type=submit]').click(function(e) {
47
+ var status = $(this).data('value');
48
+ $('#registration_request_status').val(status);
49
+ });
50
+ });
51
+
@@ -6,3 +6,6 @@
6
6
  = link_to t('label_signup'), egov_utils.new_user_path, class: 'btn btn-secondary'
7
7
  - if EgovUtils::Settings.allow_password_reset?
8
8
  = link_to t('label_forgotten_password'), egov_utils.reset_passwords_path
9
+
10
+ %br
11
+ = link_to t('.registration_request'), new_registration_request_path
@@ -1,4 +1,13 @@
1
+ %h1= t('.title')
2
+
1
3
  = bootstrap_form_for(@user) do |f|
2
4
  = f.text_field :days_before_inactive
5
+ = f.text_field :days_before_archive
6
+ = f.collection_check_boxes :roles, EgovUtils::UserUtils::Role.roles, :first, ->(role) { I18n.t("roles.#{role.first}") }
7
+ - if @user.password_change_possible?
8
+ %h2= t('.password_change')
9
+ %em= t('.password_change_note')
10
+ = f.password_field :password
11
+ = f.password_field :password_confirmation
3
12
  .form-actions
4
13
  = f.submit
@@ -1,26 +1,43 @@
1
- %ul.nav.nav-tabs{role: 'tablist'}
2
- %li.nav-item
3
- = link_to(EgovUtils::User.model_name.human(count: :other), '#users_container', id: 'users_tab', class: 'nav-link active', 'data-toggle'=>'tab', 'aria-controls'=>'users_container')
4
- %li.nav-item
5
- = link_to(EgovUtils::Group.model_name.human(count: :other), '#groups_container', id: 'groups_tab', class: 'nav-link', 'data-toggle'=>'tab', 'aria-controls'=>'groups_container')
6
- %li.nav-item.dropdown
7
- %a.nav-link.dropdown-toggle{'data-toggle'=>'dropdown', 'href'=>'#', 'role'=>'button'}
8
- = t('label_new')
9
- .dropdown-menu
10
- = link_to(t('label_new'), '#create', id: 'create_tab', class: 'dropdown-item', 'data-toggle'=>'tab', 'aria-controls'=>'create')
11
- = link_to(t('label_ldap'), '#create_ldap', id: 'create_tab', class: 'dropdown-item', 'data-toggle'=>'tab', 'aria-controls'=>'create_ldap')
1
+ %h1= EgovUtils::User.model_name.human(count: 2)
12
2
 
13
- .tab-content
14
- #users_container.tab-pane.fade.show.active{role: 'tabpanel', 'aria-labelledby'=>'users_tab'}
15
- = render 'egov_utils/users/users_tab', users: @users
16
- #groups_container.tab-pane.fade{role: 'tabpanel', 'aria-labelledby'=>'groups_tab'}
17
- = render 'egov_utils/groups/groups_tab', groups: @groups
18
- #create_ldap.tab-pane.fade{role: 'tabpanel', 'aria-labelledby'=>'create_tab'}
19
- %h3= t('label_ldap')
20
- = render 'egov_utils/users/ldap_search'
21
- #create.tab-pane.fade{role: 'tabpanel', 'aria-labelledby'=>'create_tab'}
22
- %h3= t('label_new')
23
- = bootstrap_form_for(@new_user) do |f|
24
- = render 'egov_utils/users/form', form: f
25
- .form-actions
26
- = f.submit
3
+ = bootstrap_form_tag(url: egov_utils.users_path, method: :get, layout: :inline) do |f|
4
+ .form-group
5
+ = f.text_field :search, value: params[:search], label: false, placeholder: t('label_search'), skip_label: true
6
+ = f.submit 'Vyhledat', class: 'btn btn-primary btn-sm'
7
+
8
+ %table.table.table-striped
9
+ %thead
10
+ %th= EgovUtils::User.human_attribute_name('fullname')
11
+ %th= EgovUtils::User.human_attribute_name('provider')
12
+ %th= EgovUtils::User.human_attribute_name('roles')
13
+ %th= EgovUtils::User.human_attribute_name('groups')
14
+ %th= t('label_actions')
15
+ %tbody
16
+ - if @entities.empty?
17
+ %tr
18
+ %td{colspan: 4}= t('label_no_entries')
19
+ - @entities.each do |user|
20
+ %tr
21
+ %td
22
+ %div= user.fullname
23
+ %small= user.login
24
+ %td= 'LDAP' if user.provider
25
+ %td= user.all_role_names.map { I18n.t("roles.#{_1}") }.join(', ')
26
+ %td= user.groups.map(&:name).join(', ')
27
+ %td
28
+ - unless user.active?
29
+ = button_to(t('label_approve'), approve_user_path(user), class: 'btn btn-primary btn-sm')
30
+ - if can?(:edit, user)
31
+ = link_to(t('label_edit'), edit_user_path(user), class: 'btn btn-secondary btn-sm')
32
+ - if can?(:delete, user)
33
+ - if user.deleted?
34
+ = button_to(t('label_unarchive'), unarchive_user_path(user), method: :patch, class: 'btn btn-danger btn-sm')
35
+ - else
36
+ = button_to(t('label_archive'), user_path(user), method: :delete, class: 'btn btn-danger btn-sm')
37
+
38
+ .row
39
+ .col-md-4
40
+ = page_entries_info @entities
41
+ .col-md-4
42
+ = paginate @entities
43
+ .col-md-4
@@ -42,6 +42,7 @@ cs:
42
42
  notice_signeup_with_mail: Registrace proběhla úspěšně, byl Vám odeslán potvrzovací e-mail, prosím zkontrolujte svou poštu.
43
43
  notice_password_changed: Heslo bylo úspěšně změněno
44
44
  notice_reset_email_sent: E-mail s instrukcemi pro změnu hesla byl odeslán na zadanou e-mailovou adresu.
45
+ notice_pw_reset_not_possible: Není možné resetovat heslo, protože váš účet je spravován mimo databázi aplikace VTS. Vaše přihlašovací heslo je stejné jako do ostatních systémů MSp. V případě nutnosti se, prosím, obraťte na technickou podporu Vaší organizace.
45
46
  success_user_confirm: Váše e-mailová adresa byla potvrzena. Nyní se již můžete přihlásit.
46
47
  error_password_expired: Platnost vašeho hesla vypršela. Prosím změňte ho.
47
48
  warning_password_not_changed: Heslo nebylo změněno, zadali jste všechna hesla správně?
@@ -68,6 +69,9 @@ cs:
68
69
  label_add_group_member: Přidat uživatele
69
70
  label_forgotten_password: Zapomněli jste heslo?
70
71
  label_reset_password: Obnova hesla
72
+ label_archive: Archivovat
73
+ label_unarchive: Obnovit
74
+ label_registration_request: Zažádat o přístup
71
75
 
72
76
  text_born_on_at: "Narozen %{date} v %{place}"
73
77
 
@@ -80,17 +84,22 @@ cs:
80
84
  models: &my_models
81
85
  egov_utils/user:
82
86
  one: Uživatel
83
- other: Uživatelé
87
+ few: Uživatelé
88
+ other: Uživatelů
84
89
  egov_utils/group:
85
90
  one: Skupina
86
- other: Skupiny
91
+ few: Skupiny
92
+ other: Skupin
87
93
  egov_utils/address:
88
94
  one: Adresa
89
- other: Adresy
95
+ few: Adresy
96
+ other: Adres
90
97
 
91
98
  model_attributes: &my_attributes
92
99
  egov_utils/user:
93
100
  days_before_inactive: Počet dní od posledního přihlášení před deaktivací
101
+ days_before_archive: Počet dní od deaktivace před automatickou archivací
102
+ groups: Skupiny
94
103
  login: Přihlašovací email
95
104
  mail: E-mail
96
105
  password_confirmation: Potvrzení hesla
@@ -98,8 +107,10 @@ cs:
98
107
  lastname: Příjmení
99
108
  fullname: Jméno a příjmení
100
109
  roles: Role
110
+ provider: Typ
101
111
  generate_password: Generovat heslo
102
112
  egov_utils/group:
113
+ name: 'Název'
103
114
  roles: Role
104
115
  egov_utils/address:
105
116
  full_address: Adresa
@@ -131,6 +142,17 @@ cs:
131
142
  name: Název
132
143
  ico: IČO
133
144
  legal_form: Právní forma
145
+ egov_utils/registration_request:
146
+ mail: E-mail
147
+ firstname: Jméno
148
+ lastname: Příjmení
149
+ organization: Organizace
150
+ note: Poznámka
151
+ created_at: Vytvořeno
152
+ status: Status
153
+ fullname: Jméno
154
+ reason: Odůvodnění
155
+ internal_reason: Interní poznámka
134
156
 
135
157
  models_errors: &my_model_errors
136
158
  profile:
@@ -139,6 +161,7 @@ cs:
139
161
  model_help_messages: &my_help_messages
140
162
  egov_utils/user:
141
163
  days_before_inactive: Pokud ponecháte pole prázdné, uživatelský účet nebude expirovat.
164
+ days_before_archive: Pokud ponecháte pole prázdné, uživatelský účet nebude expirovat.
142
165
  generate_password: Heslo bude vygenerováno a posláno uživateli na e-mail, při prvním přihlášení bude heslo muset změnit.
143
166
 
144
167
 
@@ -156,6 +179,8 @@ cs:
156
179
  mail: E-mailová adresa
157
180
 
158
181
  submits: &my_submits
182
+ group:
183
+ update: 'Aktualizovat skupinu'
159
184
  user:
160
185
  update: Aktualizovat uživatele
161
186
  password_change:
@@ -181,8 +206,13 @@ cs:
181
206
  created: "%{model} úspěšně vytvořen"
182
207
  updated: "%{model} úspěšně aktualizován"
183
208
  destroyed: "%{model} úspěšně smazán"
209
+ unarchived: "%{model} úspěšně obnoven"
184
210
 
185
211
  helpers:
212
+ action:
213
+ egov_utils:
214
+ group:
215
+ new: 'Nová skupina'
186
216
  label:
187
217
  <<: *my_labels
188
218
  submit:
@@ -196,3 +226,51 @@ cs:
196
226
  in_past: Musí být v minulosti
197
227
  after_1920: Musí být po roce 1920
198
228
  fileuid_format: Nesprávný tvar spisové značky
229
+
230
+ egov_utils:
231
+ current_users:
232
+ edit:
233
+ title: Úprava profilu
234
+ password_change: Změna hesla
235
+ password_change_note: Pokud necháte pole prázdná, heslo nebude aktualizováno.
236
+ groups:
237
+ edit:
238
+ title: 'Úprava skupiny'
239
+ registration_requests:
240
+ new:
241
+ title: 'Žádost o registraci'
242
+ index:
243
+ show: 'Detail žádosti'
244
+ title: 'Žádosti o přístup do aplikace'
245
+ show:
246
+ title: 'Žádost o registraci - %{name}'
247
+ accept: 'Přijmout žádost'
248
+ reject: 'Odmítnout žádost'
249
+ sessions:
250
+ new:
251
+ registration_request: 'Žádost o registraci'
252
+ users:
253
+ edit:
254
+ title: Úprava uživatele
255
+ password_change: Změna hesla
256
+ password_change_note: Pokud necháte pole prázdná, heslo nebude aktualizováno.
257
+ registration_request:
258
+ statuses:
259
+ pending: K vyřízení
260
+ accepted: Schválen
261
+ rejected: Zamítnut
262
+ create:
263
+ success: 'Žádost o registraci úspěšně vytvořena. Váš požadavek bude vyřízen v nejbližších dnech.'
264
+ update:
265
+ success: 'Žádost úspěšně uložena'
266
+
267
+ mailers:
268
+ registration_requests:
269
+ created:
270
+ subject: 'Žádost o vytvoření účtu v aplikaci VTS přijata'
271
+ accepted:
272
+ subject: 'Žádost o vytvoření účtu v aplikaci VTS schválena'
273
+ auto_accepted:
274
+ subject: 'Žádost o vytvoření účtu v aplikaci VTS přijata'
275
+ rejected:
276
+ subject: 'Žádost o vytvoření účtu v aplikaci VTS odmítnuta'
data/config/routes.rb CHANGED
@@ -10,7 +10,10 @@ EgovUtils::Engine.routes.draw do
10
10
  get :search, on: :collection
11
11
  post :approve, on: :member
12
12
  get :confirm, on: :member
13
+ patch :unarchive, on: :member
13
14
  end
15
+ resource :current_user, only: %i[edit update]
16
+ resources :registration_requests, only: %i[new create show index update]
14
17
 
15
18
  resources :people do
16
19
  get :addresses
@@ -24,7 +27,7 @@ EgovUtils::Engine.routes.draw do
24
27
  end
25
28
  resources :roles
26
29
 
27
- resources :passwords, only: [:index, :edit, :update] do
30
+ resources :passwords, only: %i[index edit update] do
28
31
  collection do
29
32
  get 'reset'
30
33
  post 'send_reset_token'
@@ -38,6 +41,8 @@ EgovUtils::Engine.routes.draw do
38
41
  get '/address/validate_ruian' => 'addresses#validate_ruian', as: :validate_ruian
39
42
  get '/organizations/district_courts' => 'organizations#district_courts', as: :district_courts_organizations
40
43
 
44
+ resource :settings, only: %i[show update]
45
+
41
46
  namespace :redmine do
42
47
  resources :issues, only: :index
43
48
  end
@@ -0,0 +1,6 @@
1
+ class AddDeletedAtToEgovUtilsUsers < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :egov_utils_users, :deleted_at, :datetime
4
+ add_index :egov_utils_users, :deleted_at
5
+ end
6
+ end
@@ -0,0 +1,16 @@
1
+ class CreateEgovUtilsRegistrationRequests < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :egov_utils_registration_requests do |t|
4
+ t.string :mail
5
+ t.string :firstname
6
+ t.string :lastname
7
+ t.string :organization
8
+ t.string :note
9
+ t.string :status
10
+ t.string :reason
11
+ t.string :internal_reason
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ class AddDaysBeforeArchiveToEgovUtilsUsers < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :egov_utils_users, :days_before_archive, :integer, default: 30
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-24 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '5.1'
61
+ - !ruby/object:Gem::Dependency
62
+ name: active_interaction
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: haml
63
77
  requirement: !ruby/object:Gem::Requirement
@@ -510,11 +524,13 @@ files:
510
524
  - app/attributes/egov_utils/region.rb
511
525
  - app/controllers/egov_utils/addresses_controller.rb
512
526
  - app/controllers/egov_utils/application_controller.rb
527
+ - app/controllers/egov_utils/current_users_controller.rb
513
528
  - app/controllers/egov_utils/groups_controller.rb
514
529
  - app/controllers/egov_utils/organizations_controller.rb
515
530
  - app/controllers/egov_utils/passwords_controller.rb
516
531
  - app/controllers/egov_utils/people_controller.rb
517
532
  - app/controllers/egov_utils/redmine/issues_controller.rb
533
+ - app/controllers/egov_utils/registration_requests_controller.rb
518
534
  - app/controllers/egov_utils/roles_controller.rb
519
535
  - app/controllers/egov_utils/sessions_controller.rb
520
536
  - app/controllers/egov_utils/users_controller.rb
@@ -525,7 +541,9 @@ files:
525
541
  - app/helpers/egov_utils/roles_helper.rb
526
542
  - app/helpers/egov_utils/users_helper.rb
527
543
  - app/jobs/egov_utils/application_job.rb
544
+ - app/jobs/egov_utils/registration_requests/check_auto_accept_job.rb
528
545
  - app/mailers/egov_utils/application_mailer.rb
546
+ - app/mailers/egov_utils/registration_request_mailer.rb
529
547
  - app/mailers/egov_utils/user_mailer.rb
530
548
  - app/models/ability.rb
531
549
  - app/models/egov_utils/abstract_person.rb
@@ -538,6 +556,7 @@ files:
538
556
  - app/models/egov_utils/natural_person.rb
539
557
  - app/models/egov_utils/person.rb
540
558
  - app/models/egov_utils/principal.rb
559
+ - app/models/egov_utils/registration_request.rb
541
560
  - app/models/egov_utils/user.rb
542
561
  - app/resources/egov_utils/legal_form.rb
543
562
  - app/resources/egov_utils/love.rb
@@ -549,7 +568,12 @@ files:
549
568
  - app/schemas/egov_utils/natural_person_schema.rb
550
569
  - app/schemas/egov_utils/person_schema.rb
551
570
  - app/schemas/egov_utils/user_schema.rb
571
+ - app/services/egov_utils/archive_users.rb
572
+ - app/services/egov_utils/refresh_groups.rb
552
573
  - app/services/egov_utils/refresh_user_groups.rb
574
+ - app/services/egov_utils/registration_requests/check_auto_accept.rb
575
+ - app/services/egov_utils/registration_requests/create.rb
576
+ - app/services/egov_utils/registration_requests/handle_request.rb
553
577
  - app/validators/birthday_validator.rb
554
578
  - app/validators/email_validator.rb
555
579
  - app/validators/fileuid_validator.rb
@@ -559,9 +583,12 @@ files:
559
583
  - app/views/common/_modal.html.haml
560
584
  - app/views/common/modal_action.js.erb
561
585
  - app/views/egov_utils/addresses/_form.html.haml
586
+ - app/views/egov_utils/current_users/edit.html.haml
562
587
  - app/views/egov_utils/groups/_form.html.haml
563
588
  - app/views/egov_utils/groups/_groups_tab.html.haml
589
+ - app/views/egov_utils/groups/edit.html.haml
564
590
  - app/views/egov_utils/groups/index.html.haml
591
+ - app/views/egov_utils/groups/new.html.haml
565
592
  - app/views/egov_utils/groups/new_users.html.haml
566
593
  - app/views/egov_utils/groups/show.html.haml
567
594
  - app/views/egov_utils/passwords/edit.html.haml
@@ -569,6 +596,13 @@ files:
569
596
  - app/views/egov_utils/passwords/reset.html.haml
570
597
  - app/views/egov_utils/people/_form.html.haml
571
598
  - app/views/egov_utils/redmine/issues/index.html.haml
599
+ - app/views/egov_utils/registration_request_mailer/accepted.html.erb
600
+ - app/views/egov_utils/registration_request_mailer/auto_accepted.html.erb
601
+ - app/views/egov_utils/registration_request_mailer/created.html.erb
602
+ - app/views/egov_utils/registration_request_mailer/rejected.html.erb
603
+ - app/views/egov_utils/registration_requests/index.html.haml
604
+ - app/views/egov_utils/registration_requests/new.html.haml
605
+ - app/views/egov_utils/registration_requests/show.html.haml
572
606
  - app/views/egov_utils/roles/index.html.haml
573
607
  - app/views/egov_utils/sessions/new.html.haml
574
608
  - app/views/egov_utils/user_mailer/account_information.html.erb
@@ -617,6 +651,9 @@ files:
617
651
  - db/migrate/20180424143207_add_titles_to_natural_people.rb
618
652
  - db/migrate/20220331113917_add_days_before_inactive_to_egov_utils_users.rb
619
653
  - db/migrate/20220624070709_migrate_person_residence_to_addresses.rb
654
+ - db/migrate/20230407114921_add_deleted_at_to_egov_utils_users.rb
655
+ - db/migrate/20230408123813_create_egov_utils_registration_requests.rb
656
+ - db/migrate/20230412063325_add_days_before_archive_to_egov_utils_users.rb
620
657
  - lib/azahara_schema_currency.rb
621
658
  - lib/azahara_schema_currency/aggregation_attribute_patch.rb
622
659
  - lib/azahara_schema_currency/association_attribute_patch.rb