Skip to content

Commit

Permalink
Create docs_links file with all documentation links (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
ammont82 authored May 28, 2024
1 parent de5c7c5 commit 1ed5732
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ProxyFieldsType, StatusErrorType } from '../../types';
import ProxyFields from './ProxyFields';
import UploadSSH from './UploadSSH';
import DiscoveryImageTypeControlGroup from './DiscoveryImageTypeControlGroup';
import { getOCPStaticIPDocLink } from '../../config/constants';
import { getOCPStaticIPDocLink } from '../../config/docs_links';
import { useTranslation } from '../../hooks/use-translation-wrapper';

export const StaticIPInfo = ({ docVersion }: { docVersion?: string }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { PrismCode, SimpleAIPrismTheme, UiIcon } from '../ui';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { Trans } from 'react-i18next';
import { saveAs } from 'file-saver';
import { CHANGE_ISO_PASSWORD_FILE_LINK } from '../../config/constants';
import { CHANGE_ISO_PASSWORD_FILE_LINK } from '../../config/docs_links';
import * as Sentry from '@sentry/browser';

export const DiscoveryTroubleshootingModalContent = () => {
Expand Down
5 changes: 2 additions & 3 deletions libs/ui-lib/lib/common/components/hosts/HostRequirements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import ExternalLink from '../ui/ExternalLink';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { fileSize } from '../../utils';
import { HOST_REQUIREMENTS_LINK } from '../../config/docs_links';

type HWRequirements = {
cpuCores?: number;
Expand Down Expand Up @@ -75,9 +76,7 @@ export const HostRequirementsList: React.FC<HostRequirementsListProps> = ({
{t(
"ai:Also note that each host's disk write speed should meet the minimum requirements to run OpenShift. ",
)}
<ExternalLink href={'https://access.redhat.com/solutions/4885641'}>
{t('ai:Learn more')}
</ExternalLink>
<ExternalLink href={HOST_REQUIREMENTS_LINK}>{t('ai:Learn more')}</ExternalLink>
</ListItem>
</List>
);
Expand Down
2 changes: 1 addition & 1 deletion libs/ui-lib/lib/common/components/ui/TechnologyPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { TECH_SUPPORT_LEVEL_LINK } from '../../config/constants';
import { TECH_SUPPORT_LEVEL_LINK } from '../../config/docs_links';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { PreviewBadge, PreviewBadgeProps } from './PreviewBadge';

Expand Down
80 changes: 0 additions & 80 deletions libs/ui-lib/lib/common/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,6 @@ import { FeatureSupportLevelData } from '../components/featureSupportLevels/Feat
import type { NewFeatureSupportLevelData } from '../components/newFeatureSupportLevels';
import buildManifest from '@openshift-assisted/ui-lib/package.json';

export const getShortOpenshiftVersion = (ocpVersion?: string) =>
ocpVersion?.split('.').slice(0, 2).join('.');

export const ASSISTED_INSTALLER_DOCUMENTATION_LINK =
'https://access.redhat.com/documentation/en-us/assisted_installer_for_openshift_container_platform/2024/html/installing_openshift_container_platform_with_the_assisted_installer/index';

export const OPENSHIFT_LIFE_CYCLE_DATES_LINK =
'https://access.redhat.com/support/policy/updates/openshift#dates';
export const getOpenShiftNetworkingDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.13'
}/installing/installing_bare_metal/installing-bare-metal.html#installation-network-user-infra_installing-bare-metal`;
export const CLUSTER_MANAGER_SITE_LINK = 'https://console.redhat.com/openshift/install/pull-secret';
export const PULL_SECRET_INFO_LINK = CLUSTER_MANAGER_SITE_LINK;
export const ODF_REQUIREMENTS_LINK =
'https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/4.15';
export const VSPHERE_CONFIG_LINK = 'https://access.redhat.com/solutions/6677901';

export const getReportIssueLink = () =>
'https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332330&issuetype=1&components=12370775';

export const FEEDBACK_FORM_LINK =
'https://docs.google.com/forms/d/e/1FAIpQLSfg9M8wRW4m_HkWeAl6KpB5dTcMu8iI3iJ29GlLfZpF2hnjng/viewform';

export const TECH_SUPPORT_LEVEL_LINK = 'https://access.redhat.com/support/offerings/techpreview';

export const getEncryptingDiskDuringInstallationDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/installing/install_config/installing-customizing.html#installation-special-config-encrypt-disk_installing-customizing`;

export const getOcpConsoleNodesPage = (ocpConsoleUrl: string) =>
`${ocpConsoleUrl}/k8s/cluster/nodes`;

export const REDHAT_CONSOLE_OPENSHIFT = 'https://console.redhat.com/openshift';

export const SSH_GENERATION_DOC_LINK = 'https://www.redhat.com/sysadmin/configure-ssh-keygen';

export const CNV_LINK = 'https://cloud.redhat.com/learn/topics/virtualization/';

export const ODF_LINK = 'https://www.redhat.com/en/resources/openshift-data-foundation-datasheet';

export const getLvmsDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.html`;

export const NMSTATE_EXAMPLES_LINK = 'https://nmstate.io/examples.html';

export const getApproveNodesInClLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.11'
}/installing/installing_platform_agnostic/installing-platform-agnostic.html#installation-approve-csrs_installing-platform-agnostic`;

// TODO(mlibra): Retrieve branding dynamically, if needed, i.e. via injecting to the "window" object
export const getProductBrandingCode = () => 'redhat';

Expand Down Expand Up @@ -374,30 +320,4 @@ export const operatorLabels = (
};
};

export const getOCPStaticIPDocLink = (docVersion = '2.8') =>
`https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${docVersion}/html-single/clusters/index#on-prem-creating-your-cluster-with-the-cli-nmstateconfig`;

export const AI_UI_TAG = 'ui_ocm';

export const OCP_RELEASES_PAGE = 'openshift/releases';

export const NUTANIX_CONFIG_LINK = 'https://access.redhat.com/solutions/6983944';

export const CHANGE_ISO_PASSWORD_FILE_LINK =
'https://raw.githubusercontent.com/openshift/assisted-service/master/docs/change-iso-password.sh';

export const CUSTOM_MANIFESTS_HELP_LINK =
'https://docs.openshift.com/container-platform/4.12/installing/install_config/installing-customizing.html';

export const getCustomManifestsDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/installing/install_config/installing-customizing.html`;

export const HOW_TO_KNOW_IF_CLUSTER_SUPPORTS_MULTIPLE_CPU_ARCHS =
'https://access.redhat.com/documentation/en-us/assisted_installer_for_openshift_container_platform/2024/html/installing_openshift_container_platform_with_the_assisted_installer/expanding-the-cluster#checking-for-multiple-architectures_expanding-the-cluster';

export const getMceDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/architecture/mce-overview-ocp.html`;
99 changes: 99 additions & 0 deletions libs/ui-lib/lib/common/config/docs_links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
export const getShortOpenshiftVersion = (ocpVersion?: string) =>
ocpVersion?.split('.').slice(0, 2).join('.');

export const getYearForAssistedInstallerDocumentationLink = () => {
return new Date().getFullYear();
};

export const ASSISTED_INSTALLER_DOCUMENTATION_LINK = `https://access.redhat.com/documentation/en-us/assisted_installer_for_openshift_container_platform/${getYearForAssistedInstallerDocumentationLink()}/html/installing_openshift_container_platform_with_the_assisted_installer/index`;

//New cluster page
export const OPENSHIFT_LIFE_CYCLE_DATES_LINK =
'https://access.redhat.com/support/policy/updates/openshift#dates';

export const TECH_SUPPORT_LEVEL_LINK = 'https://access.redhat.com/support/offerings/techpreview';

export const CLUSTER_MANAGER_SITE_LINK = 'https://console.redhat.com/openshift/install/pull-secret';

export const PULL_SECRET_INFO_LINK = CLUSTER_MANAGER_SITE_LINK;

export const getEncryptingDiskDuringInstallationDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/installing/install_config/installing-customizing.html#installation-special-config-encrypt-disk_installing-customizing`;

//Networking page
export const getOpenShiftNetworkingDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.13'
}/installing/installing_bare_metal/installing-bare-metal.html#installation-network-user-infra_installing-bare-metal`;
export const SSH_GENERATION_DOC_LINK = 'https://www.redhat.com/sysadmin/configure-ssh-keygen';

//Hosts status
export const getOcpConsoleNodesPage = (ocpConsoleUrl: string) =>
`${ocpConsoleUrl}/k8s/cluster/nodes`;

export const getApproveNodesInClLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.11'
}/installing/installing_platform_agnostic/installing-platform-agnostic.html#installation-approve-csrs_installing-platform-agnostic`;

//Static Ip configuration
export const NMSTATE_EXAMPLES_LINK = 'https://nmstate.io/examples.html';

export const getOCPStaticIPDocLink = (docVersion = '2.8') =>
`https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${docVersion}/html-single/clusters/index#on-prem-creating-your-cluster-with-the-cli-nmstateconfig`;

//Platform integration
export const NUTANIX_CONFIG_LINK = 'https://access.redhat.com/solutions/6983944';

export const VSPHERE_CONFIG_LINK = 'https://access.redhat.com/solutions/6677901';

//Custom manifests
export const CUSTOM_MANIFESTS_HELP_LINK =
'https://docs.openshift.com/container-platform/4.12/installing/install_config/installing-customizing.html';

export const getCustomManifestsDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/installing/install_config/installing-customizing.html`;

export const HOW_TO_KNOW_IF_CLUSTER_SUPPORTS_MULTIPLE_CPU_ARCHS =
'https://access.redhat.com/documentation/en-us/assisted_installer_for_openshift_container_platform/2024/html/installing_openshift_container_platform_with_the_assisted_installer/expanding-the-cluster#checking-for-multiple-architectures_expanding-the-cluster';

export const OCP_RELEASES_PAGE = 'openshift/releases';

//Host requirements
export const DISK_WRITE_SPEED_LINK = 'https://access.redhat.com/solutions/4885641';

export const HOST_REQUIREMENTS_LINK = 'https://access.redhat.com/solutions/4885641';

//Operators page
export const ODF_REQUIREMENTS_LINK =
'https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/4.15';

export const CNV_LINK = 'https://cloud.redhat.com/learn/topics/virtualization/';

export const ODF_LINK = 'https://www.redhat.com/en/resources/openshift-data-foundation-datasheet';

export const getMceDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/architecture/mce-overview-ocp.html`;

export const getLvmsDocsLink = (ocpVersion?: string) =>
`https://docs.openshift.com/container-platform/${
getShortOpenshiftVersion(ocpVersion) || '4.12'
}/storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.html`;

//Others
export const REDHAT_CONSOLE_OPENSHIFT = 'https://console.redhat.com/openshift';

export const getReportIssueLink = () =>
'https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332330&issuetype=1&components=12370775';

export const FEEDBACK_FORM_LINK =
'https://docs.google.com/forms/d/e/1FAIpQLSfg9M8wRW4m_HkWeAl6KpB5dTcMu8iI3iJ29GlLfZpF2hnjng/viewform';

export const CHANGE_ISO_PASSWORD_FILE_LINK =
'https://raw.githubusercontent.com/openshift/assisted-service/master/docs/change-iso-password.sh';
1 change: 1 addition & 0 deletions libs/ui-lib/lib/common/config/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './constants';
export * from './docs_links';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { List, ListItem, Text, TextContent } from '@patternfly/react-core';
import { ExternalLink } from '../../../../common/components/ui';
import { getOpenShiftNetworkingDocsLink } from '../../../../common/config/constants';
import { getOpenShiftNetworkingDocsLink } from '../../../../common/config/docs_links';

export interface UserManagedNetworkingTextContentProps {
shouldDisplayLoadBalancersBullet?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PreviewSupportLevel,
isPreviewSupportLevel,
} from '../../../common/types';
import { TECH_SUPPORT_LEVEL_LINK } from '../../../common/config/constants';
import { TECH_SUPPORT_LEVEL_LINK } from '../../../common/config/docs_links';
import ExternalLink from '../../../common/components/ui/ExternalLink';
import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
import { DetailItem, UiIcon } from '../../../common';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import { List, ListItem, Text, TextContent } from '@patternfly/react-core';
import { ErrorState, ExternalLink, LoadingState } from '../../../common';
import { DISK_WRITE_SPEED_LINK, ErrorState, ExternalLink, LoadingState } from '../../../common';
import { useClusterPreflightRequirements } from '../../hooks';
import { fileSize } from '../../../common/utils';
import { Cluster } from '@openshift-assisted/types/assisted-installer-service';

const DISK_WRITE_SPEED_LINK = 'https://access.redhat.com/solutions/4885641';

const parseRAM = (ramMib: number) => fileSize(ramMib * 1024 * 1024, 2, 'iec');

type PreflightRequirementsContentProps = {
Expand Down

0 comments on commit 1ed5732

Please sign in to comment.