Shorten button text

This commit is contained in:
Claudio Ortolina
2024-10-18 11:25:27 +01:00
parent b9ea7d1419
commit 9ac378c729
6 changed files with 9 additions and 9 deletions
@@ -57,7 +57,7 @@ defmodule MusicLibraryWeb.RecordLive.FormComponent do
/>
</div>
<:actions>
<.button phx-disable-with="Saving...">Save Record</.button>
<.button phx-disable-with="Saving...">Save</.button>
</:actions>
</.simple_form>
</div>
@@ -51,7 +51,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
end
socket
|> assign(:page_title, "Edit Metadata")
|> assign(:page_title, "Edit")
|> assign(:record, Records.get_record!(id))
end
@@ -42,7 +42,7 @@ defmodule MusicLibraryWeb.RecordLive.Show do
end
defp page_title(:show), do: "Show Record"
defp page_title(:edit), do: "Edit Metadata"
defp page_title(:edit), do: "Edit"
defp musicbrainz_url(record) do
"https://musicbrainz.org/release-group/#{record.musicbrainz_id}"
@@ -11,10 +11,10 @@
</:subtitle>
<:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit Metadata</.button>
<.button>Edit</.button>
</.link>
<.link phx-click={JS.push("delete", value: %{id: @record.id})} data-confirm="Are you sure?">
<.button class="!bg-red-900 hover:!bg-red-700">Delete record</.button>
<.button class="!bg-red-900 hover:!bg-red-700">Delete</.button>
</.link>
</:actions>
</.header>
@@ -177,11 +177,11 @@ defmodule MusicLibraryWeb.RecordIndexTest do
assert index_live
|> element("#records-#{record.id} a", "Edit")
|> render_click() =~ "Edit Metadata"
|> render_click() =~ "Edit"
assert_patch(index_live, ~p"/records/#{record}/edit")
assert index_live |> render() =~ "Edit Metadata"
assert index_live |> render() =~ "Edit"
end
test "can change the record cover", %{conn: conn} do
@@ -18,8 +18,8 @@ defmodule MusicLibraryWeb.RecordShowTest do
{:ok, show_live, _html} = live(conn, ~p"/records/#{record.id}")
assert show_live
|> element("a", "Edit Metadata")
|> render_click() =~ "Edit Metadata"
|> element("a", "Edit")
|> render_click() =~ "Edit"
assert_patch(show_live, ~p"/records/#{record}/show/edit")
end