mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
deploy BDC wizard improvement for CU1 (#7756)
* unified admin user account (#7485) * azdata changes * spaces * error message * comments * support AD authentication for bdc deployment (#7518) * enable ad authentication * remove export for internal interface * add comments * more changes after testing * update notebooks * escape slash * more comments * Update deploy-bdc-aks.ipynb * Update deploy-bdc-existing-aks.ipynb * Update deploy-bdc-existing-kubeadm.ipynb * AD changes and review feedback (#7618) * enable ad authentication * remove export for internal interface * add comments * more changes after testing * update notebooks * escape slash * more comments * Update deploy-bdc-aks.ipynb * Update deploy-bdc-existing-aks.ipynb * Update deploy-bdc-existing-kubeadm.ipynb * address comments from scenario review (#7546) * support AD authentication for bdc deployment (#7518) * enable ad authentication * remove export for internal interface * add comments * more changes after testing * update notebooks * escape slash * more comments * Update deploy-bdc-aks.ipynb * Update deploy-bdc-existing-aks.ipynb * Update deploy-bdc-existing-kubeadm.ipynb * scenario review feedbacks * more fixes * adjust the display order of resource types * different way to implement left side buttons * revert unwanted changes * rename variable * more fixes for the scenario review feedback (#7589) * fix more issues * add help links * model view readonly text with links * fix size string * address comments * update notebooks * text update * address the feedback of 2nd round of deploy BDC wizard review (#7646) * 2nd review meeting comments * fix the unit test failure * recent changes in azdata * notebook background execution with azdata (#7741) * notebook background execution with azdata * prompt to open notebook in case of failure * fix path quote issue * better temp file handling * expose docker settings (#7751) * add docker settings * new icon for container image
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DialogInfoBase, FieldType, FieldInfo, SectionInfo, LabelPosition } from '../interfaces';
|
||||
import { DialogInfoBase, FieldType, FieldInfo, SectionInfo, LabelPosition, FontWeight, FontStyle } from '../interfaces';
|
||||
import { Model } from './model';
|
||||
import { getDateTimeString } from '../utils';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -40,7 +41,6 @@ export interface WizardPageContext extends CreateContext {
|
||||
container: azdata.window.Wizard;
|
||||
}
|
||||
|
||||
|
||||
export interface SectionContext extends CreateContext {
|
||||
sectionInfo: SectionInfo;
|
||||
view: azdata.ModelView;
|
||||
@@ -70,12 +70,13 @@ export function createTextInput(view: azdata.ModelView, inputInfo: { defaultValu
|
||||
}).component();
|
||||
}
|
||||
|
||||
export function createLabel(view: azdata.ModelView, info: { text: string, description?: string, required?: boolean, width?: string, fontStyle?: string }): azdata.TextComponent {
|
||||
export function createLabel(view: azdata.ModelView, info: { text: string, description?: string, required?: boolean, width?: string, fontStyle?: FontStyle, fontWeight?: FontWeight, links?: azdata.LinkArea[] }): azdata.TextComponent {
|
||||
const text = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
value: info.text,
|
||||
description: info.description,
|
||||
requiredIndicator: info.required,
|
||||
CSSStyles: { 'font-style': info.fontStyle || 'normal' }
|
||||
CSSStyles: { 'font-style': info.fontStyle || 'normal', 'font-weight': info.fontWeight || 'normal' },
|
||||
links: info.links
|
||||
}).component();
|
||||
text.width = info.width;
|
||||
return text;
|
||||
@@ -101,11 +102,13 @@ export function createCheckbox(view: azdata.ModelView, info: { initialValue: boo
|
||||
}).component();
|
||||
}
|
||||
|
||||
export function createDropdown(view: azdata.ModelView, info: { defaultValue?: string | azdata.CategoryValue, values?: string[] | azdata.CategoryValue[], width?: string }): azdata.DropDownComponent {
|
||||
export function createDropdown(view: azdata.ModelView, info: { defaultValue?: string | azdata.CategoryValue, values?: string[] | azdata.CategoryValue[], width?: string, editable?: boolean, required?: boolean }): azdata.DropDownComponent {
|
||||
return view.modelBuilder.dropDown().withProperties<azdata.DropDownProperties>({
|
||||
values: info.values,
|
||||
value: info.defaultValue,
|
||||
width: info.width
|
||||
width: info.width,
|
||||
editable: info.editable,
|
||||
fireOnTextChange: true
|
||||
}).component();
|
||||
}
|
||||
|
||||
@@ -232,7 +235,6 @@ function addLabelInputPairToContainer(view: azdata.ModelView, components: azdata
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function processField(context: FieldContext): void {
|
||||
switch (context.fieldInfo.type) {
|
||||
case FieldType.Options:
|
||||
@@ -263,19 +265,21 @@ function processField(context: FieldContext): void {
|
||||
}
|
||||
|
||||
function processOptionsTypeField(context: FieldContext): void {
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: false, width: context.fieldInfo.labelWidth });
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const dropdown = createDropdown(context.view, {
|
||||
values: context.fieldInfo.options,
|
||||
defaultValue: context.fieldInfo.defaultValue,
|
||||
width: context.fieldInfo.inputWidth
|
||||
width: context.fieldInfo.inputWidth,
|
||||
editable: context.fieldInfo.editable,
|
||||
required: context.fieldInfo.required
|
||||
});
|
||||
context.onNewInputComponentCreated(context.fieldInfo.variableName!, dropdown);
|
||||
addLabelInputPairToContainer(context.view, context.components, label, dropdown, context.fieldInfo.labelPosition);
|
||||
}
|
||||
|
||||
function processDateTimeTextField(context: FieldContext): void {
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth });
|
||||
const defaultValue = context.fieldInfo.defaultValue + new Date().toISOString().slice(0, 19).replace(/[^0-9]/g, ''); // Take the date time information and only leaving the numbers
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const defaultValue = context.fieldInfo.defaultValue + getDateTimeString();
|
||||
const input = context.view.modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
|
||||
value: defaultValue,
|
||||
ariaLabel: context.fieldInfo.label,
|
||||
@@ -289,7 +293,7 @@ function processDateTimeTextField(context: FieldContext): void {
|
||||
}
|
||||
|
||||
function processNumberField(context: FieldContext): void {
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth });
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const input = createNumberInput(context.view, {
|
||||
defaultValue: context.fieldInfo.defaultValue,
|
||||
ariaLabel: context.fieldInfo.label,
|
||||
@@ -304,7 +308,7 @@ function processNumberField(context: FieldContext): void {
|
||||
}
|
||||
|
||||
function processTextField(context: FieldContext): void {
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth });
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const input = createTextInput(context.view, {
|
||||
defaultValue: context.fieldInfo.defaultValue,
|
||||
ariaLabel: context.fieldInfo.label,
|
||||
@@ -317,7 +321,7 @@ function processTextField(context: FieldContext): void {
|
||||
}
|
||||
|
||||
function processPasswordField(context: FieldContext): void {
|
||||
const passwordLabel = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth });
|
||||
const passwordLabel = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const passwordInput = context.view.modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
|
||||
ariaLabel: context.fieldInfo.label,
|
||||
inputType: 'password',
|
||||
@@ -343,7 +347,7 @@ function processPasswordField(context: FieldContext): void {
|
||||
|
||||
if (context.fieldInfo.confirmationRequired) {
|
||||
const passwordNotMatchMessage = getPasswordMismatchMessage(context.fieldInfo.label);
|
||||
const confirmPasswordLabel = createLabel(context.view, { text: context.fieldInfo.confirmationLabel!, required: true, width: context.fieldInfo.labelWidth });
|
||||
const confirmPasswordLabel = createLabel(context.view, { text: context.fieldInfo.confirmationLabel!, required: true, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const confirmPasswordInput = context.view.modelBuilder.inputBox().withProperties<azdata.InputBoxProperties>({
|
||||
ariaLabel: context.fieldInfo.confirmationLabel,
|
||||
inputType: 'password',
|
||||
@@ -373,8 +377,8 @@ function processPasswordField(context: FieldContext): void {
|
||||
}
|
||||
|
||||
function processReadonlyTextField(context: FieldContext): void {
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: false, width: context.fieldInfo.labelWidth });
|
||||
const text = createLabel(context.view, { text: context.fieldInfo.defaultValue!, description: '', required: false, width: context.fieldInfo.inputWidth, fontStyle: context.fieldInfo.fontStyle });
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: false, width: context.fieldInfo.labelWidth, fontWeight: context.fieldInfo.labelFontWeight });
|
||||
const text = createLabel(context.view, { text: context.fieldInfo.defaultValue!, description: '', required: false, width: context.fieldInfo.inputWidth, fontStyle: context.fieldInfo.fontStyle, links: context.fieldInfo.links });
|
||||
addLabelInputPairToContainer(context.view, context.components, label, text, context.fieldInfo.labelPosition);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user