From f38dcd34565162b82c69ffdc30d494d2f8caa54f Mon Sep 17 00:00:00 2001 From: saravmajestic Date: Fri, 6 Dec 2024 12:58:10 +0530 Subject: [PATCH] fix: show notification after completing project health check --- src/webview_provider/insightsPanel.ts | 46 +++++++++++++++------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/webview_provider/insightsPanel.ts b/src/webview_provider/insightsPanel.ts index 4b8c07346..1bd978273 100644 --- a/src/webview_provider/insightsPanel.ts +++ b/src/webview_provider/insightsPanel.ts @@ -561,27 +561,33 @@ export class InsightsPanel extends AltimateWebviewProvider { args: JSON.stringify(args), }); try { - await window.withProgress( - { - title: `Performing healthcheck...`, - location: ProgressLocation.Notification, - cancellable: false, - }, - async () => { - const projectHealthcheck = - await this.dbtProjectContainer.executeAltimateDatapilotHealthcheck( - args, - ); - this._panel!.webview.postMessage({ - command: "response", - args: { - syncRequestId, - body: { projectHealthcheck }, - status: true, - }, - }); - }, + window.showInformationMessage( + "Started performing healthcheck. We will notify you once it's done.", ); + + const projectHealthcheck = + await this.dbtProjectContainer.executeAltimateDatapilotHealthcheck( + args, + ); + const result = await window.showInformationMessage( + "Healthcheck completed successfully.", + "View results", + ); + if (result === "View results") { + this.dbtTerminal.debug( + "InsightsPanel", + "Sending healthcheck results to webview", + ); + await commands.executeCommand("dbtPowerUser.Insights.focus"); + } + this._panel!.webview.postMessage({ + command: "response", + args: { + syncRequestId, + body: { projectHealthcheck }, + status: true, + }, + }); } catch (e) { this.emitError( syncRequestId,