src: Move content urls to const

This moves both preview and stable links to content to the `constants.ts` file.
This commit is contained in:
regexowl 2024-06-27 15:24:30 +02:00 committed by Ondřej Ezr
parent c6919e3753
commit b198768ca6
6 changed files with 15 additions and 17 deletions

View file

@ -43,6 +43,8 @@ import CustomHelperText from './components/CustomHelperText';
import PackageInfoNotAvailablePopover from './components/PackageInfoNotAvailablePopover';
import {
CONTENT_BETA,
CONTENT_STABLE,
EPEL_8_REPO_DEFINITION,
EPEL_9_REPO_DEFINITION,
RH_ICON_SIZE,
@ -544,11 +546,7 @@ const Packages = () => {
target="_blank"
iconPosition="right"
icon={<ExternalLinkAltIcon />}
href={
isBeta()
? '/preview/insights/content'
: '/insights/content'
}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
Manage your repositories and popular repositories
</Button>
@ -578,11 +576,7 @@ const Packages = () => {
isInline
component="a"
target="_blank"
href={
isBeta()
? '/preview/insights/content'
: '/insights/content'
}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
your repositories
</Button>{' '}
@ -635,7 +629,7 @@ const Packages = () => {
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
content services
</Button>{' '}

View file

@ -17,6 +17,7 @@ import {
InProgressIcon,
} from '@patternfly/react-icons';
import { CONTENT_BETA, CONTENT_STABLE } from '../../../../constants';
import { ApiRepositoryResponse } from '../../../../store/contentSourcesApi';
import {
convertStringToDate,
@ -118,9 +119,7 @@ const RepositoriesStatus = ({
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={
isBeta() ? '/preview/settings/content' : '/settings/content'
}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
Go to Repositories
</Button>

View file

@ -3,6 +3,7 @@ import React from 'react';
import { Alert, Button } from '@patternfly/react-core';
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import { CONTENT_BETA, CONTENT_STABLE } from '../../../../constants';
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
const RepositoryUnavailable = ({ quantity }: { quantity: number }) => {
@ -28,7 +29,7 @@ const RepositoryUnavailable = ({ quantity }: { quantity: number }) => {
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
Go to Repositories
</Button>

View file

@ -11,6 +11,7 @@ import {
} from '@patternfly/react-core';
import { RepositoryIcon } from '@patternfly/react-icons';
import { CONTENT_BETA, CONTENT_STABLE } from '../../../../../constants';
import { useGetEnvironment } from '../../../../../Utilities/useGetEnvironment';
type EmptyProps = {
@ -42,7 +43,7 @@ export default function Empty({ hasFilterValue, refetch }: EmptyProps) {
variant="primary"
component="a"
target="_blank"
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
className="pf-u-mr-sm"
>
Go to repositories

View file

@ -5,6 +5,7 @@ import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import Repositories from './Repositories';
import { CONTENT_BETA, CONTENT_STABLE } from '../../../../constants';
import { useAppSelector } from '../../../../store/hooks';
import {
selectPackages,
@ -22,7 +23,7 @@ const ManageRepositoriesButton = () => {
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
>
Create and manage repositories here
</Button>

View file

@ -10,6 +10,8 @@ export const EDIT_BLUEPRINT = `${IMAGE_BUILDER_API}/blueprints`;
export const CDN_PROD_URL = 'https://cdn.redhat.com/';
export const CDN_STAGE_URL = 'https://cdn.stage.redhat.com/';
export const CONTENT_BETA = '/preview/insights/content';
export const CONTENT_STABLE = '/insights/content';
export const DEVELOPERS_URL = 'https://developers.redhat.com/about';
export const FILE_SYSTEM_CUSTOMIZATION_URL =
'https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/creating_customized_images_by_using_insights_image_builder/customizing-file-systems-during-the-image-creation';