show inactive buckets

This commit is contained in:
Asier Isayas
2026-01-12 13:11:11 -08:00
parent 178cbfaf18
commit 07378fc8c3
@@ -68,12 +68,17 @@ export const ThroughputBucketsComponent: FC<ThroughputBucketsComponentProps> = (
key: NoDefaultThroughputSelectedKey, key: NoDefaultThroughputSelectedKey,
text: "No Default Throughput Bucket Selected", text: "No Default Throughput Bucket Selected",
}; };
const throughputBucketOptions: IDropdownOption[] = throughputBuckets
.filter((bucket) => bucket.maxThroughputPercentage !== 100) const throughputBucketOptions: IDropdownOption[] = throughputBuckets.map((bucket) => ({
.map((bucket) => ({ key: bucket.id,
key: bucket.id, text: `Bucket ${bucket.id} - ${bucket.maxThroughputPercentage}%`,
text: `Bucket ${bucket.id} - ${bucket.maxThroughputPercentage}%`, disabled: bucket.maxThroughputPercentage === 100,
})); ...(bucket.maxThroughputPercentage === 100 && {
data: {
tooltip: `Bucket ${bucket.id} is not active.`,
},
}),
}));
return [noDefaultThroughputBucketSelected, ...throughputBucketOptions]; return [noDefaultThroughputBucketSelected, ...throughputBucketOptions];
}; };
@@ -206,8 +211,20 @@ export const ThroughputBucketsComponent: FC<ThroughputBucketsComponentProps> = (
NoDefaultThroughputSelectedKey NoDefaultThroughputSelectedKey
} }
onChange={(_, option) => onDefaultBucketToggle(option.key as number, true)} onChange={(_, option) => onDefaultBucketToggle(option.key as number, true)}
styles={{ root: { width: "50%" } }}
onRenderLabel={onRenderDefaultThroughputBucketLabel} onRenderLabel={onRenderDefaultThroughputBucketLabel}
onRenderOption={(option: IDropdownOption) => {
const tooltip: string = option?.data?.tooltip;
if (!tooltip) {
return <>{option?.text}</>;
}
return (
<TooltipHost content={tooltip}>
<span>{option?.text}</span>
</TooltipHost>
);
}}
styles={{ root: { width: "50%" } }}
/> />
</Stack> </Stack>
); );