Skip to content

Commit

Permalink
Put reload into the issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 16, 2025
1 parent f9d3c32 commit e425bb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion web/src/components/core/IssuesHint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Hint, HintBody, List, ListItem, Stack } from "@patternfly/react-core";
import { _ } from "~/i18n";
import { Issue } from "~/types/issues";

export default function IssuesHint({ issues }) {
export default function IssuesHint({ issues, children }) {
if (issues === undefined || issues.length === 0) return;

return (
Expand All @@ -40,6 +40,7 @@ export default function IssuesHint({ issues }) {
<ListItem key={idx}>{i.description}</ListItem>
))}
</List>
{children}
</Stack>
</HintBody>
</Hint>
Expand Down
8 changes: 3 additions & 5 deletions web/src/components/software/SoftwarePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import React from "react";
import {
Alert,
Button,
DescriptionList,
DescriptionListDescription,
Expand Down Expand Up @@ -111,15 +110,15 @@ function SoftwarePage(): React.ReactNode {
const selectedPatternsXlSize = proposal.size ? 6 : 12;

const ReloadSection = (): React.ReactNode => (
<Alert variant="warning" isInline title={_("Repository load failed")}>
<p>
{_(
"Some installation repositories failed to load. The system cannot be installed without them.",
)}{" "}
{/* TODO: add some loading indicator */}
<Button variant="link" isInline onClick={probe}>
{_("Try again")}
</Button>
</Alert>
</p>
);

const reload = repos.some((r) => !r.loaded) ? <ReloadSection /> : null;
Expand All @@ -133,9 +132,8 @@ function SoftwarePage(): React.ReactNode {
<Page.Content>
<Grid hasGutter>
<GridItem sm={12}>
<IssuesHint issues={issues} />
<IssuesHint issues={issues}>{reload}</IssuesHint>
</GridItem>
<GridItem sm={12}>{reload}</GridItem>
<GridItem sm={12} xl={selectedPatternsXlSize}>
{patterns.length === 0 ? <NoPatterns /> : <SelectedPatterns patterns={patterns} />}
</GridItem>
Expand Down

0 comments on commit e425bb6

Please sign in to comment.