-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use own definition of PR -> implement getPRState() to get the st…
…ate specific for services
- Loading branch information
1 parent
fa2d21d
commit 2b67091
Showing
11 changed files
with
84 additions
and
53 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { PullRequestState } from '../../inspectors/ICollaborationInspector'; | ||
import { BitbucketPullRequestState, CSVService } from './ICVSService'; | ||
import { GitHubPullRequestState } from './IGitHubService'; | ||
|
||
export class CSVServicesUtils { | ||
static getPRState = ( | ||
state: PullRequestState | undefined, | ||
service: CSVService, | ||
): GitHubPullRequestState | BitbucketPullRequestState | undefined => { | ||
if (service === CSVService.github) { | ||
switch (state) { | ||
case PullRequestState.open: | ||
return GitHubPullRequestState.open; | ||
case PullRequestState.closed: | ||
return GitHubPullRequestState.closed; | ||
case PullRequestState.all: | ||
return GitHubPullRequestState.all; | ||
case undefined: | ||
return undefined; | ||
} | ||
} | ||
|
||
if (service === CSVService.bitbucket) { | ||
switch (state) { | ||
case PullRequestState.open: | ||
return BitbucketPullRequestState.open; | ||
case PullRequestState.closed: | ||
return BitbucketPullRequestState.closed; | ||
case PullRequestState.all: | ||
return BitbucketPullRequestState.open && BitbucketPullRequestState.closed && BitbucketPullRequestState.declined; | ||
case undefined: | ||
return undefined; | ||
} | ||
} | ||
}; | ||
} |
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