Skip to content

Commit 99a3137

Browse files
committed
In the batch filtering, use id instead of batchId in the URL
1 parent b7599ed commit 99a3137

File tree

3 files changed

+13
-46
lines changed

3 files changed

+13
-46
lines changed

apps/webapp/app/components/runs/v3/BatchFilters.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ function BatchIdDropdown({
773773
}) {
774774
const [open, setOpen] = useState<boolean | undefined>();
775775
const { value, replace } = useSearchParams();
776-
const batchIdValue = value("batchId");
776+
const batchIdValue = value("id");
777777

778778
const [batchId, setBatchId] = useState(batchIdValue);
779779

@@ -782,7 +782,7 @@ function BatchIdDropdown({
782782
replace({
783783
cursor: undefined,
784784
direction: undefined,
785-
batchId: batchId === "" ? undefined : batchId?.toString(),
785+
id: batchId === "" ? undefined : batchId?.toString(),
786786
});
787787

788788
setOpen(false);
@@ -851,11 +851,11 @@ function BatchIdDropdown({
851851
function AppliedBatchIdFilter() {
852852
const { value, del } = useSearchParams();
853853

854-
if (value("batchId") === undefined) {
854+
if (value("id") === undefined) {
855855
return null;
856856
}
857857

858-
const batchId = value("batchId");
858+
const batchId = value("id");
859859

860860
return (
861861
<FilterMenuProvider>
@@ -866,7 +866,7 @@ function AppliedBatchIdFilter() {
866866
<AppliedFilter
867867
label="Batch ID"
868868
value={batchId}
869-
onRemove={() => del(["batchId", "cursor", "direction"])}
869+
onRemove={() => del(["id", "cursor", "direction"])}
870870
/>
871871
</Ariakit.Select>
872872
}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.batches/route.tsx

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,23 @@
1-
import {
2-
CheckCircleIcon,
3-
ClockIcon,
4-
ExclamationCircleIcon,
5-
RectangleGroupIcon,
6-
} from "@heroicons/react/20/solid";
7-
import { ArrowUpCircleIcon } from "@heroicons/react/24/outline";
1+
import { ExclamationCircleIcon } from "@heroicons/react/20/solid";
82
import { BookOpenIcon } from "@heroicons/react/24/solid";
9-
import { Outlet, useLocation, useNavigation, useParams } from "@remix-run/react";
3+
import { useNavigation } from "@remix-run/react";
104
import { LoaderFunctionArgs } from "@remix-run/server-runtime";
115
import { formatDuration } from "@trigger.dev/core/v3/utils/durations";
126
import { typedjson, useTypedLoaderData } from "remix-typedjson";
13-
import { Feedback } from "~/components/Feedback";
147
import { ListPagination } from "~/components/ListPagination";
158
import { AdminDebugTooltip } from "~/components/admin/debugTooltip";
16-
import { InlineCode } from "~/components/code/InlineCode";
17-
import { EnvironmentLabel, EnvironmentLabels } from "~/components/environments/EnvironmentLabel";
18-
import { MainCenteredContainer, PageBody, PageContainer } from "~/components/layout/AppLayout";
19-
import { Button, LinkButton } from "~/components/primitives/Buttons";
9+
import { EnvironmentLabel } from "~/components/environments/EnvironmentLabel";
10+
import { PageBody, PageContainer } from "~/components/layout/AppLayout";
11+
import { LinkButton } from "~/components/primitives/Buttons";
2012
import { DateTime } from "~/components/primitives/DateTime";
21-
import { Header3 } from "~/components/primitives/Headers";
22-
import { InfoPanel } from "~/components/primitives/InfoPanel";
2313
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
24-
import { PaginationControls } from "~/components/primitives/Pagination";
2514
import { Paragraph } from "~/components/primitives/Paragraph";
26-
import {
27-
ResizableHandle,
28-
ResizablePanel,
29-
ResizablePanelGroup,
30-
} from "~/components/primitives/Resizable";
3115
import { Spinner } from "~/components/primitives/Spinner";
3216
import {
3317
Table,
3418
TableBlankRow,
3519
TableBody,
3620
TableCell,
37-
TableCellChevron,
3821
TableHeader,
3922
TableHeaderCell,
4023
TableRow,
@@ -46,30 +29,14 @@ import {
4629
BatchStatusCombo,
4730
descriptionForBatchStatus,
4831
} from "~/components/runs/v3/BatchStatus";
49-
import { EnabledStatus } from "~/components/runs/v3/EnabledStatus";
5032
import { LiveTimer } from "~/components/runs/v3/LiveTimer";
51-
import { ScheduleFilters } from "~/components/runs/v3/ScheduleFilters";
52-
import {
53-
ScheduleTypeCombo,
54-
ScheduleTypeIcon,
55-
scheduleTypeName,
56-
} from "~/components/runs/v3/ScheduleType";
5733
import { useOrganization } from "~/hooks/useOrganizations";
5834
import { useProject } from "~/hooks/useProject";
59-
import { useUser } from "~/hooks/useUser";
6035
import { redirectWithErrorMessage } from "~/models/message.server";
6136
import { findProjectBySlug } from "~/models/project.server";
6237
import { BatchList, BatchListPresenter } from "~/presenters/v3/BatchListPresenter.server";
63-
import { type ScheduleListItem } from "~/presenters/v3/ScheduleListPresenter.server";
6438
import { requireUserId } from "~/services/session.server";
65-
import {
66-
ProjectParamSchema,
67-
docsPath,
68-
v3BatchRunsPath,
69-
v3BillingPath,
70-
v3NewSchedulePath,
71-
v3SchedulePath,
72-
} from "~/utils/pathBuilder";
39+
import { docsPath, ProjectParamSchema, v3BatchRunsPath } from "~/utils/pathBuilder";
7340

7441
export const loader = async ({ request, params }: LoaderFunctionArgs) => {
7542
const userId = await requireUserId(request);
@@ -84,7 +51,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
8451
period: url.searchParams.get("period") ?? undefined,
8552
from: url.searchParams.get("from") ?? undefined,
8653
to: url.searchParams.get("to") ?? undefined,
87-
id: url.searchParams.get("batchId") ?? undefined,
54+
id: url.searchParams.get("id") ?? undefined,
8855
};
8956
const filters = BatchListFilters.parse(s);
9057

apps/webapp/app/utils/pathBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export function v3BatchPath(
446446
project: ProjectForPath,
447447
batch: { friendlyId: string }
448448
) {
449-
return `${v3ProjectPath(organization, project)}/batches?batchId=${batch.friendlyId}`;
449+
return `${v3ProjectPath(organization, project)}/batches?id=${batch.friendlyId}`;
450450
}
451451

452452
export function v3BatchRunsPath(

0 commit comments

Comments
 (0)