diff --git a/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/translations.ts index 077426884eb8a..34e158ac699cc 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/translations.ts @@ -168,20 +168,6 @@ export const ENTRY_NAME_INPUT_PLACEHOLDER = i18n.translate( } ); -export const ENTRY_SPACE_INPUT_LABEL = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.knowledgeBaseSettingsManagement.entrySpaceInputLabel', - { - defaultMessage: 'Space', - } -); - -export const ENTRY_SPACE_INPUT_PLACEHOLDER = i18n.translate( - 'xpack.elasticAssistant.assistant.settings.knowledgeBaseSettingsManagement.entrySpaceInputPlaceholder', - { - defaultMessage: 'Select', - } -); - export const SHARING_PRIVATE_OPTION_LABEL = i18n.translate( 'xpack.elasticAssistant.assistant.settings.knowledgeBaseSettingsManagement.sharingPrivateOptionLabel', { @@ -272,7 +258,8 @@ export const ENTRY_DESCRIPTION_HELP_LABEL = i18n.translate( export const ENTRY_DESCRIPTION_PLACEHOLDER = i18n.translate( 'xpack.elasticAssistant.assistant.settings.knowledgeBaseSettingsManagement.entryDescriptionPlaceholder', { - defaultMessage: 'Use this index to answer any question related to asset information.', + defaultMessage: + 'Example: "Use this index to answer any question related to asset information."', } ); @@ -295,7 +282,7 @@ export const ENTRY_QUERY_DESCRIPTION_PLACEHOLDER = i18n.translate( 'xpack.elasticAssistant.assistant.settings.knowledgeBaseSettingsManagement.entryQueryDescriptionPlaceholder', { defaultMessage: - 'Key terms to retrieve asset related information, like host names, IP Addresses or cloud objects.', + 'Example: "Key terms to retrieve asset related information, like host names, IP Addresses or cloud objects."', } ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/use_knowledge_base_table.tsx b/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/use_knowledge_base_table.tsx index 67157b3ae7b12..d27853f6e8625 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/use_knowledge_base_table.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/knowledge_base/knowledge_base_settings_management/use_knowledge_base_table.tsx @@ -16,6 +16,7 @@ import { } from '@kbn/elastic-assistant-common'; import useAsync from 'react-use/lib/useAsync'; +import { UserProfileAvatarData } from '@kbn/user-profile-components'; import { useAssistantContext } from '../../..'; import * as i18n from './translations'; import { BadgesColumn } from '../../assistant/common/components/assistant_settings_management/badges'; @@ -23,14 +24,21 @@ import { useInlineActions } from '../../assistant/common/components/assistant_se import { isSystemEntry } from './helpers'; const AuthorColumn = ({ entry }: { entry: KnowledgeBaseEntryResponse }) => { - const { currentUserAvatar, userProfileService } = useAssistantContext(); + const { userProfileService } = useAssistantContext(); const userProfile = useAsync(async () => { - const profile = await userProfileService?.bulkGet({ uids: new Set([entry.createdBy]) }); - return profile?.[0].user.username; - }, []); + const profile = await userProfileService?.bulkGet<{ avatar: UserProfileAvatarData }>({ + uids: new Set([entry.createdBy]), + dataPath: 'avatar', + }); + return { username: profile?.[0].user.username, avatar: profile?.[0].data.avatar }; + }, [entry.createdBy]); - const userName = useMemo(() => userProfile?.value ?? 'Unknown', [userProfile?.value]); + const userName = useMemo( + () => userProfile?.value?.username ?? 'Unknown', + [userProfile?.value?.username] + ); + const userAvatar = userProfile.value?.avatar; const badgeItem = isSystemEntry(entry) ? 'Elastic' : userName; const userImage = isSystemEntry(entry) ? ( { margin-right: 14px; `} /> - ) : currentUserAvatar?.imageUrl != null ? ( + ) : userAvatar?.imageUrl != null ? ( { ) : ( { }, { name: i18n.COLUMN_AUTHOR, - sortable: ({ users }: KnowledgeBaseEntryResponse) => users[0]?.name, render: (entry: KnowledgeBaseEntryResponse) => , }, { diff --git a/x-pack/packages/kbn-elastic-assistant/tsconfig.json b/x-pack/packages/kbn-elastic-assistant/tsconfig.json index 8d19fa86f4d11..f1dde6cbeafee 100644 --- a/x-pack/packages/kbn-elastic-assistant/tsconfig.json +++ b/x-pack/packages/kbn-elastic-assistant/tsconfig.json @@ -31,5 +31,6 @@ "@kbn/core", "@kbn/zod", "@kbn/data-views-plugin", + "@kbn/user-profile-components", ] }