Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you delete a Pipeline, the run reference leads to a meaningful message #1497

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { PipelineCoreDetailsPageComponent } from '~/concepts/pipelines/content/t
import DeletePipelineCoreResourceModal from '~/concepts/pipelines/content/DeletePipelineCoreResourceModal';
import PipelineDetailsActions from './PipelineDetailsActions';
import SelectedTaskDrawerContent from './SelectedTaskDrawerContent';
import PipelineNotFound from './PipelineNotFound';

enum PipelineDetailsTab {
GRAPH,
Expand All @@ -39,7 +40,23 @@ const PipelineDetails: PipelineCoreDetailsPageComponent = ({ breadcrumbPath }) =
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(PipelineDetailsTab.GRAPH);
const [selectedId, setSelectedId] = React.useState<string | null>(null);
const { taskMap, nodes } = usePipelineTaskTopology(pipelineRun);

if (pipelineLoadError) {
return (
<ApplicationsPage
breadcrumb={
<Breadcrumb>
{breadcrumbPath}
<BreadcrumbItem isActive>{'Pipeline not found'}</BreadcrumbItem>
</Breadcrumb>
}
title={'Pipeline not found'}
empty={false}
loaded={!pipelineLoad}
>
<PipelineNotFound />
</ApplicationsPage>
);
}
return (
<>
<Drawer isExpanded={!!selectedId}>
Expand All @@ -65,9 +82,12 @@ const PipelineDetails: PipelineCoreDetailsPageComponent = ({ breadcrumbPath }) =
}
empty={false}
loaded={pipelineLoad && pipelineTemplateLoaded}
loadError={pipelineLoadError || templateLoadError}
loadError={templateLoadError}
headerAction={
<PipelineDetailsActions onDelete={() => setDeleting(true)} pipeline={pipeline} />
pipelineLoad &&
pipelineTemplateLoaded && (
<PipelineDetailsActions onDelete={() => setDeleting(true)} pipeline={pipeline} />
)
andrewballantyne marked this conversation as resolved.
Show resolved Hide resolved
}
>
<Tabs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import {
Button,
EmptyState,
EmptyStateBody,
EmptyStateIcon,
EmptyStatePrimary,
Title,
} from '@patternfly/react-core';
import { CubesIcon } from '@patternfly/react-icons';
import { usePipelinesAPI } from '~/concepts/pipelines/context';
const PipelineNotFound: React.FC = () => {
const { namespace } = usePipelinesAPI();
const navigate = useNavigate();
return (
<EmptyState>
<EmptyStateIcon icon={CubesIcon} />
<Title headingLevel="h4" size="lg">
Pipeline not found
</Title>
<EmptyStateBody>To see more pipelines navigate to the pipelines page</EmptyStateBody>
<EmptyStatePrimary>
<Button variant="primary" onClick={() => navigate(`/pipelines/${namespace}`)}>
See all pipelines
</Button>
</EmptyStatePrimary>
</EmptyState>
);
};
export default PipelineNotFound;
Loading