fix(jira): show test Jira tickets on technique page (correct entity model)
Techniques don't have their own Jira tickets — tickets exist on tests and campaigns. The previous JiraLinkPanel entityType='technique' always returned empty. Backend: add entity_ids (list) filter to GET /jira/links so multiple test IDs can be fetched in a single request. Frontend API: listJiraLinks() accepts entity_ids[] and serialises them as repeated query params (required by FastAPI List[UUID] parsing). TechniqueDetailPage: replace JiraLinkPanel with TechniqueJiraSection — a dedicated read-only component that: - Takes technique.tests (already loaded) - Batch-fetches all test Jira links in one request - Shows test name + ticket key + status + priority + open-in-Jira link - Hides itself when no tickets exist (avoids empty panel)
This commit is contained in:
@@ -60,7 +60,17 @@ export async function createJiraLink(
|
||||
export async function listJiraLinks(params?: {
|
||||
entity_type?: JiraLinkEntityType;
|
||||
entity_id?: string;
|
||||
/** Batch-fetch links for multiple entity IDs (passed as repeated query params). */
|
||||
entity_ids?: string[];
|
||||
}): Promise<JiraLink[]> {
|
||||
// Axios doesn't repeat array params by default — build URLSearchParams manually
|
||||
if (params?.entity_ids && params.entity_ids.length > 0) {
|
||||
const p = new URLSearchParams();
|
||||
if (params.entity_type) p.append("entity_type", params.entity_type);
|
||||
for (const id of params.entity_ids) p.append("entity_ids", id);
|
||||
const { data } = await client.get<JiraLink[]>(`/jira/links?${p.toString()}`);
|
||||
return data;
|
||||
}
|
||||
const { data } = await client.get<JiraLink[]>("/jira/links", { params });
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user