From 7d0be7d355b17ddd2db79b39a609350c61dd671b Mon Sep 17 00:00:00 2001 From: victor-meng <56978073+victor-meng@users.noreply.github.com> Date: Fri, 28 May 2021 18:11:31 -0700 Subject: [PATCH] Show 10k RU instead of unlimited as max RU for unsharded collection (#845) --- .../ThroughputInput/ThroughputInput.test.tsx | 2 +- .../Controls/ThroughputInput/ThroughputInput.tsx | 13 ++++++++++--- .../__snapshots__/ThroughputInput.test.tsx.snap | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Explorer/Controls/ThroughputInput/ThroughputInput.test.tsx b/src/Explorer/Controls/ThroughputInput/ThroughputInput.test.tsx index 899a87329..6995f240a 100644 --- a/src/Explorer/Controls/ThroughputInput/ThroughputInput.test.tsx +++ b/src/Explorer/Controls/ThroughputInput/ThroughputInput.test.tsx @@ -4,7 +4,7 @@ import { ThroughputInput } from "./ThroughputInput"; const props = { isDatabase: false, showFreeTierExceedThroughputTooltip: true, - isSharded: false, + isSharded: true, setThroughputValue: () => jest.fn(), setIsAutoscale: () => jest.fn(), onCostAcknowledgeChange: () => jest.fn(), diff --git a/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx b/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx index 9ee8b272e..8c780cebc 100644 --- a/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx +++ b/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx @@ -41,9 +41,16 @@ export const ThroughputInput: FunctionComponent = ({ throughputHeaderText = AutoPilotUtils.getAutoPilotHeaderText().toLocaleLowerCase(); } else { const minRU: string = SharedConstants.CollectionCreation.DefaultCollectionRUs400.toLocaleString(); - const maxRU: string = userContext.isTryCosmosDBSubscription - ? Constants.TryCosmosExperience.maxRU.toLocaleString() - : "unlimited"; + + let maxRU: string; + if (userContext.isTryCosmosDBSubscription) { + maxRU = Constants.TryCosmosExperience.maxRU.toLocaleString(); + } else if (!isSharded) { + maxRU = "10000"; + } else { + maxRU = "unlimited"; + } + throughputHeaderText = `throughput (${minRU} - ${maxRU} RU/s)`; } return `${isDatabase ? "Database" : getCollectionName()} ${throughputHeaderText}`; diff --git a/src/Explorer/Controls/ThroughputInput/__snapshots__/ThroughputInput.test.tsx.snap b/src/Explorer/Controls/ThroughputInput/__snapshots__/ThroughputInput.test.tsx.snap index 4b0afb1ee..d295a7574 100644 --- a/src/Explorer/Controls/ThroughputInput/__snapshots__/ThroughputInput.test.tsx.snap +++ b/src/Explorer/Controls/ThroughputInput/__snapshots__/ThroughputInput.test.tsx.snap @@ -3,7 +3,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `