From 6a2cf08f2baa1d2f6d30b07871c4ee6c81323e72 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 19 Jan 2021 00:32:23 -0500 Subject: [PATCH] Changes remote provider in api to an object --- src/api/gitlens.d.ts | 10 ++++++++-- src/views/viewCommands.ts | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/api/gitlens.d.ts b/src/api/gitlens.d.ts index 10e8cd9..cca2acd 100644 --- a/src/api/gitlens.d.ts +++ b/src/api/gitlens.d.ts @@ -3,13 +3,19 @@ import { Disposable } from 'vscode'; export { Disposable } from 'vscode'; +export interface RemoteProvider { + readonly id: string; + readonly name: string; + readonly domain: string; +} + export interface CreatePullRequestActionContext { readonly type: 'createPullRequest'; readonly branch: { readonly name: string; readonly remote?: { readonly name: string; - readonly provider?: string; + readonly provider?: RemoteProvider; readonly url?: string; }; readonly repoPath: string; @@ -20,7 +26,7 @@ export interface OpenPullRequestActionContext { readonly type: 'openPullRequest'; readonly pullRequest: { readonly id: string; - readonly provider: string; + readonly provider?: RemoteProvider; readonly repoPath: string; readonly url: string; }; diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index ff1030f..35bc623 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -290,7 +290,14 @@ export class ViewCommands { remote != null ? { 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, } : undefined, @@ -409,7 +416,11 @@ export class ViewCommands { return executeActionCommand('openPullRequest', { pullRequest: { 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!, url: node.pullRequest.url, },