Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthakumaran committed Jun 18, 2024
1 parent 780eb2e commit 8c6f185
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
fail-fast: false
matrix:
include:
- elixir: 1.12.3
otp: 24
- elixir: 1.13.4
otp: 24
check_warnings: true
check_format: true
- elixir: 1.14.3
otp: 25.2.1
- elixir: 1.16
otp: 26
check_warnings: true
check_format: true
steps:
Expand Down
16 changes: 11 additions & 5 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions lib/exq_ui_web/live/busy_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@
<td><%= job.pid %></td>
<td><%= job.payload.jid %></td>
<td>
<%= live_redirect(job.queue,
class: "nounderline",
to: Routes.queue_show_path(@socket, job.queue)
) %>
<.link class="nounderline" navigate={Routes.queue_show_path(@socket, job.queue)}>
<%= job.queue %>
</.link>
</td>
<td><%= job.payload.class %></td>
<td><%= inspect(job.payload.args) %></td>
Expand Down
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/dead_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ExqUIWeb.DeadLive.Index do
%{
header: "Last Failed",
accessor: fn item ->
live_redirect(human_time(item.scheduled_at),
live_link(human_time(item.scheduled_at),
to: Routes.dead_show_path(socket, item.score, item.id),
class: "nounderline"
)
Expand Down
7 changes: 3 additions & 4 deletions lib/exq_ui_web/live/queue_live/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
<tr>
<td>
<span>
<%= live_redirect(queue.name,
class: "nounderline",
to: Routes.queue_show_path(@socket, queue.name)
) %>
<.link class="nounderline" navigate={Routes.queue_show_path(@socket, queue.name)}>
<%= queue.name %>
</.link>
</span>
</td>
<td><%= queue.count %></td>
Expand Down
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/retry_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ExqUIWeb.RetryLive.Index do
%{
header: "Next Retry",
accessor: fn item ->
live_redirect(human_time(item.scheduled_at),
live_link(human_time(item.scheduled_at),
to: Routes.retry_show_path(socket, item.score, item.id),
class: "nounderline"
)
Expand Down
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/scheduled_live/index.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ExqUIWeb.ScheduledLive.Index do
%{
header: "When",
accessor: fn item ->
live_redirect(human_time(item.scheduled_at),
live_link(human_time(item.scheduled_at),
to: Routes.scheduled_show_path(socket, item.score, item.id),
class: "nounderline"
)
Expand Down
4 changes: 3 additions & 1 deletion lib/exq_ui_web/templates/layout/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<%= csrf_meta_tag() %>
<%= live_title_tag(assigns[:page_title] || "ExqUI") %>
<.live_title>
<%= assigns[:page_title] || "ExqUI" %>
</.live_title>
<style>
<%= raw(render("app.css")) %>
</style>
Expand Down
16 changes: 14 additions & 2 deletions lib/exq_ui_web/views/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule ExqUIWeb.Helpers do
@moduledoc false

use PhoenixHTMLHelpers
import Phoenix.LiveView.Helpers
import Phoenix.Component

def nav_link(socket, name, link) do
active =
Expand All @@ -12,7 +12,19 @@ defmodule ExqUIWeb.Helpers do
""
end

live_redirect(name, to: link, class: "nav-link" <> active)
assigns = %{to: link, class: "nav-link" <> active, name: name}

~H|<.link navigate={@to} class={@class}><%= @name %></.link>|
end

def live_link(text, options) do
assigns = %{
to: Keyword.fetch!(options, :to),
class: Keyword.get(options, :class, ""),
text: text
}

~H|<.link navigate={@to} class={@class}><%= @text %></.link>|
end

def human_time(nil) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule ExqUI.MixProject do
[
{:exq, ">= 0.16.2"},
{:exq_scheduler, "~> 1.0", optional: true},
{:phoenix_live_view, "~> 0.18"},
{:phoenix_live_view, "~> 0.20"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_view, "~> 2.0"},
{:phoenix_html_helpers, "~> 1.0"},
Expand Down
2 changes: 1 addition & 1 deletion priv/static/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
nativeBuildInputs =
[ pkgs.nodejs-18_x pkgs.beam.packages.erlangR25.elixir_1_14 ];
[ pkgs.nodejs-18_x pkgs.beam.packages.erlangR26.elixir_1_16 ];
}

0 comments on commit 8c6f185

Please sign in to comment.