Allow users to switch between manual and autoscale for fixed collections (#299)
- removed the `isFixed` check in both new and old settings tab so that the options to switch between manual and autoscale shows up for fixed collections - updated the message below the text box to inform the users that the max RU for fixed collections is 10000 - updated validation rule so that the max RU cannot exceed 10000 for fixed collections for both autoscale and manual
This commit is contained in:
parent
e4bab1de4b
commit
294270b6aa
|
@ -98,11 +98,11 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
|
||||||
};
|
};
|
||||||
|
|
||||||
public canThroughputExceedMaximumValue = (): boolean => {
|
public canThroughputExceedMaximumValue = (): boolean => {
|
||||||
const isPublicAzurePortal: boolean =
|
return (
|
||||||
configContext.platform === Platform.Portal && !this.props.container.isRunningOnNationalCloud();
|
!this.props.isFixedContainer &&
|
||||||
const hasPartitionKey = !!this.props.collection.partitionKey;
|
configContext.platform === Platform.Portal &&
|
||||||
|
!this.props.container.isRunningOnNationalCloud()
|
||||||
return isPublicAzurePortal && hasPartitionKey;
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
public getInitialNotificationElement = (): JSX.Element => {
|
public getInitialNotificationElement = (): JSX.Element => {
|
||||||
|
|
|
@ -142,7 +142,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
||||||
|
|
||||||
this.step = this.props.step ?? ThroughputInputAutoPilotV3Component.defaultStep;
|
this.step = this.props.step ?? ThroughputInputAutoPilotV3Component.defaultStep;
|
||||||
this.throughputInputMaxValue = this.props.canExceedMaximumValue ? Int32.Max : this.props.maximum;
|
this.throughputInputMaxValue = this.props.canExceedMaximumValue ? Int32.Max : this.props.maximum;
|
||||||
this.autoPilotInputMaxValue = Int32.Max;
|
this.autoPilotInputMaxValue = this.props.isFixed ? this.props.maximum : Int32.Max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public hasProvisioningTypeChanged = (): boolean =>
|
public hasProvisioningTypeChanged = (): boolean =>
|
||||||
|
@ -284,6 +284,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
||||||
onChange={this.onSpendAckChecked}
|
onChange={this.onSpendAckChecked}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{this.props.isFixed && <p>When using a collection with fixed storage capacity, you can set up to 10,000 RU/s.</p>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -323,14 +324,14 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{this.props.isFixed && <p>Choose unlimited storage capacity for more than 10,000 RU/s.</p>}
|
{this.props.isFixed && <p>When using a collection with fixed storage capacity, you can set up to 10,000 RU/s.</p>}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<Stack {...checkBoxAndInputStackProps}>
|
<Stack {...checkBoxAndInputStackProps}>
|
||||||
{!this.props.isFixed && this.renderThroughputModeChoices()}
|
{this.renderThroughputModeChoices()}
|
||||||
|
|
||||||
{this.props.isAutoPilotSelected ? this.renderAutoPilotInput() : this.renderThroughputInput()}
|
{this.props.isAutoPilotSelected ? this.renderAutoPilotInput() : this.renderThroughputInput()}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
|
@ -91,7 +91,7 @@ describe("SettingsUtils", () => {
|
||||||
it("getSanitizedInputValue", () => {
|
it("getSanitizedInputValue", () => {
|
||||||
const max = 100;
|
const max = 100;
|
||||||
expect(getSanitizedInputValue("", max)).toEqual(0);
|
expect(getSanitizedInputValue("", max)).toEqual(0);
|
||||||
expect(getSanitizedInputValue("999", max)).toEqual(99);
|
expect(getSanitizedInputValue("999", max)).toEqual(100);
|
||||||
expect(getSanitizedInputValue("10", max)).toEqual(10);
|
expect(getSanitizedInputValue("10", max)).toEqual(10);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,13 +131,12 @@ export const parseConflictResolutionProcedure = (procedureFromBackEnd: string):
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSanitizedInputValue = (newValueString: string, max: number): number => {
|
export const getSanitizedInputValue = (newValueString: string, max: number): number => {
|
||||||
let newValue = parseInt(newValueString);
|
const newValue = parseInt(newValueString);
|
||||||
if (isNaN(newValue)) {
|
if (isNaN(newValue)) {
|
||||||
newValue = zeroValue;
|
return zeroValue;
|
||||||
} else if (newValue > max) {
|
|
||||||
newValue = Math.floor(newValue / 10);
|
|
||||||
}
|
}
|
||||||
return newValue;
|
// make sure new value does not exceed the maximum throughput
|
||||||
|
return Math.min(newValue, max);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isDirty = (current: isDirtyTypes, baseline: isDirtyTypes): boolean => {
|
export const isDirty = (current: isDirtyTypes, baseline: isDirtyTypes): boolean => {
|
||||||
|
|
|
@ -119,6 +119,10 @@
|
||||||
<span data-bind="text: spendAckText, attr: { for: spendAckId }"></span>
|
<span data-bind="text: spendAckText, attr: { for: spendAckId }"></span>
|
||||||
</p>
|
</p>
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
|
|
||||||
|
<!-- ko if: isFixed -->
|
||||||
|
<p>Choose unlimited storage capacity for more than 10,000 RU/s.</p>
|
||||||
|
<!-- /ko -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-bind="visible: !isAutoPilotSelected()">
|
<div data-bind="visible: !isAutoPilotSelected()">
|
||||||
|
|
|
@ -492,11 +492,11 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
||||||
});
|
});
|
||||||
|
|
||||||
this.canThroughputExceedMaximumValue = ko.pureComputed<boolean>(() => {
|
this.canThroughputExceedMaximumValue = ko.pureComputed<boolean>(() => {
|
||||||
const isPublicAzurePortal: boolean =
|
return (
|
||||||
configContext.platform === Platform.Portal && !this.container.isRunningOnNationalCloud();
|
this._isFixedContainer() &&
|
||||||
const hasPartitionKey = !!this.collection.partitionKey;
|
configContext.platform === Platform.Portal &&
|
||||||
|
!this.container.isRunningOnNationalCloud()
|
||||||
return isPublicAzurePortal && hasPartitionKey;
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.canRequestSupport = ko.pureComputed(() => {
|
this.canRequestSupport = ko.pureComputed(() => {
|
||||||
|
|
Loading…
Reference in New Issue