-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathindex.tsx
More file actions
69 lines (62 loc) · 2.22 KB
/
index.tsx
File metadata and controls
69 lines (62 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React from 'react';
import { Alert, Content, Form, Title } from '@patternfly/react-core';
import { CustomizationLabels } from '@/Components/sharedComponents/CustomizationLabels';
import { useAppSelector } from '@/store/hooks';
import {
selectPackages,
selectRecommendedRepositories,
selectWizardMode,
} from '@/store/slices/wizard';
import { useFlag } from '@/Utilities/useGetEnvironment';
import ManageRepositoriesButton from './components/ManageRepositoriesButton';
import Repositories from './components/Repositories';
const RepositoriesStep = () => {
const wizardMode = useAppSelector(selectWizardMode);
const packages = useAppSelector(selectPackages);
const recommendedRepos = useAppSelector(selectRecommendedRepositories);
const isWizardRevampEnabled = useFlag('image-builder.wizard-revamp.enabled');
const Wrapper = isWizardRevampEnabled ? React.Fragment : Form;
return (
<Wrapper>
<CustomizationLabels customization='repositories' />
<Content>
<Title
headingLevel={isWizardRevampEnabled ? 'h2' : 'h1'}
size={isWizardRevampEnabled ? 'lg' : 'xl'}
>
Included repositories
</Title>
<Content component={isWizardRevampEnabled ? 'small' : 'p'}>
Can't find a repository? Ensure it's been added on{' '}
<ManageRepositoriesButton
label={'the Repositories page'}
icon={true}
/>
</Content>
</Content>
{wizardMode === 'edit' && (
<Alert
title='Removing previously added repositories may lead to issues with selected packages'
variant='warning'
isInline
/>
)}
{packages.length && recommendedRepos.length ? (
<Alert
title="Why can't I remove a selected repository?"
variant='info'
isInline
>
EPEL repository cannot be removed, because packages from it were
selected. If you wish to remove the repository, please remove
following packages on the Packages step:{' '}
{packages.map((pkg) => pkg.name).join(', ')}
</Alert>
) : (
''
)}
<Repositories />
</Wrapper>
);
};
export default RepositoriesStep;