Skip to content

Commit 2ef8a4a

Browse files
chore: fixing credo warning
1 parent 2d7b46c commit 2ef8a4a

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

lib/ash_admin/components/resource/show.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule AshAdmin.Components.Resource.Show do
99

1010
require Logger
1111

12-
alias AshAdmin.Components.Resource.{Helpers.FormatHelper, SensitiveAttribute, CinderTable}
12+
alias AshAdmin.Components.Resource.{CinderTable, Helpers.FormatHelper, SensitiveAttribute}
1313
import AshAdmin.Helpers
1414
import AshAdmin.CoreComponents
1515

lib/ash_admin/pages/page_live.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ defmodule AshAdmin.PageLive do
455455
def handle_event("clear_all_filters", _params, socket), do: {:noreply, socket}
456456
def handle_event("toggle_sort", _params, socket), do: {:noreply, socket}
457457
def handle_event("goto_page", _params, socket), do: {:noreply, socket}
458-
def handle_event("filter_change", params, socket), do: {:noreply, socket}
458+
def handle_event("filter_change", _params, socket), do: {:noreply, socket}
459459

460460
@impl true
461461
def handle_info({:filter_builder_value, _filter, filter_query}, socket) do

mix.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ defmodule AshAdmin.MixProject do
123123
]
124124
end
125125

126-
if Mix.env() == :test do
126+
if Mix.env() == :text do
127127
# Run "mix help compile.app" to learn about applications.
128128
def application do
129129
[
130-
extra_applications: [:logger]
130+
extra_applications: [:logger],
131+
mod: {AshAdmin, []}
131132
]
132133
end
133134
end

test/components/resource/data_table_filtering_test.exs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ defmodule AshAdmin.Test.Components.Resource.DataTableFilteringTest do
1818
{view, render(view)}
1919
end
2020

21-
# Helper function to wait for Cinder table to finish loading (for existing view)
22-
defp wait_for_table_load(view) do
23-
refute_eventually(fn -> render(view) =~ "Loading..." end, timeout: 5000, interval: 100)
24-
view
25-
end
26-
2721
# Helper to retry a condition until it's false or timeout
28-
defp refute_eventually(func, opts \\ []) do
22+
defp refute_eventually(func, opts) do
2923
timeout = Keyword.get(opts, :timeout, 2000)
3024
interval = Keyword.get(opts, :interval, 50)
3125
end_time = System.monotonic_time(:millisecond) + timeout
@@ -89,7 +83,7 @@ defmodule AshAdmin.Test.Components.Resource.DataTableFilteringTest do
8983

9084
describe "basic filter functionality" do
9185
test "renders data table instead of schema view", %{conn: conn} do
92-
{view, html} =
86+
{_view, html} =
9387
live_and_wait(conn, "/api/admin?domain=Domain&resource=Post&action_type=read&action=read")
9488

9589
# Should NOT show the schema view (Attributes/Relationships tables)
@@ -174,7 +168,6 @@ defmodule AshAdmin.Test.Components.Resource.DataTableFilteringTest do
174168
assert html =~ "First post about Elixir"
175169
end
176170

177-
@skip true
178171
test "clears all filters at once", %{conn: conn} do
179172
{view, _html} =
180173
live_and_wait(conn, "/api/admin?domain=Domain&resource=Post&action_type=read&action=read")

test/support/resources/comment.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ defmodule AshAdmin.Test.Comment do
1919

2020
actions do
2121
default_accept(:*)
22-
defaults([:create, :read, :update, :destroy])
22+
defaults([:read, :update, :destroy])
2323

24-
create :create_with_photo do
24+
create :create do
25+
primary?(true)
2526
argument(:photo, :file)
2627
end
2728
end

0 commit comments

Comments
 (0)