easy-admin-rails 0.2.2 → 0.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87d3c4867f51a6c89bd00852824be9345c18dbac643010d91bbbcaed411eb683
4
- data.tar.gz: f37721aeeebfc654554f1d544b0f5a649ea4b764f36ae35a52b5993741c42b69
3
+ metadata.gz: 200c3fe21e8f5566d71ebdb3a33e3323f13a306b854d3b40eb1b0ae49967b7d5
4
+ data.tar.gz: be99b25d0ae753a87e3d3c8a1c660d4ee03174080f5aa80139c52650ea538353
5
5
  SHA512:
6
- metadata.gz: 9aaf3cba5a2b398313e7d916cb6be2d0754a3fff3ec7c8e31ff70c03638186f7656925d30c5f49150c20c5f27040202dc9625ae306d2daed331e089d86817157
7
- data.tar.gz: 95e1b5e2579cd2fe1a1aab49a2f92e2c5f2ffce0a2a7bb254c5f52044c161c133415a6df4e242380ca0c584ec760269600a988ec055e316858fa2ddc32469159
6
+ metadata.gz: eb4f2033bc990a07e5b92a93823637841b8de9b1c7bbfc7341ef626efbb483235aafbae6c0ebae6aec545f7172a41177ef6dd064d8ead0355b23f83663e77ff5
7
+ data.tar.gz: 158d1b41f51cd695ad7c034eae47e847a910a9eacb70c7f51a8260067f01d6732cb56547ccce545f01547b5dc4b3b7855bebc7462980ee12800a3a35abdfd9b7
@@ -110,11 +110,16 @@ module EasyAdmin
110
110
 
111
111
  respond_to do |format|
112
112
  format.html do
113
- flash[:alert] = error_message
114
-
115
- # Try to redirect back, fallback to dashboard
116
- redirect_path = request.referer&.start_with?(request.base_url) ? request.referer : easy_admin.root_path
117
- redirect_to redirect_path
113
+ # Check if this is a turbo_frame request (like inline editing)
114
+ if turbo_frame_request?
115
+ render template: 'easy_admin/application/authorization_failure', layout: false
116
+ else
117
+ flash[:alert] = error_message
118
+
119
+ # Try to redirect back, fallback to dashboard
120
+ redirect_path = request.referer&.start_with?(request.base_url) ? request.referer : easy_admin.root_path
121
+ redirect_to redirect_path
122
+ end
118
123
  end
119
124
 
120
125
  format.turbo_stream do
@@ -0,0 +1,9 @@
1
+ <turbo-frame id="modal">
2
+ <%= turbo_stream.update("notifications") do %>
3
+ <%== EasyAdmin::NotificationComponent.new(
4
+ type: :error,
5
+ message: @error_message,
6
+ title: "Access Denied"
7
+ ).call %>
8
+ <% end %>
9
+ </turbo-frame>
@@ -1,3 +1,3 @@
1
1
  module EasyAdmin
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy-admin-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slaurmagan
@@ -355,6 +355,7 @@ files:
355
355
  - app/models/easy_admin/application_record.rb
356
356
  - app/policies/admin_user_policy.rb
357
357
  - app/policies/application_policy.rb
358
+ - app/views/easy_admin/application/authorization_failure.html.erb
358
359
  - app/views/easy_admin/application/authorization_failure.turbo_stream.erb
359
360
  - app/views/easy_admin/dashboard/index.html.erb
360
361
  - app/views/easy_admin/dashboards/card.html.erb
@@ -454,12 +455,12 @@ files:
454
455
  - lib/generators/easy_admin/templates/easy_admin.rb
455
456
  - lib/generators/easy_admin/templates/resource.rb
456
457
  - lib/tasks/easy_admin_tasks.rake
457
- homepage: https://github.com/yourusername/easy_admin
458
+ homepage: https://github.com/Slaurmagan/easy-admin
458
459
  licenses:
459
460
  - MIT
460
461
  metadata:
461
462
  allowed_push_host: https://rubygems.org
462
- homepage_uri: https://github.com/yourusername/easy_admin
463
+ homepage_uri: https://github.com/Slaurmagan/easy-admin
463
464
  source_code_uri: https://github.com/Slaurmagan/easy-admin
464
465
  changelog_uri: https://github.com/Slaurmagan/easy-admin/blob/main/CHANGELOG.md
465
466
  post_install_message: