Skip to content

Commit 1a1e03e

Browse files
committed
Fixes repo provider on Commit Graph
1 parent d7aee42 commit 1a1e03e

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

src/plus/webviews/graph/graphWebview.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3751,8 +3751,15 @@ async function formatRepositories(repositories: Repository[]): Promise<GraphRepo
37513751
id: r.id,
37523752
name: r.name,
37533753
path: r.path,
3754+
provider: remote?.provider
3755+
? {
3756+
name: remote.provider.name,
3757+
connected: connected,
3758+
icon: remote.provider.icon === 'remote' ? 'cloud' : remote.provider.icon,
3759+
url: remote.provider.url({ type: RemoteResourceType.Repo }),
3760+
}
3761+
: undefined,
37543762
isVirtual: r.provider.virtual,
3755-
isConnected: connected,
37563763
};
37573764
}),
37583765
);

src/plus/webviews/graph/protocol.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ export interface GraphRepository {
151151
name: string;
152152
path: string;
153153
isVirtual: boolean;
154-
isConnected: boolean;
154+
provider?: {
155+
name: string;
156+
connected: boolean;
157+
icon?: string;
158+
url?: string;
159+
};
155160
}
156161

157162
export interface GraphCommitIdentity {

src/webviews/apps/plus/graph/GraphWrapper.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,31 +1134,31 @@ export function GraphWrapper({
11341134
<header className="titlebar graph-app__header">
11351135
<div className="titlebar__row titlebar__row--wrap">
11361136
<div className="titlebar__group">
1137-
{repo && branchState?.provider?.url && (
1137+
{repo?.provider?.url && (
11381138
<>
11391139
<GlTooltip placement="bottom">
11401140
<a
1141-
href={branchState.provider.url}
1141+
href={repo.provider.url}
11421142
className="action-button"
11431143
style={{ marginRight: '-0.5rem' }}
1144-
aria-label={`Open Repository on ${branchState.provider.name}`}
1144+
aria-label={`Open Repository on ${repo.provider.name}`}
11451145
>
11461146
<span
11471147
className={
1148-
branchState.provider.icon === 'cloud'
1148+
repo.provider.icon === 'cloud'
11491149
? 'codicon codicon-cloud action-button__icon'
1150-
: `glicon glicon-provider-${branchState.provider.icon} action-button__icon`
1150+
: `glicon glicon-provider-${repo.provider.icon} action-button__icon`
11511151
}
11521152
aria-hidden="true"
11531153
></span>
11541154
</a>
1155-
<span slot="content">Open Repository on {branchState.provider.name}</span>
1155+
<span slot="content">Open Repository on {repo.provider.name}</span>
11561156
</GlTooltip>
1157-
{repo.isConnected !== true && (
1157+
{repo?.provider?.connected !== true && (
11581158
<GlConnect
11591159
type="action"
11601160
connected={false}
1161-
integration={branchState.provider.name}
1161+
integration={repo.provider.name}
11621162
connectUrl={createCommandLink('gitlens.plus.cloudIntegrations.connect', {
11631163
args: {
11641164
source: 'graph',

0 commit comments

Comments
 (0)