From 213873c8270e380a7188a1cf11cc59ee9a1d7174 Mon Sep 17 00:00:00 2001 From: Gage Krumbach Date: Thu, 11 Apr 2024 14:15:28 -0500 Subject: [PATCH] Add useUser hook to EnsureCompatiblePipelineServer component Add paragraph tags to body text in EnsureCompatiblePipelineServer component Update pipeline rendering message --- .../EnsureCompatiblePipelineServer.tsx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx b/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx index 4a649b091f..101f6a5271 100644 --- a/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx +++ b/frontend/src/concepts/pipelines/EnsureCompatiblePipelineServer.tsx @@ -15,6 +15,7 @@ import { ExclamationTriangleIcon } from '@patternfly/react-icons'; import DeletePipelineServerModal from '~/concepts/pipelines/content/DeletePipelineServerModal'; import ExternalLink from '~/components/ExternalLink'; import NoPipelineServer from '~/concepts/pipelines/NoPipelineServer'; +import { useUser } from '~/redux/selectors'; import { usePipelinesAPI } from './context'; // TODO: Fix doc link to go to more docs on v2 @@ -29,8 +30,13 @@ const EnsureCompatiblePipelineServer: React.FC { const { pipelinesServer } = usePipelinesAPI(); + const { isAdmin } = useUser(); const [isDeleting, setIsDeleting] = React.useState(false); + const bodyText = isAdmin + ? "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." + : 'Rendering of this pipeline version in the UI is no longer supported. To access this pipeline, contact your administrator.'; + if (pipelinesServer.initializing) { return ( @@ -49,7 +55,7 @@ const EnsureCompatiblePipelineServer: React.FC - To remove unsupported versions, delete this project‘s pipeline server and create - a new one.{' '} +

{bodyText}

- - - - - + {isAdmin && ( + + + + + + )}
setIsDeleting(false)} />