From 42c28fd3011bd7021dc7ddb6c2110506b819e701 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 08:30:13 +0800 Subject: [PATCH] Use TopNavControlButtonData for channel test button (#243) (#245) (cherry picked from commit 6121bd4f4bd21e70120a1e9b02dcccc6bb7bf576) Signed-off-by: Miki Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../components/details/ChannelDetails.tsx | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/public/pages/Channels/components/details/ChannelDetails.tsx b/public/pages/Channels/components/details/ChannelDetails.tsx index 96b71f4f..abdb7baa 100644 --- a/public/pages/Channels/components/details/ChannelDetails.tsx +++ b/public/pages/Channels/components/details/ChannelDetails.tsx @@ -33,6 +33,7 @@ import { ChannelDetailItems } from './ChannelDetailItems'; import { ChannelDetailsActions } from './ChannelDetailsActions'; import { ChannelSettingsDetails } from './ChannelSettingsDetails'; import PageHeader from "../../../../components/PageHeader/PageHeader"; +import { TopNavControlButtonData } from '../../../../../../../src/plugins/navigation/public'; interface ChannelDetailsProps extends RouteComponentProps<{ id: string @@ -191,19 +192,12 @@ export function ChannelDetails(props: ChannelDetailsProps) { ), }, { - renderComponent: ( -
- - Send test message - -
- ), - }, + controlType: 'button', + testId: 'send-test-message-button', + isDisabled: !channel?.is_enabled, + run: sendTestMessage, + label: 'Send test message', + } as TopNavControlButtonData, ]; const badgeComponent =