Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-valim committed Jan 30, 2024
1 parent 442a8aa commit dd13bbc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 37 deletions.
14 changes: 3 additions & 11 deletions lib/livebook_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ defmodule LivebookWeb.CoreComponents do
use Phoenix.Component

alias Phoenix.LiveView.JS
import LivebookWeb.Gettext

@doc """
Renders [Remix](https://remixicon.com) icon.
Expand Down Expand Up @@ -760,8 +759,6 @@ defmodule LivebookWeb.CoreComponents do
default: &Function.identity/1,
doc: "the function for mapping each row before calling the :col and :action slots"

attr :show_action_label, :boolean, default: false

slot :col, required: true do
attr :label, :string
end
Expand Down Expand Up @@ -789,9 +786,7 @@ defmodule LivebookWeb.CoreComponents do
:if={@action != []}
class="py-3.5 pl-3 pr-5 text-right text-sm font-semibold text-gray-900 sm:pr-7"
>
<%= if @show_action_label,
do: "Action",
else: "<span class=\"sr-only\">#{gettext("Actions")}</span>" %>
<span>Actions</span>
</th>
</tr>
</thead>
Expand All @@ -814,12 +809,9 @@ defmodule LivebookWeb.CoreComponents do
</div>
</td>
<td :if={@action != []} class="relative p-0">
<div class="relative whitespace-nowrap py-4 pl-3 pr-4 text-sm font-medium sm:pr-6">
<div class="relative whitespace-nowrap py-4 pl-3 pr-4 text-sm font-medium sm:pr-6 flex justify-end items-center">
<span class="absolute -inset-y-px -right-4 left-0 group-hover:bg-gray-100 sm:rounded-r-xl" />
<span
:for={action <- @action}
class="relative ml-4 flex justify-end items-center gap-4"
>
<span :for={action <- @action} class="relative ml-4">
<%= render_slot(action, @row_item.(row)) %>
</span>
</div>
Expand Down
24 changes: 0 additions & 24 deletions lib/livebook_web/gettext.ex

This file was deleted.

4 changes: 3 additions & 1 deletion lib/livebook_web/live/hub/secret_list_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule LivebookWeb.Hub.SecretListComponent do
No secrets here... yet!
</.no_entries>
<div :if={@secrets != []}>
<.table id="hub-secrets-table" rows={@secrets} show_action_label={true}>
<.table id="hub-secrets-table" rows={@secrets}>
<:col :let={secret} label="Name"><%= secret.name %></:col>
<:action :let={secret}>
<span class="tooltip left" data-tooltip="Edit">
Expand All @@ -33,6 +33,8 @@ defmodule LivebookWeb.Hub.SecretListComponent do
<.remix_icon icon="edit-fill" class="text-lg" />
</.link>
</span>
</:action>
<:action :let={secret}>
<span class="tooltip left" data-tooltip="Delete">
<button
id={"hub-secret-#{secret.name}-delete"}
Expand Down
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ defmodule Livebook.MixProject do
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:floki, ">= 0.27.0", only: :test},
{:bypass, "~> 2.1", only: :test},
{:gettext, "~> 0.20"},
# ZTA deps
{:jose, "~> 1.11.5"},
{:req, "~> 0.4.4"},
Expand Down

0 comments on commit dd13bbc

Please sign in to comment.