Fix scale tab not showing the correct throughput mode and value and remove freetierautoscalethroughput feature flag (#1245)

This commit is contained in:
victor-meng
2022-03-31 12:13:08 -07:00
committed by GitHub
parent 06f6df83ad
commit 2e3e547a46
10 changed files with 28 additions and 39 deletions

View File

@@ -34,9 +34,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
}: ThroughputInputProps) => {
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
const [throughput, setThroughput] = useState<number>(
isFreeTier && userContext.features.freetierAutoscaleThroughput
? AutoPilotUtils.autoPilotThroughput1K
: AutoPilotUtils.autoPilotThroughput4K
isFreeTier ? AutoPilotUtils.autoPilotThroughput1K : AutoPilotUtils.autoPilotThroughput4K
);
const [isCostAcknowledged, setIsCostAcknowledged] = useState<boolean>(false);
const [throughputError, setThroughputError] = useState<string>("");
@@ -157,10 +155,9 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
const handleOnChangeMode = (event: React.ChangeEvent<HTMLInputElement>, mode: string): void => {
if (mode === "Autoscale") {
const defaultThroughput =
isFreeTier && userContext.features.freetierAutoscaleThroughput
? AutoPilotUtils.autoPilotThroughput1K
: AutoPilotUtils.autoPilotThroughput4K;
const defaultThroughput = isFreeTier
? AutoPilotUtils.autoPilotThroughput1K
: AutoPilotUtils.autoPilotThroughput4K;
setThroughput(defaultThroughput);
setIsAutoScaleSelected(true);
setThroughputValue(defaultThroughput);
@@ -236,11 +233,7 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
}}
onChange={(event, newInput?: string) => onThroughputValueChange(newInput)}
step={AutoPilotUtils.autoPilotIncrementStep}
min={
userContext.features.freetierAutoscaleThroughput
? AutoPilotUtils.autoPilotThroughput1K
: AutoPilotUtils.autoPilotThroughput4K
}
min={AutoPilotUtils.autoPilotThroughput1K}
value={throughput.toString()}
aria-label="Max request units per second"
required={true}

View File

@@ -1638,7 +1638,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
aria-label="Max request units per second"
errorMessage=""
key=".0:$.2"
min={4000}
min={1000}
onChange={[Function]}
required={true}
step={1000}
@@ -1660,7 +1660,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
aria-label="Max request units per second"
deferredValidationTime={200}
errorMessage=""
min={4000}
min={1000}
onChange={[Function]}
required={true}
resizable={true}
@@ -1956,7 +1956,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
aria-invalid={false}
className="ms-TextField-field field-64"
id="TextField2"
min={4000}
min={1000}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}