mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
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:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user