From 9e02123330301108c4a4d044373b4f209385313b Mon Sep 17 00:00:00 2001 From: nasc17 <69922333+nasc17@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:45:33 -0800 Subject: [PATCH] Add loading component to Postgres Connection String Page (#14468) * Add loading component * Removed setting loading to true in update command --- .../postgres/postgresConnectionStringsPage.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/arc/src/ui/dashboards/postgres/postgresConnectionStringsPage.ts b/extensions/arc/src/ui/dashboards/postgres/postgresConnectionStringsPage.ts index 88b8fd0b43..c601fc508f 100644 --- a/extensions/arc/src/ui/dashboards/postgres/postgresConnectionStringsPage.ts +++ b/extensions/arc/src/ui/dashboards/postgres/postgresConnectionStringsPage.ts @@ -12,6 +12,7 @@ import { PostgresModel } from '../../../models/postgresModel'; export class PostgresConnectionStringsPage extends DashboardPage { private keyValueContainer?: KeyValueContainer; + private connectionStringsLoading!: azdata.LoadingComponent; constructor(protected modelView: azdata.ModelView, private _postgresModel: PostgresModel) { super(modelView); @@ -59,7 +60,14 @@ export class PostgresConnectionStringsPage extends DashboardPage { this.keyValueContainer = new KeyValueContainer(this.modelView.modelBuilder, this.getConnectionStrings()); this.disposables.push(this.keyValueContainer); - content.addItem(this.keyValueContainer.container); + + this.connectionStringsLoading = this.modelView.modelBuilder.loadingComponent() + .withItem(this.keyValueContainer.container) + .withProperties({ + loading: !this._postgresModel.configLastUpdated + }).component(); + + content.addItem(this.connectionStringsLoading, { CSSStyles: cssStyles.text }); this.initialized = true; return root; } @@ -88,5 +96,6 @@ export class PostgresConnectionStringsPage extends DashboardPage { private handleServiceUpdated() { this.keyValueContainer?.refresh(this.getConnectionStrings()); + this.connectionStringsLoading.loading = false; } }