Skip to content

Commit

Permalink
Show v2 notification
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia-db committed Aug 28, 2024
1 parent 8027a68 commit 31c361c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/databricks-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## 1.4.0 (2024-08-28)

- Added a notification about upcoming V2 release:
> **Please note the V2 version of the extension will be made the default in a few days. With this update it is easier to set up your project, integrate with Databricks Asset Bundles and run your code remotely with fewer steps. [Learn more](https://docs.databricks.com/en/dev-tools/vscode-ext/install.html).**
# Release: v1.3.1

## packages/databricks-vscode
Expand Down
17 changes: 16 additions & 1 deletion packages/databricks-vscode/src/whatsNewPopup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {ExtensionContext, Uri, commands, window} from "vscode";
import {ExtensionContext, Uri, commands, window, env} from "vscode";

Check failure on line 1 in packages/databricks-vscode/src/whatsNewPopup.ts

View workflow job for this annotation

GitHub Actions / run-tests (darwin_amd64, macos-latest, 18.x, stable) / Test VSCode Extension

'env' is defined but never used

Check failure on line 1 in packages/databricks-vscode/src/whatsNewPopup.ts

View workflow job for this annotation

GitHub Actions / run-tests (windows_amd64, windows-latest, 18.x, stable) / Test VSCode Extension

'env' is defined but never used
import {PackageJsonUtils} from "./utils";
import {StateStorage} from "./vscode-objs/StateStorage";
import path from "path";
import {exists} from "fs-extra";
import * as semver from "semver";
import {openExternal} from "./utils/urlUtils";

export async function findFileFowWhatsNew(
context: ExtensionContext,
Expand Down Expand Up @@ -33,6 +34,18 @@ export async function findFileFowWhatsNew(
return context.asAbsolutePath("CHANGELOG.md");
}

async function showV2Notification() {
const choice = await window.showInformationMessage(
"Please note the V2 version of the extension will be made the default in a few days. With this update it is easier to set up your project, integrate with Databricks Asset Bundles and run your code remotely with fewer steps.",
"Learn more"
);
if (choice === "Learn more") {
openExternal(
"https://docs.databricks.com/en/dev-tools/vscode-ext/install.html"
);
}
}

export async function showWhatsNewPopup(
context: ExtensionContext,
storage: StateStorage
Expand Down Expand Up @@ -62,6 +75,7 @@ export async function showWhatsNewPopup(

if (window.state.focused) {
commands.executeCommand("markdown.showPreview", Uri.file(markdownFile));
showV2Notification();
return;
}

Expand All @@ -70,6 +84,7 @@ export async function showWhatsNewPopup(
return;
}
commands.executeCommand("markdown.showPreview", Uri.file(markdownFile));
showV2Notification();
listener.dispose();
});
context.subscriptions.push(listener);
Expand Down

0 comments on commit 31c361c

Please sign in to comment.