diff --git a/site/src/pages/TasksPage/BatchDeleteConfirmation.stories.tsx b/site/src/pages/TasksPage/BatchDeleteConfirmation.stories.tsx index bea8e1796e..4d14bf6e1d 100644 --- a/site/src/pages/TasksPage/BatchDeleteConfirmation.stories.tsx +++ b/site/src/pages/TasksPage/BatchDeleteConfirmation.stories.tsx @@ -33,7 +33,7 @@ const meta: Meta = { name: "task-docs-789", display_name: "Update Documentation", initial_prompt: "Update documentation for the new features", - // Intentionally null to test that only 2 workspaces are shown in review resources stage + // Intentionally null to test that only 2 workspaces are shown workspace_id: null, created_at: new Date( Date.now() - 3 * 24 * 60 * 60 * 1000, @@ -64,23 +64,3 @@ export const ReviewTasks: Story = { }); }, }; - -export const ReviewResources: Story = { - play: async ({ canvasElement, step }) => { - const body = within(canvasElement.ownerDocument.body); - - await step("Advance to stage 2: Review tasks", async () => { - const confirmButton = await body.findByRole("button", { - name: /review selected tasks/i, - }); - await userEvent.click(confirmButton); - }); - - await step("Advance to stage 3: Review resources", async () => { - const confirmButton = await body.findByRole("button", { - name: /confirm.*tasks/i, - }); - await userEvent.click(confirmButton); - }); - }, -}; diff --git a/site/src/pages/TasksPage/BatchDeleteConfirmation.tsx b/site/src/pages/TasksPage/BatchDeleteConfirmation.tsx index 9e903f8985..825f98bfb4 100644 --- a/site/src/pages/TasksPage/BatchDeleteConfirmation.tsx +++ b/site/src/pages/TasksPage/BatchDeleteConfirmation.tsx @@ -2,7 +2,7 @@ import type { Task } from "api/typesGenerated"; import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog"; import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; -import { ClockIcon, ServerIcon, UserIcon } from "lucide-react"; +import { ClockIcon, UserIcon } from "lucide-react"; import { type FC, type ReactNode, useState } from "react"; dayjs.extend(relativeTime); @@ -24,17 +24,12 @@ export const BatchDeleteConfirmation: FC = ({ onConfirm, isLoading, }) => { - const [stage, setStage] = useState<"consequences" | "tasks" | "resources">( - "consequences", - ); + const [stage, setStage] = useState<"consequences" | "tasks">("consequences"); const onProceed = () => { switch (stage) { - case "resources": - onConfirm(); - break; case "tasks": - setStage("resources"); + onConfirm(); break; case "consequences": setStage("tasks"); @@ -45,15 +40,12 @@ export const BatchDeleteConfirmation: FC = ({ const taskCount = `${checkedTasks.length} ${ checkedTasks.length === 1 ? "task" : "tasks" }`; + const workspaceCountText = `${workspaceCount} ${ + workspaceCount === 1 ? "workspace" : "workspaces" + }`; let confirmText: ReactNode = <>Review selected tasks…; if (stage === "tasks") { - confirmText = <>Confirm {taskCount}…; - } - if (stage === "resources") { - const workspaceCountText = `${workspaceCount} ${ - workspaceCount === 1 ? "workspace" : "workspaces" - }`; confirmText = ( <> Delete {taskCount} and {workspaceCountText} @@ -70,7 +62,6 @@ export const BatchDeleteConfirmation: FC = ({ onClose(); }} title={`Delete ${taskCount}`} - hideCancel confirmLoading={isLoading} confirmText={confirmText} onConfirm={onProceed} @@ -78,11 +69,6 @@ export const BatchDeleteConfirmation: FC = ({ <> {stage === "consequences" && } {stage === "tasks" && } - {stage === "resources" && ( - - )} - {/* Preload ServerIcon to prevent flicker on stage 3 */} - } /> @@ -93,11 +79,6 @@ interface TasksStageProps { tasks: readonly Task[]; } -interface ResourcesStageProps { - tasks: readonly Task[]; - workspaceCount: number; -} - const Consequences: FC = () => { return ( <> @@ -174,24 +155,3 @@ const Tasks: FC = ({ tasks }) => { ); }; - -const Resources: FC = ({ tasks, workspaceCount }) => { - const taskCount = tasks.length; - - return ( -
-

- Deleting {taskCount === 1 ? "this task" : "these tasks"} will also - permanently destroy… -

-
-
- - - {workspaceCount} {workspaceCount === 1 ? "workspace" : "workspaces"} - -
-
-
- ); -};