IssueReportPage: match the corrected row shape, assignees is a list
damocles caught it on the swarm-controller PR: forge's assignee field is legacy single-value, assignees is the real multi-assignee list, and this repo actually uses multiple. Widen the frontend's row type + column to match -- rendered comma-joined the same way labels already are.
This commit is contained in:
parent
e815c7cb5c
commit
f4b61db753
1 changed files with 13 additions and 7 deletions
|
|
@ -34,13 +34,17 @@ interface IssueReportRow {
|
|||
number: number;
|
||||
title: string;
|
||||
labels: string[];
|
||||
assignee: string | null;
|
||||
// `string[]`, not a single `assignee` — forge's own `assignee` field is
|
||||
// the legacy single-value one; `assignees` is the real multi-assignee
|
||||
// list, and this repo actually uses multiple (caught against an
|
||||
// earlier draft of this row shape that had it singular).
|
||||
assignees: string[];
|
||||
html_url: string | null;
|
||||
blocked: boolean;
|
||||
depended_on_by_count: number;
|
||||
}
|
||||
|
||||
type SortKey = 'repo' | 'number' | 'title' | 'assignee' | 'blocked' | 'depended_on_by_count';
|
||||
type SortKey = 'repo' | 'number' | 'title' | 'assignees' | 'blocked' | 'depended_on_by_count';
|
||||
type SortDir = 'asc' | 'desc';
|
||||
|
||||
// Sentinel `<select>` value for "every repo" — `''` can't collide with a
|
||||
|
|
@ -61,8 +65,8 @@ function compareRows(a: IssueReportRow, b: IssueReportRow, key: SortKey): number
|
|||
return a.number - b.number;
|
||||
case 'title':
|
||||
return a.title.localeCompare(b.title);
|
||||
case 'assignee':
|
||||
return (a.assignee ?? '').localeCompare(b.assignee ?? '');
|
||||
case 'assignees':
|
||||
return a.assignees.join(', ').localeCompare(b.assignees.join(', '));
|
||||
case 'blocked':
|
||||
return Number(a.blocked) - Number(b.blocked);
|
||||
case 'depended_on_by_count':
|
||||
|
|
@ -216,9 +220,11 @@ export function IssueReportPage() {
|
|||
render: (r) => (r.labels.length ? r.labels.join(', ') : '—'),
|
||||
},
|
||||
{
|
||||
key: 'assignee',
|
||||
header: <SortHeader label="assignee" sortKey="assignee" activeKey={sortKey} dir={sortDir} onSort={onSort} />,
|
||||
render: (r) => r.assignee ?? '—',
|
||||
key: 'assignees',
|
||||
header: (
|
||||
<SortHeader label="assignees" sortKey="assignees" activeKey={sortKey} dir={sortDir} onSort={onSort} />
|
||||
),
|
||||
render: (r) => (r.assignees.length ? r.assignees.join(', ') : '—'),
|
||||
},
|
||||
{
|
||||
key: 'blocked',
|
||||
|
|
|
|||
Loading…
Reference in a new issue