-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add InvalidArgoDeploymentAlert component to AppRoutes
Update link text in InvalidArgoDeploymentAlert component
- Loading branch information
1 parent
65b648d
commit 2911814
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
frontend/src/concepts/pipelines/content/InvalidArgoDeploymentAlert.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Alert, AlertActionCloseButton, AlertActionLink } from '@patternfly/react-core'; | ||
import React from 'react'; | ||
import { useBrowserStorage } from '~/components/browserStorage'; | ||
import { useIsAreaAvailable, SupportedArea } from '~/concepts/areas'; | ||
|
||
const INVALID_ARGO_DEPLOYMENT_DOCUMENTATION_URL = ''; | ||
|
||
export const InvalidArgoDeploymentAlert: React.FC = () => { | ||
const [invalidArgoDeploymentAlertDismissed, setInvalidArgoDeploymentAlertDismissed] = | ||
useBrowserStorage('invalidArgoDeploymentAlertDismissed', false, true, true); | ||
|
||
const showMessage = | ||
useIsAreaAvailable(SupportedArea.DS_PIPELINES).customCondition( | ||
({ dscStatus }) => | ||
!!dscStatus?.conditions.some( | ||
(c) => c.type === 'CapabilityDSPv2Argo' && c.status === 'False', | ||
), | ||
) && !invalidArgoDeploymentAlertDismissed; | ||
|
||
if (!showMessage) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Alert | ||
actionLinks={ | ||
<AlertActionLink | ||
component="a" | ||
href={INVALID_ARGO_DEPLOYMENT_DOCUMENTATION_URL} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
View documentation | ||
</AlertActionLink> | ||
} | ||
actionClose={ | ||
<AlertActionCloseButton onClose={() => setInvalidArgoDeploymentAlertDismissed(true)} /> | ||
} | ||
isInline | ||
variant="warning" | ||
title="Data Science Pipelines enablement failed" | ||
> | ||
Data Science Pipelines could not be enabled because a version of Argo Workflow that is not | ||
managed by Red Hat is installed on your cluster. To learn more, view the Red Hat Openshift AI | ||
2.9 documentation. | ||
</Alert> | ||
); | ||
}; |