Move loading component out of common properties component (#10134)

This commit is contained in:
Charles Gagnon
2020-04-22 17:36:21 -07:00
committed by GitHub
parent 52f33cc587
commit 7bd1dfdf0f
5 changed files with 19 additions and 53 deletions

View File

@@ -42,16 +42,6 @@ export default class PropertiesContainerComponent extends ComponentBase implemen
public setProperties(properties: { [key: string]: any; }): void {
super.setProperties(properties);
this._propertiesContainer.displayProperties = this.displayProperties;
this._propertiesContainer.loading = this.loading;
}
public get loading(): boolean {
return this.getPropertyOrDefault<azdata.PropertiesContainerComponentProperties, boolean>((props) => props.loading, true);
}
public set loading(newValue: boolean) {
this.setPropertyFromUI<azdata.PropertiesContainerComponentProperties, boolean>((props, value) => props.loading = value, newValue);
this._propertiesContainer.loading = newValue;
}
public get displayProperties(): DisplayProperty[] {

View File

@@ -52,10 +52,14 @@ const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.Da
@Component({
selector: 'properties-widget',
template: '<properties-container></properties-container>'
template: `
<loading-spinner [loading]="_loading" [loadingMessage]="loadingMessage" [loadingCompletedMessage]="loadingCompletedMessage"></loading-spinner>
<properties-container></properties-container>`
})
export class PropertiesWidgetComponent extends DashboardWidget implements IDashboardWidget, OnInit {
@ViewChild(PropertiesContainer) private _propertiesContainer: PropertiesContainer;
public loadingMessage: string = nls.localize('loadingProperties', "Loading properties");
public loadingCompletedMessage: string = nls.localize('loadingPropertiesCompleted', "Loading properties completed");
private _connection: ConnectionManagementInfo;
constructor(
@@ -245,13 +249,6 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
return val;
}
protected setLoadingStatus(loading: boolean): void {
super.setLoadingStatus(loading);
if (this._inited) {
this._propertiesContainer.loading = loading;
}
}
public get height(): number {
return convertSizeToNumber(this._propertiesContainer.height);
}