Skip to content

Commit

Permalink
Add extension name to the private preview terms and conditions popup (#…
Browse files Browse the repository at this point in the history
…1144)

## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!-- How is this tested? -->
  • Loading branch information
kartikgupta-db authored Mar 19, 2024
1 parent 3153117 commit 5370f04
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/databricks-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,22 @@ export async function activate(
customWhenContext.setDeploymentState("idle");

const stateStorage = new StateStorage(context);
const packageMetadata = await PackageJsonUtils.getMetadata(context);

await stateStorage.set("databricks.preview-tnc.accepted", false);

if (
!stateStorage.get("databricks.preview-tnc.accepted") &&
!isIntegrationTest()
) {
const acceptTnc = await window.showInformationMessage(
`Please note that you should only be using this functionality if you are part of our private preview and have accepted our terms and conditions regarding this preview.`,
`Databricks Extension v${packageMetadata.version} is in private preview`,
{
modal: true,
detail: `In order to enroll in the private preview please contact us and we will get you added`,
detail:
`Please note that you should only be using this functionality if you are part of our private` +
`preview and have accepted our terms and conditions regarding this preview.` +
`In order to enroll in the private preview please contact us and we will get you added`,
},
"Contact us",
"Continue if you are already enrolled"
Expand All @@ -109,15 +115,6 @@ export async function activate(
}
}

if (extensions.getExtension("databricks.databricks-vscode") !== undefined) {
await commands.executeCommand(
"workbench.extensions.uninstallExtension",
"databricks.databricks-vscode"
);

await commands.executeCommand("workbench.action.reloadWindow");
}

if (!(await PackageJsonUtils.checkArchCompat(context))) {
return undefined;
}
Expand Down Expand Up @@ -175,7 +172,6 @@ export async function activate(
`${path.delimiter}${context.asAbsolutePath("./bin")}`
);

const packageMetadata = await PackageJsonUtils.getMetadata(context);
logging.NamedLogger.getOrCreate(Loggers.Extension).debug("Metadata", {
metadata: packageMetadata,
});
Expand Down

0 comments on commit 5370f04

Please sign in to comment.