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:
Alan Ren
2019-10-16 20:41:15 -07:00
committed by GitHub
parent 5d4da455bd
commit 2ab7a47353
40 changed files with 2019 additions and 730 deletions

View File

@@ -126,6 +126,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
let button = this._buttons.get(handle);
if (!button) {
button = new DialogButton(details.label, details.enabled);
button.position = details.position;
button.hidden = details.hidden;
button.onClick(() => this.onButtonClick(handle));
this._buttons.set(handle, button);
@@ -134,6 +135,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
button.enabled = details.enabled;
button.hidden = details.hidden;
button.focused = details.focused;
button.position = details.position;
}
return Promise.resolve();

View File

@@ -74,7 +74,7 @@ class ModelBuilderImpl implements azdata.ModelBuilder {
groupContainer(): azdata.GroupBuilder {
let id = this.getNextComponentId();
let container: GenericContainerBuilder<azdata.GroupContainer, any, any> = new GenericContainerBuilder<azdata.GroupContainer, azdata.GroupLayout, azdata.GroupItemLayout>(this._proxy, this._handle, ModelComponentTypes.Group, id);
let container = new GroupContainerBuilder(this._proxy, this._handle, ModelComponentTypes.Group, id);
this._componentBuilders.set(id, container);
return container;
}
@@ -422,6 +422,12 @@ class FormContainerBuilder extends GenericContainerBuilder<azdata.FormContainer,
}
}
class GroupContainerBuilder extends ContainerBuilderImpl<azdata.GroupContainer, azdata.GroupLayout, azdata.GroupItemLayout> {
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) {
super(new GroupContainerComponentWrapper(proxy, handle, type, id));
}
}
class ToolbarContainerBuilder extends GenericContainerBuilder<azdata.ToolbarContainer, azdata.ToolbarLayout, any> implements azdata.ToolbarBuilder {
withToolbarItems(components: azdata.ToolbarComponent[]): azdata.ContainerBuilder<azdata.ToolbarContainer, any, any> {
this._component.itemConfigs = components.map(item => {
@@ -1291,7 +1297,7 @@ class DropDownWrapper extends ComponentWrapper implements azdata.DropDownCompone
public get value(): string | azdata.CategoryValue {
let val = this.properties['value'];
if (!val && this.values && this.values.length > 0) {
if (!this.editable && !val && this.values && this.values.length > 0) {
val = this.values[0];
}
return val;
@@ -1545,6 +1551,19 @@ class HyperlinkComponentWrapper extends ComponentWrapper implements azdata.Hyper
}
}
class GroupContainerComponentWrapper extends ComponentWrapper implements azdata.GroupContainer {
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) {
super(proxy, handle, type, id);
this.properties = {};
}
public get collapsed(): boolean {
return this.properties['collapsed'];
}
public set collapsed(v: boolean) {
this.setProperty('collapsed', v);
}
}
class ModelViewImpl implements azdata.ModelView {
public onClosedEmitter = new Emitter<any>();

View File

@@ -208,6 +208,7 @@ class ButtonImpl implements azdata.window.Button {
private _enabled: boolean;
private _hidden: boolean;
private _focused: boolean;
private _position: azdata.window.DialogButtonPosition;
private _onClick = new Emitter<void>();
public onClick = this._onClick.event;
@@ -215,6 +216,7 @@ class ButtonImpl implements azdata.window.Button {
constructor(private _extHostModelViewDialog: ExtHostModelViewDialog) {
this._enabled = true;
this._hidden = false;
this._position = 'right';
}
public get label(): string {
@@ -244,6 +246,15 @@ class ButtonImpl implements azdata.window.Button {
this._extHostModelViewDialog.updateButton(this);
}
public get position(): azdata.window.DialogButtonPosition {
return this._position;
}
public set position(value: azdata.window.DialogButtonPosition) {
this._position = value;
this._extHostModelViewDialog.updateButton(this);
}
public get focused(): boolean {
return this._focused;
}
@@ -471,10 +482,10 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
return handle;
}
private getHandle(item: azdata.window.Button | azdata.window.Dialog | azdata.window.DialogTab
| azdata.window.ModelViewPanel | azdata.window.Wizard | azdata.window.WizardPage | azdata.workspace.ModelViewEditor) {
public getHandle(item: azdata.window.Button | azdata.window.Dialog | azdata.window.DialogTab
| azdata.window.ModelViewPanel | azdata.window.Wizard | azdata.window.WizardPage | azdata.workspace.ModelViewEditor, createIfNotFound: boolean = true) {
let handle = this._objectHandles.get(item);
if (handle === undefined) {
if (createIfNotFound && handle === undefined) {
handle = ExtHostModelViewDialog.getNewHandle();
this._objectHandles.set(item, handle);
this._objectsByHandle.set(handle, item);
@@ -587,7 +598,8 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
label: button.label,
enabled: button.enabled,
hidden: button.hidden,
focused: button.focused
focused: button.focused,
position: button.position
});
}
@@ -614,11 +626,12 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
return tab;
}
public createButton(label: string): azdata.window.Button {
public createButton(label: string, position: azdata.window.DialogButtonPosition = 'right'): azdata.window.Button {
let button = new ButtonImpl(this);
this.getHandle(button);
this.registerOnClickCallback(button, button.getOnClickCallback());
button.label = label;
button.position = position;
return button;
}

View File

@@ -413,8 +413,8 @@ export function createAdsApiFactory(accessor: ServicesAccessor): IAdsExtensionAp
createTab(title: string): azdata.window.DialogTab {
return extHostModelViewDialog.createTab(title, extension);
},
createButton(label: string): azdata.window.Button {
return extHostModelViewDialog.createButton(label);
createButton(label: string, position: azdata.window.DialogButtonPosition = 'right'): azdata.window.Button {
return extHostModelViewDialog.createButton(label, position);
},
openDialog(dialog: azdata.window.Dialog) {
return extHostModelViewDialog.openDialog(dialog);

View File

@@ -253,6 +253,7 @@ export interface IModelViewButtonDetails {
enabled: boolean;
hidden: boolean;
focused?: boolean;
position?: 'left' | 'right';
}
export interface IModelViewWizardPageDetails {

View File

@@ -10,7 +10,7 @@ import {
} from '@angular/core';
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
import { GroupLayout } from 'azdata';
import { GroupLayout, GroupContainerProperties } from 'azdata';
import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase';
@@ -37,7 +37,6 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
@Input() modelStore: IModelStore;
private _containerLayout: GroupLayout;
private _collapsed: boolean;
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
@@ -45,7 +44,7 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) el: ElementRef) {
super(changeRef, el);
this._collapsed = false;
this.collapsed = false;
}
ngOnInit(): void {
@@ -63,10 +62,18 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
public setLayout(layout: GroupLayout): void {
this._containerLayout = layout;
this._collapsed = !!layout.collapsed;
this.collapsed = !!layout.collapsed;
this.layout();
}
public set collapsed(newValue: boolean) {
this.setPropertyFromUI<GroupContainerProperties, boolean>((properties, value) => { properties.collapsed = value; }, newValue);
}
public get collapsed(): boolean {
return this.getPropertyOrDefault<GroupContainerProperties, boolean>((props) => props.collapsed, false);
}
private hasHeader(): boolean {
return this._containerLayout && this._containerLayout && this._containerLayout.header !== undefined;
}
@@ -88,12 +95,12 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
}
private getContainerDisplayStyle(): string {
return !this.isCollapsible() || !this._collapsed ? 'block' : 'none';
return !this.isCollapsible() || !this.collapsed ? 'block' : 'none';
}
private getHeaderClass(): string {
if (this.isCollapsible()) {
let modifier = this._collapsed ? 'collapsed' : 'expanded';
let modifier = this.collapsed ? 'collapsed' : 'expanded';
return `modelview-group-header-collapsible ${modifier}`;
} else {
return 'modelview-group-header';
@@ -102,7 +109,7 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
private changeState(): void {
if (this.isCollapsible()) {
this._collapsed = !this._collapsed;
this.collapsed = !this.collapsed;
this._changeRef.detectChanges();
}
}

View File

@@ -41,9 +41,7 @@ export default () => `
<div class="section deploy" style="display:${showDeploySection() ? 'block' : 'none'}">
<h2 class="caption">${escape(localize('welcomePage.deploy', "Deploy"))}</h2>
<ul>
<li><a href="command:azdata.resource.sql-image.deploy">${escape(localize('welcomePage.deploy-image', "Deploy SQL Server on Docker…"))}</a></li>
<li><a href="command:azdata.resource.sql-bdc.deploy">${escape(localize('welcomePage.deploy-bdc', "Deploy SQL Server Big Data Cluster…"))}</a></li>
<li><a href="command:azdata.resource.deploy">${escape(localize('welcomePage.MoreOptions', "More…"))}</a></li>
<li><a href="command:azdata.resource.deploy">${escape(localize('welcomePage.DeploySQLServer', "Deploy SQL Server…"))}</a></li>
</ul>
</div>
<div class="section recent">

View File

@@ -105,10 +105,6 @@ suite('ExtHostModelViewDialog Tests', () => {
});
test('Button clicks are forwarded to the correct button', () => {
// Set up the proxy to record button handles
let handles = [];
mockProxy.setup(x => x.$setButtonDetails(It.isAny(), It.isAny())).callback((handle, details) => handles.push(handle));
// Set up the buttons to record click events
let label1 = 'button_1';
let label2 = 'button_2';
@@ -117,14 +113,16 @@ suite('ExtHostModelViewDialog Tests', () => {
let clickEvents = [];
button1.onClick(() => clickEvents.push(1));
button2.onClick(() => clickEvents.push(2));
const button1Handle = extHostModelViewDialog.getHandle(button1, false);
const button2Handle = extHostModelViewDialog.getHandle(button2, false);
extHostModelViewDialog.updateButton(button1);
extHostModelViewDialog.updateButton(button2);
// If the main thread sends some notifications that the buttons have been clicked
extHostModelViewDialog.$onButtonClick(handles[0]);
extHostModelViewDialog.$onButtonClick(handles[1]);
extHostModelViewDialog.$onButtonClick(handles[1]);
extHostModelViewDialog.$onButtonClick(handles[0]);
extHostModelViewDialog.$onButtonClick(button1Handle);
extHostModelViewDialog.$onButtonClick(button2Handle);
extHostModelViewDialog.$onButtonClick(button2Handle);
extHostModelViewDialog.$onButtonClick(button1Handle);
// Then the clicks should have been handled by the expected handlers
assert.deepEqual(clickEvents, [1, 2, 2, 1]);