Skip to content

Commit

Permalink
fix(jira): check if issues field is defined in response (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: Niklas Aronsson <niklasar@axis.com>
  • Loading branch information
anicke and Niklas Aronsson authored Nov 21, 2024
1 parent 76174da commit 060bcf6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-singers-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axis-backstage/plugin-jira-dashboard-common': patch
---

Set issues field as optional in JiraResponse
5 changes: 5 additions & 0 deletions .changeset/hungry-spiders-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axis-backstage/plugin-jira-dashboard': patch
---

Check if the `issues` field is set before use
2 changes: 1 addition & 1 deletion plugins/jira-dashboard-common/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type JiraDataResponse = {
name: string;
query?: string;
type: 'component' | 'filter';
issues: Issue[];
issues?: Issue[];
};

// @public
Expand Down
2 changes: 1 addition & 1 deletion plugins/jira-dashboard-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export type JiraDataResponse = {
name: string;
query?: string;
type: 'component' | 'filter';
issues: Issue[];
issues?: Issue[];
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const JiraTable = ({
);
}

transformAssignees(tableContent.issues);
transformAssignees(tableContent?.issues || []);

const nbrOfIssues = tableContent?.issues?.length ?? 0;

Expand Down

0 comments on commit 060bcf6

Please sign in to comment.