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

View File

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