Skip to content

Commit 4b4d96a

Browse files
authored
Merge branch 'main' into fix-extra-trial
2 parents ed44f53 + f25a333 commit 4b4d96a

File tree

5 files changed

+45
-12
lines changed

5 files changed

+45
-12
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Each task should have a created_at date so that we can sort by assigned date
2+
-- NOTE: This relies on the assigned date never changing; if the app allows changes, we will likely want create a dedicated assigned_on date in addition to (or instead of) this column
3+
ALTER TABLE task
4+
ADD COLUMN created_at TIMESTAMPTZ NOT NULL DEFAULT NOW();
5+
6+
-- Add index to allow easy queries of tasks by date
7+
CREATE INDEX idx_created_at ON task(created_at);

src/backend/db/zapatos/schema.d.ts

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

src/backend/routers/para.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const para = router({
8383
"task.due_date",
8484
"task.seen",
8585
"task.trial_count",
86+
"task.created_at",
8687

8788
eb
8889
.selectFrom("trial_data")

src/pages/benchmarks/index.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,9 @@ function Benchmarks() {
122122
<FilterAlt /> Filter <KeyboardArrowDown />
123123
</span>
124124

125-
{
126-
// TODO: replace simple sort pill w/this sort pill placeholder
127-
/*
128-
TODO: replace simple sort pill w/this sort pill placeholder
129-
130-
Sort Pill Placeholder
131-
<span
125+
{/* simple sort pill POC (TODO: add `<KeyboardArrowDown/>` if dropdown needed) */}
126+
<button
127+
onClick={() => handleSort("created_at")}
132128
className={`${$button.pilled}`}
133129
style={{
134130
display: "flex",
@@ -137,10 +133,8 @@ function Benchmarks() {
137133
gap: "4px",
138134
}}
139135
>
140-
<Sort /> Sort <KeyboardArrowDown />
141-
</span>
142-
*/
143-
}
136+
<Sort /> Sort by date
137+
</button>
144138

145139
{/* simple sort pill POC (see TODO above) */}
146140
<button

src/types/global.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type Benchmark = SelectableForTable<"benchmark">;
55
export type ChangeEvent = React.ChangeEvent<HTMLInputElement>;
66
export type FormEvent = React.FormEvent<HTMLFormElement>;
77

8-
export type SortProperty = "first_name";
8+
export type SortProperty = "first_name" | "created_at";
99
export type SortDirection = "asc" | "desc";
1010

1111
export interface TaskData {
@@ -21,4 +21,5 @@ export interface TaskData {
2121
trial_count: number | null;
2222
seen: boolean;
2323
completed_trials: string | number | bigint | null;
24+
created_at: Date;
2425
}

0 commit comments

Comments
 (0)