Skip to content

Commit 54e00af

Browse files
authored
feat: bounty claims (#30)
* feat: bounty claims * handle all kinds of ticket_refs * refactor controller for better control and o11y * properly set ids * update claim notif * improve notif handling * restructure claim schema * add /claims/:id * render claim body * improve claim page * simplify claim status values * drop unique constraint on claims * add group share on claims * update seeds to add shared claims * update claim page to display co-authors * display paid amount on claim page * handle not found case * include all claims when calculating total paid * handle all types of claim payment statuses * update context in rendered markdown * reorganize page * reorganize more * update styling * impl create_payment_session * in midst of implementing reward_bounty * handle splits * miscellanea * add reward bounty drawer * finalize reward bounty form * filter specific event actions * fix miscellanea * update tests * add label on bounty created * delete obsolete class
1 parent eca9ed3 commit 54e00af

File tree

27 files changed

+1559
-413
lines changed

27 files changed

+1559
-413
lines changed

config/config.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ config :algora, Oban,
3232
comment_consumers: 1,
3333
github_og_image: 5,
3434
notify_bounty: 1,
35-
notify_tip_intent: 1
35+
notify_tip_intent: 1,
36+
notify_claim: 1
3637
]
3738

3839
# Configures the mailer

lib/algora/accounts/accounts.ex

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,15 @@ defmodule Algora.Accounts do
318318
end
319319

320320
def get_random_access_tokens(n) when is_integer(n) and n > 0 do
321-
Identity
322-
|> where([i], i.provider == "github" and not is_nil(i.provider_token))
323-
|> order_by(fragment("RANDOM()"))
324-
|> limit(^n)
325-
|> select([i], i.provider_token)
326-
|> Repo.all()
321+
case Identity
322+
|> where([i], i.provider == "github" and not is_nil(i.provider_token))
323+
|> order_by(fragment("RANDOM()"))
324+
|> limit(^n)
325+
|> select([i], i.provider_token)
326+
|> Repo.all() do
327+
[""] -> []
328+
tokens -> tokens
329+
end
327330
end
328331

329332
defp update_github_token(%User{} = user, new_token) do

0 commit comments

Comments
 (0)