Skip to content

Commit

Permalink
Merge pull request #125 from akira/phx-live-0.18
Browse files Browse the repository at this point in the history
add support for phx-live 0.18
  • Loading branch information
ananthakumaran authored Sep 24, 2022
2 parents 964cd5c + 7a08851 commit d6440b3
Show file tree
Hide file tree
Showing 27 changed files with 146 additions and 38 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ jobs:
fail-fast: false
matrix:
include:
- elixir: 1.10.4
otp: 23.0
- elixir: 1.12.3
otp: 24.1
- elixir: 1.13.0
otp: 24.1
check_warnings: true
check_format: true
steps:
- uses: actions/checkout@v2
- run: docker-compose up -d
Expand All @@ -20,5 +24,7 @@ jobs:
elixir-version: ${{matrix.elixir}}
- run: mix deps.get
- run: mix format --check-formatted
if: ${{ matrix.check_format }}
- run: mix compile --force --warnings-as-errors
if: ${{ matrix.check_warnings }}
- run: mix test --trace --cover
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :exq,
name: Exq,
Expand Down
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

# Print only warnings and errors during test
config :logger, level: :warn
Expand Down
1 change: 1 addition & 0 deletions lib/exq_ui_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ defmodule ExqUIWeb do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML

import Phoenix.Component
# Import LiveView helpers (live_render, live_component, live_patch, etc)
import Phoenix.LiveView.Helpers

Expand Down
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/busy_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<h5 class="mt-2 text-muted">Nodes</h5>
<table class="mt-2 table table-bordered">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</div>
</div>
<div class="row">
<div id="realtime-chart" class="col-12" phx-hook="HistoricalPlot" phx-update="ignore"></div>
<div id="historical-chart" class="col-12" phx-hook="HistoricalPlot" phx-update="ignore"></div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div>
<%= if @total_page > 0 do %>
<nav class="my-2">
<ul class="pagination pagination-sm justify-content-end mb-0">
Expand All @@ -15,4 +16,4 @@
</ul>
</nav>
<% end %>

</div>
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/components/table_component.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% end %>
</div>
<div class="col-6">
<%= live_component ExqUIWeb.PaginationComponent, total: @total, current_page: @current_page, page_size: @page_size %>
<.live_component module={ExqUIWeb.PaginationComponent} id="pagination" total={@total} current_page={@current_page} page_size={@page_size} />
</div>
</div>
<div class="row">
Expand Down
6 changes: 3 additions & 3 deletions lib/exq_ui_web/live/dashboard_live.html.heex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.RealtimeStatsComponent, id: "realtime-stats" %>
<%= live_component ExqUIWeb.HistoricalStatsComponent, id: "historical-stats" %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.RealtimeStatsComponent} id="realtime-stats" />
<.live_component module={ExqUIWeb.HistoricalStatsComponent} id="historical-stats" />
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/dead_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.TableComponent, id: "dead-table", actions: @actions, columns: @columns, items: @items, total: @total, current_page: @current_page, page_size: @page_size %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.TableComponent} id="dead-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/dead_live/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.JobDetailsComponent, id: "jobs-details", item: @item, actions: @actions %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<table class="mt-2 table table-bordered">
<thead>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/queue_live/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<div class="row">
<div col="col-16">
<div class="d-flex align-items-center">
<span class="text-muted">Enqueued jobs in <b><%= @name %></b> queue: <b><%= @total %></b></span>
</div>
</div>
</div>
<%= live_component ExqUIWeb.TableComponent, id: "queues-table", actions: @actions, columns: @columns, items: @items, total: @total, current_page: @current_page, page_size: @page_size %>
<.live_component module={ExqUIWeb.TableComponent} id="queues-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
2 changes: 1 addition & 1 deletion lib/exq_ui_web/live/recurring_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />

<div>
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/retry_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.TableComponent, id: "retry-table", actions: @actions, columns: @columns, items: @items, total: @total, current_page: @current_page, page_size: @page_size %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.TableComponent} id="retry-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />

4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/retry_live/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.JobDetailsComponent, id: "jobs-details", item: @item, actions: @actions %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/scheduled_live/index.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.TableComponent, id: "scheduled-table", actions: @actions, columns: @columns, items: @items, total: @total, current_page: @current_page, page_size: @page_size %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.TableComponent} id="scheduled-table" actions={@actions} columns={@columns} items={@items} total={@total} current_page={@current_page} page_size={@page_size} />
4 changes: 2 additions & 2 deletions lib/exq_ui_web/live/scheduled_live/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<%= live_component ExqUIWeb.StatsComponent, id: "stats" %>
<%= live_component ExqUIWeb.JobDetailsComponent, id: "jobs-details", item: @item, actions: @actions %>
<.live_component module={ExqUIWeb.StatsComponent} id="stats" />
<.live_component module={ExqUIWeb.JobDetailsComponent} id="jobs-details" item={@item} actions={@actions} />
2 changes: 1 addition & 1 deletion lib/exq_ui_web/templates/layout/live.html.heex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= live_component ExqUIWeb.NavBarComponent %>
<.live_component module={ExqUIWeb.NavBarComponent} id="nav-bar" />
<main role="main" class="container">
<p style="display:none" class="invisible alert alert-info" role="alert"
phx-click="lv:clear-flash"
Expand Down
10 changes: 7 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ defmodule ExqUI.MixProject do
[
app: :exq_ui,
version: @version,
elixir: "~> 1.7",
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
docs: docs(),
deps: deps(),
package: package()
package: package(),
test_coverage: [
ignore_modules: [ExqUI.Queue.JobItem, ExqUIWeb, ExqUIWeb.ErrorView, ExqUIWeb.Router],
summary: [threshold: 80]
]
]
end

Expand All @@ -32,7 +36,7 @@ defmodule ExqUI.MixProject do
[
{:exq, ">= 0.16.2"},
{:exq_scheduler, "~> 1.0", optional: true},
{:phoenix_live_view, "~> 0.16"},
{:phoenix_live_view, "~> 0.17"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
Expand Down
10 changes: 5 additions & 5 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"},
"mime": {:hex, :mime, "2.0.3", "3676436d3d1f7b81b5a2d2bd8405f412c677558c81b1c92be58c00562bb59095", [:mix], [], "hexpm", "27a30bf0db44d25eecba73755acf4068cbfe26a4372f9eb3e4ea3a45956bff6b"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"},
"nimble_strftime": {:hex, :nimble_strftime, "0.1.1", "b988184d1bd945bc139b2c27dd00a6c0774ec94f6b0b580083abd62d5d07818b", [:mix], [], "hexpm", "89e599c9b8b4d1203b7bb5c79eb51ef7c6a28fbc6228230b312f8b796310d755"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"phoenix": {:hex, :phoenix, "1.6.7", "f1de32418bbbcd471f4fe74d3860ee9c8e8c6c36a0ec173be8ff468a5d72ac90", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b354a4f11d9a2f3a380fb731042dae064f22d7aed8c7e7c024a2459f12994aad"},
"phoenix": {:hex, :phoenix, "1.6.12", "f8f8ac077600f84419806dd53114b2e77aedde7a502e74181a7d886355aa0643", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2d6cf5583c9c20f7103c40e6014ef802d96553b8e5d6585ad6e627bd5ddb0d12"},
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.17.9", "36b5aa812bc3ccd64c9630f6b3234d9ea21105493237e927aae19d0ba758f0db", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f7ebc3e0ba0c5f6b6996ed6c901ddbfdaba59a6d09b569e7cb2f2f7d693b4455"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.18.0", "8705283efbc623df6290d5f8cb233afa9bcdcfc969749ce6e313877108f65887", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6 or ~> 1.7", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.1", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "545f11c15d595595690da16c4f607417bfb1862e518c07c9f78c754ac186cd7d"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_view": {:hex, :phoenix_view, "1.1.2", "1b82764a065fb41051637872c7bd07ed2fdb6f5c3bd89684d4dca6e10115c95a", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "7ae90ad27b09091266f6adbb61e1d2516a7c3d7062c6789d46a7554ec40f3a56"},
"plug": {:hex, :plug, "1.13.6", "187beb6b67c6cec50503e940f0434ea4692b19384d47e5fdfd701e93cadb4cc2", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02b9c6b9955bce92c829f31d6284bf53c591ca63c4fb9ff81dfd0418667a34ff"},
"plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"plug_crypto": {:hex, :plug_crypto, "1.2.3", "8f77d13aeb32bfd9e654cb68f0af517b371fb34c56c9f2b58fe3df1235c1251a", [:mix], [], "hexpm", "b5672099c6ad5c202c45f5a403f21a3411247f164e4a8fab056e5cd8a290f4a2"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"redix": {:hex, :redix, "1.1.5", "6fc460d66a5c2287e83e6d73dddc8d527ff59cb4d4f298b41e03a4db8c3b2bd5", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "679afdd4c14502fe9c11387ff1cdcb33065a1cf511097da1eee407f17c7a418b"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
Expand Down
2 changes: 1 addition & 1 deletion priv/static/js/app.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions test/exq_ui_web/live/dead_live/index_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,22 @@ defmodule ExqUIWeb.DeadLive.IndexTest do
html = render(view)
assert html =~ ~r/Hardworker.*409/
end

test "delete_all", %{conn: conn} do
{:ok, view, _} = live(conn, "/dead")
html = render(view)
assert html =~ ~r/hard.*409.*RuntimeError/
assert html =~ ~r/hard.*548.*kill/

element(
view,
"#table-component"
)
|> render_hook("action", %{"table" => %{"action" => "delete_all"}})

{:ok, view, _} = live(conn, "/dead")
html = render(view)
refute html =~ ~r/hard.*409.*RuntimeError/
refute html =~ ~r/hard.*548.*kill/
end
end
42 changes: 42 additions & 0 deletions test/exq_ui_web/live/queue_live/show_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
defmodule ExqUIWeb.QueueLive.ShowTest do
use ExqUI.ConnCase

test "/queues/hard", %{conn: conn} do
{:ok, view, _} = live(conn, "/queues/hard")
html = render(view)

assert html =~ ~r/Hardworker.*428/
end

test "delete_all", %{conn: conn} do
{:ok, view, _} = live(conn, "/queues/hard")

html =
element(
view,
"#table-component"
)
|> render_hook("action", %{"table" => %{"action" => "delete_all"}})

refute html =~ ~r/Hardworker.*428/
end

test "delete", %{conn: conn} do
{:ok, view, _} = live(conn, "/queues/hard")

html =
element(
view,
"#table-component"
)
|> render_hook("action", %{
"table" => %{
"24b09253-1bbe-4d8a-804a-582d3541d31b" =>
"{\"args\":[428],\"class\":\"Hardworker\",\"enqueued_at\":1638553683.274524,\"jid\":\"24b09253-1bbe-4d8a-804a-582d3541d31b\",\"queue\":\"hard\",\"retry\":3}",
"action" => "delete"
}
})

refute html =~ ~r/Hardworker.*428/
end
end
18 changes: 18 additions & 0 deletions test/exq_ui_web/live/retry_live/index_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ defmodule ExqUIWeb.RetryLive.IndexTest do
assert html =~ ~r/hard.*235.*RuntimeError/
end

test "delete_all", %{conn: conn} do
{:ok, view, _} = live(conn, "/retries")
html = render(view)
assert html =~ ~r/hard.*499.*{:bad, :reason}/
assert html =~ ~r/hard.*235.*RuntimeError/

element(
view,
"#table-component"
)
|> render_hook("action", %{"table" => %{"action" => "delete_all"}})

{:ok, view, _} = live(conn, "/retries")
html = render(view)
refute html =~ ~r/hard.*499.*{:bad, :reason}/
refute html =~ ~r/hard.*235.*RuntimeError/
end

test "retry now", %{conn: conn} do
{:ok, view, _} = live(conn, "/retries")

Expand Down
Loading

0 comments on commit d6440b3

Please sign in to comment.