diff --git a/libs/locales/lib/en/translation.json b/libs/locales/lib/en/translation.json index 569ce81c36..fdf8ef710d 100644 --- a/libs/locales/lib/en/translation.json +++ b/libs/locales/lib/en/translation.json @@ -421,6 +421,7 @@ "ai:IP allocation from the DHCP server timed out.": "IP allocation from the DHCP server timed out.", "ai:iPXE script file is ready to be downloaded": "iPXE script file is ready to be downloaded", "ai:iPXE script file URL": "iPXE script file URL", + "ai:It can be fixed in the <1>{pageURL.name} page.": "It can be fixed in the <1>{pageURL.name} page.", "ai:It can be fixed in the <2> step.": "It can be fixed in the <2> step.", "ai:It is not possible to remove a host which is being installed.": "It is not possible to remove a host that is being installed.", "ai:It is not possible to remove a node from a cluster during installation.": "It is not possible to remove a node from a cluster during installation.", diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/wizardTransition.ts b/libs/ui-lib/lib/cim/components/ClusterDeployment/wizardTransition.ts index 6ca0e2eb0e..9faa5ec87a 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/wizardTransition.ts +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/wizardTransition.ts @@ -1,3 +1,4 @@ +import { Host } from '@openshift-assisted/types/assisted-installer-service'; import { getAllClusterWizardSoftValidationIds, getWizardStepClusterStatus, @@ -68,6 +69,15 @@ const networkingStepValidationsMap: WizardStepValidationMap = { // TODO(mlibra): remove that container-images-available from soft validations and let backend drive it via disabling it. // Depends on: https://issues.redhat.com/browse/MGMT-5265 softValidationIds: ['ntp-synced', 'container-images-available'], + getPageURL: (host: Host, validationID: string) => { + if (validationID === 'ntp-synced') { + return { + url: `multicloud/infrastructure/environments/details/${host.infraEnvId || ''}`, + name: 'infrastructure environment', + }; + } + return undefined; + }, }; const reviewStepValidationsMap: WizardStepValidationMap = { diff --git a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts index ec18c2ca6e..c876c3e20e 100644 --- a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts +++ b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts @@ -67,6 +67,9 @@ export const getAIHosts = ( progressStages: agentProgress?.progressStages, bootstrap: agent.status?.bootstrap, installationDiskId: agent.spec.installation_disk_id || agent.status?.installation_disk_id, + infraEnvId: `${agent.metadata?.namespace || ''}/${ + agent.metadata?.labels?.['infraenvs.agent-install.openshift.io'] || '' + }`, }; }); diff --git a/libs/ui-lib/lib/common/components/clusterWizard/ReviewValidations.tsx b/libs/ui-lib/lib/common/components/clusterWizard/ReviewValidations.tsx index ac83887bfd..75b68eee8a 100644 --- a/libs/ui-lib/lib/common/components/clusterWizard/ReviewValidations.tsx +++ b/libs/ui-lib/lib/common/components/clusterWizard/ReviewValidations.tsx @@ -68,6 +68,7 @@ const FailingValidation = ({ setCurrentStepId, wizardStepNames, wizardStepsValidationsMap, + host, }: FailingValidationsProps) => { const { t } = useTranslation(); @@ -88,7 +89,16 @@ const FailingValidation = ({ // no sooner step, so the user can not do anything about it ... fix = t('ai:Please wait till all checks are finished.'); } else if (step) { - fix = ( + const pageURL = host + ? wizardStepsValidationsMap[step].getPageURL?.(host, validation.id) + : undefined; + fix = pageURL ? ( + <> + + ai:It can be fixed in the {pageURL.name} page. + + + ) : ( <> ai:It can be fixed in the{' '} @@ -196,6 +206,7 @@ export const HostsValidations = ({ key={validationId} validation={validation} + host={host} hostGroup={group} severity={severity} setCurrentStepId={setCurrentStepId} diff --git a/libs/ui-lib/lib/common/components/clusterWizard/types.ts b/libs/ui-lib/lib/common/components/clusterWizard/types.ts index be69dafa4c..5a89e7634b 100644 --- a/libs/ui-lib/lib/common/components/clusterWizard/types.ts +++ b/libs/ui-lib/lib/common/components/clusterWizard/types.ts @@ -56,6 +56,7 @@ export type FailingValidationsProps = { severity?: 'danger' | 'warning'; wizardStepNames: { [key in S]: string }; wizardStepsValidationsMap: WizardStepsValidationMap; + host?: Host; }; export type ValidationActionLinkProps = { diff --git a/libs/ui-lib/lib/common/components/clusterWizard/validationsInfoUtils.ts b/libs/ui-lib/lib/common/components/clusterWizard/validationsInfoUtils.ts index 9ce7a15999..5c7ea6b5eb 100644 --- a/libs/ui-lib/lib/common/components/clusterWizard/validationsInfoUtils.ts +++ b/libs/ui-lib/lib/common/components/clusterWizard/validationsInfoUtils.ts @@ -34,6 +34,15 @@ export type WizardStepValidationMap = { validationIds: HostValidationId[]; }; softValidationIds: (HostValidationId | ClusterValidationId)[]; + getPageURL?: ( + host: Host, + validationId: string, + ) => + | { + url: string; + name: string; + } + | undefined; }; export type WizardStepsValidationMap = {