Skip to content

Commit edeb008

Browse files
committed
miscellanea
1 parent 4b256c7 commit edeb008

File tree

7 files changed

+35
-7
lines changed

7 files changed

+35
-7
lines changed

lib/algora/matches/matches.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ defmodule Algora.Matches do
1616
JobMatch
1717
|> filter_by_job_posting_id(opts[:job_posting_id])
1818
|> filter_by_user_id(opts[:user_id])
19+
|> filter_by_org_id(opts[:org_id])
1920
|> filter_by_status(opts[:status])
2021
|> join(:inner, [m], j in assoc(m, :job_posting), as: :j)
2122
|> filter_by_org_id(opts[:org_id])
@@ -233,8 +234,8 @@ defmodule Algora.Matches do
233234
asc: m.candidate_approved_at,
234235
asc: m.candidate_bookmarked_at,
235236
desc: m.candidate_discarded_at,
236-
asc: fragment("CASE WHEN ? = 'highlighted' THEN 0 WHEN ? = 'approved' THEN 1 ELSE 2 END", m.status, m.status),
237-
desc: m.updated_at
237+
# asc: fragment("CASE WHEN ? = 'highlighted' THEN 0 WHEN ? = 'approved' THEN 1 ELSE 2 END", m.status, m.status),
238+
desc: m.inserted_at
238239
)
239240
|> preload(job_posting: :user)
240241
|> Repo.all()

lib/algora/matches/schemas/job_match.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ defmodule Algora.Matches.JobMatch do
1515
field :candidate_bookmarked_at, :utc_datetime_usec
1616
field :candidate_discarded_at, :utc_datetime_usec
1717
field :custom_sort_order, :integer
18+
field :anonymize, :boolean, default: true
1819

1920
belongs_to :user, Algora.Accounts.User
2021
belongs_to :job_posting, Algora.Jobs.JobPosting
@@ -36,7 +37,8 @@ defmodule Algora.Matches.JobMatch do
3637
:candidate_approved_at,
3738
:candidate_bookmarked_at,
3839
:candidate_discarded_at,
39-
:custom_sort_order
40+
:custom_sort_order,
41+
:anonymize
4042
])
4143
|> validate_required([:user_id, :job_posting_id])
4244
|> validate_inclusion(:status, [:pending, :discarded, :approved, :highlighted])

lib/algora/shared/money_utils.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ defmodule Algora.MoneyUtils do
44
def fmt_precise!(money), do: Money.to_string!(money, no_fraction_if_integer: false)
55

66
def fmt_compact(money) do
7-
# TODO: handle other currencies
8-
"$" <> Algora.Util.format_number_compact(money.amount)
7+
money
8+
|> Money.to_string!(no_fraction_if_integer: true)
9+
|> String.replace(",000,000", "M")
10+
|> String.replace(",000", "k")
911
end
1012

1113
@spec split_evenly(Money.t(), non_neg_integer()) :: [Money.t()]

lib/algora/shared/util.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,14 @@ defmodule Algora.Util do
270270
end
271271

272272
def compact_org_name(org_name) do
273-
# Remove YC batch strings like "YC S24", "YC W23", etc.
274273
org_name
274+
# Remove YC batch strings like "YC S24", "YC W23", etc.
275275
|> String.replace(~r/\s*\(?YC\s+[a-z]\d{2}\)?\s*/i, "")
276+
# Remove common company suffixes
277+
|> String.replace(
278+
~r/,?\s+(PBC\.?|Public Benefit Corporation|Corporation|Corp\.?|,?\s*Inc\.?|Labs|Technologies|Industries|Research)\s*$/i,
279+
""
280+
)
276281
|> String.trim()
277282
end
278283
end

lib/algora_web/components/tech_badge.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,15 @@ defmodule AlgoraWeb.Components.TechBadge do
129129
"transformers" ->
130130
"huggingface"
131131

132+
"spark" ->
133+
"apachespark"
134+
132135
"kafka" ->
133136
"apachekafka"
134137

138+
"apache kafka" ->
139+
"apachekafka"
140+
135141
"vim script" ->
136142
"vim"
137143

@@ -224,6 +230,7 @@ defmodule AlgoraWeb.Components.TechBadge do
224230
"TikTok",
225231
"Django",
226232
"ApacheKafka",
233+
"ApacheSpark",
227234
"ObjectiveC",
228235
"Envoy",
229236
"RabbitMQ",

lib/algora_web/live/org/jobs_live.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ defmodule AlgoraWeb.Org.JobsLive do
132132
<div class="flex items-center gap-2">
133133
<%= if @current_user_role in [:admin, :mod] do %>
134134
<.link
135-
navigate={~p"/#{@current_org.handle}/jobs/#{job.id}"}
135+
navigate={~p"/#{@current_org.handle}/job/#{job.id}"}
136136
class="text-lg sm:text-2xl font-semibold"
137137
>
138138
<span class="underline">{job.title}</span>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
defmodule Algora.Repo.Migrations.AddAnonymizeToJobMatches do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:job_matches) do
6+
add :anonymize, :boolean, default: true
7+
end
8+
9+
create index(:job_matches, [:anonymize])
10+
end
11+
end

0 commit comments

Comments
 (0)