Skip to content

[WIP] Fix action buttons #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
@apply bg-gray-500;
border-radius: 4px;
}

button.btn-secondary {
@apply bg-orange-700 text-white hover:bg-orange-800;
}
4 changes: 2 additions & 2 deletions lib/error_tracker/web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ defmodule ErrorTracker.Web.CoreComponents do
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="!h-4 !w-4 inline-block"
class="!h-4 !w-4 !mr-1 inline-block"
>
<path
fill-rule="evenodd"
Expand All @@ -156,7 +156,7 @@ defmodule ErrorTracker.Web.CoreComponents do
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="!h-4 !w-4 inline-block"
class="!h-4 !w-4 !mr-1 inline-block"
>
<path
fill-rule="evenodd"
Expand Down
56 changes: 27 additions & 29 deletions lib/error_tracker/web/live/dashboard.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<th scope="col" class="px-4 pr-2 w-72">Error</th>
<th scope="col" class="px-4 py-3 w-72">Occurrences</th>
<th scope="col" class="px-4 py-3 w-28">Status</th>
<th scope="col" class="px-4 py-3 w-28"></th>
<th scope="col" class="px-4 py-3 w-40"></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -86,37 +86,35 @@
<.badge :if={error.status == :resolved} color={:green}>Resolved</.badge>
<.badge :if={error.status == :unresolved} color={:red}>Unresolved</.badge>
</td>
<td class="px-4 py-4 text-center">
<div class="flex justify-between">
<.button
:if={error.status == :unresolved}
phx-click="resolve"
phx-value-error_id={error.id}
>
Resolve
</.button>
<td class="px-4 py-4 pt-6 text-center flex space-x-2 justify-end">
<.button
:if={error.status == :unresolved}
phx-click="resolve"
phx-value-error_id={error.id}
>
Resolve
</.button>

<.button
:if={error.status == :resolved}
phx-click="unresolve"
phx-value-error_id={error.id}
>
Unresolve
</.button>
<.button
:if={error.status == :resolved}
phx-click="unresolve"
phx-value-error_id={error.id}
>
Unresolve
</.button>

<.button :if={!error.muted} phx-click="mute" type="link" phx-value-error_id={error.id}>
<.icon name="bell-slash" /> Mute
</.button>
<.button :if={!error.muted} phx-click="mute" phx-value-error_id={error.id} class="flex items-center btn-secondary">
<.icon name="bell-slash" /> Mute
</.button>

<.button
:if={error.muted}
phx-click="unmute"
type="link"
phx-value-error_id={error.id}
>
<.icon name="bell" /> Unmute
</.button>
</div>
<.button
:if={error.muted}
phx-click="unmute"
phx-value-error_id={error.id}
class="flex items-center btn-secondary"
>
<.icon name="bell" /> Unmute
</.button>
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions lib/error_tracker/web/live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@
Mark as unresolved
</.button>

<.button :if={[email protected]} phx-click="mute" type="link">
<.button :if={[email protected]} phx-click="mute">
<.icon name="bell-slash" /> Mute
</.button>

<.button :if={@error.muted} phx-click="unmute" type="link">
<.button :if={@error.muted} phx-click="unmute">
<.icon name="bell" /> Unmute
</.button>
</div>
Expand Down