Wizard: Add 'Refresh' button to repositories step

Users may visit the Repositories service to add or modify repositories
while they are on the repositories step in the wizard. This commit adds
a 'Refresh' button that will refetch the repositories and update the
table so that the user does not have to restart the wizard to view their
modifications.
This commit is contained in:
lucasgarfield 2023-05-03 15:50:41 +02:00 committed by Lucas Garfield
parent 383f2a6855
commit 05b411c241
2 changed files with 137 additions and 72 deletions

View file

@ -1,13 +1,32 @@
import React from 'react';
import componentTypes from '@data-driven-forms/react-form-renderer/component-types';
import { Text } from '@patternfly/react-core';
import { Button, Text } from '@patternfly/react-core';
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import nextStepMapper from './repositoriesStepMapper';
import StepTemplate from './stepTemplate';
import { useGetEnvironment } from '../../../Utilities/useGetEnvironment';
import CustomButtons from '../formComponents/CustomButtons';
const VisitButton = () => {
const { isBeta } = useGetEnvironment();
return (
<Button
component="a"
target="_blank"
variant="link"
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
>
Create and manage repositories here
</Button>
);
};
export default {
StepTemplate,
id: 'wizard-repositories',
@ -25,8 +44,7 @@ export default {
Select custom repositories from which to search and add packages to
this image.
<br />
Custom repositories can be managed using the Repositories app on Red
Hat Insights.
<VisitButton />
</Text>
),
},