fix(github-deployments): handle deployments without commits

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2021-05-20 17:44:24 -04:00
parent dc7ac4076a
commit 4d38bab75f
3 changed files with 12 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-deployments': patch
---
Handle deployments without a commit
+1 -1
View File
@@ -60,7 +60,7 @@ export type GithubDeployment = {
commit: {
abbreviatedOid: string;
commitUrl: string;
};
} | null;
creator: {
login: string;
};
@@ -66,11 +66,12 @@ export function createStatusColumn(): TableColumn<GithubDeployment> {
export function createCommitColumn(): TableColumn<GithubDeployment> {
return {
title: 'Commit',
render: (row: GithubDeployment): JSX.Element => (
<Link to={row.commit.commitUrl} target="_blank" rel="noopener">
{row.commit.abbreviatedOid}
</Link>
),
render: (row: GithubDeployment) =>
row.commit && (
<Link to={row.commit.commitUrl} target="_blank" rel="noopener">
{row.commit.abbreviatedOid}
</Link>
),
};
}