Skip to content

Commit 73eef7b

Browse files
committed
Closes #3538 improves graph integration connection
1 parent 754ac4e commit 73eef7b

File tree

4 files changed

+75
-16
lines changed

4 files changed

+75
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2020
- Changes the new _Commit Graph_ sidebar to be enabled by default; use the `gitlens.graph.sidebar.enabled` settings to disable it
2121
- Changes how GitLens handles creating and renaming branches to avoid using the terminal — refs [#3528](https://github.com/gitkraken/vscode-gitlens/issues/3528)
2222
- Improves repository locating when using Launchpad — closes [#3633](https://github.com/gitkraken/vscode-gitlens/issues/3633)
23-
- Improves unnecessary prompting for certain deeplink and Launchpad workflows
24-
- Changes to automatically record repository path location when opening repositories — closes [#3635](https://github.com/gitkraken/vscode-gitlens/issues/3635)
25-
- Improves _Switch_, _Open in Worktree_, and deep link flows:
23+
- Improves _Switch_, _Open in Worktree_, and deeplink and Launchpad workflows
2624
- Reduces prompts for locating repositories which the user has previously opened — closes [#3555](https://github.com/gitkraken/vscode-gitlens/issues/3555)
2725
- Improves automatic detection of matching repositories for pull requests — closes [#3627](https://github.com/gitkraken/vscode-gitlens/issues/3627)
28-
- Automatically fetches from the repository when needed rather than prompting the user
26+
- Automatically fetches the repository when needed rather than prompting the user
27+
- Improves the integration connection indicator and connection button on the _Commit Graph_ — closes [#3538](https://github.com/gitkraken/vscode-gitlens/issues/3538)
28+
- Changes to automatically record repository path location when opening repositories — closes [#3635](https://github.com/gitkraken/vscode-gitlens/issues/3635)
2929

3030
### Fixed
3131

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

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import { DidChangeHostWindowFocusNotification } from '../../../protocol';
7272
import { GlButton } from '../../shared/components/button.react';
7373
import { GlCheckbox } from '../../shared/components/checkbox';
7474
import { CodeIcon } from '../../shared/components/code-icon.react';
75-
import { GlConnect } from '../../shared/components/integrations/connect.react';
75+
import { GlIndicator } from '../../shared/components/indicators/indicator.react';
7676
import { GlMarkdown } from '../../shared/components/markdown/markdown.react';
7777
import { MenuDivider, MenuItem, MenuLabel } from '../../shared/components/menu/react';
7878
import { GlPopover } from '../../shared/components/overlays/popover.react';
@@ -1000,12 +1000,13 @@ export function GraphWrapper({
10001000
<div className="titlebar__group">
10011001
{repo?.provider?.url && (
10021002
<>
1003-
<GlTooltip placement="bottom">
1003+
<GlPopover placement="bottom">
10041004
<a
10051005
href={repo.provider.url}
10061006
className="action-button"
10071007
style={{ marginRight: '-0.5rem' }}
10081008
aria-label={`Open Repository on ${repo.provider.name}`}
1009+
slot="anchor"
10091010
>
10101011
<span
10111012
className={
@@ -1014,23 +1015,75 @@ export function GraphWrapper({
10141015
: `glicon glicon-provider-${repo.provider.icon} action-button__icon`
10151016
}
10161017
aria-hidden="true"
1017-
></span>
1018+
>
1019+
{repo.provider.integration?.connected && (
1020+
<GlIndicator
1021+
style={{
1022+
marginLeft: '-0.2rem',
1023+
// @ts-expect-error React doesn't like that we are setting a custom css prop
1024+
'--gl-indicator-color': 'green',
1025+
'--gl-indicator-size': '0.4rem',
1026+
}}
1027+
></GlIndicator>
1028+
)}
1029+
</span>
10181030
</a>
1019-
<span slot="content">Open Repository on {repo.provider.name}</span>
1020-
</GlTooltip>
1031+
<span slot="content">
1032+
Open Repository on {repo.provider.name}
1033+
<hr />
1034+
{repo.provider.integration?.connected ? (
1035+
<span>
1036+
<span
1037+
style={{ marginTop: '-3px' }}
1038+
className="codicon codicon-check"
1039+
aria-hidden="true"
1040+
></span>{' '}
1041+
Connected to {repo.provider.name}
1042+
</span>
1043+
) : (
1044+
repo.provider.integration?.connected === false && (
1045+
<>
1046+
<span
1047+
style={{ marginTop: '-3px' }}
1048+
className="codicon codicon-plug"
1049+
aria-hidden="true"
1050+
></span>{' '}
1051+
<a
1052+
href={createCommandLink<ConnectCloudIntegrationsCommandArgs>(
1053+
'gitlens.plus.cloudIntegrations.connect' as Commands,
1054+
{
1055+
integrationIds: [repo.provider.integration.id],
1056+
source: 'graph',
1057+
},
1058+
)}
1059+
>
1060+
Connect to {repo.provider.name}
1061+
</a>
1062+
<span> &mdash; not connected</span>
1063+
</>
1064+
)
1065+
)}
1066+
</span>
1067+
</GlPopover>
10211068
{repo?.provider?.integration?.connected === false && (
1022-
<GlConnect
1023-
type="action"
1024-
connected={false}
1025-
integration={repo.provider.name}
1026-
connectUrl={createCommandLink<ConnectCloudIntegrationsCommandArgs>(
1069+
<GlButton
1070+
appearance="toolbar"
1071+
href={createCommandLink<ConnectCloudIntegrationsCommandArgs>(
10271072
'gitlens.plus.cloudIntegrations.connect' as Commands,
10281073
{
10291074
integrationIds: [repo.provider.integration.id],
10301075
source: 'graph',
10311076
},
10321077
)}
1033-
></GlConnect>
1078+
>
1079+
<CodeIcon icon="plug" style={{ color: 'var(--titlebar-fg)' }}></CodeIcon>
1080+
<span slot="tooltip">
1081+
Connect to {repo.provider.name}
1082+
<hr />
1083+
View pull requests and issues in the Commit Graph, Launchpad, autolinks, and
1084+
more
1085+
</span>
1086+
</GlButton>
10341087
)}
10351088
</>
10361089
)}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { reactWrapper } from '../helpers/react-wrapper';
2+
import { GlIndicator as GlIndicatorWC, tagName } from './indicator';
3+
4+
export const GlIndicator = reactWrapper(GlIndicatorWC, { tagName: tagName });

src/webviews/apps/shared/components/indicators/indicator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { html, LitElement } from 'lit';
22
import { customElement, property } from 'lit/decorators.js';
33
import { baseStyles, pulseStyles } from './indicator.css';
44

5-
@customElement('gl-indicator')
5+
export const tagName = 'gl-indicator';
6+
7+
@customElement(tagName)
68
export class GlIndicator extends LitElement {
79
static override styles = [baseStyles, pulseStyles];
810

0 commit comments

Comments
 (0)