diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetConsumerOffset.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetConsumerOffset.tsx index 1fd65b0a5..024cfdd07 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetConsumerOffset.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetConsumerOffset.tsx @@ -12,7 +12,7 @@ import { updateConsumerGroup } from "@/api/consumerGroups/actions"; import { Dryrun } from "./Dryrun"; import { LoadingPage } from "./LoadingPage"; import { ResetOffset } from "./ResetOffset"; -import { Page } from "@/libs/patternfly/react-core"; +import { Page, PageSection } from "@/libs/patternfly/react-core"; import { useTranslations } from "next-intl"; import { useAlert } from "@/components/AlertContext"; @@ -208,19 +208,21 @@ export function ResetConsumerOffset({ kafkaId, consumerGroupName, uniqueOffsets, - true // dryRun + true, // dryRun ); if (response.payload) { const res = response.payload; - const offsets: Offset[] = Array.from(res.attributes?.offsets ?? []).map(o => { - return { + const offsets: Offset[] = Array.from(res.attributes?.offsets ?? []).map( + (o) => { + return { topicId: o.topicId!, topicName: o.topicName, partition: o.partition, offset: o.offset, - } - }); + }; + }, + ); setNewOffsetData(offsets); setShowDryRun(true); @@ -280,7 +282,7 @@ export function ResetConsumerOffset({ }; return ( - + {isLoading ? ( ) : showDryRun ? ( @@ -316,6 +318,6 @@ export function ResetConsumerOffset({ cliCommand={generateCliCommand()} /> )} - + ); } diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetOffset.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetOffset.tsx index 105fc6272..2145ab0b8 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetOffset.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/reset-offset/ResetOffset.tsx @@ -83,6 +83,20 @@ export function ResetOffset({ onOffsetSelect: (value: OffsetValue) => void; }) { const t = useTranslations("ConsumerGroupsTable"); + + const isDisabled = + (selectTopic === "allTopics" || + (selectTopic === "selectedTopic" && + offset.topicName && + (selectPartition === "allPartitions" || + (selectPartition === "selectedPartition" && + offset.partition !== undefined)))) && + (selectOffset === "custom" + ? offset.offset + : selectOffset === "specificDateTime" + ? offset.offset + : selectOffset === "latest" || selectOffset === "earliest"); + return ( @@ -224,20 +238,14 @@ export function ResetOffset({