polish(rover): drop redundant View action; location cell already links

This commit is contained in:
Graham McIntire 2026-05-02 17:02:56 -05:00
parent d44351366a
commit 558980a191
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 3 additions and 18 deletions

View file

@ -277,15 +277,8 @@ defmodule MicrowavepropWeb.RoverLocationsLive do
assigns = %{record: record, owner?: owner?(scope, record)}
~H"""
<div class="flex gap-2">
<.link
navigate={~p"/rover-locations/#{@record.id}"}
class="btn btn-xs btn-ghost"
>
View
</.link>
<div :if={@owner?} class="flex gap-2">
<button
:if={@owner?}
type="button"
phx-click="edit"
phx-value-id={@record.id}
@ -294,7 +287,6 @@ defmodule MicrowavepropWeb.RoverLocationsLive do
Edit
</button>
<button
:if={@owner?}
type="button"
phx-click="delete"
phx-value-id={@record.id}

View file

@ -121,7 +121,7 @@ defmodule MicrowavepropWeb.RoverLocationsLiveTest do
assert html =~ ~s(value="EM12gm")
end
test "View link on each row navigates to the show page", %{conn: conn, user: user} do
test "the location cell links to the show page", %{conn: conn, user: user} do
{:ok, loc} =
Rover.create_location(user, %{
lat: 32.5,
@ -132,14 +132,7 @@ defmodule MicrowavepropWeb.RoverLocationsLiveTest do
{:ok, lv, _html} = live(conn, ~p"/rover-locations")
assert {:ok, _show_lv, html} =
lv
|> element("a[href='/rover-locations/#{loc.id}']", "View")
|> render_click()
|> follow_redirect(conn, ~p"/rover-locations/#{loc.id}")
assert html =~ "rooftop spot"
assert html =~ "EM12gm"
assert has_element?(lv, "a[href='/rover-locations/#{loc.id}']")
end
test "edit/delete buttons appear only on the owner's row", %{conn: conn, user: user} do