Skip to content

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

[FIX] Show consistent empty state when search returns no results (#1827)

Chandrasekharan Md11510a0ad60
diff --git a/frontend/src/components/custom-tools/view-tools/ViewTools.jsx b/frontend/src/components/custom-tools/view-tools/ViewTools.jsx
index 64552f320..6317f484f 100644
--- a/frontend/src/components/custom-tools/view-tools/ViewTools.jsx
+++ b/frontend/src/components/custom-tools/view-tools/ViewTools.jsx
@@ -1,4 +1,3 @@
-import { Typography } from "antd";
import PropTypes from "prop-types";
import { ListView } from "../../widgets/list-view/ListView";
@@ -44,13 +43,7 @@ function ViewTools({
}
if (!listOfTools?.length) {
- return (
- <div className="center">
- <Typography.Title level={5}>
- No results found for this search
- </Typography.Title>
- </div>
- );
+ return <EmptyState text="No results found for this search" />;
}
return (
diff --git a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
index e5033e05a..5bde2402f 100644
--- a/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
+++ b/frontend/src/components/deployments/api-deployment/ApiDeployment.jsx
@@ -299,6 +299,7 @@ function ApiDeployment() {
enableSearch={true}
onSearch={handleSearch}
setSearchList={setFilteredData}
+ searchTerm={searchTerm}
pagination={{
current: pagination.current,
pageSize: pagination.pageSize,
diff --git a/frontend/src/components/deployments/body/Body.jsx b/frontend/src/components/deployments/body/Body.jsx
index 02060d3be..86aa56527 100644
--- a/frontend/src/components/deployments/body/Body.jsx
+++ b/frontend/src/components/deployments/body/Body.jsx
@@ -17,10 +17,18 @@ function Body({
forceExpandedId = null,
scrollToId = null,
pagination = null,
+ searchTerm = "",
}) {
if (isTableLoading) {
return <SpinnerLoader />;
}
+ if (!tableData?.length && searchTerm) {
+ return (
+ <IslandLayout>
+ <EmptyState text="No results found for this search" />
+ </IslandLayout>
+ );
+ }
if (!tableData?.length) {
return (
<IslandLayout>
@@ -68,6 +76,7 @@ Body.propTypes = {
total: PropTypes.number,
onChange: PropTypes.func,
}),
+ searchTerm: PropTypes.string,
};
export { Body };
diff --git a/frontend/src/components/deployments/layout/Layout.jsx b/frontend/src/components/deployments/layout/Layout.jsx
index 50b35ac31..9af8741a0 100644
--- a/frontend/src/components/deployments/layout/Layout.jsx
+++ b/frontend/src/components/deployments/layout/Layout.jsx
@@ -18,6 +18,7 @@ function Layout({
onSearch,
setSearchList,
pagination = null,
+ searchTerm = "",
}) {
return (
<div className="deploy-layout">
@@ -42,6 +43,7 @@ function Layout({
forceExpandedId={forceExpandedId}
scrollToId={scrollToId}
pagination={pagination}
+ searchTerm={searchTerm}
/>
</div>
</div>
@@ -67,6 +69,7 @@ Layout.propTypes = {
total: PropTypes.number,
onChange: PropTypes.func,
}),
+ searchTerm: PropTypes.string,
};
export { Layout };
diff --git a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
index 46a49eb7a..870ddfdd8 100644
--- a/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
+++ b/frontend/src/components/pipelines-or-deployments/pipelines/Pipelines.jsx
@@ -375,6 +375,7 @@ function Pipelines({ type }) {
scrollToId={scrollRestoreId}
enableSearch={true}
onSearch={handleSearch}
+ searchTerm={searchTerm}
pagination={{
current: pagination.current,
pageSize: pagination.pageSize,
diff --git a/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx b/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
index 04ef6c52d..9bf7c0f2c 100644
--- a/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
+++ b/frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
@@ -49,6 +49,7 @@ function ToolSettings({ type }) {
const handleException = useExceptionHandler();
const { posthogEventText, setPostHogCustomEvent } = usePostHogEvents();
const {
+ listRef,
displayList,
setDisplayList,
setMasterList,
@@ -259,7 +260,7 @@ function ToolSettings({ type }) {
titleProp="adapter_name"
descriptionProp="description"
iconProp="icon"
- isEmpty={!displayList?.length}
+ isEmpty={!listRef.current.length}
centered
isClickable={false}
handleShare={handleShare}
diff --git a/frontend/src/components/workflows/workflow/Workflows.jsx b/frontend/src/components/workflows/workflow/Workflows.jsx
index af17ce3da..73da9ec98 100644
--- a/frontend/src/components/workflows/workflow/Workflows.jsx
+++ b/frontend/src/components/workflows/workflow/Workflows.jsx
@@ -31,7 +31,7 @@ const PROJECT_FILTER_OPTIONS = [
{ label: "Organization Workflows", value: "all" },
];
-const { Title, Text } = Typography;
+const { Text } = Typography;
function Workflows() {
const navigate = useNavigate();
@@ -351,9 +351,7 @@ function Workflows() {
</div>
)}
{isEmpty(projectList) && !isEmpty(projectListRef?.current) && (
- <div className="center">
- <Title level={5}>No results found for this search</Title>
- </div>
+ <EmptyState text="No results found for this search" />
)}
{!isEmpty(projectList) && (
<ViewTools
diff --git a/frontend/src/pages/ConnectorsPage.jsx b/frontend/src/pages/ConnectorsPage.jsx
index 111073eb5..a2ad4bfa9 100644
--- a/frontend/src/pages/ConnectorsPage.jsx
+++ b/frontend/src/pages/ConnectorsPage.jsx
@@ -29,7 +29,7 @@ function ConnectorsPage() {
const { setAlertDetails } = useAlertStore();
const handleException = useExceptionHandler();
const { getUrl } = useRequestUrl();
- const { displayList, setDisplayList, setMasterList, onSearch } =
+ const { listRef, displayList, setDisplayList, setMasterList, onSearch } =
useListSearch("connector_name");
useEffect(() => {
@@ -177,7 +177,7 @@ function ConnectorsPage() {
iconProp="icon"
showOwner={true}
type="Connector"
- isEmpty={!displayList.length}
+ isEmpty={!listRef.current.length}
centered
isClickable={false}
/>