Browse Source

Changes remote provider in api to an object

main
Eric Amodio 3 years ago
parent
commit
6a2cf08f2b
2 changed files with 21 additions and 4 deletions
  1. +8
    -2
      src/api/gitlens.d.ts
  2. +13
    -2
      src/views/viewCommands.ts

+ 8
- 2
src/api/gitlens.d.ts View File

@ -3,13 +3,19 @@ import { Disposable } from 'vscode';
export { Disposable } from 'vscode'; export { Disposable } from 'vscode';
export interface RemoteProvider {
readonly id: string;
readonly name: string;
readonly domain: string;
}
export interface CreatePullRequestActionContext { export interface CreatePullRequestActionContext {
readonly type: 'createPullRequest'; readonly type: 'createPullRequest';
readonly branch: { readonly branch: {
readonly name: string; readonly name: string;
readonly remote?: { readonly remote?: {
readonly name: string; readonly name: string;
readonly provider?: string;
readonly provider?: RemoteProvider;
readonly url?: string; readonly url?: string;
}; };
readonly repoPath: string; readonly repoPath: string;
@ -20,7 +26,7 @@ export interface OpenPullRequestActionContext {
readonly type: 'openPullRequest'; readonly type: 'openPullRequest';
readonly pullRequest: { readonly pullRequest: {
readonly id: string; readonly id: string;
readonly provider: string;
readonly provider?: RemoteProvider;
readonly repoPath: string; readonly repoPath: string;
readonly url: string; readonly url: string;
}; };

+ 13
- 2
src/views/viewCommands.ts View File

@ -290,7 +290,14 @@ export class ViewCommands {
remote != null remote != null
? { ? {
name: remote.name, name: remote.name,
provider: remote.provider?.name,
provider:
remote.provider != null
? {
id: remote.provider.id,
name: remote.provider.name,
domain: remote.provider.domain,
}
: undefined,
url: remote.url, url: remote.url,
} }
: undefined, : undefined,
@ -409,7 +416,11 @@ export class ViewCommands {
return executeActionCommand<OpenPullRequestActionContext>('openPullRequest', { return executeActionCommand<OpenPullRequestActionContext>('openPullRequest', {
pullRequest: { pullRequest: {
id: node.pullRequest.id, id: node.pullRequest.id,
provider: node.pullRequest.provider.name,
provider: {
id: node.pullRequest.provider.id,
name: node.pullRequest.provider.name,
domain: node.pullRequest.provider.domain,
},
repoPath: node.uri.repoPath!, repoPath: node.uri.repoPath!,
url: node.pullRequest.url, url: node.pullRequest.url,
}, },

Loading…
Cancel
Save