22import './settings.scss' ;
33import type { ConnectCloudIntegrationsCommandArgs } from '../../../commands/cloudIntegrations' ;
44import type { AutolinkConfig } from '../../../config' ;
5- import type { IssuesCloudHostIntegrationId , SupportedCloudIntegrationIds } from '../../../constants.integrations' ;
5+ import type { SupportedCloudIntegrationIds } from '../../../constants.integrations' ;
6+ import { IssuesCloudHostIntegrationId } from '../../../constants.integrations' ;
67import { createCommandLink } from '../../../system/commands' ;
78import type { IpcMessage , UpdateConfigurationParams } from '../../protocol' ;
89import { DidChangeConfigurationNotification , UpdateConfigurationCommand } from '../../protocol' ;
910import type { State } from '../../settings/protocol' ;
1011import {
1112 DidChangeAccountNotification ,
12- DidChangeConnectedJiraNotification ,
13+ DidChangeIssueIntegrationConnectedNotification ,
1314 DidOpenAnchorNotification ,
1415 GenerateConfigurationPreviewRequest ,
1516} from '../../settings/protocol' ;
@@ -159,8 +160,12 @@ export class SettingsApp extends App<State> {
159160 this . renderAutolinkIntegration ( ) ;
160161 break ;
161162
162- case DidChangeConnectedJiraNotification . is ( msg ) :
163- this . state . hasConnectedJira = msg . params . hasConnectedJira ;
163+ case DidChangeIssueIntegrationConnectedNotification . is ( msg ) :
164+ if ( msg . params . integrationId === IssuesCloudHostIntegrationId . Jira ) {
165+ this . state . hasConnectedJira = msg . params . connected ;
166+ } else if ( msg . params . integrationId === IssuesCloudHostIntegrationId . Linear ) {
167+ this . state . hasConnectedLinear = msg . params . connected ;
168+ }
164169 this . setState ( this . state ) ;
165170 this . renderAutolinkIntegration ( ) ;
166171 break ;
@@ -804,8 +809,8 @@ export class SettingsApp extends App<State> {
804809 const $root = document . querySelector ( '[data-component="autolink-integration"]' ) ;
805810 if ( $root == null ) return ;
806811
807- const { hasAccount, hasConnectedJira } = this . state ;
808- let message = `<a href="${ createCommandLink < ConnectCloudIntegrationsCommandArgs > (
812+ const { hasAccount, hasConnectedJira, hasConnectedLinear } = this . state ;
813+ let messageJira = `<a href="${ createCommandLink < ConnectCloudIntegrationsCommandArgs > (
809814 'gitlens.plus.cloudIntegrations.connect' ,
810815 {
811816 integrationIds : [ 'jira' as IssuesCloudHostIntegrationId . Jira ] as SupportedCloudIntegrationIds [ ] ,
@@ -821,11 +826,30 @@ export class SettingsApp extends App<State> {
821826 hasAccount ? '' : 'sign up and '
822827 } get access to automatic rich Jira autolinks.`;
823828 if ( hasAccount && hasConnectedJira ) {
824- message =
829+ messageJira =
825830 '<i class="codicon codicon-check" style="vertical-align: text-bottom"></i> Jira connected — automatic rich Jira autolinks are enabled.' ;
826831 }
832+ let messageLinear = `<a href="${ createCommandLink < ConnectCloudIntegrationsCommandArgs > (
833+ 'gitlens.plus.cloudIntegrations.connect' ,
834+ {
835+ integrationIds : [ 'linear' as IssuesCloudHostIntegrationId . Linear ] as SupportedCloudIntegrationIds [ ] ,
836+ source : {
837+ source : 'settings' ,
838+ detail : {
839+ action : 'connect' ,
840+ integration : 'linear' ,
841+ } ,
842+ } ,
843+ } ,
844+ ) } ">Connect to Linear</a> — ${
845+ hasAccount ? '' : 'sign up and '
846+ } get access to automatic rich Linear autolinks.`;
847+ if ( hasAccount && hasConnectedLinear ) {
848+ messageLinear =
849+ '<i class="codicon codicon-check" style="vertical-align: text-bottom"></i> Linear connected — automatic rich Linear autolinks are enabled.' ;
850+ }
827851
828- $root . innerHTML = message ;
852+ $root . innerHTML = ` ${ messageJira } <br/> ${ messageLinear } ` ;
829853 }
830854
831855 private renderAutolinks ( ) {
0 commit comments