mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* fix(github-project): render linked PR and sub-issue progress values * fix(github-project): probe schema support for project column values * fix(github-project): preserve independently supported project fields * Preserve nullable project values and unsupported fetch concurrency * Exercise project relation payloads through unchanged consumers * Combine project coordination test cache imports * Use checked project payload types in consumer tests * Place project provider column contract in cross-layer tests --------- Co-authored-by: Wooseong Kim <innocarpe@gmail.com>
70 lines
1.9 KiB
TypeScript
70 lines
1.9 KiB
TypeScript
import type { GitHubProjectRow, GitHubProjectTable } from './project-types'
|
|
|
|
export function projectRelationsTableFixture(): GitHubProjectTable {
|
|
const row = (id: string, position: number, points: number): GitHubProjectRow => ({
|
|
id,
|
|
itemType: 'ISSUE',
|
|
position,
|
|
updatedAt: '',
|
|
content: {
|
|
number: position + 1,
|
|
title: id,
|
|
body: null,
|
|
url: null,
|
|
state: 'OPEN',
|
|
stateReason: null,
|
|
isDraft: null,
|
|
repository: 'acme/repo',
|
|
assignees: [],
|
|
labels: [],
|
|
parentIssue: null,
|
|
issueType: null
|
|
},
|
|
fieldValuesByFieldId: { points: { kind: 'number', fieldId: 'points', number: points } }
|
|
})
|
|
const populated = row('populated', 0, 2)
|
|
populated.content.linkedPullRequests = {
|
|
pullRequests: [{ number: 12, title: 'Change', url: 'https://github.com/acme/repo/pull/12' }],
|
|
totalCount: 3
|
|
}
|
|
populated.content.subIssuesProgress = { completed: 1, total: 2, percentCompleted: 50 }
|
|
const points = { kind: 'field', id: 'points', name: 'Points', dataType: 'NUMBER' } as const
|
|
return {
|
|
project: {
|
|
id: 'project-1',
|
|
owner: 'acme',
|
|
ownerType: 'organization',
|
|
number: 1,
|
|
title: 'Roadmap',
|
|
url: 'https://github.com/orgs/acme/projects/1'
|
|
},
|
|
selectedView: {
|
|
id: 'view-1',
|
|
number: 1,
|
|
name: 'Table',
|
|
layout: 'TABLE_LAYOUT',
|
|
filter: '',
|
|
fields: [
|
|
points,
|
|
{
|
|
kind: 'field',
|
|
id: 'prs',
|
|
name: 'Linked pull requests',
|
|
dataType: 'LINKED_PULL_REQUESTS'
|
|
},
|
|
{
|
|
kind: 'field',
|
|
id: 'progress',
|
|
name: 'Sub-issues progress',
|
|
dataType: 'SUB_ISSUES_PROGRESS'
|
|
}
|
|
],
|
|
groupByFields: [points],
|
|
sortByFields: [{ field: points, direction: 'ASC' }]
|
|
},
|
|
rows: [populated, row('legacy', 1, 1)],
|
|
totalCount: 2,
|
|
parentFieldDropped: false
|
|
}
|
|
}
|