Skip to content

Commit

Permalink
feature:AxisCommunications#140 Feature - Show Jira priority in the Ji…
Browse files Browse the repository at this point in the history
…ra Table (AxisCommunications#140)

Signed-off-by: Mark Connolly <[email protected]>
  • Loading branch information
mark-con committed Jun 26, 2024
1 parent 4f1aed7 commit 64b835b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/big-kiwis-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@axis-backstage/plugin-jira-dashboard-common': minor
'@axis-backstage/plugin-jira-dashboard': minor
---

Adding Priority Column to the Jira Table
3 changes: 3 additions & 0 deletions plugins/jira-dashboard-common/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export type Issue = {
name: string;
iconUrl: string;
};
priority: {
name: string;
};
};
};

Expand Down
3 changes: 3 additions & 0 deletions plugins/jira-dashboard-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export type Issue = {
name: string;
iconUrl: string;
};
priority: {
name: string;
};
};
};

Expand Down
18 changes: 18 additions & 0 deletions plugins/jira-dashboard/dev/__fixtures__/jiraResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"issuetype": {
"name": "Task",
"iconUrl": ""
},
"priority": {
"name": "Minor"
}
}
},
Expand All @@ -54,6 +57,9 @@
"issuetype": {
"name": "Bug",
"iconUrl": ""
},
"priority": {
"name": "Blocker"
}
}
},
Expand All @@ -72,6 +78,9 @@
"issuetype": {
"name": "Story",
"iconUrl": ""
},
"priority": {
"name": "Major"
}
}
}
Expand All @@ -96,6 +105,9 @@
"issuetype": {
"name": "Task",
"iconUrl": ""
},
"priority": {
"name": "Minor"
}
}
},
Expand All @@ -114,6 +126,9 @@
"issuetype": {
"name": "Bug",
"iconUrl": ""
},
"priority": {
"name": "Blocker"
}
}
},
Expand All @@ -132,6 +147,9 @@
"issuetype": {
"name": "Story",
"iconUrl": ""
},
"priority": {
"name": "Major"
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions plugins/jira-dashboard/src/components/JiraTable/JiraTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ describe('JiraTable', () => {
expect(getByTestId('table-header')).toBeInTheDocument();
});

it('renders no content message when no issues passed', async () => {
const emptyJiraDataResponse = {
name: 'Open Issues',
type: 'filter',
issues: [],
} as JiraDataResponse;
const { getByText } = await renderInTestApp(
<JiraTable tableContent={emptyJiraDataResponse} />,
);
expect(getByText('No issues found')).toBeInTheDocument();
});

it('renders error when data is missing', async () => {
const { getByText } = await renderInTestApp(
<JiraTable tableContent={undefined!} />,
Expand Down
20 changes: 20 additions & 0 deletions plugins/jira-dashboard/src/components/JiraTable/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ export const columns: TableColumn[] = [
);
},
},
{
title: 'Priority',
field: 'fields.priority.name',
highlight: true,
type: 'string',
width: '15%',
render: (issue: Partial<Issue>) => {
if (!issue.self || !issue.key) {
return null;
}
return (
<Link
to={getIssueUrl(issue.self, issue.key)}
title="Go to issue in Jira"
>
{issue.fields?.priority.name}
</Link>
);
},
},
{
title: 'Status',
field: 'fields.status.name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"issuetype": {
"name": "Task",
"iconUrl": ""
},
"priority": {
"name": "Minor"
}
}
},
Expand All @@ -35,6 +38,9 @@
"issuetype": {
"name": "Bug",
"iconUrl": ""
},
"priority": {
"name": "Blocker"
}
}
},
Expand All @@ -53,6 +59,9 @@
"issuetype": {
"name": "Story",
"iconUrl": ""
},
"priority": {
"name": "Major"
}
}
}
Expand Down

0 comments on commit 64b835b

Please sign in to comment.