Skip to content

Commit a640d67

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: allow canceling jobs while jobs are loading (#34369)
GitOrigin-RevId: 5690931e0bfd5c4d851b75ed08f7f35ac41cd744
1 parent 2801106 commit a640d67

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

npm-packages/dashboard-common/src/features/schedules/components/ScheduledFunctionsContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function ScheduledFunctionsContent({
3030

3131
return (
3232
<div className="relative flex h-full max-w-6xl grow flex-col gap-4">
33-
<ScheduledFunctionsContentToolbar jobs={jobs} />
33+
<ScheduledFunctionsContentToolbar />
3434
<Sheet
3535
className="flex min-w-[40rem] max-w-full grow flex-col"
3636
padding={false}

npm-packages/dashboard-common/src/features/schedules/components/ScheduledFunctionsContentToolbar.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { TrashIcon } from "@radix-ui/react-icons";
22
import { useRouter } from "next/router";
33
import { useContext, useState } from "react";
4-
import { ScheduledJob } from "system-udfs/convex/_system/frontend/common";
54
import { useCancelAllJobs } from "@common/features/schedules/lib/api";
65
import { DeploymentInfoContext } from "@common/lib/deploymentContext";
76
import {
@@ -20,11 +19,7 @@ import { Button } from "@common/elements/Button";
2019
import { SchedulerStatus } from "@common/elements/SchedulerStatus";
2120
import { ConfirmationDialog } from "@common/elements/ConfirmationDialog";
2221

23-
export function ScheduledFunctionsContentToolbar({
24-
jobs,
25-
}: {
26-
jobs: ScheduledJob[];
27-
}) {
22+
export function ScheduledFunctionsContentToolbar() {
2823
const currentOpenFunction = useCurrentOpenFunction();
2924
const moduleFunctions = useModuleFunctions();
3025
const router = useRouter();
@@ -94,7 +89,7 @@ export function ScheduledFunctionsContentToolbar({
9489
size="sm"
9590
onClick={() => setShowDeleteModal(true)}
9691
icon={<TrashIcon />}
97-
disabled={jobs.length === 0 || !canCancelJobs}
92+
disabled={!canCancelJobs}
9893
tip={
9994
!canCancelJobs &&
10095
"You do not have permission to cancel scheduled runs in production."

0 commit comments

Comments
 (0)