From 806aa966b293b127df518e9d1030069fc251f2e7 Mon Sep 17 00:00:00 2001 From: hemahg Date: Tue, 20 Aug 2024 10:51:47 +0530 Subject: [PATCH] consumer group reset offset Signed-off-by: hemahg --- .../ConnectedConsumerGroupTable.tsx | 4 +- .../[groupId]/ResetOffsetModal.stories.tsx | 1 + .../[groupId]/ResetOffsetModal.tsx | 6 +- .../reset-offset/ResetConsumerOffset.tsx | 178 +++++++++--------- ui/messages/en.json | 9 +- 5 files changed, 102 insertions(+), 96 deletions(-) diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/ConnectedConsumerGroupTable.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/ConnectedConsumerGroupTable.tsx index 1ea7c61a8..efc33e1d1 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/ConnectedConsumerGroupTable.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/ConnectedConsumerGroupTable.tsx @@ -144,11 +144,11 @@ export function ConnectedConsumerGroupsTable({ onResetOffset={(row) => { startTransition(() => { if (row.attributes.state === "STABLE") { - router.push(`${baseurl}/${row.id}/reset-offset`); - } else if (row.attributes.state === "EMPTY") { setResetOffsetModalOpen(true) setConsumerGroupMembers(row.attributes.members?.map((member) => member.memberId) || []); router.push(`${baseurl}/${row.id}/reset-offset`); + } else if (row.attributes.state === "EMPTY") { + router.push(`${baseurl}/${row.id}/reset-offset`); } }); }} diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.stories.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.stories.tsx index 866f348fa..60aa663fb 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.stories.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.stories.tsx @@ -9,6 +9,7 @@ type Story = StoryObj; export const Default: Story = { args: { + isResetOffsetModalOpen: true, members: ["console-datagen-consumer-0", "console-datagen-consumer-1"] }, }; diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.tsx index 2c67686ae..9ea286d0f 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/consumer-groups/[groupId]/ResetOffsetModal.tsx @@ -24,7 +24,6 @@ export function ResetOffsetModal({ titleIconVariant="warning" isOpen={isResetOffsetModalOpen} variant={ModalVariant.medium} - description={t("consumer_group_must_be_empty_description")} onClose={onClickClose} actions={[ - - - - - - - - + + } + + + + + + + + + + ) } diff --git a/ui/messages/en.json b/ui/messages/en.json index 972b5c131..4f9e7868e 100644 --- a/ui/messages/en.json +++ b/ui/messages/en.json @@ -388,7 +388,8 @@ "cancel": "Cancel", "reset_offset": "Reset consumer offset", "reset_offset_description": "Consumer group must be empty to reset offsets.", - "member_list_to_shutdown": "Active members of the group that need to shutdown:", + "member_shutdown_helper_text": "To reset the consumer group offsets, all the active members must be shut down.", + "shutdown_active_members": "Shut down active members before proceeding", "learn_to_shutdown_members": "Learn how to shut down members", "reset_consumer_offset": "Reset consumer offset", "consumer_name": "Consumer group: {consumerGroupName}", @@ -412,7 +413,11 @@ "selected_partition": "A selected partition", "select_date_time": "Select Date time", "iso_date_format": "ISO 8601 Date-Time Format", - "unix_date_format": "Unix Epoch Milliseconds" + "unix_date_format": "Unix Epoch Milliseconds", + "dry_run_result": "Dry Run results", + "download_dryrun_result": "Download Dry Run results", + "jump_to_topic": "Jump to topic" + }, "CreateTopic": { "title": "Topic creation wizard",