Skip to content

Commit 558c50e

Browse files
authored
Merge branch 'main' into issue/1262
2 parents 795f16e + a87278a commit 558c50e

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

frontend/src/components/ConsumerGroups/Details/ListItem.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const ListItem: React.FC<Props> = ({ clusterName, name, consumers }) => {
3131
useDeleteConsumerGroupOffsetsMutation(consumerProps);
3232

3333
const getTotalconsumerLag = () => {
34+
if (consumers.every((consumer) => consumer?.consumerLag === null)) {
35+
return 'N/A';
36+
}
3437
let count = 0;
3538
consumers.forEach((consumer) => {
3639
count += consumer?.consumerLag || 0;

frontend/src/components/Topics/List/TopicTable.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,13 @@ const TopicTable: React.FC = () => {
7575
maxSize: 148,
7676
},
7777
{
78+
id: TopicColumnsToSort.MESSAGES_COUNT,
7879
header: 'Number of messages',
79-
accessorKey: 'partitions',
80-
enableSorting: false,
81-
size: 146,
82-
cell: ({ getValue }) => {
83-
const partitions = getValue<Topic['partitions']>();
84-
if (partitions === undefined || partitions.length === 0) {
85-
return 0;
86-
}
87-
return partitions.reduce((memo, { offsetMax, offsetMin }) => {
88-
return memo + (offsetMax - offsetMin);
89-
}, 0);
80+
accessorKey: 'messagesCount',
81+
cell: (args) => {
82+
return args.getValue() ?? 'N/A';
9083
},
84+
size: 146,
9185
},
9286
{
9387
id: TopicColumnsToSort.SIZE,

frontend/src/lib/fixtures/topics.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const internalTopicPayload = {
1717
segmentSize: 0,
1818
segmentCount: 1,
1919
underReplicatedPartitions: 0,
20+
messagesCount: 0,
2021
partitions: [
2122
{
2223
partition: 0,
@@ -38,6 +39,7 @@ export const externalTopicPayload = {
3839
segmentSize: 1263,
3940
segmentCount: 1,
4041
underReplicatedPartitions: 0,
42+
messagesCount: 0,
4143
partitions: [
4244
{
4345
partition: 0,

0 commit comments

Comments
 (0)