diff --git a/frontend/src/pages/projects/screens/detail/ProjectDetailsComponents.tsx b/frontend/src/pages/projects/screens/detail/ProjectDetailsComponents.tsx
index 258366353c..95e19ed355 100644
--- a/frontend/src/pages/projects/screens/detail/ProjectDetailsComponents.tsx
+++ b/frontend/src/pages/projects/screens/detail/ProjectDetailsComponents.tsx
@@ -6,7 +6,6 @@ import ServingRuntimeList from '~/pages/modelServing/screens/projects/ServingRun
import { ProjectDetailsContext } from '~/pages/projects/ProjectDetailsContext';
import { featureFlagEnabled } from '~/utilities/utils';
import PipelinesSection from '~/pages/projects/screens/detail/pipelines/PipelinesSection';
-import usePipelines from '~/concepts/pipelines/apiHooks/usePipelines';
import NotebooksList from './notebooks/NotebookList';
import { ProjectSectionID } from './types';
import StorageList from './storage/StorageList';
@@ -28,13 +27,10 @@ const ProjectDetailsComponents: React.FC = () => {
dataConnections: { data: connections, loaded: connectionsLoaded },
servingRuntimes: { data: modelServers, loaded: modelServersLoaded },
} = React.useContext(ProjectDetailsContext);
-
- // Limit set to 1 for checking pipeline emptiness
- const [pipelines, pipelinesLoaded] = usePipelines(1);
-
const modelServingEnabled = featureFlagEnabled(
dashboardConfig.spec.dashboardConfig.disableModelServing,
);
+ const [isPipelinesEmpty, setIsPipelinesEmpty] = React.useState(false);
const pipelinesEnabled =
featureFlagEnabled(dashboardConfig.spec.dashboardConfig.disablePipelines) &&
dashboardConfig.status.dependencyOperators.redhatOpenshiftPipelines.available;
@@ -60,8 +56,8 @@ const ProjectDetailsComponents: React.FC = () => {
? [
{
id: ProjectSectionID.PIPELINES,
- component: ,
- isEmpty: pipelinesLoaded && pipelines.length === 0,
+ component: ,
+ isEmpty: isPipelinesEmpty,
},
]
: []),
diff --git a/frontend/src/pages/projects/screens/detail/pipelines/PipelinesList.tsx b/frontend/src/pages/projects/screens/detail/pipelines/PipelinesList.tsx
index f038c0d882..18d7c66e1b 100644
--- a/frontend/src/pages/projects/screens/detail/pipelines/PipelinesList.tsx
+++ b/frontend/src/pages/projects/screens/detail/pipelines/PipelinesList.tsx
@@ -9,7 +9,11 @@ import { usePipelinesAPI } from '~/concepts/pipelines/context';
import EmptyStateErrorMessage from '~/components/EmptyStateErrorMessage';
import { TABLE_CONTENT_LIMIT, LIMIT_MAX_ITEM_COUNT } from '~/concepts/pipelines/const';
-const PipelinesList: React.FC = () => {
+type PipelinesListProps = {
+ setIsPipelinesEmpty?: (value: boolean) => void;
+};
+
+const PipelinesList: React.FC = ({ setIsPipelinesEmpty }) => {
const { namespace } = usePipelinesAPI();
const [pipelines, loaded, loadError, refresh] = usePipelines(LIMIT_MAX_ITEM_COUNT);
const navigate = useNavigate();
@@ -29,6 +33,10 @@ const PipelinesList: React.FC = () => {
}
if (pipelines.length === 0) {
+ // Call setIsPipelinesEmpty only if it is provided
+ if (setIsPipelinesEmpty) {
+ setIsPipelinesEmpty(true);
+ }
return (
);
diff --git a/frontend/src/pages/projects/screens/detail/pipelines/PipelinesSection.tsx b/frontend/src/pages/projects/screens/detail/pipelines/PipelinesSection.tsx
index ed36a91cd9..31889cfa4b 100644
--- a/frontend/src/pages/projects/screens/detail/pipelines/PipelinesSection.tsx
+++ b/frontend/src/pages/projects/screens/detail/pipelines/PipelinesSection.tsx
@@ -8,7 +8,11 @@ import ImportPipelineButton from '~/concepts/pipelines/content/import/ImportPipe
import PipelinesList from '~/pages/projects/screens/detail/pipelines/PipelinesList';
import EnsureAPIAvailability from '~/concepts/pipelines/EnsureAPIAvailability';
-const PipelinesSection: React.FC = () => {
+type PipelinesSectionProps = {
+ setIsPipelinesEmpty?: (value: boolean) => void;
+};
+
+const PipelinesSection: React.FC = ({ setIsPipelinesEmpty }) => {
const {
pipelinesServer: { initializing, installed, timedOut },
} = usePipelinesAPI();
@@ -32,7 +36,7 @@ const PipelinesSection: React.FC = () => {
) : (
-
+
)}