@@ -357,7 +357,7 @@ const GroupByTopics = (groupProps: {
357357 const partitionsAssigned = g . partitions . filter ( ( c ) => c . assignedMember ) . length ;
358358
359359 const partitions = groupProps . onlyShowPartitionsWithLag
360- ? g . partitions . filter ( ( e ) => e . lag !== 0 || e . isUnconsumed )
360+ ? g . partitions . filter ( ( e ) => e . isUnconsumed || ( e . lag !== null && e . lag !== 0 ) )
361361 : g . partitions ;
362362
363363 if ( partitions . length === 0 ) {
@@ -377,7 +377,7 @@ const GroupByTopics = (groupProps: {
377377
378378 < Flex gap = { 2 } >
379379 < IconButton
380- disabledReason = { cannotEditGroupReason ( groupProps . group , featurePatchGroup ) }
380+ disabledReason = { cannotEditGroupReason ( groupProps . group , featurePatchGroup , consumedPartitions ) }
381381 onClick = { ( e ) => {
382382 groupProps . onEditOffsets ( consumedPartitions ) ;
383383 e . stopPropagation ( ) ;
@@ -386,7 +386,11 @@ const GroupByTopics = (groupProps: {
386386 < EditIcon />
387387 </ IconButton >
388388 < IconButton
389- disabledReason = { cannotDeleteGroupOffsetsReason ( groupProps . group , featureDeleteGroupOffsets ) }
389+ disabledReason = { cannotDeleteGroupOffsetsReason (
390+ groupProps . group ,
391+ featureDeleteGroupOffsets ,
392+ consumedPartitions
393+ ) }
390394 onClick = { ( e ) => {
391395 groupProps . onDeleteOffsets ( consumedPartitions , 'topic' ) ;
392396 e . stopPropagation ( ) ;
@@ -488,22 +492,22 @@ const GroupByTopics = (groupProps: {
488492 < Flex gap = { 1 } pr = { 2 } >
489493 < IconButton
490494 data-testid = { `partition-edit-${ original . partitionId } ` }
491- disabledReason = {
492- original . isUnconsumed
493- ? 'No committed offset'
494- : cannotEditGroupReason ( groupProps . group , featurePatchGroup )
495- }
495+ disabledReason = { cannotEditGroupReason (
496+ groupProps . group ,
497+ featurePatchGroup ,
498+ original . isUnconsumed ? [ ] : undefined
499+ ) }
496500 onClick = { ( ) => groupProps . onEditOffsets ( [ original ] ) }
497501 >
498502 < EditIcon />
499503 </ IconButton >
500504 < IconButton
501505 data-testid = { `partition-delete-${ original . partitionId } ` }
502- disabledReason = {
503- original . isUnconsumed
504- ? 'No committed offset'
505- : cannotDeleteGroupOffsetsReason ( groupProps . group , featureDeleteGroupOffsets )
506- }
506+ disabledReason = { cannotDeleteGroupOffsetsReason (
507+ groupProps . group ,
508+ featureDeleteGroupOffsets ,
509+ original . isUnconsumed ? [ ] : undefined
510+ ) }
507511 onClick = { ( ) => groupProps . onDeleteOffsets ( [ original ] , 'partition' ) }
508512 >
509513 < TrashIcon />
@@ -630,7 +634,14 @@ const ProtocolType = (p: { group: GroupDescription }) => {
630634 return < Statistic title = "Protocol" value = { protocol } /> ;
631635} ;
632636
633- function cannotEditGroupReason ( group : GroupDescription , featurePatchGroup : boolean ) : string | undefined {
637+ function cannotEditGroupReason (
638+ group : GroupDescription ,
639+ featurePatchGroup : boolean ,
640+ consumedPartitions ?: readonly unknown [ ]
641+ ) : string | undefined {
642+ if ( consumedPartitions !== undefined && consumedPartitions . length === 0 ) {
643+ return 'No committed offsets' ;
644+ }
634645 if ( group . noEditPerms ) {
635646 return "You don't have 'editConsumerGroup' permissions for this group" ;
636647 }
@@ -656,8 +667,12 @@ function cannotDeleteGroupReason(group: GroupDescription, featureDeleteGroup: bo
656667
657668function cannotDeleteGroupOffsetsReason (
658669 group : GroupDescription ,
659- featureDeleteGroupOffsets : boolean
670+ featureDeleteGroupOffsets : boolean ,
671+ consumedPartitions ?: readonly unknown [ ]
660672) : string | undefined {
673+ if ( consumedPartitions !== undefined && consumedPartitions . length === 0 ) {
674+ return 'No committed offsets' ;
675+ }
661676 if ( group . noEditPerms ) {
662677 return "You don't have 'deleteConsumerGroup' permissions for this group" ;
663678 }
0 commit comments