Improve Configure Python wizard experience for unfamiliar kernel names. (#17272)

This commit is contained in:
Cory Rivera
2021-10-06 08:52:54 -07:00
committed by GitHub
parent 747b8e84a8
commit 5a4d1599db
5 changed files with 12 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ export class ConfigurePathPage extends BasePage {
public async initialize(): Promise<boolean> {
let wizardDescription: string;
if (this.model.kernelName) {
wizardDescription = localize('configurePython.descriptionWithKernel', "The {0} kernel requires a Python runtime to be configured and dependencies to be installed.", this.model.kernelName);
wizardDescription = localize('configurePython.descriptionWithKernel', "The '{0}' kernel requires a Python runtime to be configured and dependencies to be installed.", this.model.kernelName);
} else {
wizardDescription = localize('configurePython.descriptionWithoutKernel', "Notebook kernels require a Python runtime to be configured and dependencies to be installed.");
}

View File

@@ -128,6 +128,13 @@ export class ConfigurePythonWizard {
await this._wizard.close();
}
public showInfoMessage(errorMsg: string) {
this._wizard.message = <azdata.window.DialogMessage>{
text: errorMsg,
level: azdata.window.MessageLevel.Information
};
}
public showErrorMessage(errorMsg: string) {
this._wizard.message = <azdata.window.DialogMessage>{
text: errorMsg,

View File

@@ -158,9 +158,9 @@ export class PickPackagesPage extends BasePage {
this.requiredPackagesTable.data = requiredPkgVersions.map(pkg => [pkg.name, pkg.existingVersion ?? '-', pkg.requiredVersion]);
this.model.packagesToInstall = requiredPackages;
} else {
this.instance.showErrorMessage(localize('msgUnsupportedKernel', "Could not retrieve packages for kernel {0}", kernelName));
this.instance.showInfoMessage(localize('msgNoRequirementsForKernel', "No packages are required by default for the kernel '{0}'", kernelName));
this.requiredPackagesTable.data = [['-', '-', '-']];
this.model.packagesToInstall = undefined;
this.model.packagesToInstall = [];
}
} finally {
this.instance.wizard.doneButton.enabled = true;