V2Wizard: Expandable to alert for disabled EPEL repo
This converts previously used expendable into an info alert.
This commit is contained in:
parent
147841b095
commit
0ff0ec9758
1 changed files with 9 additions and 29 deletions
|
|
@ -1,14 +1,6 @@
|
||||||
import React, { useState } from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import {
|
import { Alert, Button, Form, Text, Title } from '@patternfly/react-core';
|
||||||
Button,
|
|
||||||
ExpandableSection,
|
|
||||||
Form,
|
|
||||||
List,
|
|
||||||
ListItem,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from '@patternfly/react-core';
|
|
||||||
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
|
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
|
||||||
|
|
||||||
import Repositories from './Repositories';
|
import Repositories from './Repositories';
|
||||||
|
|
@ -41,11 +33,6 @@ const RepositoriesStep = () => {
|
||||||
const packages = useAppSelector(selectPackages);
|
const packages = useAppSelector(selectPackages);
|
||||||
const recommendedRepos = useAppSelector(selectRecommendedRepositories);
|
const recommendedRepos = useAppSelector(selectRecommendedRepositories);
|
||||||
|
|
||||||
const [isExpanded, setIsExpanded] = useState(false);
|
|
||||||
const onToggle = (_event: React.MouseEvent, isExpanded: boolean) => {
|
|
||||||
setIsExpanded(isExpanded);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form>
|
||||||
<Title headingLevel="h1" size="xl">
|
<Title headingLevel="h1" size="xl">
|
||||||
|
|
@ -58,23 +45,16 @@ const RepositoriesStep = () => {
|
||||||
<ManageRepositoriesButton />
|
<ManageRepositoriesButton />
|
||||||
</Text>
|
</Text>
|
||||||
{recommendedRepos.length > 0 && (
|
{recommendedRepos.length > 0 && (
|
||||||
<ExpandableSection
|
<Alert
|
||||||
toggleText={"Why can't I remove a selected repository?"}
|
title="Why can't I remove a selected repository?"
|
||||||
onToggle={onToggle}
|
variant="info"
|
||||||
isExpanded={isExpanded}
|
isInline
|
||||||
isIndented
|
|
||||||
>
|
>
|
||||||
EPEL repository cannot be removed, because packages from it were
|
EPEL repository cannot be removed, because packages from it were
|
||||||
selected. If you wish to remove the repository, please remove
|
selected. If you wish to remove the repository, please remove
|
||||||
following packages on the Packages step:
|
following packages on the Packages step:{' '}
|
||||||
<List>
|
{packages.map((pkg) => pkg.name).join(', ')}
|
||||||
{packages
|
</Alert>
|
||||||
.filter((pkg) => pkg.repository === 'recommended')
|
|
||||||
.map((pkg) => (
|
|
||||||
<ListItem key={pkg.name}>{pkg.name}</ListItem>
|
|
||||||
))}
|
|
||||||
</List>
|
|
||||||
</ExpandableSection>
|
|
||||||
)}
|
)}
|
||||||
<Repositories />
|
<Repositories />
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue