<%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
<% end %>
diff --git a/lib/lightning_web/components/layouts/settings.html.heex b/lib/lightning_web/components/layouts/settings.html.heex
index eb22faf8f0..108e4ac98d 100644
--- a/lib/lightning_web/components/layouts/settings.html.heex
+++ b/lib/lightning_web/components/layouts/settings.html.heex
@@ -22,33 +22,33 @@
to={Routes.project_index_path(@socket, :index)}
active={@active_menu_item == :projects}
>
-
+ <.icon name="hero-building-library" class="h-5 w-5 inline-block mr-2" />
diff --git a/lib/lightning_web/components/viewers.ex b/lib/lightning_web/components/viewers.ex
index dafb4af029..f073506c02 100644
--- a/lib/lightning_web/components/viewers.ex
+++ b/lib/lightning_web/components/viewers.ex
@@ -189,7 +189,7 @@ defmodule LightningWeb.Components.Viewers do
>
diff --git a/lib/lightning_web/controllers/user_session_html/new.html.heex b/lib/lightning_web/controllers/user_session_html/new.html.heex
index f901bb6eeb..bad2238228 100644
--- a/lib/lightning_web/controllers/user_session_html/new.html.heex
+++ b/lib/lightning_web/controllers/user_session_html/new.html.heex
@@ -54,10 +54,8 @@
-
-
- via external provider
-
+ <.icon name="hero-identification" class="h-4 w-4" />
+ via external provider
diff --git a/lib/lightning_web/live/audit_live/index.ex b/lib/lightning_web/live/audit_live/index.ex
index 5fe382c6ef..0f11339488 100644
--- a/lib/lightning_web/live/audit_live/index.ex
+++ b/lib/lightning_web/live/audit_live/index.ex
@@ -62,7 +62,7 @@ defmodule LightningWeb.AuditLive.Index do
~H"""
<%= for {field, old, new} <- @changes do %>
<%= field %> <%= old %>
-
+ <.icon name="hero-arrow-right-mini" class="h-4 w-4 inline-block mr-2" />
<%= new %>
<% end %>
"""
diff --git a/lib/lightning_web/live/auth_providers/form_component.ex b/lib/lightning_web/live/auth_providers/form_component.ex
index 5f5eb97d1f..7a864bb14e 100644
--- a/lib/lightning_web/live/auth_providers/form_component.ex
+++ b/lib/lightning_web/live/auth_providers/form_component.ex
@@ -270,7 +270,7 @@ defmodule LightningWeb.AuthProvidersLive.FormComponent do
-
+ <.icon name="hero-trash" class="h-4 w-4 inline-block" />
Remove
diff --git a/lib/lightning_web/live/live_helpers.ex b/lib/lightning_web/live/live_helpers.ex
index 55263bebdd..6efe7d4751 100644
--- a/lib/lightning_web/live/live_helpers.ex
+++ b/lib/lightning_web/live/live_helpers.ex
@@ -3,6 +3,7 @@ defmodule LightningWeb.LiveHelpers do
General purpose LiveView helper functions
"""
import Phoenix.Component
+ import LightningWeb.Components.Icons
alias Lightning.Extensions.UsageLimiting.Context
alias Lightning.Services.UsageLimiter
@@ -102,7 +103,7 @@ defmodule LightningWeb.LiveHelpers do
-
+ <.icon name="hero-exclamation-triangle" class="h-6 w-6 text-red-600" />
Close
-
+ <.icon name="hero-x-mark" class="w-4 h-4" />
diff --git a/lib/lightning_web/live/run_live/components.ex b/lib/lightning_web/live/run_live/components.ex
index 643d2de043..7c8675f9a0 100644
--- a/lib/lightning_web/live/run_live/components.ex
+++ b/lib/lightning_web/live/run_live/components.ex
@@ -179,8 +179,8 @@ defmodule LightningWeb.RunLive.Components do
phx-hook="Tooltip"
data-placement="bottom"
>
-
@@ -196,10 +196,9 @@ defmodule LightningWeb.RunLive.Components do
}
>
<.icon
- naked
title="Inspect Step"
name="hero-document-magnifying-glass-mini"
- class="h-5 w-5"
+ class="h-5 w-5 text-gray-500 hover:text-primary-400"
/>
<% end %>
@@ -363,8 +362,8 @@ defmodule LightningWeb.RunLive.Components do
phx-hook="Tooltip"
data-placement="right"
>
-
@@ -385,9 +384,8 @@ defmodule LightningWeb.RunLive.Components do
}
>
<.icon
- naked
name="hero-document-magnifying-glass-mini"
- class="h-5 w-5"
+ class="h-5 w-5 text-gray-500 hover:text-primary-400"
/>
@@ -436,12 +434,14 @@ defmodule LightningWeb.RunLive.Components do
end}
>
<.icon
- {if not @deleted, do: [naked: true], else: []}
name="hero-play-circle-mini"
- class={"h-5 w-5 #{if not @deleted,
- do: "hover:text-primary-400 cursor-pointer",
- else: "text-gray-400 hover:text-gray-400"
- }"}
+ class={[
+ "h-5 w-5",
+ if(not @deleted,
+ do: "hover:text-primary-400 cursor-pointer",
+ else: "text-gray-400 hover:text-gray-400"
+ )
+ ]}
/>
<% else %>
@@ -458,7 +458,7 @@ defmodule LightningWeb.RunLive.Components do
)
}
>
-
+ <.icon name="hero-arrow-path" class="h-5 w-5" />
<% end %>
"""
@@ -543,46 +543,44 @@ defmodule LightningWeb.RunLive.Components do
def step_icon(%{reason: reason, error_type: error_type} = assigns) do
[icon, classes] =
case {reason, error_type} do
- {nil, _any} -> [:pending, "text-gray-400"]
- {"success", _any} -> [:success, "text-green-500"]
- {"fail", _any} -> [:fail, "text-red-500"]
- {"crash", _any} -> [:crash, "text-orange-800"]
- {"cancel", _any} -> [:cancel, "text-grey-600"]
- {"kill", "SecurityError"} -> [:shield, "text-yellow-800"]
- {"kill", "ImportError"} -> [:shield, "text-yellow-800"]
- {"kill", "TimeoutError"} -> [:clock, "text-yellow-800"]
- {"kill", "OOMError"} -> [:circle_ex, "text-yellow-800"]
- {"exception", ""} -> [:triangle_ex, "text-black-800"]
- {"lost", _nil} -> [:triangle_ex, "text-black-800"]
+ {nil, _any} ->
+ ["hero-ellipsis-horizontal-circle-solid", "text-gray-400"]
+
+ {"success", _any} ->
+ ["hero-check-circle-solid", "text-green-500"]
+
+ {"fail", _any} ->
+ ["hero-x-circle-solid", "text-red-500"]
+
+ {"crash", _any} ->
+ ["hero-x-circle-solid", "text-orange-800"]
+
+ {"cancel", _any} ->
+ ["hero-no-symbol-mini", "text-grey-600"]
+
+ {"kill", "SecurityError"} ->
+ ["hero-shield-exclamation-solid", "text-yellow-800"]
+
+ {"kill", "ImportError"} ->
+ ["hero-shield-exclamation-solid", "text-yellow-800"]
+
+ {"kill", "TimeoutError"} ->
+ ["hero-clock-solid", "text-yellow-800"]
+
+ {"kill", "OOMError"} ->
+ ["hero-exclamation-circle-solid", "text-yellow-800"]
+
+ {"exception", ""} ->
+ ["hero-exclamation-triangle-solid", "text-black-800"]
+
+ {"lost", _nil} ->
+ ["hero-exclamation-triangle-solid", "text-black-800"]
end
- assigns =
- assign(assigns,
- icon: icon,
- classes: ["mr-1.5 h-5 w-5 flex-shrink-0 inline", classes]
- )
+ assigns = assign(assigns, icon: icon, classes: classes)
~H"""
- <%= case @icon do %>
- <% :pending -> %>
-
- <% :success -> %>
-
- <% :fail -> %>
-
- <% :crash -> %>
-
- <% :cancel -> %>
-
- <% :shield -> %>
-
- <% :clock -> %>
-
- <% :circle_ex -> %>
-
- <% :triangle_ex -> %>
-
- <% end %>
+ <.icon name={@icon} class={["mr-1.5 h-5 w-5 flex-shrink-0 inline", @classes]} />
"""
end
diff --git a/storybook/runs/status_icons.story.exs b/storybook/runs/status_icons.story.exs
new file mode 100644
index 0000000000..bc663f6d1b
--- /dev/null
+++ b/storybook/runs/status_icons.story.exs
@@ -0,0 +1,31 @@
+defmodule LightningWeb.Storybook.Runs.StatusIcons do
+ alias LightningWeb.RunLive.Components
+ use PhoenixStorybook.Story, :component
+
+ # required
+ def function, do: &Components.step_icon/1
+
+ def variations do
+ [
+ {:nothing, nil, nil},
+ {:success, "success", nil},
+ {:fail, "fail", nil},
+ {:crash, "crash", nil},
+ {:cancel, "cancel", nil},
+ {:kill_security, "kill", "SecurityError"},
+ {:kill_import, "kill", "ImportError"},
+ {:kill_timeout, "kill", "TimeoutError"},
+ {:kill_oom, "kill", "OOMError"},
+ {:exception, "exception", ""},
+ {:list, "lost", nil}
+ ]
+ |> Enum.map(fn {id, reason, error_type} ->
+ %Variation{
+ id: id,
+ description: "Status Icon",
+ attributes: %{reason: reason, error_type: error_type},
+ slots: []
+ }
+ end)
+ end
+end
diff --git a/test/lightning_web/live/run_live/components_test.exs b/test/lightning_web/live/run_live/components_test.exs
index ffe59d351a..66e3fa97d8 100644
--- a/test/lightning_web/live/run_live/components_test.exs
+++ b/test/lightning_web/live/run_live/components_test.exs
@@ -108,11 +108,11 @@ defmodule LightningWeb.RunLive.ComponentsTest do
)
|> Floki.parse_fragment!()
- assert html
- |> Floki.find(
- ~s{svg[class="mr-1.5 h-5 w-5 flex-shrink-0 inline text-gray-400"]}
+ assert has_elem_with_class?(
+ html,
+ "span",
+ "hero-ellipsis-horizontal-circle-solid text-gray-400"
)
- |> Enum.any?()
assert has_run_step_link?(html, workflow.project, run, first_step)
@@ -127,11 +127,11 @@ defmodule LightningWeb.RunLive.ComponentsTest do
)
|> Floki.parse_fragment!()
- assert html
- |> Floki.find(
- ~s{svg[class="mr-1.5 h-5 w-5 flex-shrink-0 inline text-green-500"]}
+ assert has_elem_with_class?(
+ html,
+ "span",
+ "hero-check-circle-solid text-green-500"
)
- |> Enum.any?()
assert has_run_step_link?(html, workflow.project, run, second_step)
@@ -146,11 +146,11 @@ defmodule LightningWeb.RunLive.ComponentsTest do
)
|> Floki.parse_fragment!()
- assert html
- |> Floki.find(
- ~s{svg[class="mr-1.5 h-5 w-5 flex-shrink-0 inline text-red-500"]}
+ assert has_elem_with_class?(
+ html,
+ "span",
+ "hero-x-circle-solid text-red-500"
)
- |> Enum.any?()
assert has_run_step_link?(html, workflow.project, run, third_step)
@@ -493,4 +493,20 @@ defmodule LightningWeb.RunLive.ComponentsTest do
)
|> Enum.any?()
end
+
+ defp has_elem_with_class?(html, tag, class_names) do
+ html
+ |> Floki.find(tag)
+ |> Enum.filter(fn {_tag, attrs, _inner} ->
+ Enum.filter(attrs, &match?({"class", _}, &1))
+ |> Enum.find(attrs, fn {"class", value} ->
+ class_names
+ |> String.split()
+ |> Enum.all?(fn class_name ->
+ String.contains?(value, class_name)
+ end)
+ end)
+ end)
+ |> Enum.any?()
+ end
end