Skip to content

Commit

Permalink
Merge pull request #1442 from uidoyen/odh-1288
Browse files Browse the repository at this point in the history
replace EmptyState to Spinner component in Pipeline runs details tab
  • Loading branch information
openshift-merge-robot authored Jul 14, 2023
2 parents 225ba23 + 28791c3 commit c513169
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import {
Drawer,
DrawerContent,
DrawerContentBody,
EmptyState,
EmptyStateIcon,
EmptyStateVariant,
EmptyStateBody,
Title,
Bullseye,
Spinner,
} from '@patternfly/react-core';
import { useNavigate, useParams } from 'react-router-dom';
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
import ApplicationsPage from '~/pages/ApplicationsPage';
import { PipelineTopology, usePipelineTaskTopology } from '~/concepts/pipelines/topology';
import { PipelineRunKind } from '~/k8sTypes';
Expand Down Expand Up @@ -53,6 +61,26 @@ const PipelineRunDetails: PipelineCoreDetailsPageComponent = ({ breadcrumbPath,
const { taskMap, nodes } = usePipelineTaskTopology(pipelineRuntime);
const run = runResource?.run;

if (!loaded && !error) {
return (
<Bullseye>
<Spinner />
</Bullseye>
);
}

if (error) {
return (
<EmptyState variant={EmptyStateVariant.large} data-id="error-empty-state">
<EmptyStateIcon icon={ExclamationCircleIcon} />
<Title headingLevel="h4" size="lg">
Error loading pipeline run details
</Title>
<EmptyStateBody>{error.message}</EmptyStateBody>
</EmptyState>
);
}

return (
<>
<Drawer isExpanded={!!selectedId}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { EmptyState, EmptyStateBody, EmptyStateIcon, Title } from '@patternfly/react-core';
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
import { Spinner, EmptyStateVariant, EmptyState, Title } from '@patternfly/react-core';
import { Link } from 'react-router-dom';
import { PipelineRunKF } from '~/concepts/pipelines/kfTypes';
import {
Expand All @@ -15,7 +14,6 @@ import {
DetailItem,
renderDetailItems,
} from '~/concepts/pipelines/content/pipelinesDetails/pipelineRun/utils';

type PipelineRunTabDetailsProps = {
pipelineRunKF?: PipelineRunKF;
workflowName?: string;
Expand All @@ -29,14 +27,11 @@ const PipelineRunTabDetails: React.FC<PipelineRunTabDetailsProps> = ({

if (!pipelineRunKF || !workflowName) {
return (
<EmptyState>
<EmptyStateIcon icon={ExclamationCircleIcon} />
<Title headingLevel="h2" size="lg">
Error with the run
<EmptyState variant={EmptyStateVariant.large} data-id="loading-empty-state">
<Spinner size="xl" />
<Title headingLevel="h4" size="lg">
Loading
</Title>
<EmptyStateBody>
There was an issue trying to render the details information.
</EmptyStateBody>
</EmptyState>
);
}
Expand Down

0 comments on commit c513169

Please sign in to comment.