Handle "null" statusCheckRollup values on commits
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-pull-requests-board': patch
|
||||
---
|
||||
|
||||
Handle null values returned from GitHub for the statusCheckRollup value on the commit object
|
||||
@@ -92,7 +92,7 @@ const CardHeader: FunctionComponent<Props> = (props: Props) => {
|
||||
<Box display="flex" alignItems="center" flexWrap="wrap" paddingTop={1}>
|
||||
<Typography variant="body2" component="p">
|
||||
Commit Status:{' '}
|
||||
<strong>{status.commit.statusCheckRollup.state}</strong>
|
||||
<strong>{status.commit.statusCheckRollup?.state || 'N/A'}</strong>
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
+1
-3
@@ -96,9 +96,7 @@ jest.mock('../../hooks/usePullRequestsByTeam', () => {
|
||||
isArchived: false,
|
||||
status: {
|
||||
commit: {
|
||||
statusCheckRollup: {
|
||||
state: 'FAILURE',
|
||||
},
|
||||
statusCheckRollup: null,
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
+1
-3
@@ -96,9 +96,7 @@ jest.mock('../../hooks/usePullRequestsByTeam', () => {
|
||||
isArchived: false,
|
||||
status: {
|
||||
commit: {
|
||||
statusCheckRollup: {
|
||||
state: 'FAILURE',
|
||||
},
|
||||
statusCheckRollup: null,
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -85,7 +85,7 @@ export type Status = {
|
||||
commit: {
|
||||
statusCheckRollup: {
|
||||
state: string;
|
||||
};
|
||||
} | null;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user