From f67da5d63e652f36f90c1e468f0543079a86fd3c Mon Sep 17 00:00:00 2001 From: hemahg Date: Mon, 28 Oct 2024 17:37:57 +0530 Subject: [PATCH] feat: hide pause button when Kafka cluster is unmanaged Signed-off-by: hemahg --- ui/api/kafka/schema.ts | 1 + .../@header/overview/ConnectButton.tsx | 38 +++++++++++-------- .../kafka/[kafkaId]/@header/overview/page.tsx | 19 +++++++--- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/ui/api/kafka/schema.ts b/ui/api/kafka/schema.ts index 95c09b7f2..c0c0bbe42 100644 --- a/ui/api/kafka/schema.ts +++ b/ui/api/kafka/schema.ts @@ -44,6 +44,7 @@ const ClusterDetailSchema = z.object({ meta: z .object({ reconciliationPaused: z.boolean().optional(), + managed: z.boolean(), }) .optional(), attributes: z.object({ diff --git a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/@header/overview/ConnectButton.tsx b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/@header/overview/ConnectButton.tsx index 35a7eb44f..4c2c48923 100644 --- a/ui/app/[locale]/(authorized)/kafka/[kafkaId]/@header/overview/ConnectButton.tsx +++ b/ui/app/[locale]/(authorized)/kafka/[kafkaId]/@header/overview/ConnectButton.tsx @@ -8,7 +8,13 @@ import { Button, Flex, FlexItem } from "@/libs/patternfly/react-core"; import { useTranslations } from "next-intl"; import { useState } from "react"; -export function ConnectButton({ clusterId }: { clusterId: string }) { +export function ConnectButton({ + clusterId, + managed, +}: { + clusterId: string; + managed: boolean; +}) { const t = useTranslations(); const open = useOpenClusterConnectionPanel(); @@ -33,20 +39,22 @@ export function ConnectButton({ clusterId }: { clusterId: string }) { return ( <> - - - + {managed && ( + + + + )}