@@ -4,23 +4,26 @@ import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
55import { commonGithubOptions , prepareGitHubHighlighter } from './github-common'
66
7- const GH_PR_NEW = 'GH_PR_NEW ' as const
7+ const GH_PR_CREATE = 'GH_PR_CREATE ' as const
88
9- interface GitHubPRNewSpot extends CommentSpot {
10- type : typeof GH_PR_NEW
9+ interface GitHubPrCreateSpot extends CommentSpot {
10+ type : typeof GH_PR_CREATE
1111 domain : string
1212 slug : string // owner/repo
1313 title : string
1414 head : string // `user:repo:branch` where changes are implemented
1515 base : string // branch you want changes pulled into
1616}
1717
18- export class GitHubPRNewEnhancer implements CommentEnhancer < GitHubPRNewSpot > {
18+ export class GitHubPrCreateEnhancer implements CommentEnhancer < GitHubPrCreateSpot > {
1919 forSpotTypes ( ) : string [ ] {
20- return [ GH_PR_NEW ]
20+ return [ GH_PR_CREATE ]
2121 }
2222
23- tryToEnhance ( textarea : HTMLTextAreaElement , location : StrippedLocation ) : GitHubPRNewSpot | null {
23+ tryToEnhance (
24+ textarea : HTMLTextAreaElement ,
25+ location : StrippedLocation ,
26+ ) : GitHubPrCreateSpot | null {
2427 if ( textarea . id === 'feedback' ) {
2528 return null
2629 }
@@ -52,12 +55,12 @@ export class GitHubPRNewEnhancer implements CommentEnhancer<GitHubPRNewSpot> {
5255 head,
5356 slug,
5457 title,
55- type : GH_PR_NEW ,
58+ type : GH_PR_CREATE ,
5659 unique_key,
5760 }
5861 }
5962
60- enhance ( textArea : HTMLTextAreaElement , _spot : GitHubPRNewSpot ) : OverTypeInstance {
63+ enhance ( textArea : HTMLTextAreaElement , _spot : GitHubPrCreateSpot ) : OverTypeInstance {
6164 prepareGitHubHighlighter ( )
6265 const overtypeContainer = modifyDOM ( textArea )
6366 return new OverType ( overtypeContainer , {
@@ -67,7 +70,7 @@ export class GitHubPRNewEnhancer implements CommentEnhancer<GitHubPRNewSpot> {
6770 } ) [ 0 ] !
6871 }
6972
70- tableUpperDecoration ( spot : GitHubPRNewSpot ) : React . ReactNode {
73+ tableUpperDecoration ( spot : GitHubPrCreateSpot ) : React . ReactNode {
7174 const { slug } = spot
7275 return (
7376 < >
@@ -77,11 +80,11 @@ export class GitHubPRNewEnhancer implements CommentEnhancer<GitHubPRNewSpot> {
7780 )
7881 }
7982
80- tableTitle ( spot : GitHubPRNewSpot ) : string {
83+ tableTitle ( spot : GitHubPrCreateSpot ) : string {
8184 return spot . title || 'New Pull Request'
8285 }
8386
84- buildUrl ( spot : GitHubPRNewSpot ) : string {
87+ buildUrl ( spot : GitHubPrCreateSpot ) : string {
8588 return `https://${ spot . domain } /${ spot . slug } /issue/new`
8689 }
8790}
0 commit comments