solid_errors 0.2.9 → 0.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7dc7ddd54733287616461306eb9a3da6bd8bf2e247e5dc43fbb78ffd5f99940
4
- data.tar.gz: 2e299cfca4d4de770d2a39b9dbd06515df1a29f21b7b3423df6a738b7eb951d5
3
+ metadata.gz: '033943c98cec3b0ad1b2f5154c957ba896f2aa8c9deabb5928cd9dec42bae938'
4
+ data.tar.gz: 020f8653b236de3d3cd0128bccbe8b9998d790b92a562f8c65a55de717a996b2
5
5
  SHA512:
6
- metadata.gz: 427cd1279b123cbf039e9813cb829bae7416ae0a032671b7628deda001486c1a9652d83feee43b7375b2ad91d435406ef023718e0e9c1c96ee15cf36203c233e
7
- data.tar.gz: 60a96fa23c1d8bfa81a339d6e7c54c883fca07acf3fe571cab8decc167ad53aaa5330751333ffac1075691e0ff8e598bf1d1ad60547e5bdf3e9a2ca5278a2f68
6
+ metadata.gz: 042ef5b51655eb86a095a284db8bfc3714bd0d3ed56ddaf4883ea9ab3f48f269cf9de1a980d5addd46a00612770846d7b35cc331bd840a5bea936b9d328ea194
7
+ data.tar.gz: f2655775dcd4ce7e7ca32cdb25a663a3a42a71a8788dafa90a06f3f1857fe13a9df88df4320abc8c228050fb0748a45ec174080bdc5e7a88dea27d00e862f8b4
@@ -7,6 +7,11 @@ module SolidErrors
7
7
  warning: "⚠️",
8
8
  info: "ℹ️"
9
9
  }
10
+ SEVERITY_TO_BADGE_CLASSES = {
11
+ error: "bg-red-100 text-red-800",
12
+ warning: "bg-yellow-100 text-yellow-800",
13
+ info: "bg-blue-100 text-blue-800"
14
+ }
10
15
 
11
16
  has_many :occurrences, class_name: "SolidErrors::Occurrence", dependent: :destroy
12
17
 
@@ -20,5 +25,9 @@ module SolidErrors
20
25
  def emoji
21
26
  SEVERITY_TO_EMOJI[severity.to_sym]
22
27
  end
28
+
29
+ def badge_classes
30
+ "px-2 inline-flex text-[.75em] font-semibold rounded-md #{SEVERITY_TO_BADGE_CLASSES[severity.to_sym]}"
31
+ end
23
32
  end
24
33
  end
@@ -1,12 +1,16 @@
1
1
  <div class="inline-flex items-center justify-start flex-wrap gap-3 whitespace-nowrap">
2
- <% if current_controller.errors? && !current_action.errors_index? %>
3
- <%= link_to errors_path, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-gray-100 text-initial border-gray-300 hover:ring-gray-200 hover:ring-8" do %>
4
- <%= bootstrap_svg "arrow-left" %>
5
- <span>Back to errors</span>
6
- <% end %>
2
+ <%= link_to errors_path, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-gray-100 text-initial border-gray-300 hover:ring-gray-200 hover:ring-8" do %>
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
4
+ <path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/>
5
+ </svg>
6
+ <span>Back to errors</span>
7
7
  <% end %>
8
8
 
9
9
  <%= button_to error_path(error), method: :patch, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-transparent text-blue-500 border-blue-500 hover:ring-blue-200 hover:ring-8", params: { error: { resolved_at: Time.now } } do %>
10
- Resolve Error<span class="sr-only"> #<%= error.id %></span>
10
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-circle" viewBox="0 0 16 16">
11
+ <path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0"/>
12
+ <path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
13
+ </svg>
14
+ <span>Resolve Error<span class="sr-only"> #<%= error.id %></span></span>
11
15
  <% end %>
12
16
  </div>
@@ -60,7 +60,7 @@
60
60
  <%= SolidErrors::Error.human_attribute_name(:severity) %>
61
61
  </dt>
62
62
  <dd class="inline-flex items-center gap-1">
63
- <span class="<%= badge_classes %>">
63
+ <span class="<%= @error.badge_classes %>">
64
64
  <%= @error.severity %>
65
65
  </span>
66
66
  </dd>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidErrors
4
- VERSION = "0.2.9"
4
+ VERSION = "0.2.11"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim