Skip to content

Commit 043472d

Browse files
committed
miscellanea
feat: enhance tx filtering and job match timestamps feat: add hiring_keywords field to users and full_description to job postings style: update footer and header components for improved UI fix: update bounty amount displayed in platform and home live views chore: clean up onboarding form and improve user experience
1 parent 8844dd5 commit 043472d

24 files changed

+305
-168
lines changed

config/config.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config :algora,
2222
{"/create/org", "/onboarding/org"},
2323
{"/solve", "/onboarding/dev"},
2424
{"/onboarding/solver", "/onboarding/dev"},
25-
{"/onboarding/org", "https://cal.com/ioannisflo"},
2625
{"/:org/contract/:id", "/:org/contracts/:id"},
2726
{"/org/*path", "/*path"},
2827
{"/@/:handle", "/:handle/profile"},

config/runtime.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if config_env() == :prod do
5555
config :algora, Algora.Repo,
5656
# ssl: true,
5757
url: database_url,
58-
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "20"),
58+
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
5959
socket_options: maybe_ipv6,
6060
migration_primary_key: [type: :string],
6161
migration_timestamps: [type: :utc_datetime_usec],

lib/algora/accounts/schemas/user.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ defmodule Algora.Accounts.User do
5959
field :seeking_jobs, :boolean, default: false
6060
field :hiring, :boolean, default: false
6161
field :hiring_subscription, Ecto.Enum, values: [:inactive, :trial, :active], default: :inactive
62+
field :hiring_keywords, :string
6263

6364
field :hourly_rate_min, Money
6465
field :hourly_rate_max, Money
@@ -438,7 +439,7 @@ defmodule Algora.Accounts.User do
438439
end
439440

440441
def hiring_changeset(%User{} = user, params) do
441-
cast(user, params, [:preferences, :executive_name, :executive_role, :billing_name, :billing_address])
442+
cast(user, params, [:preferences, :executive_name, :executive_role, :billing_name, :billing_address, :hiring_keywords])
442443
end
443444

444445
defp validate_url(changeset, field) do

lib/algora/cloud.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ defmodule Algora.Cloud do
5757
call(AlgoraCloud, :token, [])
5858
end
5959

60+
def filter_featured_txs(transactions) do
61+
if :code.which(AlgoraCloud) == :non_existing do
62+
transactions
63+
else
64+
apply(AlgoraCloud, :filter_featured_txs, [transactions])
65+
end
66+
end
67+
6068
defp call(module, function, args) do
6169
if :code.which(module) == :non_existing do
6270
# TODO: call algora API

lib/algora/jobs/schemas/job_posting.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ defmodule Algora.Jobs.JobPosting do
2525
field :system_tags, {:array, :string}, default: []
2626
field :primary_tech, :string
2727
field :primary_tag, :string
28+
field :full_description, :string
2829

2930
field :location_meta, :map
3031
field :location_iso_lvl4, :string
@@ -58,7 +59,8 @@ defmodule Algora.Jobs.JobPosting do
5859
:location_meta,
5960
:location_iso_lvl4,
6061
:primary_tech,
61-
:primary_tag
62+
:primary_tag,
63+
:full_description
6264
])
6365
|> generate_id()
6466
|> validate_required([:url, :company_name, :company_url, :email])

lib/algora/matches/matches.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ defmodule Algora.Matches do
1414
|> filter_by_job_posting_id(opts[:job_posting_id])
1515
|> filter_by_user_id(opts[:user_id])
1616
|> filter_by_status(opts[:status])
17+
|> join(:inner, [m], j in assoc(m, :job_posting), as: :j)
18+
|> filter_by_org_id(opts[:org_id])
1719
|> order_by(^order_by_clause)
1820
|> maybe_preload(opts[:preload])
1921
|> Repo.all()
@@ -173,6 +175,12 @@ defmodule Algora.Matches do
173175
where(query, [m], m.user_id == ^user_id)
174176
end
175177

178+
defp filter_by_org_id(query, nil), do: query
179+
180+
defp filter_by_org_id(query, org_id) do
181+
where(query, [m, j], j.user_id == ^org_id)
182+
end
183+
176184
defp filter_by_status(query, nil), do: query
177185

178186
defp filter_by_status(query, status) do

lib/algora/matches/schemas/job_match.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ defmodule Algora.Matches.JobMatch do
88
field :status, Ecto.Enum, values: [:pending, :discarded, :approved, :highlighted], default: :pending
99
field :score, :decimal
1010
field :notes, :string
11+
field :approved_at, :utc_datetime_usec
12+
field :bookmarked_at, :utc_datetime_usec
13+
field :discarded_at, :utc_datetime_usec
1114

1215
belongs_to :user, Algora.Accounts.User
1316
belongs_to :job_posting, Algora.Jobs.JobPosting
@@ -17,7 +20,7 @@ defmodule Algora.Matches.JobMatch do
1720

1821
def changeset(job_match, attrs) do
1922
job_match
20-
|> cast(attrs, [:user_id, :job_posting_id, :status, :score, :notes])
23+
|> cast(attrs, [:user_id, :job_posting_id, :status, :score, :notes, :approved_at, :bookmarked_at, :discarded_at])
2124
|> validate_required([:user_id, :job_posting_id])
2225
|> validate_inclusion(:status, [:pending, :discarded, :approved, :highlighted])
2326
|> foreign_key_constraint(:user_id)

lib/algora/payments/payments.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ defmodule Algora.Payments do
439439

440440
query = from q in query, limit: ^opts[:limit]
441441

442-
Repo.all(query)
442+
query
443+
|> Repo.all()
444+
|> Algora.Cloud.filter_featured_txs()
443445
end
444446

445447
def list_received_transactions(user_id, opts \\ []) do
@@ -469,7 +471,9 @@ defmodule Algora.Payments do
469471

470472
query = from q in query, limit: ^opts[:limit]
471473

472-
Repo.all(query)
474+
query
475+
|> Repo.all()
476+
|> Algora.Cloud.filter_featured_txs()
473477
end
474478

475479
@spec enqueue_pending_transfers(user_id :: String.t()) :: {:ok, nil} | {:error, term()}
@@ -879,6 +883,7 @@ defmodule Algora.Payments do
879883
transactions =
880884
tx_query
881885
|> Repo.all()
886+
|> Algora.Cloud.filter_featured_txs()
882887
|> Enum.reduce(%{}, fn tx, acc ->
883888
# Group transactions by bounty_id when repository is null and bounty_id exists
884889
if tx.bounty_id && !tx.ticket.repository do

lib/algora/workspace/workspace.ex

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ defmodule Algora.Workspace do
9898
where: t.number == ^number,
9999
where: r.name == ^repo,
100100
where: u.provider_login == ^owner,
101-
preload: [repository: {r, user: u}]
101+
preload: [repository: {r, user: u}],
102+
limit: 1
102103
)
103104
)
104105
end
@@ -643,9 +644,7 @@ defmodule Algora.Workspace do
643644
def list_user_contributions(ids, opts \\ []) do
644645
tech_stack = opts[:tech_stack] || []
645646

646-
tech_stack = if "Haskell" in tech_stack, do: ["Haskell"], else: tech_stack
647-
648-
strict_tech_stack = "Haskell" in tech_stack || opts[:strict_tech_stack]
647+
strict_tech_stack = opts[:strict_tech_stack]
649648

650649
query =
651650
from uc in UserContribution,

lib/algora_web/components/footer.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ defmodule AlgoraWeb.Components.Footer do
227227
228228
<div class="flex flex-col gap-2">
229229
<.link
230-
class="flex w-max items-center gap-2 rounded-full border border-gray-700 py-2 pl-2 pr-3.5 text-xs text-muted-foreground hover:text-foreground transition-colors hover:border-gray-600"
230+
class="flex w-max items-center gap-2 rounded-full border border-gray-500 py-2 pl-2 pr-3.5 text-xs text-foreground/90 hover:text-foreground transition-colors hover:border-gray-400"
231231
href={"tel:" <> Constants.get(:tel)}
232232
>
233233
<.icon name="tabler-phone-filled" class="size-4" /> Call us

0 commit comments

Comments
 (0)