fixing model view issues (#1737)

* fixing model view issues
This commit is contained in:
Leila Lali
2018-06-26 16:40:41 -07:00
committed by GitHub
parent ca5e1e6133
commit 549037f744
6 changed files with 26 additions and 11 deletions

View File

@@ -131,7 +131,7 @@ export default class MainController implements vscode.Disposable {
}); });
dropdown.onValueChanged((params) => { dropdown.onValueChanged((params) => {
vscode.window.showInformationMessage(inputBox2.value); vscode.window.showInformationMessage(inputBox2.value);
inputBox.value = dropdown.value; inputBox.value = dropdown.value.toString();
}); });
let radioButton = view.modelBuilder.radioButton() let radioButton = view.modelBuilder.radioButton()
.withProperties({ .withProperties({

View File

@@ -94,8 +94,8 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
} }
public layout(): void { public layout(): void {
if (this._componentInstance && this._componentInstance.layout) { if (this.componentInstance && this.componentInstance.layout) {
this._componentInstance.layout(); this.componentInstance.layout();
} }
} }
@@ -110,6 +110,12 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
}; };
} }
private get componentInstance(): IComponent {
if (!this._componentInstance) {
this.loadComponent();
}
return this._componentInstance;
}
private loadComponent(): void { private loadComponent(): void {
if (!this.descriptor || !this.descriptor.type) { if (!this.descriptor || !this.descriptor.type) {

View File

@@ -26,7 +26,7 @@ import * as sqlops from 'sqlops';
selector: 'modelview-content', selector: 'modelview-content',
template: ` template: `
<div *ngIf="rootDescriptor" style="width: 100%; height: 100%;"> <div *ngIf="rootDescriptor" style="width: 100%; height: 100%;">
<model-component-wrapper [descriptor]="rootDescriptor" [modelStore]="modelStore"> <model-component-wrapper style="display: block; height: 100%" [descriptor]="rootDescriptor" [modelStore]="modelStore">
</model-component-wrapper> </model-component-wrapper>
</div> </div>
` `

View File

@@ -26,10 +26,11 @@ import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox.component';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Registry } from 'vs/platform/registry/common/platform'; import { Registry } from 'vs/platform/registry/common/platform';
export const DialogModule = (params, selector: string, instantiationService: IInstantiationService): any => {
/* Model-backed components */ /* Model-backed components */
let extensionComponents = Registry.as<IComponentRegistry>(Extensions.ComponentContribution).getAllCtors(); let extensionComponents = Registry.as<IComponentRegistry>(Extensions.ComponentContribution).getAllCtors();
export const DialogModule = (params, selector: string, instantiationService: IInstantiationService): any => {
@NgModule({ @NgModule({
declarations: [ declarations: [
Checkbox, Checkbox,

View File

@@ -93,12 +93,12 @@ export class DialogPane extends Disposable implements IThemable {
} }
private getTabDimension(): DOM.Dimension { private getTabDimension(): DOM.Dimension {
return new DOM.Dimension(DOM.getContentWidth(this._body), DOM.getContentHeight(this._body)); return new DOM.Dimension(DOM.getContentWidth(this._body) - 5, DOM.getContentHeight(this._body) - 5);
} }
public layout(): void { public layout(): void {
if (this._tabbedPanel) { if (this._tabbedPanel) {
this._tabbedPanel.layout(new DOM.Dimension(DOM.getContentWidth(this._body), DOM.getContentHeight(this._body))); this._tabbedPanel.layout(this.getTabDimension());
this._onTabChange.fire(this._selectedTabContent); this._onTabChange.fire(this._selectedTabContent);
} }
} }

View File

@@ -314,8 +314,16 @@ declare module 'sqlops' {
value?: string; value?: string;
actions?: ActionDescriptor[]; actions?: ActionDescriptor[];
status?: StatusIndicator; status?: StatusIndicator;
/**
* Returns true if the card is selected
*/
selected?: boolean; selected?: boolean;
cardType: CardType;
/**
* Card Type, default: Details
*/
cardType?: CardType;
} }
export type InputBoxInputType = 'color' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'range' | 'search' | 'text' | 'time' | 'url' | 'week'; export type InputBoxInputType = 'color' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'range' | 'search' | 'text' | 'time' | 'url' | 'week';