diff --git a/locales/en/plugin__kubevirt-plugin.json b/locales/en/plugin__kubevirt-plugin.json index a00e2f8c0..76fdf9b68 100644 --- a/locales/en/plugin__kubevirt-plugin.json +++ b/locales/en/plugin__kubevirt-plugin.json @@ -707,7 +707,7 @@ "Map of string keys and values that can be used to organize and categorize (scope and select) objects": "Map of string keys and values that can be used to organize and categorize (scope and select) objects", "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services.": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services.", "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. ": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. ", - "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: <2>http://kubernetes.io/docs/user-guide/labels": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: <2>http://kubernetes.io/docs/user-guide/labels", + "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info:": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info:", "masquerade": "masquerade", "Masquerade": "Masquerade", "Match label": "Match label", diff --git a/src/utils/components/AddBootableVolumeModal/components/SchedulingSettings.tsx b/src/utils/components/AddBootableVolumeModal/components/SchedulingSettings.tsx index 211b61644..8ae4b932c 100644 --- a/src/utils/components/AddBootableVolumeModal/components/SchedulingSettings.tsx +++ b/src/utils/components/AddBootableVolumeModal/components/SchedulingSettings.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; import FormGroupHelperText from '@kubevirt-utils/components/FormGroupHelperText/FormGroupHelperText'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { FormGroup, NumberInput, Text, TextInput, Title } from '@patternfly/react-core'; @@ -51,10 +52,7 @@ const SchedulingSettings: FC = ({ {t('Use cron formatting to set when and how often to look for new imports.')}{' '} - + { @@ -9,10 +9,7 @@ const PreferencePopoverContent: FC = () => { return ( <> {t('The preferred VirtualMachine attribute values required to run a given workload.')}{' '} - + ); }; diff --git a/src/utils/components/CloneVMModal/utils/constants.ts b/src/utils/components/CloneVMModal/utils/constants.ts index ca350680f..6a29dd959 100644 --- a/src/utils/components/CloneVMModal/utils/constants.ts +++ b/src/utils/components/CloneVMModal/utils/constants.ts @@ -1,8 +1,6 @@ import { ProgressStepVariant } from '@patternfly/react-core'; export const TEMPLATE_VM_NAME_LABEL = 'vm.kubevirt.io/name'; -export const DOC_URL_ENABLING_USER_CLONE_PERMISSIONS = - 'https://docs.openshift.com/container-platform/latest/virt/virtual_machines/cloning_vms/virt-enabling-user-permissions-to-clone-datavolumes.html'; export enum CLONING_STATUSES { CREATING_TARGET_VM = 'CreatingTargetVM', diff --git a/src/utils/components/CloudinitDescription/CloudinitInfoHelper.tsx b/src/utils/components/CloudinitDescription/CloudinitInfoHelper.tsx index e1221880d..5d23ab5db 100644 --- a/src/utils/components/CloudinitDescription/CloudinitInfoHelper.tsx +++ b/src/utils/components/CloudinitDescription/CloudinitInfoHelper.tsx @@ -1,11 +1,10 @@ import React from 'react'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, Stack, StackItem } from '@patternfly/react-core'; import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons'; -const CLOUD_INIT_DOC_LINK = 'https://cloudinit.readthedocs.io/en/latest/index.html'; - const CloudInitInfoHelper = () => { const { t } = useKubevirtTranslation(); return ( @@ -25,7 +24,7 @@ const CloudInitInfoHelper = () => { size="sm" variant="link" > - + {t('Learn more')} diff --git a/src/utils/components/Consoles/components/DesktopViewer/Components/MoreInformationDefault.tsx b/src/utils/components/Consoles/components/DesktopViewer/Components/MoreInformationDefault.tsx index 37336550a..757f9f57e 100644 --- a/src/utils/components/Consoles/components/DesktopViewer/Components/MoreInformationDefault.tsx +++ b/src/utils/components/Consoles/components/DesktopViewer/Components/MoreInformationDefault.tsx @@ -34,7 +34,7 @@ const MoreInformationDefault: React.FC = ({ textMor
{t('Download the MSI from ')} diff --git a/src/utils/components/Consoles/components/DesktopViewer/Components/RDPServiceModal.tsx b/src/utils/components/Consoles/components/DesktopViewer/Components/RDPServiceModal.tsx index 7752173ca..060c3d4a3 100644 --- a/src/utils/components/Consoles/components/DesktopViewer/Components/RDPServiceModal.tsx +++ b/src/utils/components/Consoles/components/DesktopViewer/Components/RDPServiceModal.tsx @@ -3,6 +3,7 @@ import React, { FC, useState } from 'react'; import { V1VirtualMachine, V1VirtualMachineInstance } from '@kubevirt-ui/kubevirt-api/kubevirt'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; import TabModal from '@kubevirt-utils/components/TabModal/TabModal'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Alert, @@ -13,7 +14,6 @@ import { StackItem, } from '@patternfly/react-core'; -import { NODE_PORTS_LINK } from '../utils/constants'; import { createRDPService } from '../utils/utils'; type RDPServiceModalProps = { @@ -52,7 +52,7 @@ const RDPServiceModal: FC = ({ isOpen, onClose, vm, vmi })
{t('RDP Service is using a node port. Node port requires additional port resources.')}
- +
diff --git a/src/utils/components/Consoles/components/DesktopViewer/utils/constants.ts b/src/utils/components/Consoles/components/DesktopViewer/utils/constants.ts index 65eb6a702..66ce51eac 100644 --- a/src/utils/components/Consoles/components/DesktopViewer/utils/constants.ts +++ b/src/utils/components/Consoles/components/DesktopViewer/utils/constants.ts @@ -5,8 +5,6 @@ export const DEFAULT_VV_MIMETYPE = 'application/x-virt-viewer'; export const DEFAULT_RDP_FILENAME = 'console.rdp'; export const DEFAULT_RDP_MIMETYPE = 'application/rdp'; export const VMI_LABEL_AS_RDP_SERVICE_SELECTOR = 'vm.kubevirt.io/name'; -export const NODE_PORTS_LINK = - 'https://access.redhat.com/documentation/en-us/openshift_container_platform/4.10/html/networking/configuring-ingress-cluster-traffic#nw-using-nodeport_configuring-ingress-cluster-traffic-nodeport'; export const POD = 'POD'; export const MULTUS = 'MULTUS'; diff --git a/src/utils/components/CreateProjectModal/CreateProjectModal.tsx b/src/utils/components/CreateProjectModal/CreateProjectModal.tsx index cf80f382d..246f69144 100644 --- a/src/utils/components/CreateProjectModal/CreateProjectModal.tsx +++ b/src/utils/components/CreateProjectModal/CreateProjectModal.tsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { Trans } from 'react-i18next'; import { ProjectRequestModel } from '@kubevirt-ui/kubevirt-api/console'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { isEmpty } from '@kubevirt-utils/utils/utils'; import { k8sCreate, K8sResourceCommon } from '@openshift-console/dynamic-plugin-sdk'; @@ -54,7 +55,7 @@ const CreateProjectModal: React.FC = ({ {t('An OpenShift project is an alternative representation of a Kubernetes namespace.')}
- + {t('Learn more about working with projects')}
diff --git a/src/utils/components/DiskModal/components/StorageClassAndPreallocation/EnablePreallocationCheckbox.tsx b/src/utils/components/DiskModal/components/StorageClassAndPreallocation/EnablePreallocationCheckbox.tsx index 651aa894f..d4c57d5c6 100644 --- a/src/utils/components/DiskModal/components/StorageClassAndPreallocation/EnablePreallocationCheckbox.tsx +++ b/src/utils/components/DiskModal/components/StorageClassAndPreallocation/EnablePreallocationCheckbox.tsx @@ -4,6 +4,7 @@ import { Trans } from 'react-i18next'; import { Link } from 'react-router-dom-v5-compat'; import HelpTextIcon from '@kubevirt-utils/components/HelpTextIcon/HelpTextIcon'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Checkbox, Flex, FlexItem, FormGroup, PopoverPosition } from '@patternfly/react-core'; @@ -44,8 +45,7 @@ const EnablePreallocationCheckbox: FC = ({ isD Refer to the diff --git a/src/utils/components/DynamicSSHKeyInjection/constants/constants.ts b/src/utils/components/DynamicSSHKeyInjection/constants/constants.ts index 601d73104..126d74268 100644 --- a/src/utils/components/DynamicSSHKeyInjection/constants/constants.ts +++ b/src/utils/components/DynamicSSHKeyInjection/constants/constants.ts @@ -1,4 +1 @@ export const DYNAMIC_CREDENTIALS_SUPPORT = 'kubevirt.io/dynamic-credentials-support'; - -export const DYNAMIC_SSH_KEY_INJECTION_LINK = - 'https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/virt-accessing-vm-ssh.html'; diff --git a/src/utils/components/GuidedTour/components/EndTourContent/EndTourContent.tsx b/src/utils/components/GuidedTour/components/EndTourContent/EndTourContent.tsx index ab8bdb205..ff16c3ef6 100644 --- a/src/utils/components/GuidedTour/components/EndTourContent/EndTourContent.tsx +++ b/src/utils/components/GuidedTour/components/EndTourContent/EndTourContent.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; import { Link } from 'react-router-dom-v5-compat'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; const EndTourContent: FC = () => { @@ -12,14 +13,11 @@ const EndTourContent: FC = () => { Thank you for taking the tour.
Stay up-to-date with Openshift Virtualization on our{' '} - + Blog {' '} or continue to learn more in our{' '} - + documentation . diff --git a/src/utils/components/NetworkInterfaceModal/components/NetworkInterfaceNetworkSelect/components/NetworkSelectHelperPopover/NetworkSelectHelperPopover.tsx b/src/utils/components/NetworkInterfaceModal/components/NetworkInterfaceNetworkSelect/components/NetworkSelectHelperPopover/NetworkSelectHelperPopover.tsx index d2aa35334..760de377d 100644 --- a/src/utils/components/NetworkInterfaceModal/components/NetworkInterfaceNetworkSelect/components/NetworkSelectHelperPopover/NetworkSelectHelperPopover.tsx +++ b/src/utils/components/NetworkInterfaceModal/components/NetworkInterfaceNetworkSelect/components/NetworkSelectHelperPopover/NetworkSelectHelperPopover.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, ButtonVariant, Popover } from '@patternfly/react-core'; import { HelpIcon } from '@patternfly/react-icons'; @@ -25,10 +26,7 @@ const NetworkSelectHelperPopover: FC = () => { VirtualMachine for high performance.
- + } headerContent={t('Network binding types')} diff --git a/src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx b/src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx index 3146cbdcc..5b2d5a614 100644 --- a/src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx +++ b/src/utils/components/SSHAccess/components/ConsoleOverVirtctl.tsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom-v5-compat'; import { V1VirtualMachine } from '@kubevirt-ui/kubevirt-api/kubevirt'; import { getConsoleVirtctlCommand } from '@kubevirt-utils/components/SSHAccess/utils'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { DescriptionListDescription, @@ -41,14 +42,8 @@ const ConsoleOverVirtctl: FC = ({ vm }) => {
For more details, see{' '} - - Installing virtctl - {' '} - in Getting started with OpenShift Virtualization. + Installing virtctl in Getting started + with OpenShift Virtualization.

diff --git a/src/utils/components/SSHAccess/constants.ts b/src/utils/components/SSHAccess/constants.ts index 2700a1b60..75ed5c268 100644 --- a/src/utils/components/SSHAccess/constants.ts +++ b/src/utils/components/SSHAccess/constants.ts @@ -5,9 +5,6 @@ export const SSH_PORT = 22; export const VMI_LABEL_AS_SSH_SERVICE_SELECTOR = 'kubevirt.io/domain'; -export const NODE_PORTS_LINK = - 'https://access.redhat.com/documentation/en-us/openshift_container_platform/4.14/html/networking/configuring-ingress-cluster-traffic#nw-using-nodeport_configuring-ingress-cluster-traffic-nodeport'; - export enum SERVICE_TYPES { LOAD_BALANCER = 'LoadBalancer', NODE_PORT = 'NodePort', diff --git a/src/utils/components/SnapshotModal/SnapshotSupportLink/SnapshotSupportLink.tsx b/src/utils/components/SnapshotModal/SnapshotSupportLink/SnapshotSupportLink.tsx index a5367e24a..9a1b79e56 100644 --- a/src/utils/components/SnapshotModal/SnapshotSupportLink/SnapshotSupportLink.tsx +++ b/src/utils/components/SnapshotModal/SnapshotSupportLink/SnapshotSupportLink.tsx @@ -1,17 +1,12 @@ import * as React from 'react'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; const SnapshotSupportLink: React.FC = () => { const { t } = useKubevirtTranslation(); return ( -
+ {t('Learn more about snapshots')} ); diff --git a/src/utils/components/SysprepModal/SysprepInfo.tsx b/src/utils/components/SysprepModal/SysprepInfo.tsx index 447113634..2f6c561ed 100644 --- a/src/utils/components/SysprepModal/SysprepInfo.tsx +++ b/src/utils/components/SysprepModal/SysprepInfo.tsx @@ -1,11 +1,10 @@ import React, { FC } from 'react'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, Stack, StackItem, Text, TextVariants } from '@patternfly/react-core'; import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons'; -import { SYSPREP_DOC_URL } from './consts'; - const SysprepInfo: FC = () => { const { t } = useKubevirtTranslation(); @@ -30,7 +29,7 @@ const SysprepInfo: FC = () => { size="sm" variant="link" > - + {t('Learn more')} diff --git a/src/utils/components/SysprepModal/consts.ts b/src/utils/components/SysprepModal/consts.ts index beea47fd2..cf73bd759 100644 --- a/src/utils/components/SysprepModal/consts.ts +++ b/src/utils/components/SysprepModal/consts.ts @@ -1,3 +1 @@ export const SYSPREP = 'sysprep'; -export const SYSPREP_DOC_URL = - 'https://docs.openshift.com/container-platform/4.10/virt/virtual_machines/virt-automating-windows-sysprep.html'; diff --git a/src/utils/components/SysprepModal/sysprep-autounattend/SysprepAutounattendHelperPopup.tsx b/src/utils/components/SysprepModal/sysprep-autounattend/SysprepAutounattendHelperPopup.tsx index 568ba415b..23998932a 100644 --- a/src/utils/components/SysprepModal/sysprep-autounattend/SysprepAutounattendHelperPopup.tsx +++ b/src/utils/components/SysprepModal/sysprep-autounattend/SysprepAutounattendHelperPopup.tsx @@ -1,12 +1,11 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, Popover, Text, TextVariants } from '@patternfly/react-core'; import { ExternalLinkSquareAltIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; -import { SYSPREP_DOC_URL } from '../consts'; - const SysprepUnattendHelperPopup: FC = () => { const { t } = useKubevirtTranslation(); return ( @@ -27,7 +26,7 @@ const SysprepUnattendHelperPopup: FC = () => { size="sm" variant="link" > - + {t('Learn more')} diff --git a/src/utils/components/SysprepModal/sysprep-unattend/SysprepUnattendHelperPopup.tsx b/src/utils/components/SysprepModal/sysprep-unattend/SysprepUnattendHelperPopup.tsx index f8736c83f..93bcd4ccb 100644 --- a/src/utils/components/SysprepModal/sysprep-unattend/SysprepUnattendHelperPopup.tsx +++ b/src/utils/components/SysprepModal/sysprep-unattend/SysprepUnattendHelperPopup.tsx @@ -1,12 +1,11 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, Popover, Text, TextVariants } from '@patternfly/react-core'; import { ExternalLinkSquareAltIcon, OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; -import { SYSPREP_DOC_URL } from '../consts'; - const SysprepUnattendHelperPopup: FC = () => { const { t } = useKubevirtTranslation(); return ( @@ -26,7 +25,7 @@ const SysprepUnattendHelperPopup: FC = () => { size="sm" variant="link" > - + {t('Learn more')} diff --git a/src/utils/components/TolerationsModal/TolerationModalDescriptionText.tsx b/src/utils/components/TolerationsModal/TolerationModalDescriptionText.tsx index 5aaf79ed6..fb2f99048 100644 --- a/src/utils/components/TolerationsModal/TolerationModalDescriptionText.tsx +++ b/src/utils/components/TolerationsModal/TolerationModalDescriptionText.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Text, TextVariants } from '@patternfly/react-core'; import { ExternalLinkAltIcon } from '@patternfly/react-icons'; @@ -18,11 +19,7 @@ const TolerationModalDescriptionText: React.FC = () => { 'Add tolerations to allow a VirtualMachine to schedule onto Nodes with matching taints.', )} - + {t('Taints and Tolerations documentation')} diff --git a/src/utils/constants/documentation.ts b/src/utils/constants/documentation.ts new file mode 100644 index 000000000..1963e96f5 --- /dev/null +++ b/src/utils/constants/documentation.ts @@ -0,0 +1,47 @@ +export const REDHAT_BASE_URL = 'https://www.redhat.com'; +export const REDHAT_DOC_URL = 'https://access.redhat.com/documentation/en-us'; +export const OPENSHIFT_DOC_URL = 'https://docs.openshift.com/container-platform'; + +export const documentationURL = { + ANNOTATIONS: 'https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/', + AUTOCOMPUTE_CPU_LIMITS: + 'https://kubevirt.io/user-guide/virtual_machines/resources_requests_and_limits/', + CDI_UPLOAD_SUPPORTED_TYPES: `${REDHAT_DOC_URL}/openshift_container_platform/4.9/html/virtualization/virtual-machines#virt-cdi-supported-operations-matrix_virt-importing-virtual-machine-images-datavolumes`, + CHECKUPS: `${OPENSHIFT_DOC_URL}/4.16/virt/monitoring/virt-running-cluster-checkups.html`, + CHECKUPS_LATENCY: `${OPENSHIFT_DOC_URL}/4.15/virt/monitoring/virt-running-cluster-checkups.html#virt-measuring-latency-vm-secondary-network_virt-running-cluster-checkups`, + CLOUDINIT_INFO: 'https://cloudinit.readthedocs.io/en/latest/index.html', + CREATING_VMS_FROM_TEMPLATES: `${OPENSHIFT_DOC_URL}/4.15/virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-templates.html`, + CRON_INFO: `${REDHAT_BASE_URL}/sysadmin/automate-linux-tasks-cron`, + DATAVOLUME_PREALLOCATIONS: `${OPENSHIFT_DOC_URL}/4.15/virt/storage/virt-using-preallocation-for-datavolumes.html`, + DESCHEDULER: + 'https://kubevirt.io/user-guide/operations/node_assignment/#node-balancing-with-descheduler', + DEV_PREVIEW: 'https://access.redhat.com/support/offerings/devpreview', + DYNAMIC_SSH_KEY_INJECTION: `${OPENSHIFT_DOC_URL}/4.15/virt/virtual_machines/virt-accessing-vm-ssh.html`, + FREE_PAGE_REPORTING: + 'https://developers.redhat.com/articles/2024/03/13/save-memory-openshift-virtualization-using-free-page-reporting', + HIGHLIGHTS_417: + 'https://docs.openshift.com/container-platform/4.17/virt/release_notes/virt-4-17-release-notes.html#virt-4-17-new', + INSTANCE_TYPES_USER_GUIDE: + 'https://kubevirt.io/user-guide/virtual_machines/instancetypes#virtualmachinepreference', + LABELS: 'https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/', + METADATA: + 'https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata', + MIGRATION_CONFIGURATION: + 'http://kubevirt.io/api-reference/main/definitions.html#_v1_migrationconfiguration', + MIGRATION_POLICIES: + 'https://access.redhat.com/documentation/en-us/openshift_container_platform/4.15/html/virtualization/live-migration#live-migration-policies', + NAME: 'https://kubernetes.io/docs/concepts/overview/working-with-objects/name', + NAMESPACE_DOC: 'https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/', + NODEPORTS: `${REDHAT_DOC_URL}/openshift_container_platform/4.14/html/networking/configuring-ingress-cluster-traffic#nw-using-nodeport_configuring-ingress-cluster-traffic-nodeport`, + PROJECTS: 'https://docs.okd.io/latest/applications/projects/working-with-projects.html', + REDHAT_BLOG: `${REDHAT_BASE_URL}/en/blog/channel/red-hat-openshift`, + SNAPSHOT: `${REDHAT_DOC_URL}/openshift_container_platform/4.10/html/storage/using-container-storage-interface-csi#persistent-storage-csi-snapshots`, + SYSPREP: `${OPENSHIFT_DOC_URL}/4.10/virt/virtual_machines/virt-automating-windows-sysprep.html`, + TAINTS_TOLERATION: `${OPENSHIFT_DOC_URL}/4.10/virt/virtual_machines/advanced_vm_management/virt-specifying-nodes-for-vms.html#virt-about-node-placement-vms_virt-specifying-nodes-for-vms`, + TECH_PREVIEW: 'https://access.redhat.com/support/offerings/techpreview', + VIRT_CTL: `${OPENSHIFT_DOC_URL}/4.15/virt/getting_started/virt-using-the-cli-tools.html`, + VIRT_SECONDARY_NETWORK: `${OPENSHIFT_DOC_URL}/4.15/virt/vm_networking/virt-networking-overview.html#secondary-network-config`, + VIRTUALIZATION_BLOG: `https://cloud.redhat.com/learn/topics/virtualization/`, + VIRTUALIZATION_WHAT_YOU_CAN_DO: + 'https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/virtualization/about#virt-what-you-can-do-with-virt_about-virt', +}; diff --git a/src/utils/constants/url-constants.ts b/src/utils/constants/url-constants.ts deleted file mode 100644 index 6801538e9..000000000 --- a/src/utils/constants/url-constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const INSTANCE_TYPES_USER_GUIDE_LINK = - 'https://kubevirt.io/user-guide/virtual_machines/instancetypes/'; -export const AUTOCOMPUTE_CPU_LIMITS_LINK = - 'https://kubevirt.io/user-guide/virtual_machines/resources_requests_and_limits/'; - -export const TECH_PREVIEW_LINK = 'https://access.redhat.com/support/offerings/techpreview'; -export const DEV_PREVIEW_LINK = 'https://access.redhat.com/support/offerings/devpreview'; - -export const CREATING_VMS_FROM_TEMPLATES_LINK = - 'https://docs.openshift.com/container-platform/4.15/virt/virtual_machines/creating_vms_rh/virt-creating-vms-from-templates.html'; diff --git a/src/views/bootablevolumes/actions/components/EditBootableVolumesModal.tsx b/src/views/bootablevolumes/actions/components/EditBootableVolumesModal.tsx index f4e23e816..d5ab88abc 100644 --- a/src/views/bootablevolumes/actions/components/EditBootableVolumesModal.tsx +++ b/src/views/bootablevolumes/actions/components/EditBootableVolumesModal.tsx @@ -12,7 +12,7 @@ import InlineFilterSelect from '@kubevirt-utils/components/FilterSelect/InlineFi import FormPFSelect from '@kubevirt-utils/components/FormPFSelect/FormPFSelect'; import HelpTextIcon from '@kubevirt-utils/components/HelpTextIcon/HelpTextIcon'; import TabModal from '@kubevirt-utils/components/TabModal/TabModal'; -import { INSTANCE_TYPES_USER_GUIDE_LINK } from '@kubevirt-utils/constants/url-constants'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { DEFAULT_INSTANCETYPE_LABEL, @@ -139,7 +139,7 @@ const EditBootableVolumesModal: FC = ({ 'The preferred VirtualMachine attribute values required to run a given workload.', )}{' '} diff --git a/src/views/catalog/CustomizeInstanceType/tabs/configuration/utils/tabs/CustomizeInstanceTypeMetadataTab.tsx b/src/views/catalog/CustomizeInstanceType/tabs/configuration/utils/tabs/CustomizeInstanceTypeMetadataTab.tsx index 714ef04f7..ffbd434ec 100644 --- a/src/views/catalog/CustomizeInstanceType/tabs/configuration/utils/tabs/CustomizeInstanceTypeMetadataTab.tsx +++ b/src/views/catalog/CustomizeInstanceType/tabs/configuration/utils/tabs/CustomizeInstanceTypeMetadataTab.tsx @@ -6,6 +6,7 @@ import Loading from '@kubevirt-utils/components/Loading/Loading'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import SearchItem from '@kubevirt-utils/components/SearchItem/SearchItem'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { getName } from '@kubevirt-utils/resources/shared'; import { updateCustomizeInstanceType, vmSignal } from '@kubevirt-utils/store/customizeInstanceType'; @@ -66,7 +67,7 @@ const CustomizeInstanceTypeMetadataTab = () => { editOnTitleJustify isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} showEditOnTitle /> { descriptionHeader={{t('Annotations')}} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} /> diff --git a/src/views/catalog/templatescatalog/components/TemplatesCatalogHeader.tsx b/src/views/catalog/templatescatalog/components/TemplatesCatalogHeader.tsx index b6998a094..64c2784cd 100644 --- a/src/views/catalog/templatescatalog/components/TemplatesCatalogHeader.tsx +++ b/src/views/catalog/templatescatalog/components/TemplatesCatalogHeader.tsx @@ -2,7 +2,7 @@ import React, { FC, memo, useEffect, useState } from 'react'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; import HelpTextIcon from '@kubevirt-utils/components/HelpTextIcon/HelpTextIcon'; -import { CREATING_VMS_FROM_TEMPLATES_LINK } from '@kubevirt-utils/constants/url-constants'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { pluralize, @@ -51,7 +51,10 @@ export const TemplatesCatalogHeader: FC<{ bodyContent={ <> {t('Red Hat recommended configuration for each OS.')}{' '} - + } /> diff --git a/src/views/cdi-upload-provider/upload-pvc-form/UploadPVC.tsx b/src/views/cdi-upload-provider/upload-pvc-form/UploadPVC.tsx index e5a124125..2f6baa0b4 100644 --- a/src/views/cdi-upload-provider/upload-pvc-form/UploadPVC.tsx +++ b/src/views/cdi-upload-provider/upload-pvc-form/UploadPVC.tsx @@ -15,6 +15,7 @@ import DataVolumeModel from '@kubevirt-ui/kubevirt-api/console/models/DataVolume import { V1beta1DataVolume } from '@kubevirt-ui/kubevirt-api/containerized-data-importer/models'; import { IoK8sApiStorageV1StorageClass } from '@kubevirt-ui/kubevirt-api/kubernetes'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { createUploadPVC } from '@kubevirt-utils/hooks/useCDIUpload/utils'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { @@ -33,12 +34,7 @@ import { ActionGroup, Alert, Button, ButtonVariant } from '@patternfly/react-cor import useBaseImages from '../hooks/useBaseImages'; import useMultipleAccessReviews from '../hooks/useMultipleAccessReviews'; -import { - CDI_UPLOAD_OS_URL_PARAM, - CDI_UPLOAD_SUPPORTED_TYPES_URL, - CDI_UPLOAD_URL_BUILDER, - uploadErrorType, -} from '../utils/consts'; +import { CDI_UPLOAD_OS_URL_PARAM, CDI_UPLOAD_URL_BUILDER, uploadErrorType } from '../utils/consts'; import { CDIUploadContext } from '../utils/context'; import { getName, getNamespace, getPVCNamespace } from '../utils/selectors'; import { resourcePath } from '../utils/utils'; @@ -230,7 +226,7 @@ const UploadPVCPage: FC = () => {

diff --git a/src/views/cdi-upload-provider/utils/consts.ts b/src/views/cdi-upload-provider/utils/consts.ts index af2ce019e..52ada1ca5 100644 --- a/src/views/cdi-upload-provider/utils/consts.ts +++ b/src/views/cdi-upload-provider/utils/consts.ts @@ -30,8 +30,6 @@ export const LABEL_CDROM_SOURCE = 'kubevirt.ui/cdrom'; export const TEMPLATE_OS_LABEL = 'os.template.kubevirt.io'; export const TEMPLATE_OS_NAME_ANNOTATION = 'name.os.template.kubevirt.io'; export const VM_TEMPLATE_NAME_PARAMETER = '${NAME}'; // eslint-disable-line no-template-curly-in-string -export const CDI_UPLOAD_SUPPORTED_TYPES_URL = - 'https://access.redhat.com/documentation/en-us/openshift_container_platform/4.9/html/virtualization/virtual-machines#virt-cdi-supported-operations-matrix_virt-importing-virtual-machine-images-datavolumes'; export enum uploadErrorType { ALLOCATE = 'allocate', diff --git a/src/views/checkups/network/list/CheckupsNetworkListEmptyState.tsx b/src/views/checkups/network/list/CheckupsNetworkListEmptyState.tsx index 2d3184687..e799079ab 100644 --- a/src/views/checkups/network/list/CheckupsNetworkListEmptyState.tsx +++ b/src/views/checkups/network/list/CheckupsNetworkListEmptyState.tsx @@ -2,6 +2,7 @@ import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom-v5-compat'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { ALL_NAMESPACES_SESSION_KEY } from '@kubevirt-utils/hooks/constants'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { useActiveNamespace } from '@openshift-console/dynamic-plugin-sdk'; @@ -76,7 +77,7 @@ const CheckupsNetworkListEmptyState = ({ isPermitted, nadsInNamespace }) => { )} diff --git a/src/views/checkups/storage/list/CheckupsStorageListEmptyState.tsx b/src/views/checkups/storage/list/CheckupsStorageListEmptyState.tsx index 5591b889f..33cc11ed7 100644 --- a/src/views/checkups/storage/list/CheckupsStorageListEmptyState.tsx +++ b/src/views/checkups/storage/list/CheckupsStorageListEmptyState.tsx @@ -3,6 +3,7 @@ import { useLocation, useNavigate } from 'react-router-dom-v5-compat'; import { IoK8sApiRbacV1ClusterRoleBinding } from '@kubevirt-ui/kubevirt-api/kubernetes'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { ALL_NAMESPACES_SESSION_KEY } from '@kubevirt-utils/hooks/constants'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { useActiveNamespace } from '@openshift-console/dynamic-plugin-sdk'; @@ -92,9 +93,7 @@ const CheckupsStorageListEmptyState: FC = ({ diff --git a/src/views/clusteroverview/OverviewTab/getting-started-card/feature-highlights-section/FeatureHighlightsSection.tsx b/src/views/clusteroverview/OverviewTab/getting-started-card/feature-highlights-section/FeatureHighlightsSection.tsx index 74686c705..b584b8005 100644 --- a/src/views/clusteroverview/OverviewTab/getting-started-card/feature-highlights-section/FeatureHighlightsSection.tsx +++ b/src/views/clusteroverview/OverviewTab/getting-started-card/feature-highlights-section/FeatureHighlightsSection.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import GettingStartedSectionContents from '../utils/getting-started-content/GettingStartedSectionContents'; @@ -14,7 +15,7 @@ const FeatureHighlightsSection: React.FC = () => { const moreLink: GettingStartedLink = { external: true, - href: 'https://cloud.redhat.com/learn/topics/virtualization/', + href: documentationURL.VIRTUALIZATION_BLOG, id: 'openshift-virtualization-feature-highlights', title: t('Visit the blog'), }; @@ -22,7 +23,7 @@ const FeatureHighlightsSection: React.FC = () => { const links: GettingStartedLink[] = [ { external: true, - href: 'https://developers.redhat.com/articles/2024/03/13/save-memory-openshift-virtualization-using-free-page-reporting', + href: documentationURL.FREE_PAGE_REPORTING, id: 'item1', title: ( { }, { external: true, - href: 'https://docs.openshift.com/container-platform/4.17/virt/release_notes/virt-4-17-release-notes.html#virt-4-17-new', + href: documentationURL.HIGHLIGHTS_417, id: 'item2', title: ( { bodyContent={

- +

- +

} diff --git a/src/views/datasources/dataimportcron/details/DataImportCronDetailsGrid.tsx b/src/views/datasources/dataimportcron/details/DataImportCronDetailsGrid.tsx index 07e61550a..f90b232d5 100644 --- a/src/views/datasources/dataimportcron/details/DataImportCronDetailsGrid.tsx +++ b/src/views/datasources/dataimportcron/details/DataImportCronDetailsGrid.tsx @@ -13,6 +13,7 @@ import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider import OwnerDetailsItem from '@kubevirt-utils/components/OwnerDetailsItem/OwnerDetailsItem'; import Timestamp from '@kubevirt-utils/components/Timestamp/Timestamp'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { k8sPatch, ResourceLink, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk'; import { DescriptionList, Grid, GridItem } from '@patternfly/react-core'; @@ -51,7 +52,7 @@ export const DataImportCronDetailsGrid: React.FC descriptionData={dataImportCron?.metadata?.name} descriptionHeader={t('Name')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/identifiers#names" + moreInfoURL={documentationURL.NAME} /> breadcrumb="DataImportCron.metadata.namespace" descriptionHeader={t('Namespace')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/namespaces" + moreInfoURL={documentationURL.NAMESPACE_DOC} /> descriptionHeader={t('Labels')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} showEditOnTitle /> descriptionHeader={t('Annotations')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} /> = ({ {t( 'Schedule specifies in cron format when and how often to look for new imports.', )} - +
diff --git a/src/views/datasources/dataimportcron/details/DataImportCronManageModal/utils.ts b/src/views/datasources/dataimportcron/details/DataImportCronManageModal/utils.ts index d8a8ef0b1..6eabdaf1c 100644 --- a/src/views/datasources/dataimportcron/details/DataImportCronManageModal/utils.ts +++ b/src/views/datasources/dataimportcron/details/DataImportCronManageModal/utils.ts @@ -10,8 +10,6 @@ import { DATA_SOURCE_CRONJOB_LABEL } from '@kubevirt-utils/resources/template'; import { ensurePath } from '@kubevirt-utils/utils/utils'; import { k8sCreate, k8sDelete, k8sPatch } from '@openshift-console/dynamic-plugin-sdk'; -export const CRON_DOC_URL = 'https://www.redhat.com/sysadmin/automate-linux-tasks-cron'; - export const onDataImportCronManageSubmit = async ({ data: { allowAutoUpdate, importsToKeep, schedule, url }, resources: { dataImportCron, dataSource }, diff --git a/src/views/datasources/details/components/DataSourceDetailsGrid.tsx/DataSourceDetailsGrid.tsx b/src/views/datasources/details/components/DataSourceDetailsGrid.tsx/DataSourceDetailsGrid.tsx index bd9817d6f..44684e026 100644 --- a/src/views/datasources/details/components/DataSourceDetailsGrid.tsx/DataSourceDetailsGrid.tsx +++ b/src/views/datasources/details/components/DataSourceDetailsGrid.tsx/DataSourceDetailsGrid.tsx @@ -16,6 +16,7 @@ import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider import OwnerDetailsItem from '@kubevirt-utils/components/OwnerDetailsItem/OwnerDetailsItem'; import Timestamp from '@kubevirt-utils/components/Timestamp/Timestamp'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { DEFAULT_INSTANCETYPE_LABEL, @@ -53,7 +54,7 @@ export const DataSourceDetailsGrid: React.FC = ({ da descriptionData={dataSource?.metadata?.name} descriptionHeader={t('Name')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/identifiers#names" + moreInfoURL={documentationURL.NAME} /> = ({ da breadcrumb="DataSource.metadata.namespace" descriptionHeader={t('Namespace')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/namespaces" + moreInfoURL={documentationURL.NAMESPACE_DOC} /> = ({ da descriptionHeader={t('Labels')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} showEditOnTitle /> = ({ da descriptionHeader={t('Annotations')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} /> = ({ <> {t('Schedule specifies in cron format when and how often to look for new imports.')} - + diff --git a/src/views/migrationpolicies/details/tabs/details/components/MigrationPolicyDetailsSection/MigrationPolicyDetailsSection.tsx b/src/views/migrationpolicies/details/tabs/details/components/MigrationPolicyDetailsSection/MigrationPolicyDetailsSection.tsx index f3462bd52..6ebc6bf25 100644 --- a/src/views/migrationpolicies/details/tabs/details/components/MigrationPolicyDetailsSection/MigrationPolicyDetailsSection.tsx +++ b/src/views/migrationpolicies/details/tabs/details/components/MigrationPolicyDetailsSection/MigrationPolicyDetailsSection.tsx @@ -4,6 +4,7 @@ import { Trans } from 'react-i18next'; import { V1alpha1MigrationPolicy } from '@kubevirt-ui/kubevirt-api/kubevirt'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { NO_DATA_DASH } from '@kubevirt-utils/resources/vm/utils/constants'; import { @@ -70,7 +71,7 @@ const MigrationPolicyDetailsSection: FC = ({ descriptionData={mp?.metadata?.name} descriptionHeader={t('Name')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/identifiers#names" + moreInfoURL={documentationURL.NAME} /> = ({ } descriptionHeader={t('Bandwidth per migration')} isPopover - moreInfoURL="http://kubevirt.io/api-reference/main/definitions.html#_v1_migrationconfiguration" + moreInfoURL={documentationURL.MIGRATION_CONFIGURATION} /> = ({ } descriptionHeader={t('Auto converge')} isPopover - moreInfoURL="http://kubevirt.io/api-reference/main/definitions.html#_v1_migrationconfiguration" + moreInfoURL={documentationURL.MIGRATION_CONFIGURATION} /> = ({ } descriptionHeader={t('Post-copy')} isPopover - moreInfoURL="http://kubevirt.io/api-reference/main/definitions.html#_v1_migrationconfiguration" + moreInfoURL={documentationURL.MIGRATION_CONFIGURATION} /> = ({ } descriptionHeader={t('Completion timeout')} isPopover - moreInfoURL="http://kubevirt.io/api-reference/main/definitions.html#_v1_migrationconfiguration" + moreInfoURL={documentationURL.MIGRATION_CONFIGURATION} /> @@ -155,14 +156,14 @@ const MigrationPolicyDetailsSection: FC = ({ <Popover bodyContent={ - <Trans ns="plugin__kubevirt-plugin"> - Map of string keys and values that can be used to organize and categorize (scope - and select) objects. May match selectors of replication controllers and - services. More info:{' '} - <a href="http://kubernetes.io/docs/user-guide/labels"> - http://kubernetes.io/docs/user-guide/labels - </a> - </Trans> + <> + <Trans ns="plugin__kubevirt-plugin"> + Map of string keys and values that can be used to organize and categorize + (scope and select) objects. May match selectors of replication controllers and + services. More info: + </Trans>{' '} + <a href={documentationURL.LABELS}>{documentationURL.LABELS}</a> + </> } headerContent={t('Labels')} > diff --git a/src/views/migrationpolicies/list/components/MigrationPoliciesEmptyState/MigrationPoliciesEmptyState.tsx b/src/views/migrationpolicies/list/components/MigrationPoliciesEmptyState/MigrationPoliciesEmptyState.tsx index deff755d0..0638734c7 100644 --- a/src/views/migrationpolicies/list/components/MigrationPoliciesEmptyState/MigrationPoliciesEmptyState.tsx +++ b/src/views/migrationpolicies/list/components/MigrationPoliciesEmptyState/MigrationPoliciesEmptyState.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { ListPageBody, ListPageHeader } from '@openshift-console/dynamic-plugin-sdk'; import { @@ -45,7 +46,7 @@ const MigrationPoliciesEmptyState: FC = () => { <br /> <EmptyStateActions> <ExternalLink - href="https://access.redhat.com/documentation/en-us/openshift_container_platform/4.15/html/virtualization/live-migration#live-migration-policies" + href={documentationURL.MIGRATION_POLICIES} text={t('Learn more about MigrationPolicies')} /> </EmptyStateActions> diff --git a/src/views/templates/details/tabs/details/components/Annotations.tsx b/src/views/templates/details/tabs/details/components/Annotations.tsx index 349ba0c71..bc5f6aba5 100644 --- a/src/views/templates/details/tabs/details/components/Annotations.tsx +++ b/src/views/templates/details/tabs/details/components/Annotations.tsx @@ -1,15 +1,16 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import { TemplateModel } from '@kubevirt-ui/kubevirt-api/console'; import { AnnotationsModal } from '@kubevirt-utils/components/AnnotationsModal/AnnotationsModal'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk'; import { LabelsAnnotationsType, TemplateDetailsGridProps } from '../TemplateDetailsPage'; -const Annotations: React.FC<TemplateDetailsGridProps> = ({ editable, template }) => { +const Annotations: FC<TemplateDetailsGridProps> = ({ editable, template }) => { const { createModal } = useModal(); const { t } = useKubevirtTranslation(); const annotationsCount = Object.keys(template?.metadata?.annotations || {}).length; @@ -51,7 +52,7 @@ const Annotations: React.FC<TemplateDetailsGridProps> = ({ editable, template }) descriptionHeader={t('Annotations')} isEdit={editable} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} onEditClick={onEditClick} /> ); diff --git a/src/views/templates/details/tabs/details/components/CreatedAt.tsx b/src/views/templates/details/tabs/details/components/CreatedAt.tsx index 7d227ff84..4e4b53445 100644 --- a/src/views/templates/details/tabs/details/components/CreatedAt.tsx +++ b/src/views/templates/details/tabs/details/components/CreatedAt.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import Timestamp from '@kubevirt-utils/components/Timestamp/Timestamp'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { V1Template } from '@kubevirt-utils/models'; @@ -20,7 +21,7 @@ const CreatedAt: React.FC<CreatedAtProps> = ({ template }) => { descriptionData={<Timestamp timestamp={template?.metadata?.creationTimestamp} />} descriptionHeader={t('Created at')} isPopover - moreInfoURL="https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + moreInfoURL={documentationURL.METADATA} /> ); }; diff --git a/src/views/templates/details/tabs/details/components/Labels.tsx b/src/views/templates/details/tabs/details/components/Labels.tsx index a16604d62..55bb8c296 100644 --- a/src/views/templates/details/tabs/details/components/Labels.tsx +++ b/src/views/templates/details/tabs/details/components/Labels.tsx @@ -5,6 +5,7 @@ import { LabelsModal } from '@kubevirt-utils/components/LabelsModal/LabelsModal' import MetadataLabels from '@kubevirt-utils/components/MetadataLabels/MetadataLabels'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk'; @@ -49,7 +50,7 @@ const Labels: FC<TemplateDetailsGridProps> = ({ editable, template }) => { descriptionHeader={t('Labels')} isEdit={editable} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} onEditClick={onEditClick} showEditOnTitle /> diff --git a/src/views/templates/details/tabs/details/components/Name.tsx b/src/views/templates/details/tabs/details/components/Name.tsx index 1d2685e0d..ceb3fd2a0 100644 --- a/src/views/templates/details/tabs/details/components/Name.tsx +++ b/src/views/templates/details/tabs/details/components/Name.tsx @@ -1,13 +1,14 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; type NameProps = { name: string; }; -const Name: React.FC<NameProps> = ({ name }) => { +const Name: FC<NameProps> = ({ name }) => { const { t } = useKubevirtTranslation(); return ( @@ -21,7 +22,7 @@ const Name: React.FC<NameProps> = ({ name }) => { descriptionData={name} descriptionHeader={t('Name')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/identifiers#names" + moreInfoURL={documentationURL.NAME} /> ); }; diff --git a/src/views/templates/details/tabs/details/components/Namespace.tsx b/src/views/templates/details/tabs/details/components/Namespace.tsx index 136fdee4e..d37a6451b 100644 --- a/src/views/templates/details/tabs/details/components/Namespace.tsx +++ b/src/views/templates/details/tabs/details/components/Namespace.tsx @@ -1,6 +1,7 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { ResourceLink } from '@openshift-console/dynamic-plugin-sdk'; @@ -8,7 +9,7 @@ type NamespaceProps = { namespace: string; }; -const Namespace: React.FC<NamespaceProps> = ({ namespace }) => { +const Namespace: FC<NamespaceProps> = ({ namespace }) => { const { t } = useKubevirtTranslation(); return ( @@ -21,7 +22,7 @@ const Namespace: React.FC<NamespaceProps> = ({ namespace }) => { descriptionData={<ResourceLink kind="Namespace" name={namespace} />} descriptionHeader={t('Namespace')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/namespaces" + moreInfoURL={documentationURL.NAMESPACE_DOC} /> ); }; diff --git a/src/views/templates/details/tabs/scheduling/components/Descheduler.tsx b/src/views/templates/details/tabs/scheduling/components/Descheduler.tsx index a0ec9489e..46fb44a37 100644 --- a/src/views/templates/details/tabs/scheduling/components/Descheduler.tsx +++ b/src/views/templates/details/tabs/scheduling/components/Descheduler.tsx @@ -1,9 +1,9 @@ import React, { FC, useState } from 'react'; import produce from 'immer'; -import { DESCHEDULER_URL } from 'src/views/templates/utils/constants'; import { isDeschedulerOn } from 'src/views/templates/utils/utils'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useDeschedulerInstalled } from '@kubevirt-utils/hooks/useDeschedulerInstalled'; import { useIsAdmin } from '@kubevirt-utils/hooks/useIsAdmin'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; @@ -52,7 +52,7 @@ const Descheduler: FC<DeschedulerProps> = ({ onSubmit, template }) => { <Button className="no-left-padding" component="a" - href={DESCHEDULER_URL} + href={documentationURL.DESCHEDULER} icon={<ExternalLinkAltIcon />} iconPosition="right" target="_blank" diff --git a/src/views/templates/list/components/VirtualMachineTemplatesEmptyState/VirtualMachineTemplatesEmptyState.tsx b/src/views/templates/list/components/VirtualMachineTemplatesEmptyState/VirtualMachineTemplatesEmptyState.tsx index b885b40a2..8e01d157d 100644 --- a/src/views/templates/list/components/VirtualMachineTemplatesEmptyState/VirtualMachineTemplatesEmptyState.tsx +++ b/src/views/templates/list/components/VirtualMachineTemplatesEmptyState/VirtualMachineTemplatesEmptyState.tsx @@ -2,7 +2,7 @@ import React, { FC } from 'react'; import { Trans } from 'react-i18next'; import ExternalLink from '@kubevirt-utils/components/ExternalLink/ExternalLink'; -import { CREATING_VMS_FROM_TEMPLATES_LINK } from '@kubevirt-utils/constants/url-constants'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { ListPageBody, ListPageHeader } from '@openshift-console/dynamic-plugin-sdk'; import { @@ -49,7 +49,7 @@ const VirtualMachineTemplatesEmptyState: FC<VirtualMachineTemplatesEmptyStatePro <br /> <EmptyStateActions> <ExternalLink - href={CREATING_VMS_FROM_TEMPLATES_LINK} + href={documentationURL.CREATING_VMS_FROM_TEMPLATES} text={t('Learn more about templates')} /> </EmptyStateActions> diff --git a/src/views/templates/utils/constants.ts b/src/views/templates/utils/constants.ts index 1f164b7a7..d7dc54151 100644 --- a/src/views/templates/utils/constants.ts +++ b/src/views/templates/utils/constants.ts @@ -4,9 +4,6 @@ export const ANNOTATIONS = { providerName: 'template.kubevirt.io/provider', }; -export const DESCHEDULER_URL = - 'https://kubevirt.io/user-guide/operations/node_assignment/#node-balancing-with-descheduler'; - export const LABELS = { name: 'vm.kubevirt.io/template', namespace: 'vm.kubevirt.io/template.namespace', diff --git a/src/views/virtualmachines/details/tabs/configuration/metadata/MetadataTab.tsx b/src/views/virtualmachines/details/tabs/configuration/metadata/MetadataTab.tsx index cf3ee3f80..bd5469fed 100644 --- a/src/views/virtualmachines/details/tabs/configuration/metadata/MetadataTab.tsx +++ b/src/views/virtualmachines/details/tabs/configuration/metadata/MetadataTab.tsx @@ -5,6 +5,7 @@ import { LabelsModal } from '@kubevirt-utils/components/LabelsModal/LabelsModal' import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import SearchItem from '@kubevirt-utils/components/SearchItem/SearchItem'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { getName } from '@kubevirt-utils/resources/shared'; import { @@ -53,7 +54,7 @@ const MetadataTab: FC<ConfigurationInnerTabProps> = ({ vm }) => { editOnTitleJustify isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} showEditOnTitle /> <VirtualMachineDescriptionItem @@ -75,7 +76,7 @@ const MetadataTab: FC<ConfigurationInnerTabProps> = ({ vm }) => { descriptionHeader={<SearchItem id="metadata">{t('Annotations')}</SearchItem>} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} /> </DescriptionList> </Grid> diff --git a/src/views/virtualmachines/details/tabs/configuration/ssh/components/DynamicSSHKeyInjectionDescription.tsx b/src/views/virtualmachines/details/tabs/configuration/ssh/components/DynamicSSHKeyInjectionDescription.tsx index 06588ae26..0e820abdf 100644 --- a/src/views/virtualmachines/details/tabs/configuration/ssh/components/DynamicSSHKeyInjectionDescription.tsx +++ b/src/views/virtualmachines/details/tabs/configuration/ssh/components/DynamicSSHKeyInjectionDescription.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { DYNAMIC_SSH_KEY_INJECTION_LINK } from '@kubevirt-utils/components/DynamicSSHKeyInjection/constants/constants'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { Button, StackItem } from '@patternfly/react-core'; import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons'; @@ -15,7 +15,7 @@ const DynamicSSHKeyInjectionDescription = ({ isDynamicSSHInjectionEnabled }) => {t('Dynamic SSH key injection is not enabled in this virtual machine.')}{' '} <Button component="a" - href={DYNAMIC_SSH_KEY_INJECTION_LINK} + href={documentationURL.DYNAMIC_SSH_KEY_INJECTION} icon={<ExternalLinkSquareAltIcon />} iconPosition="right" isInline diff --git a/src/views/virtualmachines/details/tabs/overview/components/VirtualMachinesOverviewTabGeneral/VirtualMachinesOverviewTabGeneral.tsx b/src/views/virtualmachines/details/tabs/overview/components/VirtualMachinesOverviewTabGeneral/VirtualMachinesOverviewTabGeneral.tsx index f64e22d10..6967ce99a 100644 --- a/src/views/virtualmachines/details/tabs/overview/components/VirtualMachinesOverviewTabGeneral/VirtualMachinesOverviewTabGeneral.tsx +++ b/src/views/virtualmachines/details/tabs/overview/components/VirtualMachinesOverviewTabGeneral/VirtualMachinesOverviewTabGeneral.tsx @@ -10,6 +10,7 @@ import { import { V1VirtualMachine, V1VirtualMachineInstance } from '@kubevirt-ui/kubevirt-api/kubevirt'; import OwnerDetailsItem from '@kubevirt-utils/components/OwnerDetailsItem/OwnerDetailsItem'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { getName, getNamespace } from '@kubevirt-utils/resources/shared'; import { NO_DATA_DASH } from '@kubevirt-utils/resources/vm/utils/constants'; @@ -63,7 +64,7 @@ const VirtualMachinesOverviewTabGeneral: FC<VirtualMachinesOverviewTabGeneralPro breadcrumb="VirtualMachine.metadata.namespace" descriptionHeader={t('Namespace')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/namespaces" + moreInfoURL={documentationURL.NAMESPACE_DOC} /> {canGetNode && ( <VirtualMachineDescriptionItem diff --git a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Annotations/Annotations.tsx b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Annotations/Annotations.tsx index c65806158..633587230 100644 --- a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Annotations/Annotations.tsx +++ b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Annotations/Annotations.tsx @@ -1,10 +1,11 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import VirtualMachineInstanceModel from '@kubevirt-ui/kubevirt-api/console/models/VirtualMachineInstanceModel'; import { V1VirtualMachineInstance } from '@kubevirt-ui/kubevirt-api/kubevirt'; import { AnnotationsModal } from '@kubevirt-utils/components/AnnotationsModal/AnnotationsModal'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk'; @@ -12,7 +13,7 @@ type AnnotationsProps = { vmi: V1VirtualMachineInstance; }; -const Annotations: React.FC<AnnotationsProps> = ({ vmi }) => { +const Annotations: FC<AnnotationsProps> = ({ vmi }) => { const { t } = useKubevirtTranslation(); const { createModal } = useModal(); return ( @@ -49,7 +50,7 @@ const Annotations: React.FC<AnnotationsProps> = ({ vmi }) => { descriptionHeader={t('Annotations')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/annotations" + moreInfoURL={documentationURL.ANNOTATIONS} /> ); }; diff --git a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/CreateAt/CreateAt.tsx b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/CreateAt/CreateAt.tsx index 5d02e8041..a2907496b 100644 --- a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/CreateAt/CreateAt.tsx +++ b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/CreateAt/CreateAt.tsx @@ -1,14 +1,15 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import Timestamp from '@kubevirt-utils/components/Timestamp/Timestamp'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; type CreateAtProps = { timestamp: string; }; -const CreateAt: React.FC<CreateAtProps> = ({ timestamp }) => { +const CreateAt: FC<CreateAtProps> = ({ timestamp }) => { const { t } = useKubevirtTranslation(); return ( <VirtualMachineDescriptionItem @@ -19,7 +20,7 @@ const CreateAt: React.FC<CreateAtProps> = ({ timestamp }) => { descriptionData={<Timestamp timestamp={timestamp} />} descriptionHeader={t('Created at')} isPopover - moreInfoURL="https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + moreInfoURL={documentationURL.METADATA} /> ); }; diff --git a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Labels/Labels.tsx b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Labels/Labels.tsx index 5215e361c..14b134f8e 100644 --- a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Labels/Labels.tsx +++ b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Labels/Labels.tsx @@ -6,6 +6,7 @@ import { LabelsModal } from '@kubevirt-utils/components/LabelsModal/LabelsModal' import MetadataLabels from '@kubevirt-utils/components/MetadataLabels/MetadataLabels'; import { useModal } from '@kubevirt-utils/components/ModalProvider/ModalProvider'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { k8sPatch } from '@openshift-console/dynamic-plugin-sdk'; @@ -53,7 +54,7 @@ const Labels: FC<LabelsProps> = ({ vmi }) => { descriptionHeader={t('Labels')} isEdit isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/labels" + moreInfoURL={documentationURL.LABELS} showEditOnTitle /> ); diff --git a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Name/Name.tsx b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Name/Name.tsx index c8343e819..f14afb9e2 100644 --- a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Name/Name.tsx +++ b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Name/Name.tsx @@ -1,13 +1,14 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; type NameProps = { name: string; }; -const Name: React.FC<NameProps> = ({ name }) => { +const Name: FC<NameProps> = ({ name }) => { const { t } = useKubevirtTranslation(); return ( <VirtualMachineDescriptionItem @@ -20,7 +21,7 @@ const Name: React.FC<NameProps> = ({ name }) => { descriptionData={name} descriptionHeader={t('Name')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/identifiers#names" + moreInfoURL={documentationURL.NAME} /> ); }; diff --git a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Namespace/Namespace.tsx b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Namespace/Namespace.tsx index 7f4bedfe1..154306211 100644 --- a/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Namespace/Namespace.tsx +++ b/src/views/virtualmachinesinstance/details/tabs/details/components/Details/Namespace/Namespace.tsx @@ -1,6 +1,7 @@ -import * as React from 'react'; +import React, { FC } from 'react'; import VirtualMachineDescriptionItem from '@kubevirt-utils/components/VirtualMachineDescriptionItem/VirtualMachineDescriptionItem'; +import { documentationURL } from '@kubevirt-utils/constants/documentation'; import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; import { ResourceLink } from '@openshift-console/dynamic-plugin-sdk'; @@ -8,7 +9,7 @@ type NamespaceProps = { namespace: string; }; -const Namespace: React.FC<NamespaceProps> = ({ namespace }) => { +const Namespace: FC<NamespaceProps> = ({ namespace }) => { const { t } = useKubevirtTranslation(); return ( <VirtualMachineDescriptionItem @@ -20,7 +21,7 @@ const Namespace: React.FC<NamespaceProps> = ({ namespace }) => { descriptionData={<ResourceLink kind="Namespace" name={namespace} />} descriptionHeader={t('Namespace')} isPopover - moreInfoURL="http://kubernetes.io/docs/user-guide/namespaces" + moreInfoURL={documentationURL.NAMESPACE_DOC} /> ); };