Skip to content

Commit a18f52a

Browse files
committed
fix: broken org pages
1 parent e22ad9e commit a18f52a

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

lib/algora/bounties/schemas/claim.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,18 @@ defmodule Algora.Bounties.Claim do
5858

5959
def rewarded(query \\ Claim) do
6060
from c in query,
61-
where: c.state == :approved and not is_nil(c.charged_at)
61+
join: t in assoc(c, :transactions),
62+
where: c.status == :approved,
63+
where: t.type == :credit,
64+
where: t.status == :succeeded
6265
end
6366

6467
def filter_by_org_id(query, nil), do: query
6568

6669
def filter_by_org_id(query, org_id) do
6770
from c in query,
68-
join: b in assoc(c, :bounty),
71+
join: t in assoc(c, :target),
72+
join: b in assoc(t, :bounties),
6973
join: u in assoc(b, :owner),
7074
where: u.id == ^org_id
7175
end

lib/algora_web/components/ui/stat_card.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ defmodule AlgoraWeb.Components.UI.StatCard do
4444
{render_slot(@inner_block)}
4545
<% end %>
4646
</div>
47-
<p :if={@subtext} class="text-xs text-muted-foreground">{@subtext}</p>
47+
<p :if={@subtext} class="text-xs text-muted-foreground">
48+
{if @subtext == "", do: {:safe, "&nbsp;"}, else: @subtext}
49+
</p>
4850
</div>
4951
</div>
5052
"""

lib/algora_web/live/org/analytics_live.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ defmodule AlgoraWeb.Org.AnalyticsLive do
33
use AlgoraWeb, :live_view
44

55
alias Algora.Bounties
6+
alias Algora.Bounties.Bounty
67

78
def mount(_params, _session, socket) do
89
org_id = socket.assigns.current_org.id
@@ -82,7 +83,7 @@ defmodule AlgoraWeb.Org.AnalyticsLive do
8283
<.link
8384
class="group relative flex flex-col items-start gap-x-4 gap-y-2 py-4 sm:flex-row sm:items-center"
8485
rel="noopener"
85-
href={"https://github.com/#{bounty.ticket.owner}/#{bounty.ticket.repo}/issues/#{bounty.ticket.number}"}
86+
href={Bounty.url(bounty)}
8687
>
8788
<div class="min-w-0 flex-auto">
8889
<div class="flex items-center gap-x-3">

lib/algora_web/live/org/dashboard_public_live.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ defmodule AlgoraWeb.Org.DashboardPublicLive do
4040
]
4141
end
4242

43-
defp social_link(user, :github), do: if(login = user[:provider_login], do: "https://github.com/#{login}")
44-
defp social_link(user, platform), do: user[:"#{platform}_url"]
43+
defp social_link(user, :github), do: if(login = user.provider_login, do: "https://github.com/#{login}")
44+
defp social_link(user, platform), do: Map.get(user, :"#{platform}_url")
4545

4646
def render(assigns) do
4747
~H"""

lib/algora_web/live/org/nav.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ defmodule AlgoraWeb.Org.Nav do
4141
{AlgoraWeb.Org.BountiesLive, _} -> :bounties
4242
{AlgoraWeb.Org.ProjectsLive, _} -> :projects
4343
{AlgoraWeb.Project.ViewLive, _} -> :projects
44-
{AlgoraWeb.Org.JobsLive, _} -> :jobs
4544
{AlgoraWeb.Org.SettingsLive, _} -> :settings
4645
{AlgoraWeb.Org.MembersLive, _} -> :members
4746
{_, _} -> nil
@@ -67,7 +66,6 @@ defmodule AlgoraWeb.Org.Nav do
6766
icon: "tabler-diamond",
6867
label: "Bounties"
6968
},
70-
%{href: "/org/#{org_handle}/jobs", tab: :jobs, icon: "tabler-briefcase", label: "Jobs"},
7169
%{
7270
href: "/org/#{org_handle}/team",
7371
tab: :team,

0 commit comments

Comments
 (0)