diff --git a/libs/ui-lib/lib/common/config/docs_links.ts b/libs/ui-lib/lib/common/config/docs_links.ts index b5bd1c5f16..80b9496881 100644 --- a/libs/ui-lib/lib/common/config/docs_links.ts +++ b/libs/ui-lib/lib/common/config/docs_links.ts @@ -117,23 +117,33 @@ export const getMtuLink = (ocpVersion?: string) => export const AUTHORINO_OPERATOR_LINK = 'https://github.com/Kuadrant/authorino-operator'; -export const LOCAL_STORAGE_OPERATOR_LINK = - 'https://docs.openshift.com/container-platform/4.17/storage/persistent_storage/persistent_storage_local/ways-to-provision-local-storage.html'; +export const getLsoLink = (ocpVersion?: string) => + `https://docs.openshift.com/container-platform/${getShortOpenshiftVersion( + ocpVersion, + )}/storage/persistent_storage/persistent_storage_local/ways-to-provision-local-storage.html`; -export const NMSTATE_OPERATOR_LINK = - 'https://docs.openshift.com/container-platform/4.17/networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator.html'; +export const getNmstateLink = (ocpVersion?: string) => + `https://docs.openshift.com/container-platform/${getShortOpenshiftVersion( + ocpVersion, + )}/networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator.html`; -export const NODE_FEATURE_DISCOVERY_OPERATOR_LINK = - 'https://docs.openshift.com/container-platform/4.17/hardware_enablement/psap-node-feature-discovery-operator.html'; +export const getNodeFeatureDiscoveryLink = (ocpVersion?: string) => + `https://docs.openshift.com/container-platform/${getShortOpenshiftVersion( + ocpVersion, + )}/hardware_enablement/psap-node-feature-discovery-operator.html`; -export const NVIDIA_GPU_OPERATOR_LINK = - 'https://docs.openshift.com/container-platform/4.17/virt/virtual_machines/advanced_vm_management/virt-configuring-virtual-gpus.html'; +export const getNvidiaGpuLink = (ocpVersion?: string) => + `https://docs.openshift.com/container-platform/${getShortOpenshiftVersion( + ocpVersion, + )}/virt/virtual_machines/advanced_vm_management/virt-configuring-virtual-gpus.html`; export const PIPELINES_OPERATOR_LINK = 'https://docs.openshift.com/pipelines/1.17/install_config/installing-pipelines.html'; -export const SERVICE_MESH_OPERATOR_LINK = - 'https://docs.openshift.com/container-platform/4.17/service_mesh/v1x/preparing-ossm-installation.html'; +export const getServiceMeshLink = (ocpVersion?: string) => + `https://docs.openshift.com/container-platform/${getShortOpenshiftVersion( + ocpVersion, + )}/service_mesh/v1x/preparing-ossm-installation.html`; export const SERVERLESS_OPERATOR_LINK = 'https://docs.openshift.com/serverless/1.28/install/install-serverless-operator.html#serverless-install-web-console_install-serverless-operator'; diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/LsoCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/LsoCheckbox.tsx index 70edcfe222..a8c5bc5009 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/LsoCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/LsoCheckbox.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; -import { getFieldId, LOCAL_STORAGE_OPERATOR_LINK, PopoverIcon } from '../../../../common'; +import { getFieldId, getLsoLink, PopoverIcon } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; @@ -30,12 +30,12 @@ const LsoLabel = ({ ); }; -const LsoHelperText = () => { +const LsoHelperText = ({ openshiftVersion }: { openshiftVersion?: string }) => { return ( Allows provisioning of persistent storage by using local volumes.{' '} - + {'Learn more'} @@ -46,9 +46,11 @@ const LsoHelperText = () => { const LsoCheckbox = ({ disabledReason, supportLevel, + openshiftVersion, }: { disabledReason?: string; supportLevel?: SupportLevel | undefined; + openshiftVersion?: string; }) => { const fieldId = getFieldId(LSO_FIELD_NAME, 'input'); @@ -57,7 +59,7 @@ const LsoCheckbox = ({ } - helperText={} + helperText={} isDisabled={!!disabledReason} /> diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NmstateCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NmstateCheckbox.tsx index cbe0718626..6eb891c8de 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NmstateCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NmstateCheckbox.tsx @@ -1,11 +1,6 @@ import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; -import { - getFieldId, - PopoverIcon, - ClusterOperatorProps, - NMSTATE_OPERATOR_LINK, -} from '../../../../common'; +import { getFieldId, PopoverIcon, ClusterOperatorProps, getNmstateLink } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; import NmstateRequirements from './NmstateRequirements'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; @@ -39,13 +34,13 @@ const NmstateLabel = ({ ); }; -const NmstateHelperText = () => { +const NmstateHelperText = ({ openshiftVersion }: { openshiftVersion?: string }) => { return ( Provides users with functionality to configure various network interface types, DNS, and routing on cluster nodes.{' '} - + {'Learn more'} @@ -57,10 +52,12 @@ const NmstateCheckbox = ({ clusterId, disabledReason, supportLevel, + openshiftVersion, }: { clusterId: ClusterOperatorProps['clusterId']; disabledReason?: string; supportLevel?: SupportLevel | undefined; + openshiftVersion?: string; }) => { const fieldId = getFieldId(NMSTATE_FIELD_NAME, 'input'); @@ -75,7 +72,7 @@ const NmstateCheckbox = ({ supportLevel={supportLevel} /> } - helperText={} + helperText={} isDisabled={!!disabledReason} /> diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.tsx index 89a9276df5..7723733c94 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NodeFeatureDiscoveryCheckbox.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; -import { getFieldId, NODE_FEATURE_DISCOVERY_OPERATOR_LINK, PopoverIcon } from '../../../../common'; +import { getFieldId, getNodeFeatureDiscoveryLink, PopoverIcon } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; @@ -30,13 +30,17 @@ const NodeFeatureDiscoveryLabel = ({ ); }; -const NodeFeatureDiscoveryHelperText = () => { +const NodeFeatureDiscoveryHelperText = ({ openshiftVersion }: { openshiftVersion?: string }) => { return ( Manage the detection of hardware features and configuration by labeling nodes with hardware-specific information.{' '} - + {'Learn more'} @@ -47,9 +51,11 @@ const NodeFeatureDiscoveryHelperText = () => { const NodeFeatureDiscoveryCheckbox = ({ disabledReason, supportLevel, + openshiftVersion, }: { disabledReason?: string; supportLevel?: SupportLevel | undefined; + openshiftVersion?: string; }) => { const fieldId = getFieldId(NODEFEATUREDISCOVERY_FIELD_NAME, 'input'); @@ -60,7 +66,9 @@ const NodeFeatureDiscoveryCheckbox = ({ label={ } - helperText={} + helperText={ + + } isDisabled={!!disabledReason} /> diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.tsx index 585ba4c899..dbef91e369 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/NvidiaGpuCheckbox.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; -import { getFieldId, NVIDIA_GPU_OPERATOR_LINK, PopoverIcon } from '../../../../common'; +import { getFieldId, getNvidiaGpuLink, PopoverIcon } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; @@ -30,12 +30,12 @@ const NvidiaGpuLabel = ({ ); }; -const NvidiaGpuHelperText = () => { +const NvidiaGpuHelperText = ({ openshiftVersion }: { openshiftVersion?: string }) => { return ( Automate the management of NVIDIA software components needed to provision and monitor GPUs.{' '} - + {'Learn more'} @@ -46,9 +46,11 @@ const NvidiaGpuHelperText = () => { const NvidiaGpuCheckbox = ({ disabledReason, supportLevel, + openshiftVersion, }: { disabledReason?: string; supportLevel?: SupportLevel | undefined; + openshiftVersion?: string; }) => { const fieldId = getFieldId(NVIDIAGPU_FIELD_NAME, 'input'); @@ -57,7 +59,7 @@ const NvidiaGpuCheckbox = ({ } - helperText={} + helperText={} isDisabled={!!disabledReason} /> diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.tsx index 5102334b6e..a0bfa33cc6 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/ServicemeshCheckbox.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; -import { getFieldId, PopoverIcon, SERVICE_MESH_OPERATOR_LINK } from '../../../../common'; +import { getFieldId, getServiceMeshLink, PopoverIcon } from '../../../../common'; import { OcmCheckboxField } from '../../ui/OcmFormFields'; import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; @@ -30,12 +30,12 @@ const ServiceMeshLabel = ({ ); }; -const ServiceMeshHelperText = () => { +const ServiceMeshHelperText = ({ openshiftVersion }: { openshiftVersion?: string }) => { return ( Platform that provides behavioral insight and operational control over a service mesh.{' '} - + {'Learn more'} @@ -46,9 +46,11 @@ const ServiceMeshHelperText = () => { const ServiceMeshCheckbox = ({ disabledReason, supportLevel, + openshiftVersion, }: { disabledReason?: string; supportLevel?: SupportLevel | undefined; + openshiftVersion?: string; }) => { const fieldId = getFieldId(SERVICEMESH_FIELD_NAME, 'input'); @@ -57,7 +59,7 @@ const ServiceMeshCheckbox = ({ } - helperText={} + helperText={} isDisabled={!!disabledReason} />