Skip to content

Commit 73c34dc

Browse files
authored
Improve gig activity and historical status handling
Squash merge PR #302.
1 parent 0a10676 commit 73c34dc

18 files changed

Lines changed: 417 additions & 24 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ JOB_RETRY_MAX_SECONDS=300
3636
JOB_TIMEOUT_SECONDS=600
3737
JOB_RESULT_TTL_SECONDS=3600
3838
GIG_RECRUITING_STALE_DAYS=7
39+
GIG_RECRUITING_REMINDER_MAX_AGE_DAYS=90
3940

4041
# Internal transfer storage (optional defaults for host-run app services)
4142
MINIO_ENDPOINT=http://127.0.0.1:9000

apps/admin_dashboard/src/dashboard-utils.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest"
33
import {
44
daysSince,
55
displayOnboarder,
6+
formatDate,
67
githubUrl,
78
labelForOnboardingState,
89
linkedinUrl,
@@ -45,4 +46,8 @@ describe("dashboard utility helpers", () => {
4546
expect(daysSince("2026-05-17T00:00:00Z", now)).toBe(0)
4647
expect(daysSince("not a date", now)).toBeNull()
4748
})
49+
50+
it("includes the year in formatted timestamps", () => {
51+
expect(formatDate("2026-01-27T02:26:00Z")).toContain("2026")
52+
})
4853
})

apps/admin_dashboard/src/dashboard-utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function formatDate(value?: string | null) {
3030
const date = new Date(value)
3131
if (Number.isNaN(date.getTime())) return value
3232
return date.toLocaleString(undefined, {
33+
year: "numeric",
3334
month: "short",
3435
day: "numeric",
3536
hour: "2-digit",

apps/admin_dashboard/src/main.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ function App() {
786786
const [status, setStatus] = useState("")
787787
const [jobType, setJobType] = useState("")
788788
const [gigStatus, setGigStatus] = useState("")
789+
const [gigIncludeHistorical, setGigIncludeHistorical] = useState(false)
789790
const [gigLimit, setGigLimit] = useState(100)
790791
const [projectQuery, setProjectQuery] = useState("")
791792
const [projectStatus, setProjectStatus] = useState(initialProjectDetailId ? "" : "Open")
@@ -934,6 +935,7 @@ function App() {
934935
function gigsUrl() {
935936
const params = new URLSearchParams({ limit: String(gigLimit) })
936937
if (gigStatus) params.set("status", gigStatus)
938+
if (gigIncludeHistorical) params.set("include_historical", "true")
937939
return `/dashboard/api/gigs?${params.toString()}`
938940
}
939941

@@ -1793,10 +1795,10 @@ function App() {
17931795
if (view === "jobs" && permissions.length > 0) void loadJobs()
17941796
}, [minutes, status])
17951797

1796-
// biome-ignore lint/correctness/useExhaustiveDependencies: gigs reload intentionally follows status filter changes only while gigs is active.
1798+
// biome-ignore lint/correctness/useExhaustiveDependencies: gigs reload intentionally follows list filter changes only while gigs is active.
17971799
useEffect(() => {
17981800
if (view === "gigs" && permissions.length > 0) void loadGigs()
1799-
}, [gigStatus, gigLimit])
1801+
}, [gigStatus, gigIncludeHistorical, gigLimit])
18001802

18011803
// biome-ignore lint/correctness/useExhaustiveDependencies: projects reload intentionally follows status changes only while projects is active.
18021804
useEffect(() => {
@@ -2094,12 +2096,15 @@ function App() {
20942096
sort={sort.gigs}
20952097
loading={loading}
20962098
status={gigStatus}
2099+
includeHistorical={gigIncludeHistorical}
20972100
limit={gigLimit}
20982101
staleDays={staleRecruitingDays}
20992102
canWrite={can("gigs:write")}
2103+
canIncludeHistorical={can("people:read")}
21002104
crmContactUrl={crmContactUrl}
21012105
crmAttachmentUrl={crmAttachmentUrl}
21022106
setStatus={setGigStatus}
2107+
setIncludeHistorical={setGigIncludeHistorical}
21032108
setLimit={setGigLimit}
21042109
onRefresh={refreshGigsView}
21052110
onSort={(key) => handleSort("gigs", key)}
@@ -4417,12 +4422,15 @@ function GigsView(props: {
44174422
sort: { key: string; direction: SortDirection }
44184423
loading: Record<string, boolean>
44194424
status: string
4425+
includeHistorical: boolean
44204426
limit: number
44214427
staleDays: number
44224428
canWrite: boolean
4429+
canIncludeHistorical: boolean
44234430
crmContactUrl: (contactId?: string) => string
44244431
crmAttachmentUrl: (attachmentId?: string) => string
44254432
setStatus: (value: string) => void
4433+
setIncludeHistorical: (value: boolean) => void
44264434
setLimit: (value: number) => void
44274435
onRefresh: () => void
44284436
onSort: (key: string) => void
@@ -4442,7 +4450,7 @@ function GigsView(props: {
44424450
{ total: 0, applications: 0, interested: 0, stale: 0 },
44434451
)
44444452
const filterBar = (
4445-
<Card className="grid gap-3 p-4 md:grid-cols-[minmax(160px,1fr)_auto_auto] md:items-end">
4453+
<Card className="grid gap-3 p-4 md:grid-cols-[minmax(160px,1fr)_auto_auto_auto] md:items-end">
44464454
<Label>
44474455
Status
44484456
<Select
@@ -4458,6 +4466,16 @@ function GigsView(props: {
44584466
))}
44594467
</Select>
44604468
</Label>
4469+
{props.canIncludeHistorical ? (
4470+
<label className="flex min-h-9 items-center gap-2 text-xs font-bold text-muted-foreground">
4471+
<input
4472+
type="checkbox"
4473+
checked={props.includeHistorical}
4474+
onChange={(event) => props.setIncludeHistorical(event.target.checked)}
4475+
/>
4476+
Include historical
4477+
</label>
4478+
) : null}
44614479
<Button
44624480
id="refreshGigs"
44634481
type="button"

apps/api/src/five08/backend/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,6 +2797,7 @@ async def dashboard_people_handler(
27972797
async def dashboard_gigs_handler(
27982798
request: Request,
27992799
status: str | None = Query(default=None),
2800+
include_historical: bool = Query(default=False),
28002801
limit: int = Query(default=100, ge=1, le=500),
28012802
) -> JSONResponse:
28022803
"""Return dashboard-visible Discord gigs and candidate fit snapshots."""
@@ -2826,6 +2827,7 @@ async def dashboard_gigs_handler(
28262827
settings,
28272828
viewer_discord_user_id=session.subject,
28282829
include_all=include_all,
2830+
include_historical=include_historical and include_all,
28292831
status=normalized_status,
28302832
limit=limit,
28312833
)
@@ -2855,6 +2857,7 @@ async def dashboard_gig_detail_handler(
28552857
settings,
28562858
viewer_discord_user_id=session.subject,
28572859
include_all=include_all,
2860+
include_historical=True,
28582861
engagement_id=normalized_engagement_id,
28592862
limit=1,
28602863
)
@@ -2883,6 +2886,7 @@ async def dashboard_notifications_handler(
28832886
viewer_discord_user_id=session.subject,
28842887
include_all=include_all,
28852888
stale_days=settings.gig_recruiting_stale_days,
2889+
max_age_days=settings.gig_recruiting_reminder_max_age_days,
28862890
limit=limit,
28872891
)
28882892
return JSONResponse(
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"index.html": {
3-
"file": "assets/index-DAy1pv-J.js",
3+
"file": "assets/index-DT8AhUVi.js",
44
"name": "index",
55
"src": "index.html",
66
"isEntry": true,
77
"css": [
8-
"assets/index-0wkHV6At.css"
8+
"assets/index-D2CiH-sJ.css"
99
]
1010
}
1111
}

apps/api/src/five08/backend/static/dashboard/assets/index-0wkHV6At.css renamed to apps/api/src/five08/backend/static/dashboard/assets/index-D2CiH-sJ.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/api/src/five08/backend/static/dashboard/assets/index-DAy1pv-J.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/api/src/five08/backend/static/dashboard/assets/index-DT8AhUVi.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/api/src/five08/backend/static/dashboard/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>508 Operations Dashboard</title>
7-
<script type="module" crossorigin src="/dashboard/assets/index-DAy1pv-J.js"></script>
8-
<link rel="stylesheet" crossorigin href="/dashboard/assets/index-0wkHV6At.css">
7+
<script type="module" crossorigin src="/dashboard/assets/index-DT8AhUVi.js"></script>
8+
<link rel="stylesheet" crossorigin href="/dashboard/assets/index-D2CiH-sJ.css">
99
</head>
1010
<body>
1111
<div id="root"></div>

0 commit comments

Comments
 (0)