Skip to content

Commit

Permalink
Wrap empty state in a Page component
Browse files Browse the repository at this point in the history
It's anyhow expected that the Page component wraps the whole app.

But mainly I needed it for pixel tests which break without the Page
wrapper after:
https://github.com/cockpit-project/cockpit/blob/main/test/common/testlib.py#L1161
  • Loading branch information
KKoukiou committed May 15, 2023
1 parent 1b7b7f5 commit ebb5e14
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -665,25 +665,29 @@ class Application extends React.Component {

if (!this.state.systemServiceAvailable && !this.state.userServiceAvailable) {
return (
<EmptyState variant={EmptyStateVariant.full}>
<EmptyStateHeader titleText={_("Podman service is not active")} icon={<EmptyStateIcon icon={ExclamationCircleIcon} />} headingLevel="h2" />
<EmptyStateFooter>
<Checkbox isChecked={this.state.enableService}
id="enable"
label={_("Automatically start podman on boot")}
onChange={ (_event, checked) => this.setState({ enableService: checked }) } />
<Button onClick={this.startService}>
{_("Start podman")}
</Button>
{ cockpit.manifests.system &&
<EmptyStateActions>
<Button variant="link" onClick={this.goToServicePage}>
{_("Troubleshoot")}
</Button>
</EmptyStateActions>
}
</EmptyStateFooter>
</EmptyState>
<Page>
<PageSection variant={PageSectionVariants.light}>
<EmptyState variant={EmptyStateVariant.full}>
<EmptyStateHeader titleText={_("Podman service is not active")} icon={<EmptyStateIcon icon={ExclamationCircleIcon} />} headingLevel="h2" />
<EmptyStateFooter>
<Checkbox isChecked={this.state.enableService}
id="enable"
label={_("Automatically start podman on boot")}
onChange={ (_event, checked) => this.setState({ enableService: checked }) } />
<Button onClick={this.startService}>
{_("Start podman")}
</Button>
{ cockpit.manifests.system &&
<EmptyStateActions>
<Button variant="link" onClick={this.goToServicePage}>
{_("Troubleshoot")}
</Button>
</EmptyStateActions>
}
</EmptyStateFooter>
</EmptyState>
</PageSection>
</Page>
);
}

Expand Down

0 comments on commit ebb5e14

Please sign in to comment.