Skip to content

Commit

Permalink
update wording for ensureCompatiblePipelineServer page
Browse files Browse the repository at this point in the history
  • Loading branch information
pnaik1 committed Oct 30, 2024
1 parent 2e859cb commit 1ab7f26
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ class PipelinesGlobal {
return cy.findByTestId('incompatible-pipelines-server');
}

shouldHaveIncompatibleTitleText() {
cy.findByTestId('incompatible-pipelines-server-title').should(
'contain.text',
'Unsupported pipeline and pipeline server version',
);
return this;
}

findDeletePipelineServerButton() {
return this.findIsServerIncompatible().findByTestId('delete-pipeline-server-button');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
RouteModel,
SecretModel,
} from '~/__tests__/cypress/cypress/utils/models';
import { asProductAdminUser } from '~/__tests__/cypress/cypress/utils/mockUsers';
import type { PipelineKF, PipelineVersionKF } from '~/concepts/pipelines/kfTypes';
import { tablePagination } from '~/__tests__/cypress/cypress/pages/components/Pagination';

Expand Down Expand Up @@ -502,7 +501,7 @@ describe('Pipelines', () => {
});
});

it('incompatible dpsa version shows error with delete option for regular user', () => {
it('incompatible dpsa version shows error', () => {
initIntercepts({});
pipelinesGlobal.visit(projectName);
cy.interceptK8sList(
Expand All @@ -519,7 +518,7 @@ describe('Pipelines', () => {
pipelinesGlobal.visit(projectName);
pipelinesGlobal.isApiAvailable();
pipelinesGlobal.findIsServerIncompatible().should('exist');
pipelinesGlobal.findDeletePipelineServerButton().should('exist');
pipelinesGlobal.shouldHaveIncompatibleTitleText();
});

it('error while creating a pipeline server', () => {
Expand All @@ -530,27 +529,6 @@ describe('Pipelines', () => {
.should('have.text', 'Data connection unsuccessfully verified');
});

it('incompatible dpsa version shows error with delete option for admin', () => {
asProductAdminUser();
initIntercepts({});
pipelinesGlobal.visit(projectName);
cy.interceptK8sList(
DataSciencePipelineApplicationModel,
mockK8sResourceList([
mockDataSciencePipelineApplicationK8sResource({ namespace: projectName, dspVersion: 'v1' }),
]),
);
cy.interceptK8s(
DataSciencePipelineApplicationModel,
mockDataSciencePipelineApplicationK8sResource({ namespace: projectName, dspVersion: 'v1' }),
);

pipelinesGlobal.visit(projectName);
pipelinesGlobal.isApiAvailable();
pipelinesGlobal.findIsServerIncompatible().should('exist');
pipelinesGlobal.findDeletePipelineServerButton().should('exist');
});

it('selects a different project', () => {
initIntercepts({});
pipelinesGlobal.visit(projectName);
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/concepts/pipelines/EnsureAPIAvailability.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ type EnsureAPIAvailabilityProps = {
};

const EnsureAPIAvailability: React.FC<EnsureAPIAvailabilityProps> = ({ children }) => {
const { apiAvailable } = usePipelinesAPI();

if (!apiAvailable) {
const { apiAvailable, pipelinesServer } = usePipelinesAPI();
if (!apiAvailable && pipelinesServer.compatible) {
return (
<Bullseye style={{ minHeight: 150 }} data-testid="pipelines-api-not-available">
<Spinner />
Expand Down
32 changes: 9 additions & 23 deletions frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ import {
Bullseye,
Spinner,
EmptyStateHeader,
EmptyStateActions,
EmptyStateFooter,
EmptyStateBody,
Button,
EmptyStateIcon,
ButtonVariant,
} from '@patternfly/react-core';
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
import ExternalLink from '~/components/ExternalLink';
import NoPipelineServer from '~/concepts/pipelines/NoPipelineServer';
import { ODH_PRODUCT_NAME } from '~/utilities/const';
import { DeleteServerModal, usePipelinesAPI } from './context';

const DOCS_LINK =
Expand Down Expand Up @@ -48,7 +46,8 @@ const EnsureCompatiblePipelineServer: React.FC<EnsureCompatiblePipelineServerPro
<Bullseye data-testid="incompatible-pipelines-server">
<EmptyState variant={EmptyStateVariant.lg}>
<EmptyStateHeader
titleText="Pipeline version cannot be rendered"
data-testid="incompatible-pipelines-server-title"
titleText="Unsupported pipeline and pipeline server version"
icon={
<EmptyStateIcon
color="var(--pf-v5-global--warning-color--100)"
Expand All @@ -58,27 +57,14 @@ const EnsureCompatiblePipelineServer: React.FC<EnsureCompatiblePipelineServerPro
/>
<EmptyStateBody>
<p>
Rendering of this pipeline version in the UI is no longer supported, but it can
still be accessed via the API or OpenShift Console. To remove unsupported versions,
delete this project&apos;s pipeline server and create a new one.
This project contains v1 pipeline resources, which are no longer supported or
managed by {ODH_PRODUCT_NAME}. To proceed, back up your pipelines data, delete the
pipeline server, then create a new one. Alternatively, create a new project and
pipeline server. <ExternalLink text="View the documentation" to={DOCS_LINK} /> to
learn more about the migration process, server deletion, supported versions, and
data recovery.
</p>
<ExternalLink
text="Learn more about supported versions and data recovery"
to={DOCS_LINK}
/>
</EmptyStateBody>

<EmptyStateFooter>
<EmptyStateActions>
<Button
data-testid="delete-pipeline-server-button"
variant="primary"
onClick={() => setIsDeleting(true)}
>
Delete pipeline server
</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</Bullseye>
{isDeleting ? <DeleteServerModal onClose={() => setIsDeleting(false)} /> : null}
Expand Down
34 changes: 19 additions & 15 deletions frontend/src/concepts/pipelines/content/PipelineServerActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PipelineServerActions: React.FC<PipelineServerActionsProps> = ({ variant,
React.useContext(PipelineAndVersionContext);
const { pipelines, versions } = getResourcesForDeletion();
const [deletePipelinesOpen, setDeletePipelinesOpen] = React.useState(false);

const { pipelinesServer } = usePipelinesAPI();
const DropdownComponent = (
<Dropdown
onOpenChange={(isOpened) => setOpen(isOpened)}
Expand Down Expand Up @@ -68,24 +68,28 @@ const PipelineServerActions: React.FC<PipelineServerActionsProps> = ({ variant,
<DropdownItem key="view-server-details" onClick={() => setViewOpen(true)}>
View pipeline server configuration
</DropdownItem>,
<Divider key="separator" />,
<DropdownItem
onClick={() => {
setDeleteOpen(true);
}}
key="delete-server"
>
Delete pipeline server
</DropdownItem>,
...(variant === 'kebab'
...(pipelinesServer.compatible
? [
<Divider key="separator" />,
<DropdownItem
key="delete"
onClick={() => setDeletePipelinesOpen(true)}
isDisabled={pipelines.length === 0 && versions.length === 0}
onClick={() => {
setDeleteOpen(true);
}}
key="delete-server"
>
Delete
Delete pipeline server
</DropdownItem>,
...(variant === 'kebab'
? [
<DropdownItem
key="delete"
onClick={() => setDeletePipelinesOpen(true)}
isDisabled={pipelines.length === 0 && versions.length === 0}
>
Delete
</DropdownItem>,
]
: []),
]
: []),
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ const PipelineCoreApplicationPage: React.FC<PipelineCoreApplicationPageProps> =
overrideChildPadding,
...pageProps
}) => {
const pipelinesAPi = usePipelinesAPI();
const { pipelinesServer } = usePipelinesAPI();

return (
<ApplicationsPage
{...pageProps}
loaded={!pipelinesAPi.pipelinesServer.initializing}
empty={!pipelinesAPi.pipelinesServer.installed}
loaded={!pipelinesServer.initializing}
empty={!pipelinesServer.installed}
emptyStatePage={<NoPipelineServer variant={ButtonVariant.primary} />}
headerContent={<PipelineCoreProjectSelector getRedirectPath={getRedirectPath} />}
provideChildrenPadding={!overrideChildPadding}
>
{pipelinesAPi.pipelinesServer.timedOut ? <PipelineServerTimedOut /> : children}
{pipelinesServer.timedOut && pipelinesServer.compatible ? (
<PipelineServerTimedOut />
) : (
children
)}
</ApplicationsPage>
);
};
Expand Down

0 comments on commit 1ab7f26

Please sign in to comment.