Wrap EmptyState in a Card

This prevents it overflowing onto subsequent content

Signed-off-by: Andrew Shirley <andrew@als-bi.com>
This commit is contained in:
Andrew Shirley
2021-04-19 16:31:30 +01:00
parent c4ce1ff90e
commit 4c42ecca2d
2 changed files with 33 additions and 15 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-actions': patch
---
Wrap EmptyState in Card
@@ -25,7 +25,14 @@ import {
} from '@backstage/core';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Button, Link } from '@material-ui/core';
import {
Button,
Card,
CardContent,
CardHeader,
Divider,
Link,
} from '@material-ui/core';
import React, { useEffect } from 'react';
import { generatePath, Link as RouterLink } from 'react-router-dom';
import { GITHUB_ACTIONS_ANNOTATION } from '../useProjectName';
@@ -75,20 +82,26 @@ export const RecentWorkflowRunsCard = ({
const githubHost = hostname || 'github.com';
return !runs.length ? (
<EmptyState
missing="data"
title="No Workflow Data"
description="This component has GitHub Actions enabled, but no data was found. Have you created any Workflows? Click the button below to create a new Workflow."
action={
<Button
variant="contained"
color="primary"
href={`https://${githubHost}/${owner}/${repo}/actions/new`}
>
Create new Workflow
</Button>
}
/>
<Card>
<CardHeader title="Recent Workflow Runs" />
<Divider />
<CardContent>
<EmptyState
missing="data"
title="No Workflow Data"
description="This component has GitHub Actions enabled, but no data was found. Have you created any Workflows? Click the button below to create a new Workflow."
action={
<Button
variant="contained"
color="primary"
href={`https://${githubHost}/${owner}/${repo}/actions/new`}
>
Create new Workflow
</Button>
}
/>
</CardContent>
</Card>
) : (
<InfoCard
title="Recent Workflow Runs"