diff --git a/frontend/src/lib/doc-util.tsx b/frontend/src/lib/doc-util.tsx index 29212a6cab9..3b386e47517 100644 --- a/frontend/src/lib/doc-util.tsx +++ b/frontend/src/lib/doc-util.tsx @@ -75,21 +75,22 @@ export const DOC_LINKS = { NUTANIX_POST_INSTALL: `https://docs.redhat.com/en/documentation/assisted_installer_for_openshift_container_platform/2024/html/installing_openshift_container_platform_with_the_assisted_installer/assembly_installing-on-nutanix#nutanix-post-installation-configuration_installing-on-nutanix`, } -export function ViewDocumentationLink(props: { doclink: string }): JSX.Element { +export function ViewDocumentationLink(props: { doclink: string; topPadding?: boolean }): JSX.Element { const { t } = useTranslation() + const { doclink, topPadding = true } = props return ( } iconPosition="right" style={{ - paddingTop: '15px', + ...(topPadding ? { paddingTop: '15px' } : {}), fontSize: '14px', }} > diff --git a/frontend/src/routes/Applications/Overview.tsx b/frontend/src/routes/Applications/Overview.tsx index 32458826cce..8613e9b3879 100644 --- a/frontend/src/routes/Applications/Overview.tsx +++ b/frontend/src/routes/Applications/Overview.tsx @@ -8,10 +8,8 @@ import { Stack, StackItem, Content, - ContentVariants, ToolbarItem, } from '@patternfly/react-core' -import { ExternalLinkAltIcon } from '@patternfly/react-icons' import { cellWidth } from '@patternfly/react-table' import { get } from 'lodash' import { useCallback, useContext, useMemo, useState } from 'react' @@ -609,23 +607,8 @@ export default function ApplicationsOverview() { tooltip: ( {t('Displays the type of the application. ')} - - - {t('View documentation')} - - + + ), transforms: [cellWidth(10)], diff --git a/frontend/src/routes/Home/Overview/OverviewPage.tsx b/frontend/src/routes/Home/Overview/OverviewPage.tsx index 1ec9ea92cbf..5eae0be9205 100644 --- a/frontend/src/routes/Home/Overview/OverviewPage.tsx +++ b/frontend/src/routes/Home/Overview/OverviewPage.tsx @@ -5,7 +5,6 @@ import { Card, CardBody, CardTitle, - ContentVariants, Divider, Dropdown, DropdownItem, @@ -23,7 +22,7 @@ import { AcmDynamicGrid } from '../../../components/AcmDynamicGrid' import { KubevirtProviderAlert } from '../../../components/KubevirtProviderAlert' import { useVirtualMachineDetection } from '../../../hooks/useVirtualMachineDetection' import { useTranslation } from '../../../lib/acm-i18next' -import { DOC_LINKS } from '../../../lib/doc-util' +import { DOC_LINKS, ViewDocumentationLink } from '../../../lib/doc-util' import { getUpgradeRiskPredictions } from '../../../lib/get-upgrade-risk-predictions' import { SupportedAggregate, useAggregate } from '../../../lib/useAggregates' import { ObservabilityEndpoint, PrometheusEndpoint, useMetricsPoll } from '../../../lib/useMetricsPoll' @@ -647,15 +646,7 @@ export default function OverviewPage(props: Readonly<{ selectedClusterLabels: Re {t('Enable Observability to see more metrics')} - - {t('View documentation')} - + diff --git a/frontend/src/routes/Infrastructure/Clusters/DiscoveredClusters/DiscoveredClusters.tsx b/frontend/src/routes/Infrastructure/Clusters/DiscoveredClusters/DiscoveredClusters.tsx index e5eedfef06f..0de15f1d9f3 100644 --- a/frontend/src/routes/Infrastructure/Clusters/DiscoveredClusters/DiscoveredClusters.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/DiscoveredClusters/DiscoveredClusters.tsx @@ -221,12 +221,18 @@ export function DiscoveredClustersTable(props: { ], cell: (discoveredCluster) => ( - - - - {discoveredCluster.spec.displayName} - - + } + iconPosition="left" + > + {discoveredCluster.spec.displayName} + ), exportContent: (discoveredCluster) => discoveredCluster.spec.displayName, diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterNodes/ClusterNodes.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterNodes/ClusterNodes.tsx index d8b80f2b12d..ca6676a1210 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterNodes/ClusterNodes.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterNodes/ClusterNodes.tsx @@ -10,6 +10,7 @@ import { quantityToScalar, scalarToQuantity } from '../../../../../../lib/units' import { NavigationPath } from '../../../../../../NavigationPath' import { getRoles, NodeInfo } from '../../../../../../resources' import { + AcmButton, AcmEmptyState, AcmInlineStatus, AcmPageContent, @@ -114,12 +115,18 @@ export function NodesPoolsTable() { cell: (node: NodeInfo) => { const hasOcpConsole = cluster?.distribution?.ocp?.version && cluster.consoleURL return hasOcpConsole ? ( - - - - + } + iconPosition="left" + > {node.name} - + ) : ( getSearchLink(node) ) diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx index 614722b3691..5bc18b822eb 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/ClusterDetails/ClusterOverview/ClusterOverview.tsx @@ -286,13 +286,18 @@ export function ClusterOverviewPageContent() { value: cluster?.labels?.clusterID && ( <>
{cluster?.labels?.clusterID}
- } + iconPosition="right" > - {t('openshift.cluster.manager')} - + {t('openshift.cluster.manager')} + ), }, diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateAWSControlPlane.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateAWSControlPlane.tsx index bed2e42265d..f5a1800b219 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateAWSControlPlane.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateAWSControlPlane.tsx @@ -1,5 +1,5 @@ /* Copyright Contributors to the Open Cluster Management project */ -import { CheckIcon, ExternalLinkAltIcon } from '@patternfly/react-icons' +import { CheckIcon } from '@patternfly/react-icons' import { CatalogCardItemType, CatalogColor, @@ -10,7 +10,7 @@ import { import { useCallback, useMemo, useState } from 'react' import { useTranslation } from '../../../../../lib/acm-i18next' import { useDataViewStrings } from '../../../../../lib/dataViewStrings' -import { DOC_LINKS } from '../../../../../lib/doc-util' +import { DOC_LINKS, ViewDocumentationLink } from '../../../../../lib/doc-util' import { NavigationPath, useBackCancelNavigation } from '../../../../../NavigationPath' import { AcmPage, AcmPageHeader, Provider } from '../../../../../ui-components' import { getTypedCreateClusterPath } from '../ClusterInfrastructureType' @@ -66,11 +66,7 @@ export function CreateAWSControlPlane() { alertVariant: 'info', alertContent: (() => { if (!loaded || isHypershiftEnabled) return undefined - return ( - - {t('View documentation')} - - ) + return })(), badgeList: [ { diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateControlPlane.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateControlPlane.tsx index 8846024e3e1..48d7521dee0 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateControlPlane.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/CreateControlPlane.tsx @@ -1,5 +1,5 @@ /* Copyright Contributors to the Open Cluster Management project */ -import { CheckIcon, ExternalLinkAltIcon } from '@patternfly/react-icons' +import { CheckIcon } from '@patternfly/react-icons' import { CatalogCardItemType, ICatalogCard, PageHeader } from '@stolostron/react-data-view' import { useMemo, useState } from 'react' import { useIsHypershiftEnabled } from '../../../../../hooks/use-hypershift-enabled' @@ -9,7 +9,7 @@ import { getTypedCreateClusterPath, HostInventoryInfrastructureType } from '../C import { breadcrumbs } from './common/common' import { GetControlPlane } from './common/GetControlPlane' import useNoAvailableHostsAlert from '../../../../../hooks/use-available-hosts-alert' -import { DOC_LINKS } from '../../../../../lib/doc-util' +import { DOC_LINKS, ViewDocumentationLink } from '../../../../../lib/doc-util' import { HypershiftDiagramExpand } from './common/HypershiftDiagramExpand' import { Icon } from '@patternfly/react-core' @@ -68,11 +68,7 @@ export function CreateControlPlane() { alertContent: (() => { if (!loaded) return undefined if (!isHypershiftEnabled) { - return ( - - {t('View documentation')} - - ) + return } return noAvailableHostsAlert?.content })(), diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/GetHostedCard.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/GetHostedCard.tsx index f7494c2fc5d..2c1e02d848d 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/GetHostedCard.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/GetHostedCard.tsx @@ -1,8 +1,8 @@ /* Copyright Contributors to the Open Cluster Management project */ -import { CheckIcon, ExternalLinkAltIcon } from '@patternfly/react-icons' +import { CheckIcon } from '@patternfly/react-icons' import { CatalogCardItemType, ICatalogCard } from '@stolostron/react-data-view' import { TFunction } from 'react-i18next' -import { DOC_LINKS } from '../../../../../../lib/doc-util' +import { DOC_LINKS, ViewDocumentationLink } from '../../../../../../lib/doc-util' import { Icon } from '@patternfly/react-core' function GetHostedCard(onNext: () => void, t: TFunction, isHypershiftEnabled: boolean): ICatalogCard { @@ -37,11 +37,7 @@ function GetHostedCard(onNext: () => void, t: TFunction, isHypershiftEnabled: bo ? undefined : t('Hosted control plane operator must be enabled in order to continue'), alertVariant: 'info', - alertContent: ( - - {t('View documentation')} - - ), + alertContent: , } } export default GetHostedCard diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/__snapshots__/GetHostedCard.test.tsx.snap b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/__snapshots__/GetHostedCard.test.tsx.snap index af8ca093101..4f254ab4257 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/__snapshots__/GetHostedCard.test.tsx.snap +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateClusterCatalog/common/__snapshots__/GetHostedCard.test.tsx.snap @@ -2,15 +2,10 @@ exports[`GetHostedCard Return card data - Hypershift enabled 1`] = ` { - "alertContent": - View documentation - - - , + "alertContent": , "alertTitle": undefined, "alertVariant": "info", "id": "hosted", diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/DistributionField.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/DistributionField.tsx index 517904bd7b0..0d450e92652 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/DistributionField.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/DistributionField.tsx @@ -299,9 +299,18 @@ export function DistributionField(props: { version: props.cluster?.distribution.upgradeInfo.desiredVersion, }), footerContent: ( - - {t('update.updating.link')} - + } + iconPosition="left" + > + {t('update.updating.link')} + ), } : undefined @@ -345,9 +354,18 @@ export function DistributionField(props: { version: versionNum, }), footerContent: ( - - {t('update.updating.link')} - + } + iconPosition="left" + > + {t('update.updating.link')} + ), } : undefined @@ -385,9 +403,18 @@ export function DistributionField(props: { version: props.cluster?.distribution.upgradeInfo.desiredVersion, }), footerContent: ( - - {t('update.updating.link')} - + } + iconPosition="left" + > + {t('update.updating.link')} + ), } : undefined diff --git a/frontend/src/ui-components/AcmInlineStatus/AcmInlineStatus.stories.tsx b/frontend/src/ui-components/AcmInlineStatus/AcmInlineStatus.stories.tsx index 03da49c811c..c5d192a41e7 100644 --- a/frontend/src/ui-components/AcmInlineStatus/AcmInlineStatus.stories.tsx +++ b/frontend/src/ui-components/AcmInlineStatus/AcmInlineStatus.stories.tsx @@ -3,6 +3,7 @@ import { Card, CardBody } from '@patternfly/react-core' import { ExternalLinkAltIcon } from '@patternfly/react-icons' import { AcmInlineStatus, StatusType } from './AcmInlineStatus' +import { AcmButton } from '../AcmButton' export default { title: 'InlineStatus', @@ -36,10 +37,18 @@ export const InlineStatusWithPopover = () => { headerContent: 'Status header', bodyContent: 'Some information about the status here.', footerContent: ( - // eslint-disable-next-line jsx-a11y/anchor-is-valid - - Status link - + } + iconPosition="left" + > + Status link + ), }} /> diff --git a/frontend/src/wizards/Argo/ArgoWizard.tsx b/frontend/src/wizards/Argo/ArgoWizard.tsx index d7bc1f2cc88..b5a25e548cd 100644 --- a/frontend/src/wizards/Argo/ArgoWizard.tsx +++ b/frontend/src/wizards/Argo/ArgoWizard.tsx @@ -15,16 +15,15 @@ import { WizSelect, WizTextInput, } from '@patternfly-labs/react-form-wizard' -import { Button, Content, ContentVariants, Flex, FlexItem, ToggleGroup, ToggleGroupItem } from '@patternfly/react-core' +import { Button, Content, Flex, FlexItem, ToggleGroup, ToggleGroupItem } from '@patternfly/react-core' import { Modal, ModalVariant } from '@patternfly/react-core/deprecated' -import { ExternalLinkAltIcon } from '@patternfly/react-icons' import { css } from '@emotion/css' import { get, set } from 'lodash' import { Fragment, ReactNode, useMemo, useRef, useState } from 'react' import { CreateCredentialModal } from '../../components/CreateCredentialModal' import { GitOpsOperatorAlert } from '../../components/GitOpsOperatorAlert' import { useTranslation } from '../../lib/acm-i18next' -import { DOC_LINKS } from '../../lib/doc-util' +import { DOC_LINKS, ViewDocumentationLink } from '../../lib/doc-util' import { SupportedOperator, useOperatorCheck } from '../../lib/operatorCheck' import { useValidation } from '../../hooks/useValidation' import { useWizardStrings } from '../../lib/wizardStrings' @@ -501,23 +500,7 @@ export function ArgoWizard(props: ArgoWizardProps) { {t('Register a set of one or more managed clusters to Red Hat OpenShift GitOps.')} - - - {t('View documentation')} - - + } options={props.argoServers}