Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/webviews/apps/plus/graph/GraphWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,7 @@ export function GraphWrapper({
continueCommand="gitlens.graph.continuePausedOperation"
abortCommand="gitlens.graph.abortPausedOperation"
openEditorCommand="gitlens.graph.openRebaseEditor"
webviewId="gitlens.views.graph"
></GlMergeConflictWarning>
</div>
)}
Expand Down
24 changes: 20 additions & 4 deletions src/webviews/apps/plus/shared/components/merge-rebase-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Commands } from '../../../../../constants.commands';
import type { GitPausedOperationStatus } from '../../../../../git/models/pausedOperationStatus';
import { pausedOperationStatusStringsByType } from '../../../../../git/utils/pausedOperationStatus.utils';
import { createCommandLink } from '../../../../../system/commands';
import { createWebviewCommandLink } from '../../../../../system/webview';
import { getReferenceLabel } from '../../../shared/git-utils';
import '../../../shared/components/actions/action-item';
import '../../../shared/components/actions/action-nav';
Expand Down Expand Up @@ -74,20 +75,35 @@ export class GlMergeConflictWarning extends LitElement {
@property()
openEditorCommand = 'gitlens.home.openRebaseEditor';

@property({ type: String })
webviewId?: Parameters<typeof createWebviewCommandLink>[1];

private createWebviewCommandLink<T>(command: string, props: T) {
if (this.webviewId) {
return createWebviewCommandLink(
command as Parameters<typeof createWebviewCommandLink>[0],
this.webviewId,
'',
props,
);
}
return createCommandLink(command as Commands, props);
}

private get onSkipUrl() {
return createCommandLink(this.skipCommand as Commands, this.pausedOpStatus);
return this.createWebviewCommandLink(this.skipCommand, this.pausedOpStatus);
}

private get onContinueUrl() {
return createCommandLink(this.continueCommand as Commands, this.pausedOpStatus);
return this.createWebviewCommandLink(this.continueCommand, this.pausedOpStatus);
}

private get onAbortUrl() {
return createCommandLink(this.abortCommand as Commands, this.pausedOpStatus);
return this.createWebviewCommandLink(this.abortCommand, this.pausedOpStatus);
}

private get onOpenEditorUrl() {
return createCommandLink(this.openEditorCommand as Commands, this.pausedOpStatus);
return this.createWebviewCommandLink(this.openEditorCommand, this.pausedOpStatus);
}

override render() {
Expand Down
9 changes: 4 additions & 5 deletions src/webviews/plus/graph/graphWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,10 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
this.host.registerWebviewCommand('gitlens.graph.generateCommitMessage', this.generateCommitMessage),

this.host.registerWebviewCommand('gitlens.graph.compareSelectedCommits.multi', this.compareSelectedCommits),
// TODO@d13: convert to this.host.registerWebviewCommand
registerCommand('gitlens.graph.abortPausedOperation', this.abortPausedOperation, this),
registerCommand('gitlens.graph.continuePausedOperation', this.continuePausedOperation, this),
registerCommand('gitlens.graph.openRebaseEditor', this.openRebaseEditor, this),
registerCommand('gitlens.graph.skipPausedOperation', this.skipPausedOperation, this),
this.host.registerWebviewCommand('gitlens.graph.abortPausedOperation', this.abortPausedOperation),
this.host.registerWebviewCommand('gitlens.graph.continuePausedOperation', this.continuePausedOperation),
this.host.registerWebviewCommand('gitlens.graph.openRebaseEditor', this.openRebaseEditor),
this.host.registerWebviewCommand('gitlens.graph.skipPausedOperation', this.skipPausedOperation),
);

return commands;
Expand Down
Loading