Parcourir la source

Adds fields to Issues

main
Keith Daulton il y a 1 an
committed by Keith Daulton
Parent
révision
a322bf857c
4 fichiers modifiés avec 46 ajouts et 25 suppressions
  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
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 11
- 0
src/git/models/issue.ts Voir le fichier

@ -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 Voir le fichier

@ -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 Voir le fichier

@ -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 => ({

Chargement…
Annuler
Enregistrer