mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
sql db deployments into main (WIP) (#12767)
* added my resource-deployment * changed notebook message * Add more advanced properties for spark job submission dialog (#12732) * Add more advanced properties for spark job submission dialog * Add queue * Revert "Add more advanced properties for spark job submission dialog (#12732)" This reverts commit e6a7e86ddbe70b39660098a8ebd9ded2a1c5530c. * Changes made for simplification * changed error messages * tags added * tags removed due to redundancy * Update package.json * Update resourceTypePickerDialog.ts * changes based on feedback * activaterealtimevalidation removed Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -10,8 +10,9 @@ import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DeploymentProvider, instanceOfAzureSQLVMDeploymentProvider, instanceOfCommandDeploymentProvider, instanceOfDialogDeploymentProvider, instanceOfDownloadDeploymentProvider, instanceOfNotebookBasedDialogInfo, instanceOfNotebookDeploymentProvider, instanceOfNotebookWizardDeploymentProvider, instanceOfWebPageDeploymentProvider, instanceOfWizardDeploymentProvider, NotebookInfo, NotebookPathInfo, ResourceType, ResourceTypeOption } from '../interfaces';
|
||||
import { DeploymentProvider, instanceOfAzureSQLVMDeploymentProvider, instanceOfAzureSQLDBDeploymentProvider, instanceOfCommandDeploymentProvider, instanceOfDialogDeploymentProvider, instanceOfDownloadDeploymentProvider, instanceOfNotebookBasedDialogInfo, instanceOfNotebookDeploymentProvider, instanceOfNotebookWizardDeploymentProvider, instanceOfWebPageDeploymentProvider, instanceOfWizardDeploymentProvider, NotebookInfo, NotebookPathInfo, ResourceType, ResourceTypeOption } from '../interfaces';
|
||||
import { DeployAzureSQLVMWizard } from '../ui/deployAzureSQLVMWizard/deployAzureSQLVMWizard';
|
||||
import { DeployAzureSQLDBWizard } from '../ui/deployAzureSQLDBWizard/deployAzureSQLDBWizard';
|
||||
import { DeployClusterWizard } from '../ui/deployClusterWizard/deployClusterWizard';
|
||||
import { DeploymentInputDialog } from '../ui/deploymentInputDialog';
|
||||
import { NotebookWizard } from '../ui/notebookWizard/notebookWizard';
|
||||
@@ -20,6 +21,7 @@ import { KubeService } from './kubeService';
|
||||
import { INotebookService } from './notebookService';
|
||||
import { IPlatformService } from './platformService';
|
||||
import { IToolsService } from './toolsService';
|
||||
import * as loc from './../localizedConstants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -46,6 +48,7 @@ export class ResourceTypeService implements IResourceTypeService {
|
||||
extensionResourceTypes.forEach((resourceType: ResourceType) => {
|
||||
this.updatePathProperties(resourceType, extension.extensionPath);
|
||||
resourceType.getProvider = (selectedOptions) => { return this.getProvider(resourceType, selectedOptions); };
|
||||
resourceType.getOkButtonText = (selectedOptions) => { return this.getOkButtonText(resourceType, selectedOptions); };
|
||||
this._resourceTypes.push(resourceType);
|
||||
});
|
||||
}
|
||||
@@ -78,6 +81,9 @@ export class ResourceTypeService implements IResourceTypeService {
|
||||
else if ('azureSQLVMWizard' in provider) {
|
||||
this.updateNotebookPath(provider.azureSQLVMWizard, extensionPath);
|
||||
}
|
||||
else if ('azureSQLDBWizard' in provider) {
|
||||
this.updateNotebookPath(provider.azureSQLDBWizard, extensionPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -187,7 +193,8 @@ export class ResourceTypeService implements IResourceTypeService {
|
||||
&& !instanceOfDownloadDeploymentProvider(provider)
|
||||
&& !instanceOfWebPageDeploymentProvider(provider)
|
||||
&& !instanceOfCommandDeploymentProvider(provider)
|
||||
&& !instanceOfAzureSQLVMDeploymentProvider(provider)) {
|
||||
&& !instanceOfAzureSQLVMDeploymentProvider(provider)
|
||||
&& !instanceOfAzureSQLDBDeploymentProvider(provider)) {
|
||||
errorMessages.push(`No deployment method defined for the provider, ${providerPositionInfo}`);
|
||||
}
|
||||
|
||||
@@ -245,6 +252,21 @@ export class ResourceTypeService implements IResourceTypeService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ok button text based on the selected options
|
||||
*/
|
||||
private getOkButtonText(resourceType: ResourceType, selectedOptions: { option: string, value: string }[]): string | undefined {
|
||||
if (resourceType.okButtonText && selectedOptions.length === 1) {
|
||||
const optionGiven = `${selectedOptions[0].option}=${selectedOptions[0].value}`;
|
||||
for (const possibleOption of resourceType.okButtonText) {
|
||||
if (possibleOption.when === optionGiven || possibleOption.when === undefined || possibleOption.when.toString().toLowerCase() === 'true') {
|
||||
return possibleOption.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return loc.select;
|
||||
}
|
||||
|
||||
public startDeployment(provider: DeploymentProvider): void {
|
||||
const self = this;
|
||||
if (instanceOfWizardDeploymentProvider(provider)) {
|
||||
@@ -283,6 +305,9 @@ export class ResourceTypeService implements IResourceTypeService {
|
||||
} else if (instanceOfAzureSQLVMDeploymentProvider(provider)) {
|
||||
const wizard = new DeployAzureSQLVMWizard(provider.azureSQLVMWizard, this.notebookService, this.toolsService);
|
||||
wizard.open();
|
||||
} else if (instanceOfAzureSQLDBDeploymentProvider(provider)) {
|
||||
const wizard = new DeployAzureSQLDBWizard(provider.azureSQLDBWizard, this.notebookService, this.toolsService);
|
||||
wizard.open();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user