@@ -41,11 +41,13 @@ interface TopicDataControlsProps {
4141 endOffset ?: number ;
4242 truncatedData ?: boolean ;
4343 scrollToOffset : ( offset : number ) => void ;
44+ handlePartitionChange ?: ( value : string [ ] ) => void ;
4445}
4546
4647export function TopicDataControls ( {
4748 columnsToSelect,
4849 handleSelectedColumnsUpdate,
50+ handlePartitionChange,
4951
5052 startOffset,
5153 endOffset,
@@ -55,39 +57,21 @@ export function TopicDataControls({
5557 scrollToOffset,
5658 truncatedData,
5759} : TopicDataControlsProps ) {
58- const {
59- selectedPartition,
60- handleSelectedPartitionChange : handleSelectedPartitionParamChange ,
61- handleSelectedOffsetChange,
62- handleStartTimestampChange,
63- } = useTopicDataQueryParams ( ) ;
60+ const { selectedPartition} = useTopicDataQueryParams ( ) ;
6461
6562 const partitionsToSelect = partitions ?. map ( ( { partitionId} ) => ( {
6663 content : String ( partitionId ) ,
6764 value : String ( partitionId ) ,
6865 } ) ) ;
6966
70- const handleSelectedPartitionChange = React . useCallback (
71- ( value : string [ ] ) => {
72- handleSelectedPartitionParamChange ( value [ 0 ] ) ;
73- handleSelectedOffsetChange ( undefined ) ;
74- handleStartTimestampChange ( undefined ) ;
75- } ,
76- [
77- handleSelectedPartitionParamChange ,
78- handleStartTimestampChange ,
79- handleSelectedOffsetChange ,
80- ] ,
81- ) ;
82-
8367 return (
8468 < React . Fragment >
8569 < Select
8670 className = { b ( 'partition-select' ) }
8771 label = { i18n ( 'label_partition-id' ) }
8872 options = { partitionsToSelect }
8973 value = { selectedPartition ? [ selectedPartition ] : undefined }
90- onUpdate = { handleSelectedPartitionChange }
74+ onUpdate = { handlePartitionChange }
9175 filterable = { partitions && partitions . length > 5 }
9276 disabled = { ! partitions || ! partitions . length }
9377 errorPlacement = "inside"
0 commit comments