mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Lazy load database offer in data explorer (#208)
Co-authored-by: zfoster <notzachfoster@gmail.com>
This commit is contained in:
@@ -681,7 +681,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
return true;
|
||||
};
|
||||
|
||||
public open(databaseId?: string) {
|
||||
public async open(databaseId?: string) {
|
||||
super.open();
|
||||
// TODO: Figure out if a database level partition split is about to happen once shared throughput read is available
|
||||
this.formWarnings("");
|
||||
@@ -715,6 +715,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
dataExplorerArea: Constants.Areas.ContextualPane
|
||||
};
|
||||
|
||||
await this.container.loadDatabaseOffers();
|
||||
this._onDatabasesChange(this.container.databases());
|
||||
this._setFocus();
|
||||
|
||||
@@ -748,8 +749,6 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
const cachedDatabaseIdsList = _.map(newDatabaseIds, (database: ViewModels.Database) => {
|
||||
if (database && database.offer && database.offer()) {
|
||||
this._databaseOffers.set(database.id(), database.offer());
|
||||
} else if (database && database.isDatabaseShared && database.isDatabaseShared()) {
|
||||
database.readSettings();
|
||||
}
|
||||
|
||||
return database.id();
|
||||
|
||||
@@ -268,8 +268,6 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
|
||||
const cachedKeyspaceIdsList = _.map(newKeyspaceIds, (keyspace: ViewModels.Database) => {
|
||||
if (keyspace && keyspace.offer && !!keyspace.offer()) {
|
||||
this.keyspaceOffers.set(keyspace.id(), keyspace.offer());
|
||||
} else if (keyspace && keyspace.isDatabaseShared && keyspace.isDatabaseShared()) {
|
||||
keyspace.readSettings();
|
||||
}
|
||||
return keyspace.id();
|
||||
});
|
||||
|
||||
@@ -132,7 +132,8 @@ export default class DeleteDatabaseConfirmationPane extends ContextualPaneBase {
|
||||
super.resetData();
|
||||
}
|
||||
|
||||
public open() {
|
||||
public async open() {
|
||||
await this.container.loadSelectedDatabaseOffer();
|
||||
this.recordDeleteFeedback(this.shouldRecordFeedback());
|
||||
super.open();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user