maquina 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +163 -179
  5. data/app/controllers/concerns/maquina/authenticate.rb +33 -13
  6. data/app/controllers/concerns/maquina/resourceful.rb +1 -1
  7. data/app/controllers/maquina/first_runs_controller.rb +43 -0
  8. data/app/controllers/maquina/sessions_controller.rb +22 -25
  9. data/app/helpers/maquina/application_helper.rb +3 -5
  10. data/app/models/concerns/maquina/searchable.rb +4 -0
  11. data/app/models/maquina/organization.rb +2 -0
  12. data/app/models/maquina/user.rb +2 -0
  13. data/app/views/layouts/maquina/sessions.html.erb +6 -4
  14. data/app/views/maquina/accept_invitations/new_view.rb +1 -1
  15. data/app/views/maquina/application/alert.rb +4 -4
  16. data/app/views/maquina/application/components/action_text_component.rb +1 -1
  17. data/app/views/maquina/application/components/checkbox_component.rb +1 -1
  18. data/app/views/maquina/application/components/date_component.rb +1 -1
  19. data/app/views/maquina/application/components/file_component.rb +1 -1
  20. data/app/views/maquina/application/components/input_component.rb +1 -1
  21. data/app/views/maquina/application/components/select_component.rb +1 -1
  22. data/app/views/maquina/application/components/text_area_component.rb +1 -1
  23. data/app/views/maquina/application/edit.rb +1 -1
  24. data/app/views/maquina/application/form.rb +1 -1
  25. data/app/views/maquina/application/index_header.rb +1 -1
  26. data/app/views/maquina/application/index_modal.rb +1 -1
  27. data/app/views/maquina/application/index_table.rb +1 -1
  28. data/app/views/maquina/application/new.rb +1 -1
  29. data/app/views/maquina/application/sessions_header.rb +5 -3
  30. data/app/views/maquina/application_view.rb +1 -1
  31. data/app/views/maquina/first_runs/form.rb +28 -0
  32. data/app/views/maquina/first_runs/show.html.erb +5 -0
  33. data/app/views/maquina/form.rb +44 -0
  34. data/app/views/maquina/navbar/menu.rb +1 -1
  35. data/app/views/maquina/navbar/menu_item_link.rb +1 -1
  36. data/app/views/maquina/navbar/mobile_button.rb +1 -1
  37. data/app/views/maquina/navbar/mobile_menu.rb +1 -1
  38. data/app/views/maquina/navbar/notification.rb +1 -1
  39. data/app/views/maquina/navbar/profile.rb +1 -1
  40. data/app/views/maquina/navbar/profile_button.rb +1 -1
  41. data/app/views/maquina/navbar/profile_menu.rb +1 -1
  42. data/app/views/maquina/navbar/profile_menu_item_link.rb +1 -1
  43. data/app/views/maquina/navbar/search.rb +1 -1
  44. data/app/views/maquina/navbar/title.rb +1 -1
  45. data/app/views/maquina/sessions/form.rb +3 -4
  46. data/app/views/maquina/sessions/new.html.erb +1 -4
  47. data/config/importmap.rb +7 -6
  48. data/config/locales/flash.es.yml +14 -5
  49. data/config/locales/forms.es.yml +13 -1
  50. data/config/locales/models.es.yml +1 -0
  51. data/config/locales/views.es.yml +8 -0
  52. data/config/routes.rb +1 -0
  53. data/lib/generators/maquina/install_stimulus_controllers/install_stimulus_controllers_generator.rb +23 -0
  54. data/lib/maquina/version.rb +1 -1
  55. data/lib/maquina.rb +2 -2
  56. metadata +31 -74
  57. data/app/views/maquina/sessions/create.turbo_stream.erb +0 -11
@@ -2,8 +2,8 @@ es:
2
2
  flash:
3
3
  create:
4
4
  notice:
5
- title: Se creó con éxito
6
- description: Tú registro fue creado
5
+ title: Se creó con éxito
6
+ description: Tú registro fue creado
7
7
  alert:
8
8
  title: No se pudo crear
9
9
  description: Revisa los mensajes del formulario para resolver el problema
@@ -11,7 +11,7 @@ es:
11
11
  update:
12
12
  notice:
13
13
  title: Se actualizó con éxito
14
- description: Tú registros fue actualizado
14
+ description: Tú registros fue actualizado
15
15
  alert:
16
16
  title: No se pudo actualizar
17
17
  description: Revisa los mensajes del formulario para resolver el problema
@@ -19,10 +19,10 @@ es:
19
19
  destroy:
20
20
  notice:
21
21
  title: Se eliminó con éxito
22
- description: Tú registro fue eliminado
22
+ description: Tú registro fue eliminado
23
23
  alert:
24
24
  title: No se puedo eliminar
25
- description: Revisa los mensajes del formulario para resolver el problema
25
+ description: Revisa los mensajes del formulario para resolver el problema
26
26
 
27
27
  maquina/invitation:
28
28
  create:
@@ -42,3 +42,12 @@ es:
42
42
  notice:
43
43
  title: Sesión terminada
44
44
  description: Para continuar debes iniciar sesión
45
+
46
+ first_runs:
47
+ create:
48
+ notice:
49
+ title: Cuenta de administrador creada
50
+ description: No olvides crear un plan de cuentas
51
+ alert:
52
+ title: No se pudo crear la cuenta de administrador
53
+ description: Verifica que la contraseña sea robusta
@@ -27,13 +27,18 @@ es:
27
27
  maquina/invitation:
28
28
  email: Correo electrónico del usuario
29
29
 
30
+ first_runs:
31
+ email: admin@aoorora.com
32
+
30
33
  help:
31
34
  maquina/plan:
32
- name: Nombre del plan
35
+ name: Nombre del plan
33
36
  trial: Número de días de prueba
34
37
  price: Precio del plan
35
38
  free: Indica si el plan es gratuito
36
39
  active: Activar plan para clientes
40
+ first_runs:
41
+ password: Utilize una contraseña robusta. La contraseña debe contener al menos 8 caracteres, incluyendo letras mayúsculas y minúsculas, números y caracteres especiales.
37
42
 
38
43
  helpers:
39
44
  cancel: Cancelar
@@ -45,6 +50,9 @@ es:
45
50
  maquina/invitation:
46
51
  create: Enviar invitación
47
52
 
53
+ first_runs:
54
+ create: Crear cuenta de administrador
55
+
48
56
  maxlength:
49
57
  default: 30
50
58
 
@@ -53,6 +61,10 @@ es:
53
61
  trial: 3
54
62
  price: 9
55
63
 
64
+ first_runs:
65
+ email: 60
66
+ password: 30
67
+
56
68
  sessions:
57
69
  email: 60
58
70
  password: 60
@@ -22,6 +22,7 @@ es:
22
22
  email: Correo electrónico
23
23
  blocked_at: Bloqueado desde
24
24
  created_at: Creado el
25
+ password: Contraseña
25
26
  maquina/invitation:
26
27
  email: Correo electrónico
27
28
 
@@ -31,6 +31,14 @@ es:
31
31
  search: Buscar
32
32
 
33
33
  maquina:
34
+ application:
35
+ first_runs_header:
36
+ title: Bienvenido a maquina
37
+ description: Crea tu primera cuenta de administrador
38
+
39
+ sessions_header:
40
+ title: Iniciar sesión
41
+
34
42
  sessions:
35
43
  new:
36
44
  title: Iniciar sesión a tu cuenta
data/config/routes.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  Maquina::Engine.routes.draw do
4
4
  resource :unauthorized, controller: :unauthorized, only: [:show]
5
5
 
6
+ resource :first_run, only: [:show, :create]
6
7
  resource :sessions, path: I18n.t("routes.sessions"), only: [:new, :create, :destroy]
7
8
  resource :multifactor, only: [:new, :create]
8
9
 
@@ -0,0 +1,23 @@
1
+ module Maquina
2
+ module Generators
3
+ class InstallStimulusControllersGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../../../../app/assets/javascripts/maquina/controllers", __FILE__)
5
+
6
+ def copy_stimulus_controllers
7
+ Dir.glob(File.join(engine_views_path, "*_controller.js")) do |file|
8
+ copy_file file, File.join(app_views_path, File.basename(file))
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def engine_views_path
15
+ @engine_views_path ||= File.join(Maquina::Engine.root, "app", "assets", "javascripts", "maquina", "controllers")
16
+ end
17
+
18
+ def app_views_path
19
+ @app_views_path ||= File.join(Rails.root, "app", "javascript", "controllers")
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module Maquina
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.1"
3
3
  end
data/lib/maquina.rb CHANGED
@@ -26,9 +26,9 @@ module Maquina
26
26
  @temporary_block = 5.minutes
27
27
  @session_expiration = 2.days
28
28
  @signin_attempts = 5
29
- @root_app_path = nil
29
+ @root_app_path = "/"
30
30
 
31
- @membership_roles = {admin: "admin", member: "member"}
31
+ @membership_roles = %w[admin member].index_by(&:itself)
32
32
 
33
33
  @importmap = Importmap::Map.new
34
34
  @importmap.draw(Engine.root.join("config/importmap.rb"))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maquina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Alberto Chávez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-20 00:00:00.000000000 Z
11
+ date: 2024-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,135 +28,118 @@ dependencies:
28
28
  name: bcrypt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.1.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.1.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: money-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.15.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.15.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: turbo-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.5.0
61
+ version: 2.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.5.0
68
+ version: 2.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: stimulus-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.3.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: importmap-rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.2.0
89
+ version: 2.0.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 1.2.0
96
+ version: 2.0.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: tailwindcss-rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 2.1.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: 2.1.0
111
- - !ruby/object:Gem::Dependency
112
- name: pg_search
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 2.3.0
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 2.3.0
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: phlex-rails
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - "~>"
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: 1.1.0
132
118
  type: :runtime
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - "~>"
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: 1.1.0
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: action_policy
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - "~>"
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: 0.6.0
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - "~>"
136
+ - - ">="
151
137
  - !ruby/object:Gem::Version
152
138
  version: 0.6.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rotp
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '6.2'
160
143
  - - ">="
161
144
  - !ruby/object:Gem::Version
162
145
  version: 6.2.1
@@ -164,9 +147,6 @@ dependencies:
164
147
  prerelease: false
165
148
  version_requirements: !ruby/object:Gem::Requirement
166
149
  requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '6.2'
170
150
  - - ">="
171
151
  - !ruby/object:Gem::Version
172
152
  version: 6.2.1
@@ -174,14 +154,14 @@ dependencies:
174
154
  name: pagy
175
155
  requirement: !ruby/object:Gem::Requirement
176
156
  requirements:
177
- - - "~>"
157
+ - - ">="
178
158
  - !ruby/object:Gem::Version
179
159
  version: '6.2'
180
160
  type: :runtime
181
161
  prerelease: false
182
162
  version_requirements: !ruby/object:Gem::Requirement
183
163
  requirements:
184
- - - "~>"
164
+ - - ">="
185
165
  - !ruby/object:Gem::Version
186
166
  version: '6.2'
187
167
  - !ruby/object:Gem::Dependency
@@ -226,20 +206,6 @@ dependencies:
226
206
  - - ">="
227
207
  - !ruby/object:Gem::Version
228
208
  version: '0'
229
- - !ruby/object:Gem::Dependency
230
- name: solargraph-rails
231
- requirement: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: '0'
236
- type: :development
237
- prerelease: false
238
- version_requirements: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - ">="
241
- - !ruby/object:Gem::Version
242
- version: '0'
243
209
  - !ruby/object:Gem::Dependency
244
210
  name: brakeman
245
211
  requirement: !ruby/object:Gem::Requirement
@@ -254,20 +220,6 @@ dependencies:
254
220
  - - ">="
255
221
  - !ruby/object:Gem::Version
256
222
  version: '0'
257
- - !ruby/object:Gem::Dependency
258
- name: ruby-lsp
259
- requirement: !ruby/object:Gem::Requirement
260
- requirements:
261
- - - ">="
262
- - !ruby/object:Gem::Version
263
- version: '0'
264
- type: :development
265
- prerelease: false
266
- version_requirements: !ruby/object:Gem::Requirement
267
- requirements:
268
- - - ">="
269
- - !ruby/object:Gem::Version
270
- version: '0'
271
223
  - !ruby/object:Gem::Dependency
272
224
  name: bundle-audit
273
225
  requirement: !ruby/object:Gem::Requirement
@@ -290,6 +242,7 @@ extensions: []
290
242
  extra_rdoc_files: []
291
243
  files:
292
244
  - ".overmind.env"
245
+ - ".ruby-version"
293
246
  - Gemfile
294
247
  - Gemfile.lock
295
248
  - MIT-LICENSE
@@ -324,6 +277,7 @@ files:
324
277
  - app/controllers/maquina/accept_invitations_controller.rb
325
278
  - app/controllers/maquina/application_controller.rb
326
279
  - app/controllers/maquina/dashboard_controller.rb
280
+ - app/controllers/maquina/first_runs_controller.rb
327
281
  - app/controllers/maquina/invitations_controller.rb
328
282
  - app/controllers/maquina/plans_controller.rb
329
283
  - app/controllers/maquina/sessions_controller.rb
@@ -388,6 +342,9 @@ files:
388
342
  - app/views/maquina/application/update.turbo_stream.erb
389
343
  - app/views/maquina/application_view.rb
390
344
  - app/views/maquina/dashboard/index.html.erb
345
+ - app/views/maquina/first_runs/form.rb
346
+ - app/views/maquina/first_runs/show.html.erb
347
+ - app/views/maquina/form.rb
391
348
  - app/views/maquina/invitations/create.turbo_stream.erb
392
349
  - app/views/maquina/invitations/new.html.erb
393
350
  - app/views/maquina/navbar/menu.rb
@@ -401,7 +358,6 @@ files:
401
358
  - app/views/maquina/navbar/profile_menu_item_link.rb
402
359
  - app/views/maquina/navbar/search.rb
403
360
  - app/views/maquina/navbar/title.rb
404
- - app/views/maquina/sessions/create.turbo_stream.erb
405
361
  - app/views/maquina/sessions/form.rb
406
362
  - app/views/maquina/sessions/new.html.erb
407
363
  - app/views/maquina/unauthorized/401.html.erb
@@ -431,6 +387,7 @@ files:
431
387
  - db/migrate/20230829192656_create_maquina_memberships.rb
432
388
  - db/schema.rb
433
389
  - lib/generators/maquina/install_generator.rb
390
+ - lib/generators/maquina/install_stimulus_controllers/install_stimulus_controllers_generator.rb
434
391
  - lib/generators/maquina/install_templates/install_templates_generator.rb
435
392
  - lib/generators/maquina/tailwind_config/USAGE
436
393
  - lib/generators/maquina/tailwind_config/tailwind_config_generator.rb
@@ -466,7 +423,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
466
423
  - !ruby/object:Gem::Version
467
424
  version: '0'
468
425
  requirements: []
469
- rubygems_version: 3.5.1
426
+ rubygems_version: 3.5.18
470
427
  signing_key:
471
428
  specification_version: 4
472
429
  summary: Rails engine for building Rails applications.
@@ -1,11 +0,0 @@
1
- <%= turbo_stream.replace :form do %>
2
- <%= turbo_frame_tag :form do %>
3
- <%= render Maquina::Sessions::Form.new(OpenStruct.new(params.slice(:email, :password, :return_to))) %>
4
- <% end %>
5
- <% end %>
6
-
7
- <%= turbo_stream.replace :alert do %>
8
- <%= turbo_frame_tag :alert do %>
9
- <%= render Maquina::Application::Alert.new(flash) %>
10
- <% end %>
11
- <% end %>