Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: disable eval config after confirmation only (#1746)

Max Deichmann24b8722ad537
diff --git a/web/src/features/evals/components/eval-config-detail.tsx b/web/src/features/evals/components/eval-config-detail.tsx
index 763c7c7311..f6f8433cf5 100644
--- a/web/src/features/evals/components/eval-config-detail.tsx
+++ b/web/src/features/evals/components/eval-config-detail.tsx
@@ -5,13 +5,13 @@ import { useRouter } from "next/router";
import { EvalConfigForm } from "@/src/features/evals/components/eval-config-form";
import { useHasAccess } from "@/src/features/rbac/utils/checkAccess";
import { Button } from "@/src/components/ui/button";
-import { Pencil } from "lucide-react";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/src/components/ui/popover";
import { useState } from "react";
+import { Pencil } from "lucide-react";
export const EvalConfigDetail = () => {
const router = useRouter();
@@ -95,11 +95,16 @@ export function DeactivateConfig({
});
const onClick = () => {
+ if (!projectId) {
+ console.error("Project ID is missing");
+ return;
+ }
mutEvalConfig.mutateAsync({
projectId,
evalConfigId: config?.id ?? "",
updatedStatus: "INACTIVE",
});
+ setIsOpen(false);
};
return (
@@ -108,7 +113,6 @@ export function DeactivateConfig({
<Button
variant="ghost"
size={"sm"}
- onClick={() => void onClick()}
disabled={!hasAccess || config?.status !== "ACTIVE"}
loading={isLoading}
>
@@ -126,14 +130,7 @@ export function DeactivateConfig({
type="button"
variant="destructive"
loading={mutEvalConfig.isLoading}
- onClick={() => {
- if (!projectId) {
- console.error("Project ID is missing");
- return;
- }
- void onClick();
- setIsOpen(false);
- }}
+ onClick={onClick}
>
Deactivate Eval Job
</Button>