mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 17:22:20 -05:00
Add default model view input types and validation (#1397)
This commit is contained in:
@@ -46,7 +46,7 @@ export class MainThreadModelView extends Disposable implements MainThreadModelVi
|
||||
|
||||
$initializeModel(handle: number, rootComponent: IComponentShape): Thenable<void> {
|
||||
return this.execModelViewAction(handle, (modelView) => {
|
||||
modelView.initializeModel(rootComponent);
|
||||
modelView.initializeModel(rootComponent, (componentId) => this.runCustomValidations(handle, componentId));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,8 +82,12 @@ export class MainThreadModelView extends Disposable implements MainThreadModelVi
|
||||
return this.execModelViewAction(handle, (modelView) => modelView.setProperties(componentId, properties));
|
||||
}
|
||||
|
||||
$notifyValidation(handle: number, componentId: string, valid: boolean): Thenable<void> {
|
||||
return this.execModelViewAction(handle, (modelView) => modelView.setValid(componentId, valid));
|
||||
$validate(handle: number, componentId: string): Thenable<boolean> {
|
||||
return new Promise(resolve => this.execModelViewAction(handle, (modelView) => resolve(modelView.validate(componentId))));
|
||||
}
|
||||
|
||||
private runCustomValidations(handle: number, componentId: string): Thenable<boolean> {
|
||||
return this._proxy.$runCustomValidations(handle, componentId);
|
||||
}
|
||||
|
||||
private execModelViewAction<T>(handle: number, action: (m: IModelView) => T): Thenable<T> {
|
||||
|
||||
Reference in New Issue
Block a user