Replacing all azdata with az (#16502)

* Changed azdata to az in azcli extension and resource-deployment, and some arc. Removed user, pass, url from controller connect blade. Commented out tests. Ported over work from old branch.

* Changed unit tests, all unit tests passing. Changed parameters to new ones, fixed some Controller Connect issues.

* Connect data controller and create dc working.

* Changed az back to azdata in necessary places in resource-deployment.

* Changed notebook values and added namespace to some params.

* Added some changes from PR to this branch

* Changed azdata.ts to az.ts and changed subscription parameter

* Brought over changes from azcli PR into this branch.

* added endpoint, username, password to getIsPassword

* Changed notebooks to use proper az params, hard coded in some values to verify it is working, removed some variableNames from package.json.

* Changed -sc to --storage-class in notebook

* Added namespace to SQL deploy, deleted dc create in api

* Deleted more dc create code and uncommented findAz() with unfinished work on Do Not Ask Again.

* Removed (preview) from extensions/arc and extensions/azcli excluding preview:true in package.json

* Commented out install/update prompts until DoNotAskAgain is implemented

* Fixed bugs: JSON Output errors are now being caught, --infrastructure now has a required UI component with dropdown options, config page loads properly, SQL create flags use full names instead of shortnames.

* Adds validation to pg extensions and bug fixes (#16486)

* Extensions

* Server parameters

* Change locaiton of postgres extensions, pr fixes

* Change location of list

* List spacing

* Commented out Don't Ask Again prompt implementation.

* Uncommented header of a test file.

* Added Azure CLI arcdata extension to Prerequisites

* Reverted package.json and yarn.lock

* Took away casting of stderr and stdout in executeCommand.

* Deleted override function for initializeFields in connectControllerDialog.ts

* Removed fakeAzApi for testing and added back in (Preview)

* Removed en-us from python notebook links.

* Deleted azdata tool from tool tests in resource-deployment

* Deleted another instance of azdata in tool test

* Add back in azdata tooltype

* Remove en-us

* Replaced AzdataTool in typings

* Reverting adding azdata tool back in

* Changed Azdata to AzdataToolOld

* Added back azdata tool type

* Added AzdataToolOld to tool types

* fix test

Co-authored-by: Candice Ye <canye@microsoft.com>
Co-authored-by: nasc17 <nasc@microsoft.com>
Co-authored-by: nasc17 <69922333+nasc17@users.noreply.github.com>
Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
Candice Ye
2021-08-01 15:12:24 -07:00
committed by GitHub
parent 65cc61fdbd
commit 914fe8fc29
58 changed files with 1623 additions and 2032 deletions

View File

@@ -11,7 +11,7 @@ import { IOptionsSourceProvider } from 'resource-deployment';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { getDateTimeString, getErrorMessage, isUserCancelledError, throwUnless } from '../common/utils';
import { AzureAccountFieldInfo, AzureLocationsFieldInfo, ComponentCSSStyles, DialogInfoBase, FieldInfo, FieldType, FilePickerFieldInfo, InitialVariableValues, instanceOfDynamicEnablementInfo, IOptionsSource, KubeClusterContextFieldInfo, LabelPosition, NoteBookEnvironmentVariablePrefix, OptionsInfo, OptionsType, PageInfoBase, RowInfo, SectionInfo, TextCSSStyles } from '../interfaces';
import { AzureAccountFieldInfo, AzureLocationsFieldInfo, ComponentCSSStyles, DialogInfoBase, FieldInfo, FieldType, FilePickerFieldInfo, InfrastructureFieldInfo, InitialVariableValues, instanceOfDynamicEnablementInfo, IOptionsSource, KubeClusterContextFieldInfo, LabelPosition, NoteBookEnvironmentVariablePrefix, OptionsInfo, OptionsType, PageInfoBase, RowInfo, SectionInfo, TextCSSStyles } from '../interfaces';
import * as loc from '../localizedConstants';
import { apiService } from '../services/apiService';
import { valueProviderService } from '../services/valueProviderService';
@@ -112,6 +112,10 @@ interface AzureLocationsFieldContext extends FieldContext {
fieldInfo: AzureLocationsFieldInfo;
}
interface InfrastructureFieldContext extends FieldContext {
fieldInfo: InfrastructureFieldInfo;
}
interface AzureAccountFieldContext extends FieldContext {
fieldInfo: AzureAccountFieldInfo;
}
@@ -573,6 +577,9 @@ async function processField(context: FieldContext): Promise<void> {
case FieldType.AzureLocations:
await processAzureLocationsField(context);
break;
case FieldType.Infrastructure:
await processInfrastructureField(context);
break;
case FieldType.FilePicker:
processFilePickerField(context);
break;
@@ -1526,6 +1533,55 @@ async function processAzureLocationsField(context: AzureLocationsFieldContext):
return locationInputInfo.component;
}
/**
* An Infrastructure field consists of a dropdown field for infrastructure types
* @param context The context to use to create the field
*/
async function processInfrastructureField(context: InfrastructureFieldContext): Promise<void> {
const label = createLabel(context.view, {
text: context.fieldInfo.label || loc.infrastructure,
required: context.fieldInfo.required,
width: context.fieldInfo.labelWidth,
cssStyles: context.fieldInfo.labelCSSStyles
});
const defaultValue = context.initialVariableValues?.[context.fieldInfo.infrastructureName || '']?.toString() ?? (context.fieldInfo.required ? undefined : '');
let infrastructureInputInfo: InputComponentInfo<AzureComponent>;
// If we have an default value then we don't allow users to modify it - so use a disabled text input box instead
if (defaultValue) {
infrastructureInputInfo = createInputBoxInputInfo(context.view, {
type: 'text',
defaultValue: defaultValue,
ariaLabel: loc.infrastructure,
required: context.fieldInfo.required,
width: context.fieldInfo.inputWidth,
enabled: false
});
} else {
const infrastructureValues = context.fieldInfo.infrastructure;
infrastructureInputInfo = createDropdownInputInfo(context.view, {
defaultValue: infrastructureValues?.find(l => l === context.fieldInfo.defaultValue),
width: context.fieldInfo.inputWidth,
editable: false,
required: context.fieldInfo.required,
label: loc.infrastructure,
values: infrastructureValues
});
(<InputComponentInfo<azdata.DropDownComponent>>infrastructureInputInfo).component.fireOnTextChange = true;
}
infrastructureInputInfo.labelComponent = label;
context.fieldInfo.subFields = context.fieldInfo.subFields || [];
if (context.fieldInfo.infrastructureName) {
context.fieldInfo.subFields!.push({
label: label.value!,
variableName: context.fieldInfo.infrastructureName
});
context.onNewInputComponentCreated(context.fieldInfo.infrastructureName, infrastructureInputInfo);
}
context.onNewInputComponentCreated(context.fieldInfo.variableName || context.fieldInfo.label, infrastructureInputInfo);
addLabelInputPairToContainer(context.view, context.components, label, infrastructureInputInfo.component, context.fieldInfo);
}
export function isValidSQLPassword(password: string, userName: string = 'sa'): boolean {
// Validate SQL Server password
const containsUserName = password && userName !== undefined && password.toUpperCase().includes(userName.toUpperCase());