From 50c9a4383989180083103fb1767c362386fafef2 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Mon, 2 Oct 2023 16:16:51 -0400 Subject: [PATCH] Updates focus view to use nodeId --- src/plus/webviews/focus/focusWebview.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plus/webviews/focus/focusWebview.ts b/src/plus/webviews/focus/focusWebview.ts index 0717dbb..df389f9 100644 --- a/src/plus/webviews/focus/focusWebview.ts +++ b/src/plus/webviews/focus/focusWebview.ts @@ -129,7 +129,7 @@ export class FocusWebviewProvider implements WebviewProvider { } private async onPinIssue({ issue, pin }: PinIssueParams) { - const issueWithRemote = this._issues?.find(r => r.issue.id === issue.id); + const issueWithRemote = this._issues?.find(r => r.issue.nodeId === issue.nodeId); if (issueWithRemote == null) return; if (pin) { @@ -139,7 +139,7 @@ export class FocusWebviewProvider implements WebviewProvider { } else { const focusItem: FocusItem = { type: 'issue', - id: issueWithRemote.issue.id, + id: issueWithRemote.issue.nodeId!, remote: issueWithRemote.repoAndRemote.remote, url: issueWithRemote.issue.url, }; @@ -159,7 +159,7 @@ export class FocusWebviewProvider implements WebviewProvider { } private async onSnoozeIssue({ issue, snooze }: SnoozeIssueParams) { - const issueWithRemote = this._issues?.find(r => r.issue.id === issue.id); + const issueWithRemote = this._issues?.find(r => r.issue.nodeId === issue.nodeId); if (issueWithRemote == null) return; if (snooze) { @@ -169,7 +169,7 @@ export class FocusWebviewProvider implements WebviewProvider { } else { const focusItem: FocusItem = { type: 'issue', - id: issueWithRemote.issue.id, + id: issueWithRemote.issue.nodeId!, remote: issueWithRemote.repoAndRemote.remote, url: issueWithRemote.issue.url, }; @@ -189,7 +189,7 @@ export class FocusWebviewProvider implements WebviewProvider { } private async onPinPr({ pullRequest, pin }: PinPrParams) { - const prWithRemote = this._pullRequests?.find(r => r.pullRequest.id === pullRequest.id); + const prWithRemote = this._pullRequests?.find(r => r.pullRequest.nodeId === pullRequest.nodeId); if (prWithRemote == null) return; if (pin) { @@ -199,7 +199,7 @@ export class FocusWebviewProvider implements WebviewProvider { } else { const focusItem: FocusItem = { type: 'pr', - id: prWithRemote.pullRequest.id, + id: prWithRemote.pullRequest.nodeId!, remote: prWithRemote.repoAndRemote.remote, url: prWithRemote.pullRequest.url, }; @@ -219,7 +219,7 @@ export class FocusWebviewProvider implements WebviewProvider { } private async onSnoozePr({ pullRequest, snooze }: SnoozePrParams) { - const prWithRemote = this._pullRequests?.find(r => r.pullRequest.id === pullRequest.id); + const prWithRemote = this._pullRequests?.find(r => r.pullRequest.nodeId === pullRequest.nodeId); if (prWithRemote == null) return; if (snooze) { @@ -229,7 +229,7 @@ export class FocusWebviewProvider implements WebviewProvider { } else { const focusItem: FocusItem = { type: 'pr', - id: prWithRemote.pullRequest.id, + id: prWithRemote.pullRequest.nodeId!, remote: prWithRemote.repoAndRemote.remote, url: prWithRemote.pullRequest.url, }; @@ -630,9 +630,9 @@ function findEnrichedItems( let result; // TODO: filter by entity id, type, and gitRepositoryId if ((item as SearchedPullRequestWithRemote).pullRequest != null) { - result = enrichedItems.filter(e => e.entityId === (item as SearchedPullRequestWithRemote).pullRequest.id); + result = enrichedItems.filter(e => e.entityId === (item as SearchedPullRequestWithRemote).pullRequest.nodeId); } else { - result = enrichedItems.filter(e => e.entityId === (item as SearchedIssueWithRank).issue.id); + result = enrichedItems.filter(e => e.entityId === (item as SearchedIssueWithRank).issue.nodeId); } if (result.length === 0) return;