-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Assistant] Clean up AI settings tabs (#187705)
## Summary Code clean up for my previous PR: 1. #184678 (comment) - Remove additional props. 2. Add `Created on` column for quick prompt and system prompt table 3. Wording change: #184678 (comment) - Rename column title. **Landing page:** <img width="1282" alt="Screenshot 2024-07-09 at 19 07 34" src="https://github.com/elastic/kibana/assets/6295984/20366ee7-497f-412c-9690-953af9f6992b"> **Knowledge base:** <img width="2552" alt="Screenshot 2024-07-15 at 15 32 40" src="https://github.com/user-attachments/assets/1d651042-b187-4c08-b55d-c58c1104fd1b"> **Evaluation:** <img width="2560" alt="Screenshot 2024-07-15 at 15 34 04" src="https://github.com/user-attachments/assets/31855fe6-e5dd-462d-9c06-2fee2554361a"> <img width="2556" alt="Screenshot 2024-07-09 at 19 38 06" src="https://github.com/elastic/kibana/assets/6295984/15be4f36-261b-4652-8d4f-be8e7d14676a"> **Anonymization:** <img width="2551" alt="Screenshot 2024-07-15 at 15 32 33" src="https://github.com/user-attachments/assets/27688bb5-851e-46fc-8f75-9700ce7a248a"> **Quick prompts:** <img width="2559" alt="Screenshot 2024-07-15 at 15 30 30" src="https://github.com/user-attachments/assets/e00c39a0-fb12-46f1-bb2a-bdf5c5bd49d2"> <img width="2557" alt="Screenshot 2024-07-09 at 19 27 18" src="https://github.com/elastic/kibana/assets/6295984/b581fc46-003b-4363-9c16-22534eb1d71e"> **System prompts:** <img width="2557" alt="Screenshot 2024-07-15 at 15 30 11" src="https://github.com/user-attachments/assets/95fd4fca-5041-40b7-b500-efc192166be0"> <img width="2558" alt="Screenshot 2024-07-09 at 19 10 36" src="https://github.com/elastic/kibana/assets/6295984/a701391a-978f-4684-a2ea-f72a5f572217"> **Conversations:** <img width="2553" alt="Screenshot 2024-07-15 at 15 30 01" src="https://github.com/user-attachments/assets/3411beb8-4775-4ba7-8b3e-c4111497eed2"> <img width="2554" alt="Screenshot 2024-07-09 at 21 33 37" src="https://github.com/elastic/kibana/assets/6295984/fbe2ee80-ba20-41b6-b224-3e317dc1c20e"> Connectors: <img width="2558" alt="Screenshot 2024-07-09 at 19 09 15" src="https://github.com/elastic/kibana/assets/6295984/c711ce09-65c0-45b3-90c1-a9019d35093c"> [Design](https://www.figma.com/design/BMvpY9EhcPIaoOS7LSrkL0/[8.15]-GenAI-Security-Assistant-Settings%3A-Stack-Management-Pages?node-id=51-25207&t=JHlgCm0sCYsl8WCM-0) ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
55 changed files
with
1,611 additions
and
1,181 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
60 changes: 60 additions & 0 deletions
60
...t/impl/assistant/common/components/assistant_settings_management/inline_actions/index.tsx
This file contains 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,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; | ||
}; |
This file contains 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
89 changes: 0 additions & 89 deletions
89
...tant/impl/assistant/common/components/assistant_settings_management/row_actions/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains 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 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
Oops, something went wrong.