Repository: provectus/kafka-ui
Issue: Blank page for "Reset offsets" when consumer has no committed offsets
Labels: type/bug
scope/frontend
status/accepted
status/confirmed

### Issue submitter TODO list

- [X] I've looked up my issue in [FAQ](https://docs.kafka-ui.provectus.io/faq/common-problems)
- [X] I've searched for an already existing issues [here](https://github.com/provectus/kafka-ui/issues)
- [X] I've tried running `master`-labeled docker image and the issue still persists there
- [X] I'm running a supported version of the application which is listed [here](https://github.com/provectus/kafka-ui/blob/master/SECURITY.md)

### Describe the bug (actual behavior)

Blank page for "Reset offsets" when consumer has no committed offsets

### Expected behavior

Page is rendered

### Your installation details

[80b748b](https://github.com/provectus/kafka-ui/commit/80b748b)

### Steps to reproduce

1. run consumer group that reads from topic, but does not commit offsets
2. stop CG
3. Consumers -> select created CG -> click "..." -> "Reset offsets" 


### Screenshots


https://github.com/provectus/kafka-ui/assets/702205/027eeb5d-d548-4905-bc0c-fad3626efa1b



### Logs

_No response_

### Additional context

_No response_

Issue comments:
@iliax , @Haarolean , @freeformz , @stuarth  and @mstolbov  Greetings!!!

I see that this issue is closed but still I see that, when no Active consumer group, i don't see the inactive consumer group in the consumers page. 

I tried with both latest tag image as well as "docker pull provectuslabs/kafka-ui:master"

Both having the same behavior.

Could you please let me know when this feature will be available in the latest tag?
Eagerly waiting for this feature in the UI.


Thankyou...

Pull request review comments:
we don't need the `useMemo` here this is not expensive calculation.
` const hasAssignedTopics = consumerGroup?.data?.topics !== 0`
Okay, thank you.
Done

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
index 33dd9b48ad5..b8fac73dc1e 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/Details.tsx
@@ -54,6 +54,8 @@ const Details: React.FC = () => {
     ? filteredPartitionsByTopic
     : Object.keys(partitionsByTopic);
 
+  const hasAssignedTopics = consumerGroup?.data?.topics !== 0;
+
   return (
     <div>
       <div>
@@ -71,6 +73,7 @@ const Details: React.FC = () => {
                   action: Action.RESET_OFFSETS,
                   value: consumerGroupID,
                 }}
+                disabled={!hasAssignedTopics}
               >
                 Reset offset
               </ActionDropdownItem>
diff --git a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
index 8d220501940..548ed47f543 100644
--- a/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
+++ b/kafka-ui-react-app/src/components/ConsumerGroups/Details/ResetOffsets/ResetOffsets.tsx
@@ -21,7 +21,7 @@ const ResetOffsets: React.FC = () => {
     return <PageLoader />;
 
   const partitions = consumerGroup.data.partitions || [];
-  const { topic } = partitions[0];
+  const { topic } = partitions[0] || '';
 
   const uniqTopics = Array.from(
     new Set(partitions.map((partition) => partition.topic))


Test patch: