From a6dc47ddeb15d6c7b91e1abaaf83fba3eee2fef2 Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Wed, 23 Oct 2024 10:06:47 -0600 Subject: [PATCH] [Security Assistant] Fix Security Assistant settings link behavior and adjust initial settings tab (#197323) --- .../conversation_settings/translations.ts | 2 +- .../settings/assistant_settings_management.tsx | 10 +++++----- .../settings_context_menu.tsx | 17 +++++++++++++++++ .../stack_management/management_settings.tsx | 4 ++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/translations.ts index 55852fc2a1bad..529631574e6f7 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/translations.ts @@ -59,7 +59,7 @@ export const SETTINGS_PROMPT_HELP_TEXT_TITLE = i18n.translate( export const STREAMING_TITLE = i18n.translate( 'xpack.elasticAssistant.assistant.conversations.settings.streamingTitle', { - defaultMessage: 'STREAMING', + defaultMessage: 'Streaming', } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx index 12b26da336e72..c0dc904695257 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx @@ -37,7 +37,7 @@ interface Props { dataViews: DataViewsContract; selectedConversation: Conversation; onTabChange?: (tabId: string) => void; - currentTab?: SettingsTabs; + currentTab: SettingsTabs; } /** @@ -65,14 +65,14 @@ export const AssistantSettingsManagement: React.FC = React.memo( const tabsConfig = useMemo( () => [ - { - id: CONNECTORS_TAB, - label: i18n.CONNECTORS_MENU_ITEM, - }, { id: CONVERSATIONS_TAB, label: i18n.CONVERSATIONS_MENU_ITEM, }, + { + id: CONNECTORS_TAB, + label: i18n.CONNECTORS_MENU_ITEM, + }, { id: SYSTEM_PROMPTS_TAB, label: i18n.SYSTEM_PROMPTS_MENU_ITEM, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/settings_context_menu/settings_context_menu.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/settings_context_menu/settings_context_menu.tsx index 3a19a68643006..eddf785256d82 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/settings_context_menu/settings_context_menu.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/settings_context_menu/settings_context_menu.tsx @@ -12,6 +12,7 @@ import { EuiContextMenuPanel, EuiContextMenuItem, EuiConfirmModal, + EuiIcon, EuiNotificationBadge, EuiPopover, EuiButtonIcon, @@ -68,6 +69,7 @@ export const SettingsContextMenu: React.FC = React.memo( () => navigateToApp('management', { path: 'kibana/securityAiAssistantManagement', + openInNewTab: true, }), [navigateToApp] ); @@ -81,6 +83,7 @@ export const SettingsContextMenu: React.FC = React.memo( () => navigateToApp('management', { path: `kibana/securityAiAssistantManagement?tab=${KNOWLEDGE_BASE_TAB}`, + openInNewTab: true, }), [navigateToApp] ); @@ -101,6 +104,13 @@ export const SettingsContextMenu: React.FC = React.memo( data-test-subj={'ai-assistant-settings'} > {i18n.AI_ASSISTANT_SETTINGS} + , = React.memo( data-test-subj={'knowledge-base'} > {i18n.KNOWLEDGE_BASE} + , { const [searchParams] = useSearchParams(); const currentTab = useMemo( - () => (searchParams.get('tab') as SettingsTabs) ?? CONNECTORS_TAB, + () => (searchParams.get('tab') as SettingsTabs) ?? CONVERSATIONS_TAB, [searchParams] );