-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Security Solution] AI settings #184678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[Security Solution] AI settings #184678
Changes from 32 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
c316c0a
connectors tab
angorayc f6a81d4
connectors tab
angorayc 0f053ba
conversation tab
angorayc 889ef91
add prompts
angorayc 84f05a4
revert changes
angorayc fd873ae
evaluation tab
angorayc d5892f1
system prompt
angorayc b591eb5
connector title
angorayc 376d82e
clean up
angorayc f97b701
default page size to 25
angorayc d3fe407
Merge branch 'main' of github.com:elastic/kibana into ai-settings
angorayc 577128e
revert evaluation tab
angorayc ce38466
unit tests
angorayc 6aac96e
fix update connector from modal
angorayc d758032
fix types
angorayc d229af8
unit tests
angorayc 6cd1778
types
angorayc 7c226ba
pending changes
angorayc 7fe3085
types
angorayc 0bfdeed
update connector and model
angorayc b457625
Merge branch 'ai-settings' of github.com:angorayc/kibana into ai-sett…
angorayc 5353d20
refetch conversations
angorayc 559478a
fix create conversations from system prompt tab
angorayc d53a830
Merge branch 'main' of github.com:elastic/kibana into ai-settings
angorayc 3a3f4bc
fix prompts
angorayc bcdd052
rm updatedAt
angorayc cdfe570
styling
angorayc d838821
types
angorayc 842e9e0
revert ui-action changes
angorayc 70ef92d
avoid prompt saved automatically
angorayc 302a901
tests
angorayc bbbc345
unit tests
angorayc 01decb1
remove additional props
angorayc a635288
styling
angorayc 8b8f545
add unit tests
angorayc 6213419
Merge branch 'main' into ai-settings
angorayc 379bf18
i18n
angorayc ff48987
add pageSizeOptions
angorayc c78da14
Merge branch 'ai-settings' of github.com:angorayc/kibana into ai-sett…
angorayc 60f271e
fix typo and pagination
angorayc e63e692
store pagination and sorting in seession
angorayc 7c30b20
fix jumping cursor
angorayc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...assistant/impl/assistant/common/components/assistant_settings_management/badges/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * 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 { EuiBadge } from '@elastic/eui'; | ||
| import React from 'react'; | ||
|
|
||
| export const BadgesColumn: React.FC<{ items: string[] | null | undefined; prefix: string }> = | ||
| React.memo(({ items, prefix }) => | ||
| items && items.length > 0 ? ( | ||
| <div> | ||
| {items.map((c, idx) => ( | ||
| <EuiBadge key={`${prefix}-${idx}`} color="hollow"> | ||
| {c} | ||
| </EuiBadge> | ||
| ))} | ||
| </div> | ||
| ) : null | ||
| ); | ||
| BadgesColumn.displayName = 'BadgesColumn'; |
78 changes: 78 additions & 0 deletions
78
...assistant/impl/assistant/common/components/assistant_settings_management/flyout/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /* | ||
| * 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 { | ||
| EuiButton, | ||
| EuiButtonEmpty, | ||
| EuiFlexGroup, | ||
| EuiFlexItem, | ||
| EuiFlyout, | ||
| EuiFlyoutBody, | ||
| EuiFlyoutFooter, | ||
| EuiFlyoutHeader, | ||
| EuiTitle, | ||
| } from '@elastic/eui'; | ||
| import React from 'react'; | ||
| import * as i18n from './translations'; | ||
|
|
||
| interface Props { | ||
| children: React.ReactNode; | ||
| title: string; | ||
| flyoutVisible: boolean; | ||
| onClose: () => void; | ||
| onSaveCancelled: () => void; | ||
| onSaveConfirmed: () => void; | ||
| } | ||
|
|
||
| const FlyoutComponent: React.FC<Props> = ({ | ||
| title, | ||
| flyoutVisible, | ||
| children, | ||
| onClose, | ||
| onSaveCancelled, | ||
| onSaveConfirmed, | ||
| }) => { | ||
| return flyoutVisible ? ( | ||
| <EuiFlyout ownFocus onClose={onClose}> | ||
| <EuiFlyoutHeader> | ||
| <EuiTitle size={'s'}> | ||
| <h2>{title}</h2> | ||
| </EuiTitle> | ||
| </EuiFlyoutHeader> | ||
| <EuiFlyoutBody>{children}</EuiFlyoutBody> | ||
| <EuiFlyoutFooter> | ||
| <EuiFlexGroup justifyContent="spaceBetween" gutterSize="s"> | ||
| <EuiFlexItem grow={false}> | ||
| <EuiButtonEmpty | ||
| size="m" | ||
| color="text" | ||
| iconType="cross" | ||
| data-test-subj="cancel-button" | ||
| onClick={onSaveCancelled} | ||
| > | ||
| {i18n.FLYOUT_CANCEL_BUTTON_TITLE} | ||
| </EuiButtonEmpty> | ||
| </EuiFlexItem> | ||
| <EuiFlexItem grow={false}> | ||
| <EuiButton | ||
| size="m" | ||
| type="submit" | ||
| data-test-subj="save-button" | ||
| onClick={onSaveConfirmed} | ||
| iconType="check" | ||
| fill | ||
| > | ||
| {i18n.FLYOUT_SAVE_BUTTON_TITLE} | ||
| </EuiButton> | ||
| </EuiFlexItem> | ||
| </EuiFlexGroup> | ||
| </EuiFlyoutFooter> | ||
| </EuiFlyout> | ||
| ) : null; | ||
| }; | ||
|
|
||
| export const Flyout = React.memo(FlyoutComponent); |
22 changes: 22 additions & 0 deletions
22
...ant/impl/assistant/common/components/assistant_settings_management/flyout/translations.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| * 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 { i18n } from '@kbn/i18n'; | ||
|
|
||
| export const FLYOUT_SAVE_BUTTON_TITLE = i18n.translate( | ||
| 'xpack.elasticAssistant.assistant.settings.flyout.saveButtonTitle', | ||
| { | ||
| defaultMessage: 'Save', | ||
| } | ||
| ); | ||
|
|
||
| export const FLYOUT_CANCEL_BUTTON_TITLE = i18n.translate( | ||
| 'xpack.elasticAssistant.assistant.settings.flyout.cancelButtonTitle', | ||
| { | ||
| defaultMessage: 'Cancel', | ||
| } | ||
| ); |
29 changes: 29 additions & 0 deletions
29
...ant/common/components/assistant_settings_management/flyout/use_flyout_modal_visibility.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * 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 { useMemo, useState } from 'react'; | ||
|
|
||
| export const useFlyoutModalVisibility = () => { | ||
| const [isFlyoutOpen, setIsFlyoutOpen] = useState(false); | ||
|
|
||
| const openFlyout = () => { | ||
| setIsFlyoutOpen(true); | ||
| }; | ||
|
|
||
| const closeFlyout = () => { | ||
| setIsFlyoutOpen(false); | ||
| }; | ||
|
|
||
| return useMemo( | ||
| () => ({ | ||
| isFlyoutOpen, | ||
| openFlyout, | ||
| closeFlyout, | ||
| }), | ||
| [isFlyoutOpen] | ||
| ); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.