Parcourir la source

Names a `ViewsWithPullRequests` type

main
Eric Amodio il y a 3 ans
Parent
révision
4a4dc24dd7
2 fichiers modifiés avec 10 ajouts et 10 suppressions
  1. +3
    -10
      src/views/nodes/pullRequestNode.ts
  2. +7
    -0
      src/views/viewBase.ts

+ 3
- 10
src/views/nodes/pullRequestNode.ts Voir le fichier

@ -3,25 +3,18 @@ import { ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscod
import { Colors } from '../../constants';
import { GitBranch, GitCommit, PullRequest, PullRequestState } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { BranchesView } from '../branchesView';
import { CommitsView } from '../commitsView';
import { ContributorsView } from '../contributorsView';
import { RemotesView } from '../remotesView';
import { RepositoriesView } from '../repositoriesView';
import { SearchAndCompareView } from '../searchAndCompareView';
import { ViewsWithPullRequests } from '../viewBase';
import { RepositoryNode } from './repositoryNode';
import { ContextValues, ViewNode } from './viewNode';
export class PullRequestNode extends ViewNode<
BranchesView | CommitsView | ContributorsView | RemotesView | RepositoriesView | SearchAndCompareView
> {
export class PullRequestNode extends ViewNode<ViewsWithPullRequests> {
static key = ':pullrequest';
static getId(repoPath: string, id: string, ref: string): string {
return `${RepositoryNode.getId(repoPath)}${this.key}(${id}):${ref}`;
}
constructor(
view: BranchesView | CommitsView | ContributorsView | RemotesView | RepositoriesView | SearchAndCompareView,
view: ViewsWithPullRequests,
parent: ViewNode,
public readonly pullRequest: PullRequest,
public readonly branchOrCommit: GitBranch | GitCommit,

+ 7
- 0
src/views/viewBase.ts Voir le fichier

@ -66,6 +66,13 @@ export type ViewsWithCommits =
| RepositoriesView
| SearchAndCompareView
| TagsView;
export type ViewsWithPullRequests =
| BranchesView
| CommitsView
| ContributorsView
| RemotesView
| RepositoriesView
| SearchAndCompareView;
export interface TreeViewNodeCollapsibleStateChangeEvent<T> extends TreeViewExpansionEvent<T> {
state: TreeItemCollapsibleState;

Chargement…
Annuler
Enregistrer