瀏覽代碼

Adds fields to Issues

main
Keith Daulton 1 年之前
committed by Keith Daulton
父節點
當前提交
a322bf857c
共有 4 個文件被更改,包括 46 次插入25 次删除
  1. +1
    -1
      .vscode/queries.github-graphql-nb
  2. +11
    -0
      src/git/models/issue.ts
  3. +20
    -19
      src/plus/github/github.ts
  4. +14
    -5
      src/plus/github/models.ts

+ 1
- 1
.vscode/queries.github-graphql-nb
文件差異過大導致無法顯示
查看文件


+ 11
- 0
src/git/models/issue.ts 查看文件

@ -29,10 +29,16 @@ export interface IssueMember {
url: string;
}
export interface IssueRepository {
owner: string;
repo: string;
}
export interface IssueShape extends IssueOrPullRequest {
updatedDate: Date;
author: IssueMember;
assignees: IssueMember[];
repository: IssueRepository;
labels?: IssueLabel[];
commentsCount?: number;
thumbsUpCount?: number;
@ -143,6 +149,10 @@ export function serializeIssue(value: IssueShape): IssueShape {
avatarUrl: value.author.avatarUrl,
url: value.author.url,
},
repository: {
owner: value.repository.owner,
repo: value.repository.repo,
},
assignees: value.assignees.map(assignee => ({
name: assignee.name,
avatarUrl: assignee.avatarUrl,
@ -173,6 +183,7 @@ export class Issue implements IssueShape {
public readonly closed: boolean,
public readonly updatedDate: Date,
public readonly author: IssueMember,
public readonly repository: IssueRepository,
public readonly assignees: IssueMember[],
public readonly closedDate?: Date,
public readonly labels?: IssueLabel[],

+ 20
- 19
src/plus/github/github.ts 查看文件

@ -2571,23 +2571,6 @@ totalCommentsCount
const issueNodeProperties = `
... on Issue {
number
title
url
createdAt
closedAt
updatedAt
author {
login
avatarUrl
url
}
repository {
name
owner {
login
}
}
assignees(first: 100) {
nodes {
login
@ -2595,6 +2578,21 @@ const issueNodeProperties = `
avatarUrl
}
}
author {
login
avatarUrl
url
}
comments {
totalCount
}
number
title
url
createdAt
closedAt
closed
updatedAt
labels(first: 20) {
nodes {
color
@ -2604,8 +2602,11 @@ const issueNodeProperties = `
reactions(content: THUMBS_UP) {
totalCount
}
comments {
totalCount
repository {
name
owner {
login
}
}
}
`;

+ 14
- 5
src/plus/github/models.ts 查看文件

@ -95,14 +95,19 @@ export interface GitHubPullRequest {
export interface GitHubDetailedIssue extends GitHubIssueOrPullRequest {
date: Date;
updatedDate: Date;
closedDate: Date;
updatedAt: Date;
author: {
login: string;
avatarUrl: string;
url: string;
};
assignees: { nodes: IssueMember[] };
repository: {
name: string;
owner: {
login: string;
};
};
labels?: { nodes: IssueLabel[] };
reactions?: {
totalCount: number;
@ -302,20 +307,24 @@ export namespace GitHubDetailedIssue {
String(value.number),
value.title,
value.url,
value.date,
new Date(value.createdAt),
value.closed,
value.updatedDate,
new Date(value.updatedAt),
{
name: value.author.login,
avatarUrl: value.author.avatarUrl,
url: value.author.url,
},
{
owner: value.repository.owner.login,
repo: value.repository.name,
},
value.assignees.nodes.map(assignee => ({
name: assignee.name,
avatarUrl: assignee.avatarUrl,
url: assignee.url,
})),
value.closedDate,
value.closedAt == null ? undefined : new Date(value.closedAt),
value.labels?.nodes == null
? undefined
: value.labels.nodes.map(label => ({

Loading…
取消
儲存