From d6239d162b945fa4d169af23cf695e61ffbdb213 Mon Sep 17 00:00:00 2001
From: Sasha
Date: Wed, 6 Nov 2024 13:03:53 +0100
Subject: [PATCH] [OPIK-319]: fix the eslint issues;
---
.../pages/PromptPage/PromptTab/CommitsTab.tsx | 2 +-
.../PromptPage/PromptTab/EditPromptDialog.tsx | 4 ++--
.../pages/PromptPage/PromptTab/PromptTab.tsx | 10 ++++-----
.../pages/PromptsPage/AddEditPromptDialog.tsx | 4 ++--
.../pages/PromptsPage/PromptsPage.tsx | 21 +++++++++++--------
5 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/CommitsTab.tsx b/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/CommitsTab.tsx
index ab43b8137..1a7b26fc7 100644
--- a/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/CommitsTab.tsx
+++ b/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/CommitsTab.tsx
@@ -86,7 +86,7 @@ const CommitsTab = ({ prompt }: CommitsTabInterface) => {
});
}
},
- [prompt?.id],
+ [prompt?.id, navigate, workspaceName],
);
if (isPending) {
diff --git a/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/EditPromptDialog.tsx b/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/EditPromptDialog.tsx
index 8fbf17b05..87aa80a54 100644
--- a/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/EditPromptDialog.tsx
+++ b/apps/opik-frontend/src/components/pages/PromptPage/PromptTab/EditPromptDialog.tsx
@@ -46,7 +46,7 @@ const EditPromptDialog: React.FunctionComponent = ({
return (
-
+
-
-
+
+
Prompt
-
+
{activeVersion?.template}
diff --git a/apps/opik-frontend/src/components/pages/PromptsPage/AddEditPromptDialog.tsx b/apps/opik-frontend/src/components/pages/PromptsPage/AddEditPromptDialog.tsx
index a4de8aa58..908c29fad 100644
--- a/apps/opik-frontend/src/components/pages/PromptsPage/AddEditPromptDialog.tsx
+++ b/apps/opik-frontend/src/components/pages/PromptsPage/AddEditPromptDialog.tsx
@@ -52,7 +52,7 @@ const AddEditPromptDialog: React.FunctionComponent
= ({
...(description ? { description } : {}),
},
});
- }, [name, description, template]);
+ }, [name, description, template, promptCreateMutation.mutate]);
const editPrompt = useCallback(() => {
promptUpdateMutation.mutate({
@@ -62,7 +62,7 @@ const AddEditPromptDialog: React.FunctionComponent = ({
...(description ? { description } : {}),
},
});
- }, [name, description, defaultPrompt?.id]);
+ }, [name, description, defaultPrompt?.id, promptUpdateMutation?.mutate]);
const onActionClick = () => {
if (isEdit) {
diff --git a/apps/opik-frontend/src/components/pages/PromptsPage/PromptsPage.tsx b/apps/opik-frontend/src/components/pages/PromptsPage/PromptsPage.tsx
index 1060894d6..fc0a4f696 100644
--- a/apps/opik-frontend/src/components/pages/PromptsPage/PromptsPage.tsx
+++ b/apps/opik-frontend/src/components/pages/PromptsPage/PromptsPage.tsx
@@ -138,15 +138,18 @@ const PromptsPage: React.FunctionComponent = () => {
resetDialogKeyRef.current = resetDialogKeyRef.current + 1;
}, []);
- const handleRowClick = useCallback((prompt: Prompt) => {
- navigate({
- to: "/$workspaceName/prompts/$promptId",
- params: {
- promptId: prompt.id,
- workspaceName,
- },
- });
- }, []);
+ const handleRowClick = useCallback(
+ (prompt: Prompt) => {
+ navigate({
+ to: "/$workspaceName/prompts/$promptId",
+ params: {
+ promptId: prompt.id,
+ workspaceName,
+ },
+ });
+ },
+ [navigate, workspaceName],
+ );
if (isPending) {
return ;