mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-31 06:41:35 +00:00
Remove Explorer.databaseAccount (#717)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
@@ -108,6 +108,8 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
this.collectionWithThroughputInShared = ko.observable<boolean>(false);
|
||||
this.databaseIds = ko.observableArray<string>();
|
||||
this.uniqueKeys = ko.observableArray<DynamicListItem>();
|
||||
this.isSharedAutoPilotSelected = ko.observable<boolean>();
|
||||
this.isAutoPilotSelected = ko.observable<boolean>();
|
||||
|
||||
if (this.container) {
|
||||
this.container.databases.subscribe((newDatabases: ViewModels.Database[]) => {
|
||||
@@ -177,7 +179,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
return "";
|
||||
}
|
||||
|
||||
const account = this.container.databaseAccount();
|
||||
const { databaseAccount: account } = userContext;
|
||||
if (!account) {
|
||||
return "";
|
||||
}
|
||||
@@ -235,7 +237,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
return "";
|
||||
}
|
||||
|
||||
const account = this.container.databaseAccount();
|
||||
const { databaseAccount: account } = userContext;
|
||||
if (!account) {
|
||||
return "";
|
||||
}
|
||||
@@ -523,10 +525,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
});
|
||||
|
||||
this.isFreeTierAccount = ko.computed<boolean>(() => {
|
||||
const databaseAccount = this.container && this.container.databaseAccount && this.container.databaseAccount();
|
||||
const isFreeTierAccount =
|
||||
databaseAccount && databaseAccount.properties && databaseAccount.properties.enableFreeTier;
|
||||
return isFreeTierAccount;
|
||||
return userContext?.databaseAccount?.properties?.enableFreeTier;
|
||||
});
|
||||
|
||||
this.showUpsellMessage = ko.pureComputed(() => {
|
||||
@@ -596,9 +595,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
});
|
||||
|
||||
this._isSynapseLinkEnabled = ko.computed(() => {
|
||||
const databaseAccount =
|
||||
(this.container && this.container.databaseAccount && this.container.databaseAccount()) ||
|
||||
({} as DataModels.DatabaseAccount);
|
||||
const databaseAccount = userContext?.databaseAccount || ({} as DataModels.DatabaseAccount);
|
||||
const properties = databaseAccount.properties || ({} as DataModels.DatabaseAccountExtendedProperties);
|
||||
|
||||
// TODO: remove check for capability once all accounts have been migrated
|
||||
@@ -641,7 +638,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
}
|
||||
|
||||
public getSharedThroughputDefault(): boolean {
|
||||
const subscriptionType = userContext.subscriptionType;
|
||||
const { subscriptionType } = userContext;
|
||||
if (subscriptionType === SubscriptionType.EA || this.container.isServerlessEnabled()) {
|
||||
return false;
|
||||
}
|
||||
@@ -809,7 +806,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
let indexingPolicy: DataModels.IndexingPolicy;
|
||||
let createMongoWildcardIndex: boolean;
|
||||
// todo - remove mongo indexing policy ticket # 616274
|
||||
if (userContext.apiType === "Mongo" && this.container.isEnableMongoCapabilityPresent()) {
|
||||
if (userContext.apiType === "Mongo") {
|
||||
createMongoWildcardIndex = this.shouldCreateMongoWildcardIndex();
|
||||
} else if (this.showIndexingOptionsForSharedThroughput()) {
|
||||
if (this.useIndexingForSharedThroughput()) {
|
||||
|
||||
Reference in New Issue
Block a user