Merge pull request #23877 from brianphillips/github-pr-board-null-statusCheckRollup

Handle "null" statusCheckRollup values on commits
This commit is contained in:
Ben Lambert
2024-04-02 15:14:07 +02:00
committed by GitHub
5 changed files with 9 additions and 8 deletions
+5
View File
@@ -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>
)}
@@ -96,9 +96,7 @@ jest.mock('../../hooks/usePullRequestsByTeam', () => {
isArchived: false,
status: {
commit: {
statusCheckRollup: {
state: 'FAILURE',
},
statusCheckRollup: null,
},
},
}),
@@ -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;
};
};