debian-image-builder-frontend/src/Components/CreateImageWizard/formComponents/RepositoryUnavailable.js
regexowl 9f5a0af826 Wizard: Update the Repositories step
This updates the Repositories and Review step as per [mocks](https://www.sketch.com/s/d7aa6d29-fca0-4283-a846-09cc5fd10612/a/MyEbDz7).

Repositories with the unavailable or invalid status have a popover that allows for further inspection. The time of the last introspection and the counter of failed attempts was added to the popover, together with the "Go to Repositories" button.

On Recreate the payload repositories are checked against "freshly" fetched list of repositories. In case any of the previously checked repositories is no longer available in content sources an Alert is rendered on both Repositories and Review steps. The unavailable repository is checked, but the checkbox is disabled and the information is dashed out. Since the information about the repository is stored in the Repository type, the only information available to be rendered is the baseurl.

Create image button is also disabled when recreating an image with unavailable repositories.
2023-09-11 10:30:04 +02:00

42 lines
1.2 KiB
JavaScript

import React from 'react';
import { Alert, Button } from '@patternfly/react-core';
import { ExternalLinkAltIcon } from '@patternfly/react-icons';
import { useCheckRepositoriesAvailability } from '../../../Utilities/checkRepositoriesAvailability';
import { useGetEnvironment } from '../../../Utilities/useGetEnvironment';
const RepositoryUnavailable = () => {
const { isBeta } = useGetEnvironment();
if (useCheckRepositoriesAvailability()) {
return (
<Alert
variant="warning"
title="Previously added custom repository unavailable"
isInline
>
A repository that was used to build this image previously is not
available. Address the error found in the last introspection and
validate that the repository is still accessible.
<br />
<br />
<Button
component="a"
target="_blank"
variant="link"
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? '/preview/settings/content' : '/settings/content'}
>
Go to Repositories
</Button>
</Alert>
);
} else {
return;
}
};
export default RepositoryUnavailable;