Skip to content

Commit

Permalink
[8.15] [Security Assistant] Clean up AI settings tabs (elastic#187705) (
Browse files Browse the repository at this point in the history
elastic#188544)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Security Assistant] Clean up AI settings tabs
(elastic#187705)](elastic#187705)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Angela
Chuang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-17T12:14:21Z","message":"[Security
Assistant] Clean up AI settings tabs (elastic#187705)\n\n## Summary\r\n\r\nCode
clean up for my previous PR:\r\n1.
https://github.com/elastic/kibana/pull/184678#discussion_r1657851993\r\n-
Remove additional props.\r\n2. Add `Created on` column for quick prompt
and system prompt table\r\n3. Wording
change:\r\nhttps://github.com/elastic/pull/184678#discussion_r1661034797
-\r\nRename column title.\r\n\r\n**Landing page:**\r\n<img
width=\"1282\" alt=\"Screenshot 2024-07-09 at 19 07
34\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/20366ee7-497f-412c-9690-953af9f6992b\">\r\n\r\n**Knowledge
base:**\r\n<img width=\"2552\" alt=\"Screenshot 2024-07-15 at 15 32
40\"\r\nsrc=\"https://github.com/user-attachments/assets/1d651042-b187-4c08-b55d-c58c1104fd1b\">\r\n\r\n**Evaluation:**\r\n<img
width=\"2560\" alt=\"Screenshot 2024-07-15 at 15 34
04\"\r\nsrc=\"https://github.com/user-attachments/assets/31855fe6-e5dd-462d-9c06-2fee2554361a\">\r\n\r\n<img
width=\"2556\" alt=\"Screenshot 2024-07-09 at 19 38
06\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/15be4f36-261b-4652-8d4f-be8e7d14676a\">\r\n\r\n**Anonymization:**\r\n<img
width=\"2551\" alt=\"Screenshot 2024-07-15 at 15 32
33\"\r\nsrc=\"https://github.com/user-attachments/assets/27688bb5-851e-46fc-8f75-9700ce7a248a\">\r\n\r\n**Quick
prompts:**\r\n<img width=\"2559\" alt=\"Screenshot 2024-07-15 at 15 30
30\"\r\nsrc=\"https://github.com/user-attachments/assets/e00c39a0-fb12-46f1-bb2a-bdf5c5bd49d2\">\r\n\r\n<img
width=\"2557\" alt=\"Screenshot 2024-07-09 at 19 27
18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/b581fc46-003b-4363-9c16-22534eb1d71e\">\r\n\r\n**System
prompts:**\r\n<img width=\"2557\" alt=\"Screenshot 2024-07-15 at 15 30
11\"\r\nsrc=\"https://github.com/user-attachments/assets/95fd4fca-5041-40b7-b500-efc192166be0\">\r\n\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 10
36\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/a701391a-978f-4684-a2ea-f72a5f572217\">\r\n\r\n**Conversations:**\r\n<img
width=\"2553\" alt=\"Screenshot 2024-07-15 at 15 30
01\"\r\nsrc=\"https://github.com/user-attachments/assets/3411beb8-4775-4ba7-8b3e-c4111497eed2\">\r\n\r\n<img
width=\"2554\" alt=\"Screenshot 2024-07-09 at 21 33
37\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/fbe2ee80-ba20-41b6-b224-3e317dc1c20e\">\r\n\r\nConnectors:\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 09
15\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/c711ce09-65c0-45b3-90c1-a9019d35093c\">\r\n\r\n\r\n\r\n\r\n[Design](https://www.figma.com/design/BMvpY9EhcPIaoOS7LSrkL0/[8.15]-GenAI-Security-Assistant-Settings%3A-Stack-Management-Pages?node-id=51-25207&t=JHlgCm0sCYsl8WCM-0)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"60ba001b1f01a0b5df0f2d79e96ca69c155dbaf7","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.15.0","v8.16.0"],"number":187705,"url":"https://github.com/elastic/kibana/pull/187705","mergeCommit":{"message":"[Security
Assistant] Clean up AI settings tabs (elastic#187705)\n\n## Summary\r\n\r\nCode
clean up for my previous PR:\r\n1.
https://github.com/elastic/kibana/pull/184678#discussion_r1657851993\r\n-
Remove additional props.\r\n2. Add `Created on` column for quick prompt
and system prompt table\r\n3. Wording
change:\r\nhttps://github.com/elastic/pull/184678#discussion_r1661034797
-\r\nRename column title.\r\n\r\n**Landing page:**\r\n<img
width=\"1282\" alt=\"Screenshot 2024-07-09 at 19 07
34\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/20366ee7-497f-412c-9690-953af9f6992b\">\r\n\r\n**Knowledge
base:**\r\n<img width=\"2552\" alt=\"Screenshot 2024-07-15 at 15 32
40\"\r\nsrc=\"https://github.com/user-attachments/assets/1d651042-b187-4c08-b55d-c58c1104fd1b\">\r\n\r\n**Evaluation:**\r\n<img
width=\"2560\" alt=\"Screenshot 2024-07-15 at 15 34
04\"\r\nsrc=\"https://github.com/user-attachments/assets/31855fe6-e5dd-462d-9c06-2fee2554361a\">\r\n\r\n<img
width=\"2556\" alt=\"Screenshot 2024-07-09 at 19 38
06\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/15be4f36-261b-4652-8d4f-be8e7d14676a\">\r\n\r\n**Anonymization:**\r\n<img
width=\"2551\" alt=\"Screenshot 2024-07-15 at 15 32
33\"\r\nsrc=\"https://github.com/user-attachments/assets/27688bb5-851e-46fc-8f75-9700ce7a248a\">\r\n\r\n**Quick
prompts:**\r\n<img width=\"2559\" alt=\"Screenshot 2024-07-15 at 15 30
30\"\r\nsrc=\"https://github.com/user-attachments/assets/e00c39a0-fb12-46f1-bb2a-bdf5c5bd49d2\">\r\n\r\n<img
width=\"2557\" alt=\"Screenshot 2024-07-09 at 19 27
18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/b581fc46-003b-4363-9c16-22534eb1d71e\">\r\n\r\n**System
prompts:**\r\n<img width=\"2557\" alt=\"Screenshot 2024-07-15 at 15 30
11\"\r\nsrc=\"https://github.com/user-attachments/assets/95fd4fca-5041-40b7-b500-efc192166be0\">\r\n\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 10
36\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/a701391a-978f-4684-a2ea-f72a5f572217\">\r\n\r\n**Conversations:**\r\n<img
width=\"2553\" alt=\"Screenshot 2024-07-15 at 15 30
01\"\r\nsrc=\"https://github.com/user-attachments/assets/3411beb8-4775-4ba7-8b3e-c4111497eed2\">\r\n\r\n<img
width=\"2554\" alt=\"Screenshot 2024-07-09 at 21 33
37\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/fbe2ee80-ba20-41b6-b224-3e317dc1c20e\">\r\n\r\nConnectors:\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 09
15\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/c711ce09-65c0-45b3-90c1-a9019d35093c\">\r\n\r\n\r\n\r\n\r\n[Design](https://www.figma.com/design/BMvpY9EhcPIaoOS7LSrkL0/[8.15]-GenAI-Security-Assistant-Settings%3A-Stack-Management-Pages?node-id=51-25207&t=JHlgCm0sCYsl8WCM-0)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"60ba001b1f01a0b5df0f2d79e96ca69c155dbaf7"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187705","number":187705,"mergeCommit":{"message":"[Security
Assistant] Clean up AI settings tabs (elastic#187705)\n\n## Summary\r\n\r\nCode
clean up for my previous PR:\r\n1.
https://github.com/elastic/kibana/pull/184678#discussion_r1657851993\r\n-
Remove additional props.\r\n2. Add `Created on` column for quick prompt
and system prompt table\r\n3. Wording
change:\r\nhttps://github.com/elastic/pull/184678#discussion_r1661034797
-\r\nRename column title.\r\n\r\n**Landing page:**\r\n<img
width=\"1282\" alt=\"Screenshot 2024-07-09 at 19 07
34\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/20366ee7-497f-412c-9690-953af9f6992b\">\r\n\r\n**Knowledge
base:**\r\n<img width=\"2552\" alt=\"Screenshot 2024-07-15 at 15 32
40\"\r\nsrc=\"https://github.com/user-attachments/assets/1d651042-b187-4c08-b55d-c58c1104fd1b\">\r\n\r\n**Evaluation:**\r\n<img
width=\"2560\" alt=\"Screenshot 2024-07-15 at 15 34
04\"\r\nsrc=\"https://github.com/user-attachments/assets/31855fe6-e5dd-462d-9c06-2fee2554361a\">\r\n\r\n<img
width=\"2556\" alt=\"Screenshot 2024-07-09 at 19 38
06\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/15be4f36-261b-4652-8d4f-be8e7d14676a\">\r\n\r\n**Anonymization:**\r\n<img
width=\"2551\" alt=\"Screenshot 2024-07-15 at 15 32
33\"\r\nsrc=\"https://github.com/user-attachments/assets/27688bb5-851e-46fc-8f75-9700ce7a248a\">\r\n\r\n**Quick
prompts:**\r\n<img width=\"2559\" alt=\"Screenshot 2024-07-15 at 15 30
30\"\r\nsrc=\"https://github.com/user-attachments/assets/e00c39a0-fb12-46f1-bb2a-bdf5c5bd49d2\">\r\n\r\n<img
width=\"2557\" alt=\"Screenshot 2024-07-09 at 19 27
18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/b581fc46-003b-4363-9c16-22534eb1d71e\">\r\n\r\n**System
prompts:**\r\n<img width=\"2557\" alt=\"Screenshot 2024-07-15 at 15 30
11\"\r\nsrc=\"https://github.com/user-attachments/assets/95fd4fca-5041-40b7-b500-efc192166be0\">\r\n\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 10
36\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/a701391a-978f-4684-a2ea-f72a5f572217\">\r\n\r\n**Conversations:**\r\n<img
width=\"2553\" alt=\"Screenshot 2024-07-15 at 15 30
01\"\r\nsrc=\"https://github.com/user-attachments/assets/3411beb8-4775-4ba7-8b3e-c4111497eed2\">\r\n\r\n<img
width=\"2554\" alt=\"Screenshot 2024-07-09 at 21 33
37\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/fbe2ee80-ba20-41b6-b224-3e317dc1c20e\">\r\n\r\nConnectors:\r\n<img
width=\"2558\" alt=\"Screenshot 2024-07-09 at 19 09
15\"\r\nsrc=\"https://github.com/elastic/kibana/assets/6295984/c711ce09-65c0-45b3-90c1-a9019d35093c\">\r\n\r\n\r\n\r\n\r\n[Design](https://www.figma.com/design/BMvpY9EhcPIaoOS7LSrkL0/[8.15]-GenAI-Security-Assistant-Settings%3A-Stack-Management-Pages?node-id=51-25207&t=JHlgCm0sCYsl8WCM-0)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"60ba001b1f01a0b5df0f2d79e96ca69c155dbaf7"}}]}]
BACKPORT-->
  • Loading branch information
angorayc authored Jul 17, 2024
1 parent df429da commit 87cba4b
Show file tree
Hide file tree
Showing 55 changed files with 1,611 additions and 1,181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { useAppContext } from '../../app_context';

export function AiAssistantSelectionPage() {
Expand Down Expand Up @@ -86,21 +87,25 @@ export function AiAssistantSelectionPage() {
</>
) : null}
<p>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSelectionPage.obsAssistant.documentationLinkDescription',
{ defaultMessage: 'For more info, see our' }
)}{' '}
<EuiLink
data-test-subj="pluginsAiAssistantSelectionPageDocumentationLink"
external
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/obs-ai-assistant.html"
>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSelectionPage.obsAssistant.documentationLinkLabel',
{ defaultMessage: 'documentation' }
)}
</EuiLink>
<FormattedMessage
id="aiAssistantManagementSelection.aiAssistantSelectionPage.obsAssistant.documentationLinkDescription"
defaultMessage="For more info, see our {documentation}."
values={{
documentation: (
<EuiLink
data-test-subj="pluginsAiAssistantSelectionPageDocumentationLink"
external
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/obs-ai-assistant.html"
>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSelectionPage.obsAssistant.documentationLinkLabel',
{ defaultMessage: 'documentation' }
)}
</EuiLink>
),
}}
/>
</p>
<EuiButton
iconType="gear"
Expand Down Expand Up @@ -151,21 +156,25 @@ export function AiAssistantSelectionPage() {
</>
) : null}
<p>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSelectionPage.securityAssistant.documentationLinkDescription',
{ defaultMessage: 'For more info, see our' }
)}{' '}
<EuiLink
data-test-subj="securityAiAssistantSelectionPageDocumentationLink"
external
target="_blank"
href="https://www.elastic.co/guide/en/security/current/security-assistant.html"
>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSettingsPage.securityAssistant.documentationLinkLabel',
{ defaultMessage: 'documentation' }
)}
</EuiLink>
<FormattedMessage
id="aiAssistantManagementSelection.aiAssistantSelectionPage.securityAssistant.documentationLinkDescription"
defaultMessage="For more info, see our {documentation}."
values={{
documentation: (
<EuiLink
data-test-subj="securityAiAssistantSelectionPageDocumentationLink"
external
target="_blank"
href="https://www.elastic.co/guide/en/security/current/security-assistant.html"
>
{i18n.translate(
'aiAssistantManagementSelection.aiAssistantSettingsPage.securityAssistant.documentationLinkLabel',
{ defaultMessage: 'documentation' }
)}
</EuiLink>
),
}}
/>
</p>
<EuiButton
data-test-subj="pluginsAiAssistantSelectionPageButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ export const bulkUpdateConversations = async (
toasts?.addError(error.body && error.body.message ? new Error(error.body.message) : error, {
title: i18n.translate('xpack.elasticAssistant.conversations.bulkActionsConversationsError', {
defaultMessage: 'Error updating conversations {error}',
values: { error },
values: {
error: error.message
? Array.isArray(error.message)
? error.message.join(',')
: error.message
: error,
},
}),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ export const bulkUpdatePrompts = async (
toasts?.addError(error.body && error.body.message ? new Error(error.body.message) : error, {
title: i18n.translate('xpack.elasticAssistant.prompts.bulkActionspromptsError', {
defaultMessage: 'Error updating prompts {error}',
values: { error },
values: {
error: error.message
? Array.isArray(error.message)
? error.message.join(',')
: error.message
: error,
},
}),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useConversation } from '../use_conversation';
import { getCombinedMessage } from '../prompt/helpers';
import { Conversation, useAssistantContext } from '../../..';
import { getMessageFromRawResponse } from '../helpers';
import { getDefaultSystemPrompt } from '../use_conversation/helpers';
import { getDefaultSystemPrompt, getDefaultNewSystemPrompt } from '../use_conversation/helpers';

export interface UseChatSendProps {
allSystemPrompts: PromptResponse[];
Expand Down Expand Up @@ -204,10 +204,11 @@ export const useChatSend = ({
}, [currentConversation, http, removeLastMessage, sendMessage, setCurrentConversation, toasts]);

const handleOnChatCleared = useCallback(async () => {
const defaultSystemPromptId = getDefaultSystemPrompt({
allSystemPrompts,
conversation: currentConversation,
})?.id;
const defaultSystemPromptId =
getDefaultSystemPrompt({
allSystemPrompts,
conversation: currentConversation,
})?.id ?? getDefaultNewSystemPrompt(allSystemPrompts)?.id;

setUserPrompt('');
setSelectedPromptContexts({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Props {
onClose: () => void;
onSaveCancelled: () => void;
onSaveConfirmed: () => void;
saveButtonDisabled?: boolean;
}

const FlyoutComponent: React.FC<Props> = ({
Expand All @@ -36,6 +37,7 @@ const FlyoutComponent: React.FC<Props> = ({
onClose,
onSaveCancelled,
onSaveConfirmed,
saveButtonDisabled = false,
}) => {
return flyoutVisible ? (
<EuiFlyout
Expand Down Expand Up @@ -71,6 +73,7 @@ const FlyoutComponent: React.FC<Props> = ({
data-test-subj="save-button"
onClick={onSaveConfirmed}
iconType="check"
disabled={saveButtonDisabled}
fill
>
{i18n.FLYOUT_SAVE_BUTTON_TITLE}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { EuiTableActionsColumnType } from '@elastic/eui';
import { useCallback } from 'react';
import * as i18n from './translations';

interface Props<T> {
disabled?: boolean;
onDelete?: (rowItem: T) => void;
onEdit?: (rowItem: T) => void;
}

export const useInlineActions = <T extends { isDefault?: boolean | undefined }>() => {
const getInlineActions = useCallback(({ disabled = false, onDelete, onEdit }: Props<T>) => {
const handleEdit = (rowItem: T) => {
onEdit?.(rowItem);
};

const handleDelete = (rowItem: T) => {
onDelete?.(rowItem);
};

const actions: EuiTableActionsColumnType<T> = {
name: i18n.ACTIONS_BUTTON,
actions: [
{
name: i18n.EDIT_BUTTON,
description: i18n.EDIT_BUTTON,
icon: 'pencil',
type: 'icon',
onClick: (rowItem: T) => {
handleEdit(rowItem);
},
enabled: () => !disabled,
available: () => onEdit != null,
},
{
name: i18n.DELETE_BUTTON,
description: i18n.DELETE_BUTTON,
icon: 'trash',
type: 'icon',
onClick: (rowItem: T) => {
handleDelete(rowItem);
},
enabled: ({ isDefault }: { isDefault?: boolean }) => !isDefault && !disabled,
available: () => onDelete != null,
color: 'danger',
},
],
};
return actions;
}, []);

return getInlineActions;
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ export const DELETE_BUTTON = i18n.translate(
defaultMessage: 'Delete',
}
);

export const ACTIONS_BUTTON = i18n.translate(
'xpack.elasticAssistant.assistant.settings.actionsButtonTitle',
{
defaultMessage: 'Actions',
}
);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const ConversationSelectorSettings: React.FC<Props> = React.memo(
(conversation) =>
conversation.title === conversationSelectorSettingsOption[0]?.label
) ?? conversationSelectorSettingsOption[0]?.label;

onConversationSelectionChange(newConversation);
},
[onConversationSelectionChange, conversations]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { ConversationSettings, ConversationSettingsProps } from './conversation_
import { TestProviders } from '../../../mock/test_providers/test_providers';
import { alertConvo, customConvo, welcomeConvo } from '../../../mock/conversation';
import { mockSystemPrompts } from '../../../mock/system_prompt';
import { OpenAiProviderType } from '@kbn/stack-connectors-plugin/common/openai/constants';
import { mockConnectors } from '../../../mock/connectors';
import { HttpSetup } from '@kbn/core/public';

const mockConvos = {
'1234': { ...welcomeConvo, id: '1234' },
Expand All @@ -24,18 +24,19 @@ const onSelectedConversationChange = jest.fn();
const setConversationSettings = jest.fn();
const setConversationsSettingsBulkActions = jest.fn();

const testProps = {
const testProps: ConversationSettingsProps = {
allSystemPrompts: mockSystemPrompts,
assistantStreamingEnabled: false,
connectors: mockConnectors,
conversationSettings: mockConvos,
defaultConnectorId: '123',
defaultProvider: OpenAiProviderType.OpenAi,
http: { basePath: { get: jest.fn() } },
conversationsSettingsBulkActions: {},
http: { basePath: { get: jest.fn() } } as unknown as HttpSetup,
onSelectedConversationChange,
selectedConversation: mockConvos['1234'],
setAssistantStreamingEnabled: jest.fn(),
setConversationSettings,
conversationsSettingsBulkActions: {},
setConversationsSettingsBulkActions,
} as unknown as ConversationSettingsProps;
};

jest.mock('../../../connectorland/use_load_connectors', () => ({
useLoadConnectors: () => ({
Expand Down Expand Up @@ -113,7 +114,6 @@ jest.mock('../../../connectorland/connector_selector', () => ({
/>
),
}));

describe('ConversationSettings', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down
Loading

0 comments on commit 87cba4b

Please sign in to comment.