Skip to content

Commit c98bcd4

Browse files
committed
OCPBUGS-56629: move docs urls to documentation.tsx
1 parent 4ad1808 commit c98bcd4

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

frontend/packages/console-app/src/components/quick-starts/QuickStartEmptyState.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import { useTranslation } from 'react-i18next';
1414
import { QuickStartModel } from '@console/app/src/models';
1515
import { useAccessReview } from '@console/dynamic-plugin-sdk/src/app/components/utils/rbac';
1616
import { getReferenceForModel } from '@console/dynamic-plugin-sdk/src/utils/k8s';
17+
import {
18+
documentationURLs,
19+
getDocumentationURL,
20+
} from '@console/internal/components/utils/documentation';
1721
import { LinkTo } from '@console/shared/src/components/links/LinkTo';
1822

19-
const QUICK_START_DOCS_URL =
20-
'https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/web_console/creating-quick-start-tutorials';
21-
2223
export const QuickStartEmptyState = () => {
2324
const { t } = useTranslation('console-app');
2425

@@ -64,7 +65,7 @@ export const QuickStartEmptyState = () => {
6465
target="_blank"
6566
rel="noopener noreferrer"
6667
component="a"
67-
href={QUICK_START_DOCS_URL}
68+
href={getDocumentationURL(documentationURLs.creatingQuickStartsTutorial)}
6869
iconPosition="right"
6970
icon={<ExternalLinkAltIcon />}
7071
>

frontend/packages/dev-console/src/components/import/serverless-function/AddServerlessFunctionForm.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { WatchK8sResultsObject } from '@console/dynamic-plugin-sdk';
77
import { k8sListResourceItems } from '@console/dynamic-plugin-sdk/src/utils/k8s';
88
import { getGitService, GitProvider } from '@console/git-service/src';
99
import { evaluateFunc } from '@console/git-service/src/utils/serverless-strategy-detector';
10-
import { ExternalLink } from '@console/internal/components/utils';
10+
import { DOC_URL_SERVERLESS_FUNCTIONS_GETTING_STARTED } from '@console/internal/components/utils/documentation';
1111
import { K8sResourceKind } from '@console/internal/module/k8s';
1212
import { ServerlessBuildStrategyType } from '@console/knative-plugin/src/types';
1313
import PipelineSection from '@console/pipelines-plugin/src/components/import/pipeline/PipelineSection';
@@ -20,6 +20,7 @@ import { PipelineModel } from '@console/pipelines-plugin/src/models';
2020
import { PipelineKind } from '@console/pipelines-plugin/src/types';
2121
import { useFlag } from '@console/shared/src';
2222
import { FlexForm, FormBody, FormFooter } from '@console/shared/src/components/form-utils';
23+
import { ExternalLink } from '@console/shared/src/components/links';
2324
import { NormalizedBuilderImages } from '../../../utils/imagestream-utils';
2425
import { notSupportedRuntime } from '../../../utils/serverless-functions';
2526
import AdvancedSection from '../advanced/AdvancedSection';
@@ -41,9 +42,6 @@ enum SupportedRuntime {
4142
quarkus = 'java',
4243
}
4344

44-
export const SERVERLESS_FUNCTION_DOCS_URL =
45-
'https://docs.redhat.com/en/documentation/red_hat_openshift_serverless/latest/html/functions/serverless-functions-getting-started';
46-
4745
const AddServerlessFunctionForm: React.FC<
4846
FormikProps<FormikValues> & AddServerlessFunctionFormProps
4947
> = ({
@@ -188,7 +186,7 @@ const AddServerlessFunctionForm: React.FC<
188186
</p>
189187
<ExternalLink
190188
additionalClassName="odc-func-form-link"
191-
href={SERVERLESS_FUNCTION_DOCS_URL}
189+
href={DOC_URL_SERVERLESS_FUNCTIONS_GETTING_STARTED}
192190
text={t('devconsole~Learn more')}
193191
/>
194192
</Alert>

frontend/public/components/utils/documentation.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export const DOC_URL_PODMAN = 'https://podman.io/';
1010
export const DOC_URL_RED_HAT_MARKETPLACE =
1111
'https://marketplace.redhat.com/en-us?utm_source=openshift_console';
1212

13+
const OPENSHIFT_SERVERLESS_DOCS =
14+
'https://docs.redhat.com/en/documentation/red_hat_openshift_serverless/latest/html';
15+
export const DOC_URL_SERVERLESS_FUNCTIONS_GETTING_STARTED = `${OPENSHIFT_SERVERLESS_DOCS}/functions/serverless-functions-getting-started`;
16+
1317
const KUBE_DOCS = 'https://kubernetes.io/docs/';
1418
export const DOC_URL_STORAGE_CLASSES_AWS_EBS = `${KUBE_DOCS}/concepts/storage/storage-classes/#aws-ebs`;
1519
export const DOC_URL_STORAGE_CLASSES_AZURE_DISK = `${KUBE_DOCS}/concepts/storage/storage-classes/#azure-disk`;
@@ -84,6 +88,10 @@ export const documentationURLs: documentationURLsType = {
8488
kube: `${KUBE_DOCS}/reference/access-authn-authz/extensible-admission-controllers/#response`,
8589
upstream: 'architecture/index.html#about-admission-plug-ins',
8690
},
91+
creatingQuickStartsTutorials: {
92+
downstream: 'html/web_console/creating-quick-start-tutorials',
93+
upstream: 'web_console/creating-quick-start-tutorials.html',
94+
},
8795
};
8896

8997
export const isUpstream = () => window.SERVER_FLAGS.branding === 'okd';

0 commit comments

Comments
 (0)