mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Remove infrastructure from resource-deployment (#16520)
This commit is contained in:
@@ -291,19 +291,19 @@
|
|||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"type": "options",
|
||||||
"label": "%arc.data.controller.infrastructure%",
|
"label": "%arc.data.controller.infrastructure%",
|
||||||
"defaultValue": "azure",
|
"defaultValue": "azure",
|
||||||
|
"required": true,
|
||||||
"variableName": "AZDATA_NB_VAR_ARC_INFRASTRUCTURE",
|
"variableName": "AZDATA_NB_VAR_ARC_INFRASTRUCTURE",
|
||||||
"type": "infrastructure",
|
"options": [
|
||||||
"infrastructure": [
|
|
||||||
"azure",
|
"azure",
|
||||||
"gcp",
|
"gcp",
|
||||||
"aws",
|
"aws",
|
||||||
"alibaba",
|
"alibaba",
|
||||||
"onpremises",
|
"onpremises",
|
||||||
"other"
|
"other"
|
||||||
],
|
]
|
||||||
"required": true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -361,11 +361,6 @@ export interface AzureLocationsFieldInfo extends FieldInfo {
|
|||||||
locations?: string[]
|
locations?: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InfrastructureFieldInfo extends FieldInfo {
|
|
||||||
infrastructureName?: string;
|
|
||||||
infrastructure?: string[]
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FilePickerFieldInfo extends FieldInfo {
|
export interface FilePickerFieldInfo extends FieldInfo {
|
||||||
filter: FilePickerFilter;
|
filter: FilePickerFilter;
|
||||||
}
|
}
|
||||||
@@ -401,7 +396,6 @@ export enum FieldType {
|
|||||||
Checkbox = 'checkbox',
|
Checkbox = 'checkbox',
|
||||||
AzureAccount = 'azure_account',
|
AzureAccount = 'azure_account',
|
||||||
AzureLocations = 'azure_locations',
|
AzureLocations = 'azure_locations',
|
||||||
Infrastructure = 'infrastructure',
|
|
||||||
FilePicker = 'file_picker',
|
FilePicker = 'file_picker',
|
||||||
KubeClusterContextPicker = 'kube_cluster_context_picker',
|
KubeClusterContextPicker = 'kube_cluster_context_picker',
|
||||||
KubeStorageClass = 'kube_storage_class'
|
KubeStorageClass = 'kube_storage_class'
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export const subscription = localize('azure.account.subscription', "Subscription
|
|||||||
export const subscriptionDescription = localize('azure.account.subscriptionDescription', "Change the currently selected subscriptions through the 'Select Subscriptions' action on an account listed in the 'Azure' tree view of the 'Connections' viewlet");
|
export const subscriptionDescription = localize('azure.account.subscriptionDescription', "Change the currently selected subscriptions through the 'Select Subscriptions' action on an account listed in the 'Azure' tree view of the 'Connections' viewlet");
|
||||||
export const resourceGroup = localize('azure.account.resourceGroup', "Resource Group");
|
export const resourceGroup = localize('azure.account.resourceGroup', "Resource Group");
|
||||||
export const location = localize('azure.account.location', "Azure Location");
|
export const location = localize('azure.account.location', "Azure Location");
|
||||||
export const infrastructure = localize('azure.account.infrastructure', "Infrastructure");
|
|
||||||
export const browse = localize('filePicker.browse', "Browse");
|
export const browse = localize('filePicker.browse', "Browse");
|
||||||
export const select = localize('button.label', "Select");
|
export const select = localize('button.label', "Select");
|
||||||
export const kubeConfigFilePath = localize('kubeConfigClusterPicker.kubeConfigFilePath', "Kube config file path");
|
export const kubeConfigFilePath = localize('kubeConfigClusterPicker.kubeConfigFilePath', "Kube config file path");
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { IOptionsSourceProvider } from 'resource-deployment';
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { getDateTimeString, getErrorMessage, isUserCancelledError, throwUnless } from '../common/utils';
|
import { getDateTimeString, getErrorMessage, isUserCancelledError, throwUnless } from '../common/utils';
|
||||||
import { AzureAccountFieldInfo, AzureLocationsFieldInfo, ComponentCSSStyles, DialogInfoBase, FieldInfo, FieldType, FilePickerFieldInfo, InfrastructureFieldInfo, InitialVariableValues, instanceOfDynamicEnablementInfo, IOptionsSource, KubeClusterContextFieldInfo, LabelPosition, NoteBookEnvironmentVariablePrefix, OptionsInfo, OptionsType, PageInfoBase, RowInfo, SectionInfo, TextCSSStyles } from '../interfaces';
|
import { AzureAccountFieldInfo, AzureLocationsFieldInfo, ComponentCSSStyles, DialogInfoBase, FieldInfo, FieldType, FilePickerFieldInfo, InitialVariableValues, instanceOfDynamicEnablementInfo, IOptionsSource, KubeClusterContextFieldInfo, LabelPosition, NoteBookEnvironmentVariablePrefix, OptionsInfo, OptionsType, PageInfoBase, RowInfo, SectionInfo, TextCSSStyles } from '../interfaces';
|
||||||
import * as loc from '../localizedConstants';
|
import * as loc from '../localizedConstants';
|
||||||
import { apiService } from '../services/apiService';
|
import { apiService } from '../services/apiService';
|
||||||
import { valueProviderService } from '../services/valueProviderService';
|
import { valueProviderService } from '../services/valueProviderService';
|
||||||
@@ -112,10 +112,6 @@ interface AzureLocationsFieldContext extends FieldContext {
|
|||||||
fieldInfo: AzureLocationsFieldInfo;
|
fieldInfo: AzureLocationsFieldInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InfrastructureFieldContext extends FieldContext {
|
|
||||||
fieldInfo: InfrastructureFieldInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AzureAccountFieldContext extends FieldContext {
|
interface AzureAccountFieldContext extends FieldContext {
|
||||||
fieldInfo: AzureAccountFieldInfo;
|
fieldInfo: AzureAccountFieldInfo;
|
||||||
}
|
}
|
||||||
@@ -577,9 +573,6 @@ async function processField(context: FieldContext): Promise<void> {
|
|||||||
case FieldType.AzureLocations:
|
case FieldType.AzureLocations:
|
||||||
await processAzureLocationsField(context);
|
await processAzureLocationsField(context);
|
||||||
break;
|
break;
|
||||||
case FieldType.Infrastructure:
|
|
||||||
await processInfrastructureField(context);
|
|
||||||
break;
|
|
||||||
case FieldType.FilePicker:
|
case FieldType.FilePicker:
|
||||||
processFilePickerField(context);
|
processFilePickerField(context);
|
||||||
break;
|
break;
|
||||||
@@ -1533,55 +1526,6 @@ async function processAzureLocationsField(context: AzureLocationsFieldContext):
|
|||||||
return locationInputInfo.component;
|
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 {
|
export function isValidSQLPassword(password: string, userName: string = 'sa'): boolean {
|
||||||
// Validate SQL Server password
|
// Validate SQL Server password
|
||||||
const containsUserName = password && userName !== undefined && password.toUpperCase().includes(userName.toUpperCase());
|
const containsUserName = password && userName !== undefined && password.toUpperCase().includes(userName.toUpperCase());
|
||||||
|
|||||||
Reference in New Issue
Block a user