solid_errors 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/solid_errors/errors_controller.rb +9 -3
- data/app/views/solid_errors/errors/_actions.html.erb +2 -2
- data/app/views/solid_errors/errors/_error.html.erb +1 -1
- data/app/views/solid_errors/errors/index.html.erb +0 -2
- data/lib/solid_errors/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eb4ed02d7765415bc5b1a719cc0a7e2e0b61b3a7cf174536300ab8c0fea18a2
|
4
|
+
data.tar.gz: 5bab7cc225b36530ba37a31a6fcabb29f12192fd62bfc56405164c374453bbcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd1e176b16aa361b52526d1e1612c048cf9638e33c87fa1196ef999b332c57d9356e88abdc76899705f3a828938ce8efbe50813d330e74f9ff0df11b4d4bcb8
|
7
|
+
data.tar.gz: bddc3ee8731021723630d9bfc25c207fd6317327a65df6c1201df15cc5e5df326f11bd22c24eade3007fbcdca07a757aaf49b1a9c41cf222b310fb32eed0a45f
|
@@ -4,11 +4,17 @@ module SolidErrors
|
|
4
4
|
|
5
5
|
# GET /errors
|
6
6
|
def index
|
7
|
+
errors_table = Error.arel_table
|
8
|
+
occurrences_table = Occurrence.arel_table
|
9
|
+
recent_occurrence = occurrences_table
|
10
|
+
.project(occurrences_table[:created_at].maximum)
|
11
|
+
.as('recent_occurrence')
|
12
|
+
|
7
13
|
@errors = Error.unresolved
|
8
14
|
.joins(:occurrences)
|
9
|
-
.select(
|
10
|
-
.group(
|
11
|
-
.order(
|
15
|
+
.select(errors_table[Arel.star], recent_occurrence)
|
16
|
+
.group(errors_table[:id])
|
17
|
+
.order(recent_occurrence: :desc)
|
12
18
|
end
|
13
19
|
|
14
20
|
# GET /errors/1
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<div class="inline-flex items-center justify-start flex-wrap gap-3 whitespace-nowrap">
|
2
2
|
<% if current_controller.errors? && !current_action.errors_index? %>
|
3
|
-
<%= link_to errors_path, class:
|
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
4
|
<%= bootstrap_svg "arrow-left" %>
|
5
5
|
<span>Back to errors</span>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
<%= button_to error_path(error), method: :patch, class:
|
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
10
|
Resolve Error<span class="sr-only"> #<%= error.id %></span>
|
11
11
|
<% end %>
|
12
12
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%= time_ago_in_words error.occurrences.maximum(:created_at), scope: 'datetime.distance_in_words.short' %>
|
18
18
|
</td>
|
19
19
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3">
|
20
|
-
<%= button_to error_path(error), method: :patch, class:
|
20
|
+
<%= 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 %>
|
21
21
|
Resolve<span class="sr-only">, Error #<%= error.id %></span>
|
22
22
|
<% end %>
|
23
23
|
</td>
|
data/lib/solid_errors/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solid_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|