Skip to content

Commit

Permalink
Using jqlQueryBuilder for building table links
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-Wood-Eric committed Sep 23, 2024
1 parent 397be85 commit aad6fa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions plugins/jira-dashboard-backend/src/service/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
searchJira,
SearchOptions,
} from '../api';
import { jqlQueryBuilder } from '../queries';

export const getProjectResponse = async (
projectKey: string,
Expand Down Expand Up @@ -113,7 +114,11 @@ export const getIssuesFromFilters = async (
return await Promise.all(
filters.map(async filter => ({
name: filter.name,
query: filter.query,
query: jqlQueryBuilder({
project: projectKey,
components,
query: filter.query,
}),
type: 'filter',
issues: await getIssuesByFilter(
projectKey,
Expand All @@ -133,7 +138,10 @@ export const getIssuesFromComponents = async (
return await Promise.all(
componentAnnotations.map(async componentKey => ({
name: componentKey,
query: `project = ${projectKey} AND component = ${componentKey}`,
query: jqlQueryBuilder({
project: projectKey,
components: [componentKey],
}),
type: 'component',
issues: await getIssuesByComponent(projectKey, componentKey, config),
})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const JiraTable = ({
<Link
to={`${getJiraBaseUrl(project.self)}/issues/?jql=${tableContent.query}`}
variant="h5"
component="div"
data-testid="table-header"
>
{`${capitalize(tableContent.name)} (${nbrOfIssues})`}
Expand Down

0 comments on commit aad6fa8

Please sign in to comment.