Skip to content

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

[MISC] Remove success alerts from deployments and pipelines (#1755)

Chandrasekharan M7829c15fbd13
diff --git a/frontend/src/components/custom-tools/custom-data-settings/CustomDataSettings.jsx b/frontend/src/components/custom-tools/custom-data-settings/CustomDataSettings.jsx
index 7bcd13924..1fe1647b2 100644
--- a/frontend/src/components/custom-tools/custom-data-settings/CustomDataSettings.jsx
+++ b/frontend/src/components/custom-tools/custom-data-settings/CustomDataSettings.jsx
@@ -55,13 +55,14 @@ function CustomDataSettings() {
const [jsonError, setJsonError] = useState(null);
const [isLoading, setIsLoading] = useState(false);
const [hasChanges, setHasChanges] = useState(false);
+ const [isSaved, setIsSaved] = useState(false);
const { sessionDetails } = useSessionStore();
const { details, isPublicSource, updateCustomTool } = useCustomToolStore();
const { setAlertDetails } = useAlertStore();
const axiosPrivate = useAxiosPrivate();
const handleException = useExceptionHandler();
- // Initialize editor with current custom_data
+ // Initialize editor with current custom_data (only on tab switch)
useEffect(() => {
const customData = details?.custom_data;
if (customData && Object.keys(customData).length > 0) {
@@ -70,7 +71,8 @@ function CustomDataSettings() {
setJsonValue("{\n \n}");
}
setHasChanges(false);
- }, [details?.custom_data]);
+ setIsSaved(false);
+ }, [details?.tool_id]);
// Extract variables from active prompts
const extractedVariables = useMemo(() => {
@@ -113,6 +115,9 @@ function CustomDataSettings() {
const handleEditorChange = (value) => {
setJsonValue(value || "");
setHasChanges(true);
+ if (isSaved) {
+ setIsSaved(false);
+ }
// Validate JSON
try {
@@ -158,11 +163,8 @@ function CustomDataSettings() {
setIsLoading(true);
axiosPrivate(requestOptions)
.then((res) => {
- setAlertDetails({
- type: "success",
- content: "Custom data saved successfully",
- });
setHasChanges(false);
+ setIsSaved(true);
// Update the store with the new details
const updatedDetails = res?.data;
if (updatedDetails) {
@@ -292,7 +294,7 @@ function CustomDataSettings() {
loading={isLoading}
disabled={isPublicSource || !!jsonError || !hasChanges}
>
- Save
+ {isSaved ? "Saved" : "Save"}
</CustomButton>
</Space>
</div>
diff --git a/frontend/src/components/custom-tools/custom-synonyms/CustomSynonyms.jsx b/frontend/src/components/custom-tools/custom-synonyms/CustomSynonyms.jsx
index 09472271d..616b64886 100644
--- a/frontend/src/components/custom-tools/custom-synonyms/CustomSynonyms.jsx
+++ b/frontend/src/components/custom-tools/custom-synonyms/CustomSynonyms.jsx
@@ -45,12 +45,20 @@ function CustomSynonyms() {
const [rows, setRows] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [currentPage, setCurrentPage] = useState(1);
+ const [hasChanges, setHasChanges] = useState(false);
+ const [isSaved, setIsSaved] = useState(false);
const { sessionDetails } = useSessionStore();
const { details, isPublicSource } = useCustomToolStore();
const { setAlertDetails } = useAlertStore();
const axiosPrivate = useAxiosPrivate();
const handleException = useExceptionHandler();
+ // Reset state on tool switch
+ useEffect(() => {
+ setHasChanges(false);
+ setIsSaved(false);
+ }, [details?.tool_id]);
+
useEffect(() => {
const promptGrammar = details?.prompt_grammer;
if (!promptGrammar || Object.keys(promptGrammar).length === 0) {
@@ -121,6 +129,8 @@ function CustomSynonyms() {
const updatedSynonyms = [...synonyms];
updatedSynonyms[index][propertyName] = value;
setSynonyms(updatedSynonyms);
+ setHasChanges(true);
+ setIsSaved(false);
};
const handleAddRow = () => {
@@ -137,6 +147,8 @@ function CustomSynonyms() {
const updatedSynonyms = [...synonyms];
updatedSynonyms.push(data);
setSynonyms(updatedSynonyms);
+ setHasChanges(true);
+ setIsSaved(false);
const newPage = updatedSynonyms?.length / PAGE_SIZE;
if (newPage + 1 > currentPage) {
@@ -163,15 +175,10 @@ function CustomSynonyms() {
promptGrammar[item.word] = item.synonyms || [];
});
- let successMsg = "";
- let failureMsg = "";
- if (actionType === actionTypes.save) {
- successMsg = "Saved synonyms successfully";
- failureMsg = "Failed to save synonyms";
- } else {
- successMsg = "Deleted synonyms successfully";
- failureMsg = "Failed to delete synonyms";
- }
+ const failureMsg =
+ actionType === actionTypes.save
+ ? "Failed to save synonyms"
+ : "Failed to delete synonyms";
const body = {
prompt_grammer: promptGrammar,
@@ -193,10 +200,10 @@ function CustomSynonyms() {
if (actionType === actionTypes.delete) {
setSynonyms(listOfSynonyms);
}
- setAlertDetails({
- type: "success",
- content: successMsg,
- });
+ setHasChanges(false);
+ if (actionType === actionTypes.save) {
+ setIsSaved(true);
+ }
})
.catch((err) => {
setAlertDetails(handleException(err, failureMsg));
@@ -245,9 +252,9 @@ function CustomSynonyms() {
type="primary"
onClick={() => updateSynonyms(synonyms, actionTypes.save)}
loading={isLoading}
- disabled={isPublicSource}
+ disabled={isPublicSource || !hasChanges}
>
- Save
+ {isSaved ? "Saved" : "Save"}
</CustomButton>
</Space>
</div>
diff --git a/frontend/src/components/custom-tools/document-parser/DocumentParser.jsx b/frontend/src/components/custom-tools/document-parser/DocumentParser.jsx
index 0978bd3e2..d37fc9dd5 100644
--- a/frontend/src/components/custom-tools/document-parser/DocumentParser.jsx
+++ b/frontend/src/components/custom-tools/document-parser/DocumentParser.jsx
@@ -196,10 +196,6 @@ function DocumentParser({
);
modifiedDetails["prompts"] = modifiedPrompts;
updateCustomTool({ details: modifiedDetails });
- setAlertDetails({
- type: "success",
- content: "Deleted successfully",
- });
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to delete"));
diff --git a/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx b/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx
index 794388e9c..7a53108c3 100644
--- a/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx
+++ b/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx
@@ -177,10 +177,6 @@ function ListOfTools() {
(filterToll) => filterToll?.tool_id !== tool.tool_id
);
setListOfTools(tools);
- setAlertDetails({
- type: "success",
- content: `${tool?.tool_name} - Deleted successfully`,
- });
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to Delete"));
@@ -338,10 +334,6 @@ function ListOfTools() {
axiosPrivate(requestOptions)
.then((response) => {
setOpenSharePermissionModal(false);
- setAlertDetails({
- type: "success",
- content: "Sharing settings updated successfully",
- });
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to load"));
diff --git a/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx b/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
index c2ca9458f..bb7759913 100644
--- a/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
+++ b/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
@@ -102,10 +102,6 @@ function ManageLlmProfiles() {
defaultLlmProfile: data?.default_profile,
};
updateCustomTool(updatedState);
- setAlertDetails({
- type: "success",
- content: "Default LLM Profile updated successfully",
- });
})
.catch((err) => {
handleException(err, "Failed to set default LLM Profile");
diff --git a/frontend/src/components/custom-tools/pre-and-post-amble-modal/PreAndPostAmbleModal.jsx b/frontend/src/components/custom-tools/pre-and-post-amble-modal/PreAndPostAmbleModal.jsx
index cb2f400c7..96825f7b1 100644
--- a/frontend/src/components/custom-tools/pre-and-post-amble-modal/PreAndPostAmbleModal.jsx
+++ b/frontend/src/components/custom-tools/pre-and-post-amble-modal/PreAndPostAmbleModal.jsx
@@ -21,6 +21,9 @@ function PreAndPostAmbleModal({ type, handleUpdateTool }) {
const [title, setTitle] = useState("");
const [text, setText] = useState("");
const [expandModalVisible, setExpandModalVisible] = useState(false);
+ const [hasChanges, setHasChanges] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const [isSaved, setIsSaved] = useState(false);
const textAreaRef = useRef(null);
const { details, updateCustomTool, isPublicSource } = useCustomToolStore();
const { setAlertDetails } = useAlertStore();
@@ -34,18 +37,28 @@ function PreAndPostAmbleModal({ type, handleUpdateTool }) {
setTitle("Postamble Settings");
setText(details?.postamble || "");
}
+ setHasChanges(false);
}, [type, details]);
+ // Reset isSaved on tool switch (separate from text initialization)
+ useEffect(() => {
+ setIsSaved(false);
+ }, [details?.tool_id]);
+
const setDefaultPrompt = () => {
if (type === fieldNames.preamble) {
setText(DefaultPrompts.preamble);
} else if (type === fieldNames.postamble) {
setText(DefaultPrompts.postamble);
}
+ setHasChanges(true);
+ setIsSaved(false);
};
const handleTextChange = (e) => {
setText(e.target.value);
+ setHasChanges(true);
+ setIsSaved(false);
};
const toggleExpandModal = () => {
@@ -61,6 +74,7 @@ function PreAndPostAmbleModal({ type, handleUpdateTool }) {
if (type === fieldNames.postamble) {
body["postamble"] = text;
}
+ setIsLoading(true);
handleUpdateTool(body)
.then((res) => {
const data = res?.data;
@@ -70,13 +84,14 @@ function PreAndPostAmbleModal({ type, handleUpdateTool }) {
};
const updatedDetails = { ...details, ...updatedData };
updateCustomTool({ details: updatedDetails });
- setAlertDetails({
- type: "success",
- content: "Saved successfully",
- });
+ setHasChanges(false);
+ setIsSaved(true);
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to update."));
+ })
+ .finally(() => {
+ setIsLoading(false);
});
};
@@ -149,9 +164,10 @@ function PreAndPostAmbleModal({ type, handleUpdateTool }) {
<CustomButton
type="primary"
onClick={handleSave}
- disabled={isPublicSource}
+ loading={isLoading}
+ disabled={isPublicSource || !hasChanges}
>
- Save
+ {isSaved ? "Saved" : "Save"}
</CustomButton>
</Space>
</div>
diff --git a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
index f580a46e7..676bfd241 100644
--- a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
+++ b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
@@ -247,12 +247,7 @@ function ApiDeployment() {
record.is_active = !record?.is_active;
apiDeploymentsApiService
.updateApiDeployment(record)
- .then((res) => {
- setAlertDetails({
- type: "success",
- content: "Status updated successfully",
- });
- })
+ .then(() => {})
.catch((err) => {
setAlertDetails(handleException(err));
})
diff --git a/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx b/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
index 6eda81c4f..5af0bc778 100644
--- a/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
+++ b/frontend/src/components/input-output/configure-ds/ConfigureDs.jsx
@@ -323,12 +323,6 @@ function ConfigureDs({
if (data) {
addNewItem(data, !!editItemId);
}
- setAlertDetails({
- type: "success",
- content: `Successfully ${
- method === "POST" ? "added" : "updated"
- } connector`,
- });
if (!isConnector && method === "POST") {
updateSession(type);
}
diff --git a/frontend/src/components/pipelines-or-deployments/file-history-modal/FileHistoryModal.jsx b/frontend/src/components/pipelines-or-deployments/file-history-modal/FileHistoryModal.jsx
index 1c8bd2f54..2f104d3c0 100644
--- a/frontend/src/components/pipelines-or-deployments/file-history-modal/FileHistoryModal.jsx
+++ b/frontend/src/components/pipelines-or-deployments/file-history-modal/FileHistoryModal.jsx
@@ -236,10 +236,6 @@ const FileHistoryModal = ({ open, setOpen, workflowId, workflowName }) => {
const handleDeleteSingle = async (fileHistoryId) => {
try {
await workflowApiService.deleteFileHistory(workflowId, fileHistoryId);
- setAlertDetails({
- type: "success",
- message: "File history deleted successfully",
- });
// Refresh data
fetchFileHistories(pagination.current, pagination.pageSize);
setSelectedRowKeys([]);
@@ -262,18 +258,11 @@ const FileHistoryModal = ({ open, setOpen, workflowId, workflowName }) => {
setLoading(true);
try {
- const response = await workflowApiService.bulkDeleteFileHistoriesByIds(
+ await workflowApiService.bulkDeleteFileHistoriesByIds(
workflowId,
selectedRowKeys
);
- setAlertDetails({
- type: "success",
- message:
- response?.data?.message ||
- `${selectedRowKeys.length} file histories deleted successfully`,
- });
-
// Refresh data
fetchFileHistories(pagination.current, pagination.pageSize);
setSelectedRowKeys([]);
@@ -358,17 +347,7 @@ const FileHistoryModal = ({ open, setOpen, workflowId, workflowName }) => {
filters.file_path = appliedFilters.filePath;
}
- const response = await workflowApiService.bulkClearFileHistories(
- workflowId,
- filters
- );
-
- setAlertDetails({
- type: "success",
- message:
- response?.data?.message ||
- `${response?.data?.deleted_count} file histories cleared`,
- });
+ await workflowApiService.bulkClearFileHistories(workflowId, filters);
// Refresh data
fetchFileHistories(1, pagination.pageSize);
diff --git a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
index 4cf1afc5c..d6c8ac98e 100644
--- a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
+++ b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
@@ -150,10 +150,6 @@ function Pipelines({ type }) {
const data = res?.data?.pipeline;
fieldsToUpdate.last_run_status = data?.last_run_status;
fieldsToUpdate.last_run_time = data?.last_run_time;
- setAlertDetails({
- type: "success",
- content: "Pipeline Sync Initiated",
- });
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to sync."));
@@ -232,12 +228,6 @@ function Pipelines({ type }) {
axiosPrivate(requestOptions)
.then(() => {
getPipelineList();
- setAlertDetails({
- type: "success",
- content: value
- ? "Pipeline Enabled Successfully"
- : "Pipeline Disabled Successfully",
- });
})
.catch((err) => {
setAlertDetails(handleException(err));
@@ -284,10 +274,7 @@ function Pipelines({ type }) {
const clearFileMarkers = async () => {
const workflowId = selectedPorD?.workflow_id;
- const success = await clearFileHistory(
- workflowId,
- "Pipeline File History Cleared Successfully"
- );
+ const success = await clearFileHistory(workflowId);
if (success && openDeleteModal) {
setOpenDeleteModal(false);
}
diff --git a/frontend/src/components/settings/default-triad/DefaultTriad.jsx b/frontend/src/components/settings/default-triad/DefaultTriad.jsx
index d4ef88766..77bfbc8c7 100644
--- a/frontend/src/components/settings/default-triad/DefaultTriad.jsx
+++ b/frontend/src/components/settings/default-triad/DefaultTriad.jsx
@@ -160,10 +160,6 @@ function DefaultTriad() {
};
axiosPrivate(requestOptions)
.then((res) => {
- setAlertDetails({
- type: "success",
- content: "Default triad setting saved successfully",
- });
fetchData();
setIsSubmitEnabled(false);
})
diff --git a/frontend/src/components/settings/users/Users.jsx b/frontend/src/components/settings/users/Users.jsx
index beb20b16c..586db2c7c 100644
--- a/frontend/src/components/settings/users/Users.jsx
+++ b/frontend/src/components/settings/users/Users.jsx
@@ -58,10 +58,6 @@ function Users() {
setConfirmLoading(true);
axiosPrivate(requestOptions)
.then((res) => {
- setAlertDetails({
- type: "success",
- content: "User deleted successfully",
- });
setConfirmLoading(false);
setOpen(false);
removeUser(selectedUserEmail.email);
diff --git a/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx b/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
index e44f3c148..98f0c1d31 100644
--- a/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
+++ b/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
@@ -105,10 +105,6 @@ function ToolSettings({ type }) {
updateMasterList((currentList) =>
currentList.filter((row) => row?.id !== adapterId)
);
- setAlertDetails({
- type: "success",
- content: "Successfully deleted",
- });
};
const handleDelete = (_event, adapter) => {
@@ -201,10 +197,6 @@ function ToolSettings({ type }) {
axiosPrivate(requestOptions)
.then((response) => {
setOpenSharePermissionModal(false);
- setAlertDetails({
- type: "success",
- content: "Sharing settings updated successfully",
- });
})
.catch((err) => {
setAlertDetails(handleException(err, "Failed to update sharing"));
diff --git a/frontend/src/hooks/useClearFileHistory.js b/frontend/src/hooks/useClearFileHistory.js
index 5ad264f2c..ba17aad38 100644
--- a/frontend/src/hooks/useClearFileHistory.js
+++ b/frontend/src/hooks/useClearFileHistory.js
@@ -20,13 +20,9 @@ const useClearFileHistory = () => {
/**
* Clear file history for a workflow
* @param {string} workflowId - The workflow ID
- * @param {string} successMessage - Custom success message
* @return {Promise<boolean>} - Returns true if successful, false otherwise
*/
- const clearFileHistory = async (
- workflowId,
- successMessage = "File history cleared successfully"
- ) => {
+ const clearFileHistory = async (workflowId) => {
if (!workflowId) {
setAlertDetails({
type: "error",
@@ -38,12 +34,7 @@ const useClearFileHistory = () => {
setIsClearing(true);
try {
- const res = await workflowServiceInstance.clearFileMarkers(workflowId);
- const msg = res?.data || successMessage;
- setAlertDetails({
- type: "success",
- content: msg,
- });
+ await workflowServiceInstance.clearFileMarkers(workflowId);
return true;
} catch (err) {
setAlertDetails(handleException(err, "Failed to clear file history"));