|
@ -1,3 +1,5 @@ |
|
|
|
|
|
import type { Head } from '@gitkraken/gitkraken-components'; |
|
|
|
|
|
import { stringify } from 'json5'; |
|
|
import type { |
|
|
import type { |
|
|
ColorTheme, |
|
|
ColorTheme, |
|
|
ConfigurationChangeEvent, |
|
|
ConfigurationChangeEvent, |
|
@ -81,6 +83,7 @@ import type { SubscriptionChangeEvent } from '../../subscription/subscriptionSer |
|
|
import { arePlusFeaturesEnabled, ensurePlusFeaturesEnabled } from '../../subscription/utils'; |
|
|
import { arePlusFeaturesEnabled, ensurePlusFeaturesEnabled } from '../../subscription/utils'; |
|
|
import type { |
|
|
import type { |
|
|
DismissBannerParams, |
|
|
DismissBannerParams, |
|
|
|
|
|
DoubleClickedRefParams, |
|
|
EnsureRowParams, |
|
|
EnsureRowParams, |
|
|
GetMissingAvatarsParams, |
|
|
GetMissingAvatarsParams, |
|
|
GetMissingRefsMetadataParams, |
|
|
GetMissingRefsMetadataParams, |
|
@ -104,7 +107,7 @@ import type { |
|
|
UpdateColumnParams, |
|
|
UpdateColumnParams, |
|
|
UpdateRefsVisibilityParams, |
|
|
UpdateRefsVisibilityParams, |
|
|
UpdateSelectedRepositoryParams, |
|
|
UpdateSelectedRepositoryParams, |
|
|
UpdateSelectionParams, |
|
|
|
|
|
|
|
|
UpdateSelectionParams |
|
|
} from './protocol'; |
|
|
} from './protocol'; |
|
|
import { |
|
|
import { |
|
|
DidChangeAvatarsNotificationType, |
|
|
DidChangeAvatarsNotificationType, |
|
@ -120,6 +123,7 @@ import { |
|
|
DidEnsureRowNotificationType, |
|
|
DidEnsureRowNotificationType, |
|
|
DidSearchNotificationType, |
|
|
DidSearchNotificationType, |
|
|
DismissBannerCommandType, |
|
|
DismissBannerCommandType, |
|
|
|
|
|
DoubleClickedRefCommandType, |
|
|
EnsureRowCommandType, |
|
|
EnsureRowCommandType, |
|
|
GetMissingAvatarsCommandType, |
|
|
GetMissingAvatarsCommandType, |
|
|
GetMissingRefsMetadataCommandType, |
|
|
GetMissingRefsMetadataCommandType, |
|
@ -420,6 +424,9 @@ export class GraphWebview extends WebviewBase { |
|
|
case UpdateRefsVisibilityCommandType.method: |
|
|
case UpdateRefsVisibilityCommandType.method: |
|
|
onIpc(UpdateRefsVisibilityCommandType, e, params => this.onRefsVisibilityChanged(params)); |
|
|
onIpc(UpdateRefsVisibilityCommandType, e, params => this.onRefsVisibilityChanged(params)); |
|
|
break; |
|
|
break; |
|
|
|
|
|
case DoubleClickedRefCommandType.method: |
|
|
|
|
|
onIpc(DoubleClickedRefCommandType, e, params => this.onDoubleClickRef(params)); |
|
|
|
|
|
break; |
|
|
case UpdateSelectedRepositoryCommandType.method: |
|
|
case UpdateSelectedRepositoryCommandType.method: |
|
|
onIpc(UpdateSelectedRepositoryCommandType, e, params => this.onSelectedRepositoryChanged(params)); |
|
|
onIpc(UpdateSelectedRepositoryCommandType, e, params => this.onSelectedRepositoryChanged(params)); |
|
|
break; |
|
|
break; |
|
@ -561,6 +568,22 @@ export class GraphWebview extends WebviewBase { |
|
|
this.updateHiddenRefs(e.refs, e.visible); |
|
|
this.updateHiddenRefs(e.refs, e.visible); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private onDoubleClickRef(e: DoubleClickedRefParams) { |
|
|
|
|
|
if (e.ref.context) { |
|
|
|
|
|
const item: GraphItemContext = typeof e.ref.context === 'string' |
|
|
|
|
|
? JSON.parse(e.ref.context) |
|
|
|
|
|
: e.ref.context as GraphItemContext; |
|
|
|
|
|
|
|
|
|
|
|
const { ref } = item.webviewItemValue as GraphItemRefContextValue; |
|
|
|
|
|
if (e.ref.refType === 'head' && (e.ref as Head).isCurrentHead) { |
|
|
|
|
|
return GitActions.switchTo(ref.repoPath); |
|
|
|
|
|
} |
|
|
|
|
|
return GitActions.switchTo(ref.repoPath, ref); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Promise.resolve(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@debug() |
|
|
@debug() |
|
|
private async onEnsureRow(e: EnsureRowParams, completionId?: string) { |
|
|
private async onEnsureRow(e: EnsureRowParams, completionId?: string) { |
|
|
if (this._graph == null) return; |
|
|
if (this._graph == null) return; |
|
|