fix(github-deployments): handle deployments without commits
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-deployments': patch
|
||||
---
|
||||
|
||||
Handle deployments without a commit
|
||||
@@ -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>
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user