Skip to content

Commit dd91b8b

Browse files
Replace link to login command page with text instructions (stolostron#4015)
Signed-off-by: Kevin Cormier <kcormier@redhat.com>
1 parent d9bf3a0 commit dd91b8b

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

frontend/public/locales/en/translation.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@
810810
"Copy button": "Copy button",
811811
"Copy this private URL to share": "Copy this private URL to share",
812812
"Copy to clipboard": "Copy to clipboard",
813+
"copy.login.command.instructions": "Use the masthead to access the <bold>Copy login command</bold> option under your user profile. Run the provided <code>oc login</code> command to log in.",
813814
"Core": "Core",
814815
"Could not find the AgentClusterInstall resource.": "Could not find the AgentClusterInstall resource.",
815816
"Could not process request because of invalid data.": "Could not process request because of invalid data.",
@@ -1700,7 +1701,6 @@
17001701
"Local placement": "Local placement",
17011702
"Location": "Location",
17021703
"Log in to OpenShift Container Platform": "Log in to OpenShift Container Platform",
1703-
"Log in to OpenShift Container Platform.": "Log in to OpenShift Container Platform.",
17041704
"Logs": "Logs",
17051705
"low": "low",
17061706
"Low": "Low",
@@ -2306,7 +2306,6 @@
23062306
"Run an OpenShift cluster where the control plane and data plane are coupled. The control plane is hosted by a dedicated group of physical or virtual nodes and the network stack is shared.": "Run an OpenShift cluster where the control plane and data plane are coupled. The control plane is hosted by a dedicated group of physical or virtual nodes and the network stack is shared.",
23072307
"Run an OpenShift cluster where the control plane is decoupled from the data plane, and is treated like a multi-tenant workload on a hosting service cluster. The data plane is on a separate network domain that allows segmentation between management and workload traffic.": "Run an OpenShift cluster where the control plane is decoupled from the data plane, and is treated like a multi-tenant workload on a hosting service cluster. The data plane is on a separate network domain that allows segmentation between management and workload traffic.",
23082308
"Run command": "Run command",
2309-
"Run the following `oc login` command": "Run the following `oc login` command",
23102309
"S3 Bucket": "S3 Bucket",
23112310
"save": "Save",
23122311
"Save": "Save",

frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateCluster/components/assisted-installer/hypershift/HypershiftAWSCLI.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MemoryRouter, Route, Routes } from 'react-router-dom-v5-compat'
44
import { RecoilRoot } from 'recoil'
55
import { nockGet, nockIgnoreApiPaths } from '../../../../../../../../lib/nock-util'
66
import { mockOpenShiftConsoleConfigMap } from '../../../../../../../../lib/test-metadata'
7-
import { clickByText, waitForNocks, waitForTestId, waitForText } from '../../../../../../../../lib/test-util'
7+
import { waitForNocks, waitForTestId, waitForText } from '../../../../../../../../lib/test-util'
88
import { NavigationPath } from '../../../../../../../../NavigationPath'
99
import { HypershiftAWSCLI } from './HypershiftAWSCLI'
1010

@@ -33,6 +33,6 @@ describe('HypershiftAWSCLI', () => {
3333
// find code block
3434
await waitForTestId('code-content')
3535
await waitForTestId('helper-command')
36-
await clickByText('Run the following `oc login` command')
36+
await waitForText('Copy login command')
3737
})
3838
})

frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateCluster/components/assisted-installer/hypershift/HypershiftAWSCLI.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ hcp create cluster aws \\
105105
title: t('Create the Hosted Control Plane'),
106106
content: (
107107
<Fragment>
108-
<Text component={TextVariants.h4}>{t('Log in to OpenShift Container Platform.')}</Text>
108+
<Text component={TextVariants.h4}>{t('Log in to OpenShift Container Platform')}</Text>
109109
{GetOCLogInCommand()}
110110
<Text component={TextVariants.h4}>{t('Run command')}</Text>
111111
<Text component={TextVariants.p}>

frontend/src/routes/Infrastructure/Clusters/ManagedClusters/CreateCluster/components/assisted-installer/hypershift/common/common.tsx

+3-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { ClipboardCopyButton, CodeBlockAction, Text, TextVariants } from '@patternfly/react-core'
44
import { Fragment, useState } from 'react'
5-
import { useTranslation } from '../../../../../../../../../lib/acm-i18next'
5+
import { Trans, useTranslation } from '../../../../../../../../../lib/acm-i18next'
66

77
export function Actions(code: string, id: string) {
88
const { t } = useTranslation()
@@ -33,16 +33,9 @@ export function Actions(code: string, id: string) {
3333
}
3434

3535
export function GetOCLogInCommand() {
36-
const { t } = useTranslation()
3736
return (
38-
<Text
39-
component={TextVariants.a}
40-
onClick={() => {
41-
window.open(window.SERVER_FLAGS?.requestTokenURL)
42-
}}
43-
target="_blank"
44-
>
45-
{t('Run the following `oc login` command')}
37+
<Text component={TextVariants.p}>
38+
<Trans i18nKey="copy.login.command.instructions" components={{ bold: <strong />, code: <code /> }} />
4639
</Text>
4740
)
4841
}

0 commit comments

Comments
 (0)