Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Fix/prompt studio helper modal (#1198)

Athulb4220f77444e
diff --git a/frontend/src/components/common/PromptStudioModal.jsx b/frontend/src/components/common/PromptStudioModal.jsx
index 4233df319..b4ee1ba6b 100644
--- a/frontend/src/components/common/PromptStudioModal.jsx
+++ b/frontend/src/components/common/PromptStudioModal.jsx
@@ -2,13 +2,11 @@ import { Button, Modal } from "antd";
import PropTypes from "prop-types";
import { useNavigate } from "react-router-dom";
import { useSessionStore } from "../../store/session-store";
-import { usePromptStudioStore } from "../../store/prompt-studio-store";
import "./PromptStudioModal.css";
-export function PromptStudioModal({ onClose }) {
+export function PromptStudioModal({ onClose, showModal }) {
const navigate = useNavigate();
const { sessionDetails } = useSessionStore();
- const { count } = usePromptStudioStore();
const handleClose = () => {
if (onClose) onClose();
@@ -22,7 +20,7 @@ export function PromptStudioModal({ onClose }) {
return (
<Modal
title="Create Prompt Studio"
- open={count === 0}
+ open={showModal}
onCancel={handleClose}
footer={null}
centered
@@ -65,6 +63,7 @@ export function PromptStudioModal({ onClose }) {
PromptStudioModal.propTypes = {
onClose: PropTypes.func,
+ showModal: PropTypes.bool.isRequired,
};
PromptStudioModal.defaultProps = {
diff --git a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
index f1e128a24..d62210c12 100644
--- a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
+++ b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
@@ -389,6 +389,8 @@ function ApiDeployment() {
useEffect(() => {
if (!isLoading && count === 0 && !modalDismissed) {
setShowModal(true);
+ } else if (!isLoading && count > 0) {
+ setShowModal(false);
}
}, [isLoading, count, modalDismissed]);
@@ -399,7 +401,9 @@ function ApiDeployment() {
return (
<>
- {showModal && <PromptStudioModal onClose={handleModalClose} />}
+ {showModal && (
+ <PromptStudioModal onClose={handleModalClose} showModal={showModal} />
+ )}
<Layout
type="api"
columns={columns}
diff --git a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
index 1e30cd214..a501b2305 100644
--- a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
+++ b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
@@ -611,6 +611,8 @@ function Pipelines({ type }) {
useEffect(() => {
if (!isLoading && count === 0 && !modalDismissed) {
setShowModal(true);
+ } else if (!isLoading && count > 0) {
+ setShowModal(false);
}
}, [isLoading, count, modalDismissed]);
@@ -621,7 +623,9 @@ function Pipelines({ type }) {
return (
<div className="p-or-d-layout">
- {showModal && <PromptStudioModal onClose={handleModalClose} />}
+ {showModal && (
+ <PromptStudioModal onClose={handleModalClose} showModal={showModal} />
+ )}
<Layout
type={type}
columns={columns}
diff --git a/frontend/src/components/workflows/workflow/Workflows.jsx b/frontend/src/components/workflows/workflow/Workflows.jsx
index 84ff35763..25c5fd16d 100644
--- a/frontend/src/components/workflows/workflow/Workflows.jsx
+++ b/frontend/src/components/workflows/workflow/Workflows.jsx
@@ -203,6 +203,8 @@ function Workflows() {
useEffect(() => {
if (!isLoading && count === 0 && !modalDismissed) {
setShowModal(true);
+ } else if (!isLoading && count > 0) {
+ setShowModal(false);
}
}, [isLoading, count, modalDismissed]);
@@ -213,7 +215,9 @@ function Workflows() {
return (
<>
- {showModal && <PromptStudioModal onClose={handleModalClose} />}
+ {showModal && (
+ <PromptStudioModal onClose={handleModalClose} showModal={showModal} />
+ )}
<ToolNavBar
enableSearch
searchList={projectList}