Skip to content

Commit a90b73c

Browse files
authored
Filter runs by queue, machine, version (#2277)
* Queue in run table and filtering * Debounce the filter changes * Remove console log * Added machine filtering * Added version filtering * Filter by version in the db * Removed duplicate classes * Version filtering hasFilters consistency * Added queues and machines to the bulk action summary * runs.list filtering for queue and machine * Fix for machine errors
1 parent ff01871 commit a90b73c

19 files changed

+906
-35
lines changed

.changeset/two-eagles-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Added runs.list filtering for queue and machine

apps/webapp/app/assets/icons/MachineIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function MachineIcon({ preset, className }: { preset?: string; className?
2727
}
2828
}
2929

30-
function MachineDefaultIcon({ className }: { className?: string }) {
30+
export function MachineDefaultIcon({ className }: { className?: string }) {
3131
return (
3232
<svg className={className} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
3333
<path

apps/webapp/app/components/BulkActionFilterSummary.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,32 @@ export function BulkActionFilterSummary({
201201
/>
202202
);
203203
}
204+
case "queues": {
205+
const values = Array.isArray(value) ? value : [`${value}`];
206+
return (
207+
<AppliedFilter
208+
variant="minimal/medium"
209+
key={key}
210+
label={filterTitle(key)}
211+
icon={filterIcon(key)}
212+
value={appliedSummary(values.map((v) => v.replace("task/", "")))}
213+
removable={false}
214+
/>
215+
);
216+
}
217+
case "machines": {
218+
const values = Array.isArray(value) ? value : [`${value}`];
219+
return (
220+
<AppliedFilter
221+
variant="minimal/medium"
222+
key={key}
223+
label={filterTitle(key)}
224+
icon={filterIcon(key)}
225+
value={appliedSummary(values)}
226+
removable={false}
227+
/>
228+
);
229+
}
204230
default: {
205231
assertNever(typedKey);
206232
}

apps/webapp/app/components/MachineLabelCombo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { type MachinePresetName } from "@trigger.dev/core/v3";
1+
import { MachinePresetName } from "@trigger.dev/core/v3";
22
import { MachineIcon } from "~/assets/icons/MachineIcon";
33
import { cn } from "~/utils/cn";
44

5+
export const machines = Object.values(MachinePresetName.enum);
6+
57
export function MachineLabelCombo({
68
preset,
79
className,

0 commit comments

Comments
 (0)