-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
PullRequest
to a shared location for reviewing of types (#4578)
and some other small cleanup Co-authored-by: Alex Ross <alros@microsoft.com>
- Loading branch information
Showing
15 changed files
with
133 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { TimelineEvent } from '../common/timelineEvent'; | ||
import { | ||
GithubItemStateEnum, | ||
IAccount, | ||
ILabel, | ||
IMilestone, | ||
MergeMethod, | ||
MergeMethodsAvailability, | ||
PullRequestChecks, | ||
PullRequestMergeability, | ||
PullRequestReviewRequirement, | ||
ReviewState, | ||
} from './interface'; | ||
|
||
export enum ReviewType { | ||
Comment = 'comment', | ||
Approve = 'approve', | ||
RequestChanges = 'requestChanges', | ||
} | ||
|
||
export interface PullRequest { | ||
number: number; | ||
title: string; | ||
titleHTML: string; | ||
url: string; | ||
createdAt: string; | ||
body: string; | ||
bodyHTML?: string; | ||
author: IAccount; | ||
state: GithubItemStateEnum; | ||
events: TimelineEvent[]; | ||
isCurrentlyCheckedOut: boolean; | ||
isRemoteBaseDeleted?: boolean; | ||
base: string; | ||
isRemoteHeadDeleted?: boolean; | ||
isLocalHeadDeleted?: boolean; | ||
head: string; | ||
labels: ILabel[]; | ||
assignees: IAccount[]; | ||
commitsCount: number; | ||
milestone: IMilestone | undefined; | ||
repositoryDefaultBranch: string; | ||
/** | ||
* User can edit PR title and description (author or user with push access) | ||
*/ | ||
canEdit: boolean; | ||
/** | ||
* Users with push access to repo have rights to merge/close PRs, | ||
* edit title/description, assign reviewers/labels etc. | ||
*/ | ||
hasWritePermission: boolean; | ||
pendingCommentText?: string; | ||
pendingCommentDrafts?: { [key: string]: string }; | ||
pendingReviewType?: ReviewType; | ||
status: PullRequestChecks | null; | ||
reviewRequirement: PullRequestReviewRequirement | null; | ||
mergeable: PullRequestMergeability; | ||
defaultMergeMethod: MergeMethod; | ||
mergeMethodsAvailability: MergeMethodsAvailability; | ||
autoMerge?: boolean; | ||
allowAutoMerge: boolean; | ||
autoMergeMethod?: MergeMethod; | ||
reviewers: ReviewState[]; | ||
isDraft?: boolean; | ||
isIssue: boolean; | ||
isAuthor?: boolean; | ||
continueOnGitHub: boolean; | ||
currentUserReviewState: string; | ||
isDarkTheme: boolean; | ||
hasReviewDraft: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters