Show 10k RU instead of unlimited as max RU for unsharded collection (#845)

This commit is contained in:
victor-meng 2021-05-28 18:11:31 -07:00 committed by GitHub
parent 04b3ef051a
commit 7d0be7d355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -4,7 +4,7 @@ import { ThroughputInput } from "./ThroughputInput";
const props = { const props = {
isDatabase: false, isDatabase: false,
showFreeTierExceedThroughputTooltip: true, showFreeTierExceedThroughputTooltip: true,
isSharded: false, isSharded: true,
setThroughputValue: () => jest.fn(), setThroughputValue: () => jest.fn(),
setIsAutoscale: () => jest.fn(), setIsAutoscale: () => jest.fn(),
onCostAcknowledgeChange: () => jest.fn(), onCostAcknowledgeChange: () => jest.fn(),

View File

@ -41,9 +41,16 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
throughputHeaderText = AutoPilotUtils.getAutoPilotHeaderText().toLocaleLowerCase(); throughputHeaderText = AutoPilotUtils.getAutoPilotHeaderText().toLocaleLowerCase();
} else { } else {
const minRU: string = SharedConstants.CollectionCreation.DefaultCollectionRUs400.toLocaleString(); const minRU: string = SharedConstants.CollectionCreation.DefaultCollectionRUs400.toLocaleString();
const maxRU: string = userContext.isTryCosmosDBSubscription
? Constants.TryCosmosExperience.maxRU.toLocaleString() let maxRU: string;
: "unlimited"; if (userContext.isTryCosmosDBSubscription) {
maxRU = Constants.TryCosmosExperience.maxRU.toLocaleString();
} else if (!isSharded) {
maxRU = "10000";
} else {
maxRU = "unlimited";
}
throughputHeaderText = `throughput (${minRU} - ${maxRU} RU/s)`; throughputHeaderText = `throughput (${minRU} - ${maxRU} RU/s)`;
} }
return `${isDatabase ? "Database" : getCollectionName()} ${throughputHeaderText}`; return `${isDatabase ? "Database" : getCollectionName()} ${throughputHeaderText}`;

View File

@ -3,7 +3,7 @@
exports[`ThroughputInput Pane should render Default properly 1`] = ` exports[`ThroughputInput Pane should render Default properly 1`] = `
<ThroughputInput <ThroughputInput
isDatabase={false} isDatabase={false}
isSharded={false} isSharded={true}
onCostAcknowledgeChange={[Function]} onCostAcknowledgeChange={[Function]}
setIsAutoscale={[Function]} setIsAutoscale={[Function]}
setThroughputValue={[Function]} setThroughputValue={[Function]}