katalyst-koi 5.3.0 → 5.4.0

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/katalyst/koi.esm.js +9 -19
  3. data/app/assets/builds/katalyst/koi.js +9 -19
  4. data/app/assets/builds/katalyst/koi.min.js +1 -1
  5. data/app/assets/builds/katalyst/koi.min.js.map +1 -1
  6. data/app/assets/stylesheets/koi/blocks/index.css +1 -0
  7. data/app/assets/stylesheets/koi/{login.css → blocks/roadblock.css} +8 -5
  8. data/app/components/koi/tables/cells/attachment_component.rb +1 -1
  9. data/app/controllers/admin/admin_users_controller.rb +2 -2
  10. data/app/controllers/admin/credentials_controller.rb +32 -51
  11. data/app/controllers/admin/otps_controller.rb +5 -17
  12. data/app/controllers/admin/profiles_controller.rb +31 -0
  13. data/app/controllers/admin/sessions_controller.rb +9 -3
  14. data/app/controllers/admin/tokens_controller.rb +6 -2
  15. data/app/controllers/concerns/koi/controller/has_webauthn.rb +53 -9
  16. data/app/javascript/koi/controllers/webauthn_authentication_controller.js +1 -1
  17. data/app/javascript/koi/controllers/webauthn_registration_controller.js +8 -18
  18. data/app/models/admin/credential.rb +4 -0
  19. data/app/views/admin/admin_users/edit.html.erb +3 -1
  20. data/app/views/admin/admin_users/show.html.erb +3 -0
  21. data/app/views/admin/credentials/_credentials.html.erb +8 -5
  22. data/app/views/admin/credentials/new.html.erb +32 -41
  23. data/app/views/admin/credentials/show.html.erb +19 -0
  24. data/app/views/admin/otps/_form.html.erb +1 -1
  25. data/app/views/admin/{admin_users/_form.html+self.erb → profiles/_form.html.erb} +1 -1
  26. data/app/views/admin/{admin_users/edit.html+self.erb → profiles/edit.html.erb} +0 -1
  27. data/app/views/admin/{admin_users/show.html+self.erb → profiles/show.html.erb} +15 -10
  28. data/app/views/admin/sessions/new.html.erb +26 -27
  29. data/app/views/admin/sessions/otp.html.erb +13 -5
  30. data/app/views/admin/sessions/password.html.erb +16 -8
  31. data/app/views/admin/tokens/show.html.erb +12 -8
  32. data/app/views/layouts/koi/_application_navigation.html.erb +13 -9
  33. data/app/views/layouts/koi/application.html.erb +19 -10
  34. data/config/locales/koi.en.yml +0 -1
  35. data/config/routes.rb +14 -9
  36. data/lib/generators/koi/helpers/resource_helpers.rb +1 -1
  37. data/lib/koi/config.rb +2 -1
  38. data/lib/koi/engine.rb +1 -0
  39. metadata +21 -9
  40. data/app/views/admin/credentials/_credentials.html+self.erb +0 -12
  41. data/app/views/admin/credentials/create.turbo_stream.erb +0 -5
  42. data/app/views/admin/credentials/destroy.turbo_stream.erb +0 -5
  43. data/app/views/layouts/koi/login.html.erb +0 -50
@@ -58,7 +58,7 @@ module Koi
58
58
  private
59
59
 
60
60
  def archivable?
61
- model_class&.included_modules&.include?(Koi::Model::Archivable)
61
+ model_class&.include?(Koi::Model::Archivable)
62
62
  end
63
63
 
64
64
  def orderable?
data/lib/koi/config.rb CHANGED
@@ -12,7 +12,8 @@ module Koi
12
12
  :document_mime_types,
13
13
  :document_size_limit,
14
14
  :image_mime_types,
15
- :image_size_limit
15
+ :image_size_limit,
16
+ :site_name
16
17
 
17
18
  def initialize
18
19
  @admin_name = "Koi"
data/lib/koi/engine.rb CHANGED
@@ -10,6 +10,7 @@ require "rotp"
10
10
  require "rqrcode"
11
11
  require "stimulus-rails"
12
12
  require "turbo-rails"
13
+ require "useragent"
13
14
  require "webauthn"
14
15
 
15
16
  module Koi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-koi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -107,6 +107,20 @@ dependencies:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: useragent
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
110
124
  - !ruby/object:Gem::Dependency
111
125
  name: webauthn
112
126
  requirement: !ruby/object:Gem::Requirement
@@ -282,6 +296,7 @@ files:
282
296
  - app/assets/stylesheets/koi/blocks/page-header.css
283
297
  - app/assets/stylesheets/koi/blocks/pagy.css
284
298
  - app/assets/stylesheets/koi/blocks/prose.css
299
+ - app/assets/stylesheets/koi/blocks/roadblock.css
285
300
  - app/assets/stylesheets/koi/blocks/tables/index.css
286
301
  - app/assets/stylesheets/koi/blocks/tables/query.css
287
302
  - app/assets/stylesheets/koi/blocks/tables/table.css
@@ -316,7 +331,6 @@ files:
316
331
  - app/assets/stylesheets/koi/global/variables.css
317
332
  - app/assets/stylesheets/koi/icons.css
318
333
  - app/assets/stylesheets/koi/index.css
319
- - app/assets/stylesheets/koi/login.css
320
334
  - app/assets/stylesheets/koi/utilities/index.css
321
335
  - app/assets/stylesheets/koi/utilities/visually-hidden.css
322
336
  - app/components/concerns/koi/tables/cells.rb
@@ -343,6 +357,7 @@ files:
343
357
  - app/controllers/admin/credentials_controller.rb
344
358
  - app/controllers/admin/dashboards_controller.rb
345
359
  - app/controllers/admin/otps_controller.rb
360
+ - app/controllers/admin/profiles_controller.rb
346
361
  - app/controllers/admin/sessions_controller.rb
347
362
  - app/controllers/admin/tokens_controller.rb
348
363
  - app/controllers/admin/url_rewrites_controller.rb
@@ -383,24 +398,22 @@ files:
383
398
  - app/models/concerns/koi/model/otp.rb
384
399
  - app/models/url_rewrite.rb
385
400
  - app/models/well_known.rb
386
- - app/views/admin/admin_users/_form.html+self.erb
387
401
  - app/views/admin/admin_users/_form.html.erb
388
402
  - app/views/admin/admin_users/archived.html.erb
389
- - app/views/admin/admin_users/edit.html+self.erb
390
403
  - app/views/admin/admin_users/edit.html.erb
391
404
  - app/views/admin/admin_users/index.html.erb
392
405
  - app/views/admin/admin_users/new.html.erb
393
- - app/views/admin/admin_users/show.html+self.erb
394
406
  - app/views/admin/admin_users/show.html.erb
395
- - app/views/admin/credentials/_credentials.html+self.erb
396
407
  - app/views/admin/credentials/_credentials.html.erb
397
- - app/views/admin/credentials/create.turbo_stream.erb
398
- - app/views/admin/credentials/destroy.turbo_stream.erb
399
408
  - app/views/admin/credentials/new.html.erb
409
+ - app/views/admin/credentials/show.html.erb
400
410
  - app/views/admin/dashboards/show.html.erb
401
411
  - app/views/admin/otps/_form.html.erb
402
412
  - app/views/admin/otps/create.turbo_stream.erb
403
413
  - app/views/admin/otps/new.html.erb
414
+ - app/views/admin/profiles/_form.html.erb
415
+ - app/views/admin/profiles/edit.html.erb
416
+ - app/views/admin/profiles/show.html.erb
404
417
  - app/views/admin/sessions/new.html.erb
405
418
  - app/views/admin/sessions/otp.html.erb
406
419
  - app/views/admin/sessions/password.html.erb
@@ -433,7 +446,6 @@ files:
433
446
  - app/views/layouts/koi/_navigation_item.html.erb
434
447
  - app/views/layouts/koi/application.html.erb
435
448
  - app/views/layouts/koi/frame.html.erb
436
- - app/views/layouts/koi/login.html.erb
437
449
  - config/brakeman.ignore
438
450
  - config/importmap.rb
439
451
  - config/initializers/extensions.rb
@@ -1,12 +0,0 @@
1
- <%# locals: (admin_user:) %>
2
-
3
- <%= table_with(id: dom_id(admin_user, :credentials), collection: admin_user.credentials) do |table, credential| %>
4
- <% table.text :nickname, label: "Name" %>
5
- <% table.date :updated_at, label: "Last use" do |date| %>
6
- <%= date unless credential.created_at == credential.updated_at %>
7
- <% end %>
8
- <% table.cell :actions, label: "" do %>
9
- <%= link_to("Remove passkey", admin_admin_user_credential_path(admin_user, credential),
10
- data: { turbo_method: :delete }) %>
11
- <% end %>
12
- <% end %>
@@ -1,5 +0,0 @@
1
- <%# locals: (admin_user:) %>
2
-
3
- <%= turbo_stream.replace(dom_id(admin_user, :credentials)) do %>
4
- <%= render "admin/credentials/credentials", admin_user: %>
5
- <% end %>
@@ -1,5 +0,0 @@
1
- <%# locals: (admin_user:) %>
2
-
3
- <%= turbo_stream.replace(dom_id(admin_user, :credentials)) do %>
4
- <%= render "admin/credentials/credentials", admin_user: %>
5
- <% end %>
@@ -1,50 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
-
6
- <!-- title -->
7
- <title><%= Koi.config.admin_name %></title>
8
-
9
- <!-- meta -->
10
- <%= csrf_meta_tags %>
11
- <%= csp_meta_tag %>
12
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=0.6667">
13
- <meta name="robots" content="noindex,nofollow">
14
- <%= Koi::Release.meta_tags(self) %>
15
-
16
- <meta name="turbo-refresh-method" content="morph">
17
- <meta name="turbo-refresh-scroll" content="preserve">
18
- <%= yield :head %>
19
-
20
- <!-- fonts -->
21
- <%= preload_link_tag("koi/inter-variable-v4-1.woff2") %>
22
- <%= preload_link_tag("koi/inter-variable-v4-1-italic.woff2") %>
23
- <%= preload_link_tag("koi/inconsolata-v37-latin-regular.woff2") %>
24
-
25
- <!-- icons -->
26
- <%= favicon_link_tag("koi/logo.svg") %>
27
-
28
- <!-- styles -->
29
- <%= stylesheet_link_tag(path_to_stylesheet("koi/login.css"), "data-turbo-track": "reload") %>
30
- <%= stylesheet_link_tag(Koi.config.admin_stylesheet, "data-turbo-track": "reload") %>
31
-
32
- <!-- scripts -->
33
- <%= javascript_importmap_tags(Koi.config.admin_javascript_entry_point) %>
34
- </head>
35
- <body>
36
- <main class="cover" data-centered>
37
- <div class="login | modal">
38
- <div class="wrapper flow">
39
- <header>
40
- <icon aria-hidden="true" class="icon" data-icon="koi">&nbsp;</icon>
41
- <h1>Koi</h1>
42
- <h2 class="site-name"><%= URI.parse(root_url).host %></h2>
43
- </header>
44
-
45
- <%= yield %>
46
- </div>
47
- </div>
48
- </main>
49
- </body>
50
- </html>