mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixed the stray validation error message in Resource Deployment wizard (#13747)
* Fixed the stray validation error message * Removed not working ' with validation Adding back cancel button disabling
This commit is contained in:
@@ -7,7 +7,7 @@ import { EOL } from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { getErrorMessage } from './common/utils';
|
||||
import { ResourceTypeCategories } from './constants';
|
||||
import { FieldType, OptionsType } from './interfaces';
|
||||
import { FieldType, ITool, OptionsType } from './interfaces';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export const account = localize('azure.account', "Azure Account");
|
||||
@@ -81,3 +81,7 @@ export const discoverPathOrAdditionalInformationText = localize('resourceDeploym
|
||||
export const requiredToolsText = localize('resourceDeployment.requiredTools', "Required tools");
|
||||
export const installToolsText = localize('resourceDeployment.InstallTools', "Install tools");
|
||||
export const optionsText = localize('resourceDeployment.Options', "Options");
|
||||
|
||||
export function getToolInstallingMessage(tool: ITool): string {
|
||||
return localize('deploymentDialog.InstallingTool', "Required tool '{0}' [ {1} ] is being installed now.", tool.displayName, tool.homePage);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
private _tools: ITool[] = [];
|
||||
private _eulaValidationSucceeded: boolean = false;
|
||||
private _isInitialized = false;
|
||||
private _isDoneButtonEnabled = false;
|
||||
private _resourceType: ResourceType;
|
||||
|
||||
public set resourceProvider(provider: DeploymentProvider) {
|
||||
@@ -58,14 +57,28 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
return false; // we return false so that the workflow does not proceed and user gets to either click acceptEulaAndSelect again or cancel
|
||||
}
|
||||
|
||||
if (!this._isDoneButtonEnabled) {
|
||||
this.wizard.wizardObject.message = {
|
||||
text: localize('deploymentDialog.FailedToolsInstallation', "Some tools were still not discovered. Please make sure that they are installed, running and discoverable"),
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
return false;
|
||||
for (let i = 0; i < this._tools.length; i++) {
|
||||
switch (this._tools[i].status) {
|
||||
case ToolStatus.Installing:
|
||||
this.wizard.wizardObject.message = {
|
||||
text: loc.getToolInstallingMessage(this._tools[i]),
|
||||
level: azdata.window.MessageLevel.Information
|
||||
};
|
||||
return false;
|
||||
case ToolStatus.Installed:
|
||||
continue;
|
||||
default:
|
||||
this.wizard.wizardObject.message = {
|
||||
text: localize('deploymentDialog.FailedToolsInstallation', "Some tools were still not discovered. Please make sure that they are installed, running and discoverable"),
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this.wizard.wizardObject.message = {
|
||||
text: ''
|
||||
};
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -293,6 +306,7 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
this._installationInProgress = true;
|
||||
let tool: ITool;
|
||||
try {
|
||||
this.enableDoneButton(false);
|
||||
const toolRequirements = this.toolRequirements;
|
||||
let toolsNotInstalled: ITool[] = [];
|
||||
for (let i: number = 0; i < toolRequirements.length; i++) {
|
||||
@@ -302,7 +316,7 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
// Update the informational message
|
||||
this.wizard.wizardObject.message = {
|
||||
level: azdata.window.MessageLevel.Information,
|
||||
text: localize('deploymentDialog.InstallingTool', "Required tool '{0}' [ {1} ] is being installed now.", tool.displayName, tool.homePage)
|
||||
text: loc.getToolInstallingMessage(tool)
|
||||
};
|
||||
await this._tools[i].install();
|
||||
if (tool.status === ToolStatus.Installed && toolReq.version && !tool.isSameOrNewerThan(toolReq.version)) {
|
||||
@@ -313,7 +327,9 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
toolsNotInstalled.push(tool);
|
||||
if (this._tools[i].status !== ToolStatus.Installed) {
|
||||
toolsNotInstalled.push(tool);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update the informational message
|
||||
@@ -365,7 +381,6 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
this._agreementContainer.enabled = enable;
|
||||
this._optionsContainer.enabled = enable;
|
||||
this.wizard.wizardObject.cancelButton.enabled = enable;
|
||||
// select and install tools buttons are controlled separately
|
||||
}
|
||||
|
||||
public async onLeave(): Promise<void> {
|
||||
@@ -503,7 +518,6 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
}
|
||||
|
||||
private enableDoneButton(enable: boolean) {
|
||||
this._isDoneButtonEnabled = enable;
|
||||
this.wizard.wizardObject.doneButton.enabled = enable;
|
||||
this.wizard.wizardObject.nextButton.enabled = enable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user