From 8166f11ee6e4e606a76ace27ac56c47fe29d73c6 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Tue, 3 Mar 2026 17:14:47 +0530 Subject: [PATCH 1/3] [FIX] Fix multiple regressions in card-based deployment layout - Fix null reference in CreateApiDeploymentModal (unable to create API deployment) - Replace clickable endpoint link with copy button to prevent 404 redirects - Add immediate table update on manual ETL sync with API response - Remove strict is_active filter for API deployment banner visibility - Remove redundant DeleteModal (delete now triggers directly from card) - Cleanup Azure connector error message (remove redundant prefix) Co-Authored-By: Claude Opus 4.6 --- .../src/components/agency/agency/Agency.jsx | 19 ++++----- .../api-deployment/ApiDeployment.jsx | 19 +++------ .../CreateApiDeploymentModal.jsx | 6 +-- .../pipelines/Pipelines.jsx | 39 +++++-------------- .../card-grid-view/CardFieldComponents.jsx | 26 ++----------- .../azure_cloud_storage/exceptions.py | 13 ++----- 6 files changed, 36 insertions(+), 86 deletions(-) diff --git a/frontend/src/components/agency/agency/Agency.jsx b/frontend/src/components/agency/agency/Agency.jsx index fb6b9ee596..966b2e4fd0 100644 --- a/frontend/src/components/agency/agency/Agency.jsx +++ b/frontend/src/components/agency/agency/Agency.jsx @@ -327,13 +327,14 @@ function Agency() { return; } - const apiDeploymentData = apiDeployments?.data || []; - const pipelineData = pipelines?.data || []; + const apiDeploymentData = + apiDeployments?.data?.results || apiDeployments?.data || []; + const pipelineData = pipelines?.data?.results || pipelines?.data || []; - // Find active deployments - const activeApiDeployment = apiDeploymentData.find( - (deployment) => deployment.is_active, - ); + // Show banner for any API deployment linked to this workflow, prefer active one + const apiDeployment = + apiDeploymentData.find((deployment) => deployment.is_active) || + apiDeploymentData[0]; // For pipelines, any pipeline associated with this workflow is considered a deployment // regardless of active status, since workflows can only have one deployment @@ -341,11 +342,11 @@ function Agency() { // Set deployment info let deploymentInfo = null; - if (activeApiDeployment) { + if (apiDeployment) { deploymentInfo = { type: "API", - name: activeApiDeployment.display_name, - id: activeApiDeployment.id, + name: apiDeployment.display_name, + id: apiDeployment.id, }; } else if (workflowPipelines.length > 0) { // If multiple pipelines, prioritize by type: ETL > TASK diff --git a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx index 7805e16406..ea3c8cdd85 100644 --- a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx +++ b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx @@ -23,7 +23,6 @@ import { NotificationModal } from "../../pipelines-or-deployments/notification-m import { SharePermission } from "../../widgets/share-permission/SharePermission"; import { workflowService } from "../../workflows/workflow/workflow-service.js"; import { CreateApiDeploymentModal } from "../create-api-deployment-modal/CreateApiDeploymentModal"; -import { DeleteModal } from "../delete-modal/DeleteModal"; import { DisplayCode } from "../display-code/DisplayCode"; import { Layout } from "../layout/Layout"; import { ManageKeys } from "../manage-keys/ManageKeys"; @@ -38,7 +37,6 @@ function ApiDeployment() { const workflowApiService = workflowService(); const [isTableLoading, setIsTableLoading] = useState(true); const [openAddApiModal, setOpenAddApiModal] = useState(false); - const [openDeleteModal, setOpenDeleteModal] = useState(false); const [openCodeModal, setOpenCodeModal] = useState(false); const [openManageKeysModal, setOpenManageKeysModal] = useState(false); const [selectedRow, setSelectedRow] = useState({}); @@ -164,11 +162,11 @@ function ApiDeployment() { fetchListRef.current = getApiDeploymentList; - const deleteApiDeployment = () => { + const deleteApiDeployment = (item) => { + const id = item?.id || selectedRow.id; apiDeploymentsApiService - .deleteApiDeployment(selectedRow.id) - .then((res) => { - setOpenDeleteModal(false); + .deleteApiDeployment(id) + .then(() => { getApiDeploymentList( pagination.current, pagination.pageSize, @@ -215,8 +213,8 @@ function ApiDeployment() { openAddModal(true); }; - const handleDeleteDeployment = () => { - setOpenDeleteModal(true); + const handleDeleteDeployment = (item) => { + deleteApiDeployment(item); }; const handleViewLogsDeployment = (deployment) => { @@ -320,11 +318,6 @@ function ApiDeployment() { workflowEndpointList={workflowEndpointList} /> )} - { @@ -83,7 +83,7 @@ const CreateApiDeploymentModal = ({ }; const createApiDeployment = () => { - const wf = workflowEndpointList.find( + const wf = workflowEndpointList?.find( (item) => item?.workflow === formDetails?.workflow, ); setPostHogCustomEvent("intent_success_api_deployment", { @@ -262,7 +262,7 @@ const CreateApiDeploymentModal = ({ help={getBackendErrorDetail("workflow", backendErrors)} >