From 1636d39637be97c38443feaa5bcea09f0986aaff Mon Sep 17 00:00:00 2001 From: Purva Naik Date: Wed, 30 Oct 2024 23:07:52 +0530 Subject: [PATCH] update wording for ensureCompatiblePipelineServer page (#3394) --- .../pages/pipelines/pipelinesGlobal.ts | 8 +++++ .../tests/mocked/pipelines/pipelines.cy.ts | 26 ++------------ .../pipelines/EnsureAPIAvailability.tsx | 5 ++- .../EnsureCompatiblePipelineServer.tsx | 32 +++++------------ .../content/PipelineServerActions.tsx | 34 +++++++++++-------- .../global/PipelineCoreApplicationPage.tsx | 12 ++++--- 6 files changed, 48 insertions(+), 69 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelinesGlobal.ts b/frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelinesGlobal.ts index d0ac13fb78..11ef14e657 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelinesGlobal.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/pipelines/pipelinesGlobal.ts @@ -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'); } diff --git a/frontend/src/__tests__/cypress/cypress/tests/mocked/pipelines/pipelines.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/mocked/pipelines/pipelines.cy.ts index d0f98bb667..effe3ca15d 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/mocked/pipelines/pipelines.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/mocked/pipelines/pipelines.cy.ts @@ -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'; @@ -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( @@ -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', () => { @@ -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); diff --git a/frontend/src/concepts/pipelines/EnsureAPIAvailability.tsx b/frontend/src/concepts/pipelines/EnsureAPIAvailability.tsx index 7f1a207f47..62f143603c 100644 --- a/frontend/src/concepts/pipelines/EnsureAPIAvailability.tsx +++ b/frontend/src/concepts/pipelines/EnsureAPIAvailability.tsx @@ -7,9 +7,8 @@ type EnsureAPIAvailabilityProps = { }; const EnsureAPIAvailability: React.FC = ({ children }) => { - const { apiAvailable } = usePipelinesAPI(); - - if (!apiAvailable) { + const { apiAvailable, pipelinesServer } = usePipelinesAPI(); + if (!apiAvailable && pipelinesServer.compatible) { return ( diff --git a/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx b/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx index 1f9c895bb2..19a1a3136c 100644 --- a/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx +++ b/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx @@ -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 = @@ -48,7 +46,8 @@ const EnsureCompatiblePipelineServer: React.FC

- 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'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. to + learn more about the migration process, server deletion, supported versions, and + data recovery.

-
- - - - - -
{isDeleting ? setIsDeleting(false)} /> : null} diff --git a/frontend/src/concepts/pipelines/content/PipelineServerActions.tsx b/frontend/src/concepts/pipelines/content/PipelineServerActions.tsx index 2f2a70e058..d539c0ee44 100644 --- a/frontend/src/concepts/pipelines/content/PipelineServerActions.tsx +++ b/frontend/src/concepts/pipelines/content/PipelineServerActions.tsx @@ -27,7 +27,7 @@ const PipelineServerActions: React.FC = ({ variant, React.useContext(PipelineAndVersionContext); const { pipelines, versions } = getResourcesForDeletion(); const [deletePipelinesOpen, setDeletePipelinesOpen] = React.useState(false); - + const { pipelinesServer } = usePipelinesAPI(); const DropdownComponent = ( setOpen(isOpened)} @@ -68,24 +68,28 @@ const PipelineServerActions: React.FC = ({ variant, setViewOpen(true)}> View pipeline server configuration , - , - { - setDeleteOpen(true); - }} - key="delete-server" - > - Delete pipeline server - , - ...(variant === 'kebab' + ...(pipelinesServer.compatible ? [ + , setDeletePipelinesOpen(true)} - isDisabled={pipelines.length === 0 && versions.length === 0} + onClick={() => { + setDeleteOpen(true); + }} + key="delete-server" > - Delete + Delete pipeline server , + ...(variant === 'kebab' + ? [ + setDeletePipelinesOpen(true)} + isDisabled={pipelines.length === 0 && versions.length === 0} + > + Delete + , + ] + : []), ] : []), ]} diff --git a/frontend/src/pages/pipelines/global/PipelineCoreApplicationPage.tsx b/frontend/src/pages/pipelines/global/PipelineCoreApplicationPage.tsx index f13816f4d6..9c1bc8983c 100644 --- a/frontend/src/pages/pipelines/global/PipelineCoreApplicationPage.tsx +++ b/frontend/src/pages/pipelines/global/PipelineCoreApplicationPage.tsx @@ -20,18 +20,22 @@ const PipelineCoreApplicationPage: React.FC = overrideChildPadding, ...pageProps }) => { - const pipelinesAPi = usePipelinesAPI(); + const { pipelinesServer } = usePipelinesAPI(); return ( } headerContent={} provideChildrenPadding={!overrideChildPadding} > - {pipelinesAPi.pipelinesServer.timedOut ? : children} + {pipelinesServer.timedOut && pipelinesServer.compatible ? ( + + ) : ( + children + )} ); };