Add loading component to Postgres Connection String Page (#14468)

* Add loading component

* Removed setting loading to true in update command
This commit is contained in:
nasc17
2021-03-01 16:45:33 -08:00
committed by GitHub
parent cf08963fc1
commit 9e02123330

View File

@@ -12,6 +12,7 @@ import { PostgresModel } from '../../../models/postgresModel';
export class PostgresConnectionStringsPage extends DashboardPage { export class PostgresConnectionStringsPage extends DashboardPage {
private keyValueContainer?: KeyValueContainer; private keyValueContainer?: KeyValueContainer;
private connectionStringsLoading!: azdata.LoadingComponent;
constructor(protected modelView: azdata.ModelView, private _postgresModel: PostgresModel) { constructor(protected modelView: azdata.ModelView, private _postgresModel: PostgresModel) {
super(modelView); super(modelView);
@@ -59,7 +60,14 @@ export class PostgresConnectionStringsPage extends DashboardPage {
this.keyValueContainer = new KeyValueContainer(this.modelView.modelBuilder, this.getConnectionStrings()); this.keyValueContainer = new KeyValueContainer(this.modelView.modelBuilder, this.getConnectionStrings());
this.disposables.push(this.keyValueContainer); this.disposables.push(this.keyValueContainer);
content.addItem(this.keyValueContainer.container);
this.connectionStringsLoading = this.modelView.modelBuilder.loadingComponent()
.withItem(this.keyValueContainer.container)
.withProperties<azdata.LoadingComponentProperties>({
loading: !this._postgresModel.configLastUpdated
}).component();
content.addItem(this.connectionStringsLoading, { CSSStyles: cssStyles.text });
this.initialized = true; this.initialized = true;
return root; return root;
} }
@@ -88,5 +96,6 @@ export class PostgresConnectionStringsPage extends DashboardPage {
private handleServiceUpdated() { private handleServiceUpdated() {
this.keyValueContainer?.refresh(this.getConnectionStrings()); this.keyValueContainer?.refresh(this.getConnectionStrings());
this.connectionStringsLoading.loading = false;
} }
} }