From eb3f6bc93f3184d99b35a2240eecff541eee2cc9 Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Tue, 15 Jul 2025 20:22:06 +0200 Subject: [PATCH] Fabric: set default throughput for new container to 5k (#2190) --- .../Controls/ThroughputInput/ThroughputInput.tsx | 9 +++++---- .../Panes/AddCollectionPanel/AddCollectionPanel.tsx | 6 +++--- src/Utils/AutoPilotUtils.ts | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx b/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx index c72925be0..13a0923f3 100644 --- a/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx +++ b/src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx @@ -5,13 +5,13 @@ import { useDatabases } from "Explorer/useDatabases"; import React, { FunctionComponent, useEffect, useState } from "react"; import * as Constants from "../../../Common/Constants"; import { InfoTooltip } from "../../../Common/Tooltip/InfoTooltip"; +import { isFabricNative } from "../../../Platform/Fabric/FabricUtil"; import * as SharedConstants from "../../../Shared/Constants"; import { userContext } from "../../../UserContext"; import { getCollectionName } from "../../../Utils/APITypeUtils"; import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils"; import * as PricingUtils from "../../../Utils/PricingUtils"; import "./ThroughputInput.less"; -import { isFabricNative } from "../../../Platform/Fabric/FabricUtil"; export interface ThroughputInputProps { isDatabase: boolean; @@ -41,11 +41,12 @@ export const ThroughputInput: FunctionComponent = ({ let defaultThroughput: number; const workloadType: Constants.WorkloadType = getWorkloadType(); - if ( + if (isFabricNative()) { + defaultThroughput = AutoPilotUtils.autoPilotThroughput5K; + } else if ( isFreeTier || isQuickstart || - [Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType) || - isFabricNative() + [Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType) ) { defaultThroughput = AutoPilotUtils.autoPilotThroughput1K; } else if (workloadType === Constants.WorkloadType.Production) { diff --git a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx index e6f26b18b..323ed1bca 100644 --- a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx @@ -52,6 +52,7 @@ import { getCollectionName } from "Utils/APITypeUtils"; import { isCapabilityEnabled, isServerlessAccount, isVectorSearchEnabled } from "Utils/CapabilityUtils"; import { getUpsellMessage } from "Utils/PricingUtils"; import { ValidCosmosDbIdDescription, ValidCosmosDbIdInputPattern } from "Utils/ValidationUtils"; +import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils"; import { CollapsibleSectionComponent } from "../../Controls/CollapsiblePanel/CollapsibleSectionComponent"; import { ThroughputInput } from "../../Controls/ThroughputInput/ThroughputInput"; import { ContainerSampleGenerator } from "../../DataSamples/ContainerSampleGenerator"; @@ -60,7 +61,6 @@ import { useDatabases } from "../../useDatabases"; import { PanelFooterComponent } from "../PanelFooterComponent"; import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent"; import { PanelLoadingScreen } from "../PanelLoadingScreen"; -import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils"; export interface AddCollectionPanelProps { explorer: Explorer; @@ -1355,8 +1355,8 @@ export class AddCollectionPanel extends React.Component