enable/disable per autoscale selection

This commit is contained in:
Sung-Hyun Kang 2025-01-13 09:49:48 -06:00
parent 80781f7c8f
commit 07c4ca9c50
2 changed files with 2 additions and 4 deletions

View File

@ -66,7 +66,6 @@ export class ScaleComponent extends React.Component<ScaleComponentProps, ScaleCo
isThroughputDiscardable: false,
isBucketsDiscardable: false,
};
console.log(this.offer);
}
public isAutoScaleEnabled = (): boolean => {
@ -80,7 +79,6 @@ export class ScaleComponent extends React.Component<ScaleComponentProps, ScaleCo
capability.name.toLowerCase() === Constants.CapabilityNames.EnableAutoScale.toLowerCase()
);
});
return !!enableAutoScaleCapability;
};
@ -234,7 +232,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps, ScaleCo
<MessageBar messageBarType={MessageBarType.warning}>{this.getInitialNotificationElement()}</MessageBar>
)}
{!this.isAutoScaleEnabled() && <Stack {...subComponentStackProps}>{this.getThroughputInputComponent()}</Stack>}
{this.props.enableThroughputBuckets && (
{this.props.enableThroughputBuckets && !this.props.isAutoPilotSelected && (
<ThroughputBucketsComponent
currentBuckets={this.props.throughputBuckets}
throughputBucketsBaseline={this.props.throughputBucketsBaseline}

View File

@ -27,7 +27,7 @@ export const ThroughputBucketsComponent: FC<ThroughputBucketsComponentProps> = (
}) => {
const getThroughputBuckets = (buckets: ThroughputBucket[]): ThroughputBucket[] => {
return DEFAULT_BUCKETS.map(
(defaultBucket) => buckets.find((bucket) => bucket.id === defaultBucket.id) || defaultBucket,
(defaultBucket) => buckets?.find((bucket) => bucket.id === defaultBucket.id) || defaultBucket,
);
};