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> </div>
<:actions> <:actions>
<.button phx-disable-with="Saving...">Save Record</.button> <.button phx-disable-with="Saving...">Save</.button>
</:actions> </:actions>
</.simple_form> </.simple_form>
</div> </div>
@@ -51,7 +51,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
end end
socket socket
|> assign(:page_title, "Edit Metadata") |> assign(:page_title, "Edit")
|> assign(:record, Records.get_record!(id)) |> assign(:record, Records.get_record!(id))
end end
@@ -42,7 +42,7 @@ defmodule MusicLibraryWeb.RecordLive.Show do
end end
defp page_title(:show), do: "Show Record" 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 defp musicbrainz_url(record) do
"https://musicbrainz.org/release-group/#{record.musicbrainz_id}" "https://musicbrainz.org/release-group/#{record.musicbrainz_id}"
@@ -11,10 +11,10 @@
</:subtitle> </:subtitle>
<:actions> <:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}> <.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit Metadata</.button> <.button>Edit</.button>
</.link> </.link>
<.link phx-click={JS.push("delete", value: %{id: @record.id})} data-confirm="Are you sure?"> <.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> </.link>
</:actions> </:actions>
</.header> </.header>
@@ -177,11 +177,11 @@ defmodule MusicLibraryWeb.RecordIndexTest do
assert index_live assert index_live
|> element("#records-#{record.id} a", "Edit") |> element("#records-#{record.id} a", "Edit")
|> render_click() =~ "Edit Metadata" |> render_click() =~ "Edit"
assert_patch(index_live, ~p"/records/#{record}/edit") assert_patch(index_live, ~p"/records/#{record}/edit")
assert index_live |> render() =~ "Edit Metadata" assert index_live |> render() =~ "Edit"
end end
test "can change the record cover", %{conn: conn} do 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}") {:ok, show_live, _html} = live(conn, ~p"/records/#{record.id}")
assert show_live assert show_live
|> element("a", "Edit Metadata") |> element("a", "Edit")
|> render_click() =~ "Edit Metadata" |> render_click() =~ "Edit"
assert_patch(show_live, ~p"/records/#{record}/show/edit") assert_patch(show_live, ~p"/records/#{record}/show/edit")
end end