From 0f82ed3749d919d1e72ff0625f28a33528b864ea Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 2 Oct 2020 14:44:12 -0700 Subject: [PATCH] Add checks for serverless account (#244) --- src/Explorer/Tabs/SettingsTab.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Explorer/Tabs/SettingsTab.ts b/src/Explorer/Tabs/SettingsTab.ts index bdc1e18f9..53e2cc25a 100644 --- a/src/Explorer/Tabs/SettingsTab.ts +++ b/src/Explorer/Tabs/SettingsTab.ts @@ -516,6 +516,10 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor return false; } + if (this.container.isServerlessEnabled()) { + return false; + } + const numPartitions = this.collection.quotaInfo().numPartitions; return !!this.collection.partitionKeyProperty || numPartitions > 1; }); @@ -525,7 +529,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor ); this.minRUs = ko.computed(() => { - if (this.isTryCosmosDBSubscription()) { + if (this.isTryCosmosDBSubscription() || this.container.isServerlessEnabled()) { return SharedConstants.CollectionCreation.DefaultCollectionRUs400; } @@ -572,7 +576,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor this.maxRUs = ko.computed(() => { const isTryCosmosDBSubscription = this.isTryCosmosDBSubscription(); - if (isTryCosmosDBSubscription) { + if (isTryCosmosDBSubscription || this.container.isServerlessEnabled()) { return Constants.TryCosmosExperience.maxRU; } @@ -748,7 +752,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor if ( this.rupm() === Constants.RUPMStates.on && this.throughput() > - SharedConstants.CollectionCreation.MaxRUPMPerPartition * this.collection.quotaInfo().numPartitions + SharedConstants.CollectionCreation.MaxRUPMPerPartition * this.collection.quotaInfo()?.numPartitions ) { return false; }