Skip to content

Commit

Permalink
Clean up link for space and credential
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Feb 28, 2024
1 parent e9628b3 commit 96dd51a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
28 changes: 15 additions & 13 deletions lib/polar_web/live/dashboard/space_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ defmodule PolarWeb.Dashboard.SpaceLive do
id={"credential_#{credential.id}"}
class="relative flex justify-between gap-x-6 px-4 py-5 hover:bg-gray-50 sm:px-6"
>
<.link navigate={~p"/dashboard/spaces/#{credential.space_id}/credentials/#{credential.id}"}>
<div class="min-w-0">
<div class="min-w-0">
<.link navigate={
~p"/dashboard/spaces/#{credential.space_id}/credentials/#{credential.id}"
}>
<div class="flex items-start gap-x-3">
<p class="text-sm font-semibold leading-6 text-gray-900"><%= credential.name %></p>
<p class="text-sm font-semibold leading-6 text-indigo-500"><%= credential.name %></p>
</div>
<div class="mt-1 flex items-center gap-x-2 text-xs leading-5 text-gray-500">
<p class="whitespace-nowrap">
Expand All @@ -77,16 +79,16 @@ defmodule PolarWeb.Dashboard.SpaceLive do
<% end %>
</p>
</div>
</div>
<div class="flex flex-none items-center gap-x-4">
<.link
navigate={~p"/dashboard/spaces/#{credential.space_id}/credentials/#{credential.id}"}
class="hidden rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:block"
>
<%= gettext("View credential") %>
</.link>
</div>
</.link>
</.link>
</div>
<div class="flex flex-none items-center gap-x-4">
<.link
navigate={~p"/dashboard/spaces/#{credential.space_id}/credentials/#{credential.id}"}
class="hidden rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:block"
>
<%= gettext("View credential") %>
</.link>
</div>
</li>
</ul>
</div>
Expand Down
26 changes: 13 additions & 13 deletions lib/polar_web/live/dashboard_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ defmodule PolarWeb.DashboardLive do
id={"space_#{space.id}"}
class="relative flex justify-between gap-x-6 px-4 py-5 hover:bg-gray-50 sm:px-6"
>
<.link navigate={~p"/dashboard/spaces/#{space.id}"}>
<div class="min-w-0">
<div class="min-w-0">
<.link navigate={~p"/dashboard/spaces/#{space.id}"}>
<div class="flex items-start gap-x-3">
<p class="text-sm font-semibold leading-6 text-gray-900"><%= space.name %></p>
<p class="text-sm font-semibold leading-6 text-indigo-600"><%= space.name %></p>
</div>
<div class="mt-1 flex items-center gap-x-2 text-xs leading-5 text-gray-500">
<p class="whitespace-nowrap">
Expand All @@ -65,16 +65,16 @@ defmodule PolarWeb.DashboardLive do
</svg>
<p class="truncate"><%= gettext("Owned by") %> <%= space.owner.email %></p>
</div>
</div>
<div class="flex flex-none items-center gap-x-4">
<.link
navigate={~p"/dashboard/spaces/#{space.id}"}
class="hidden rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:block"
>
<%= gettext("View space") %>
</.link>
</div>
</.link>
</.link>
</div>
<div class="flex flex-none items-center gap-x-4">
<.link
navigate={~p"/dashboard/spaces/#{space.id}"}
class="hidden rounded-md bg-white px-2.5 py-1.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:block"
>
<%= gettext("View space") %>
</.link>
</div>
</li>
</ul>
</div>
Expand Down
1 change: 0 additions & 1 deletion lib/polar_web/live/root_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ defmodule PolarWeb.RootLive do
use PolarWeb, :live_view

alias Polar.Repo
alias Polar.Streams
alias Polar.Streams.Version

import Ecto.Query, only: [from: 2]
Expand Down
2 changes: 1 addition & 1 deletion test/polar_web/live/dashboard_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ defmodule PolarWeb.DashboardLiveTest do
{:ok, lv, _html} = live(conn, ~p"/dashboard")

lv
|> element("#space_#{space.id} a", "View space")
|> element("#space_#{space.id} a", space.name)
|> render_click()

assert_redirect(lv, ~p"/dashboard/spaces/#{space.id}")
Expand Down

0 comments on commit 96dd51a

Please sign in to comment.