Skip to content

Commit

Permalink
Merge remote-tracking branch '2.x' into backport/backport-215-to-2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Songkan Tang <[email protected]>
  • Loading branch information
songkant-aws committed Sep 5, 2024
2 parents 6826da3 + bf904f9 commit 7572794
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 58 deletions.
6 changes: 3 additions & 3 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "assistantDashboards",
"version": "2.16.0.0",
"opensearchDashboardsVersion": "2.16.0",
"version": "2.17.0.0",
"opensearchDashboardsVersion": "2.17.0",
"server": true,
"ui": true,
"requiredPlugins": [
Expand All @@ -21,4 +21,4 @@
"configPath": [
"assistant"
]
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assistant-dashboards",
"version": "2.16.0.0",
"version": "2.17.0.0",
"main": "index.ts",
"license": "Apache-2.0",
"scripts": {
Expand Down Expand Up @@ -39,5 +39,9 @@
"eslintIgnore": [
"node_modules/*",
"target/*"
]
}
],
"resolutions": {
"braces": "^3.0.3",
"micromatch": "^4.0.8"
}
}
4 changes: 2 additions & 2 deletions public/components/chat_experimental_badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React, { useState } from 'react';
import {
EuiPopover,
EuiButtonIcon,
EuiSmallButtonIcon,
EuiTitle,
EuiHorizontalRule,
EuiText,
Expand All @@ -32,7 +32,7 @@ export const ChatExperimentalBadge = ({ onClick }: ChatExperimentalBadgeProps) =
<EuiPopover
isOpen={visible}
button={
<EuiButtonIcon
<EuiSmallButtonIcon
color="text"
iconType="beaker"
onClick={handleIconClick}
Expand Down
4 changes: 2 additions & 2 deletions public/components/chat_window_header_title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiPopover,
EuiButtonIcon,
EuiSmallButtonIcon,
EuiToolTip,
} from '@elastic/eui';
import React, { useCallback, useMemo, useState } from 'react';
Expand Down Expand Up @@ -125,7 +125,7 @@ export const ChatWindowHeaderTitle = React.memo(() => {
<EuiPopover
id="conversationTitle"
button={
<EuiButtonIcon
<EuiSmallButtonIcon
onClick={onButtonClick}
aria-label="toggle chat context menu"
color="text"
Expand Down
4 changes: 2 additions & 2 deletions public/components/edit_conversation_name_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { useCallback, useRef } from 'react';

import { EuiConfirmModal, EuiFieldText, EuiSpacer, EuiText } from '@elastic/eui';
import { EuiConfirmModal, EuiCompressedFieldText, EuiSpacer, EuiText } from '@elastic/eui';
import { useCore } from '../contexts/core_context';
import { usePatchConversation } from '../hooks';

Expand Down Expand Up @@ -65,7 +65,7 @@ export const EditConversationNameModal = ({
<p>Please enter a new name for your conversation.</p>
</EuiText>
<EuiSpacer size="xs" />
<EuiFieldText
<EuiCompressedFieldText
inputRef={titleInputRef}
defaultValue={defaultTitle}
aria-label="Conversation name input"
Expand Down
20 changes: 10 additions & 10 deletions public/components/incontext_insight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import './index.scss';
import { i18n } from '@osd/i18n';
import {
EuiWrappingPopover,
EuiButton,
EuiFieldText,
EuiSmallButton,
EuiCompressedFieldText,
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiCompressedFormRow,
EuiPopoverTitle,
EuiText,
EuiPopoverFooter,
Expand All @@ -23,7 +23,7 @@ import {
EuiPanel,
keys,
EuiIcon,
EuiButtonIcon,
EuiSmallButtonIcon,
} from '@elastic/eui';
import React, { Children, isValidElement, useEffect, useRef, useState } from 'react';
import { IncontextInsight as IncontextInsightInput } from '../../types';
Expand Down Expand Up @@ -202,8 +202,8 @@ export const IncontextInsight = ({ children, httpSetup }: IncontextInsightProps)
return (
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={6}>
<EuiFormRow>
<EuiFieldText
<EuiCompressedFormRow>
<EuiCompressedFieldText
placeholder="Ask a question"
value={userQuestion}
autoFocus
Expand All @@ -215,10 +215,10 @@ export const IncontextInsight = ({ children, httpSetup }: IncontextInsightProps)
}
}}
/>
</EuiFormRow>
</EuiCompressedFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
<EuiSmallButton
fill
iconType="returnKey"
iconSide="right"
Expand All @@ -228,7 +228,7 @@ export const IncontextInsight = ({ children, httpSetup }: IncontextInsightProps)
}}
>
Go
</EuiButton>
</EuiSmallButton>
</EuiFlexItem>
</EuiFlexGroup>
);
Expand Down Expand Up @@ -318,7 +318,7 @@ export const IncontextInsight = ({ children, httpSetup }: IncontextInsightProps)
</EuiFlexItem>
<EuiFlexItem grow={false}>
<div>
<EuiButtonIcon
<EuiSmallButtonIcon
title={i18n.translate('assistantDashboards.incontextInsight.closeAssistant', {
defaultMessage: 'Close assistant popover',
})}
Expand Down
6 changes: 3 additions & 3 deletions public/components/invite_message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiButton, EuiEmptyPrompt, EuiLink } from '@elastic/eui';
import { EuiSmallButton, EuiEmptyPrompt, EuiLink } from '@elastic/eui';
import React from 'react';

export const InviteMessage: React.FC = () => {
Expand All @@ -28,9 +28,9 @@ export const InviteMessage: React.FC = () => {
</>
}
actions={
<EuiButton color="primary" fill href={mailtoLink}>
<EuiSmallButton color="primary" fill href={mailtoLink}>
Request invite
</EuiButton>
</EuiSmallButton>
}
/>
);
Expand Down
22 changes: 11 additions & 11 deletions public/components/notebook/notebook_name_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*/

import {
EuiButton,
EuiButtonEmpty,
EuiSmallButton,
EuiSmallButtonEmpty,
EuiLink,
EuiFormRow,
EuiCompressedFormRow,
EuiModal,
EuiModalBody,
EuiModalFooter,
EuiModalHeader,
EuiFieldText,
EuiCompressedFieldText,
EuiModalHeaderTitle,
} from '@elastic/eui';
import React, { useState, useCallback } from 'react';
Expand Down Expand Up @@ -71,20 +71,20 @@ export const NotebookNameModal = ({ onClose, saveChat }: NotebookNameModalProps)
</EuiModalHeader>

<EuiModalBody>
<EuiFormRow label="Please enter a name for your notebook.">
<EuiFieldText
<EuiCompressedFormRow label="Please enter a name for your notebook.">
<EuiCompressedFieldText
value={name}
onChange={(e) => setName(e.target.value)}
aria-label="Notebook name input"
/>
</EuiFormRow>
</EuiCompressedFormRow>
</EuiModalBody>

<EuiModalFooter>
<EuiButtonEmpty onClick={onClose} data-test-subj="cancelSaveToNotebookButton">
<EuiSmallButtonEmpty onClick={onClose} data-test-subj="cancelSaveToNotebookButton">
Cancel
</EuiButtonEmpty>
<EuiButton
</EuiSmallButtonEmpty>
<EuiSmallButton
type="submit"
fill
isLoading={loading}
Expand All @@ -93,7 +93,7 @@ export const NotebookNameModal = ({ onClose, saveChat }: NotebookNameModalProps)
data-test-subj="confirmSaveToNotebookButton"
>
Confirm name
</EuiButton>
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
</>
Expand Down
6 changes: 3 additions & 3 deletions public/tabs/chat/chat_page_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import {
EuiButton,
EuiSmallButton,
EuiEmptyPrompt,
EuiFlexGroup,
EuiFlexItem,
Expand Down Expand Up @@ -69,14 +69,14 @@ export const ChatPageContent: React.FC<ChatPageContentProps> = React.memo((props
body={props.messagesLoadingError.message}
titleSize="l"
actions={
<EuiButton
<EuiSmallButton
className="llm-chat-error-refresh-button"
fill
iconType="refresh"
onClick={props.onRefresh}
>
Refresh
</EuiButton>
</EuiSmallButton>
}
/>
</>
Expand Down
12 changes: 6 additions & 6 deletions public/tabs/chat/messages/message_bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import {
EuiAvatar,
EuiButtonIcon,
EuiSmallButtonIcon,
EuiCopy,
EuiFlexGroup,
EuiFlexItem,
Expand Down Expand Up @@ -184,7 +184,7 @@ export const MessageBubble: React.FC<MessageBubbleProps> = React.memo((props) =>
<EuiFlexItem grow={false}>
<EuiCopy textToCopy={props.message.content ?? ''}>
{(copy) => (
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="copy message"
title="copy message"
onClick={copy}
Expand All @@ -197,7 +197,7 @@ export const MessageBubble: React.FC<MessageBubbleProps> = React.memo((props) =>
)}
{props.showRegenerate && props.interaction?.interaction_id ? (
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="regenerate message"
onClick={() => props.onRegenerate?.(props.interaction?.interaction_id || '')}
title="regenerate message"
Expand All @@ -211,7 +211,7 @@ export const MessageBubble: React.FC<MessageBubbleProps> = React.memo((props) =>
<>
{feedbackResult !== false ? (
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="feedback thumbs up"
color={feedbackResult === true ? 'primary' : 'text'}
iconType="thumbsUp"
Expand All @@ -221,7 +221,7 @@ export const MessageBubble: React.FC<MessageBubbleProps> = React.memo((props) =>
) : null}
{feedbackResult !== true ? (
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="feedback thumbs down"
color={feedbackResult === false ? 'primary' : 'text'}
iconType="thumbsDown"
Expand All @@ -233,7 +233,7 @@ export const MessageBubble: React.FC<MessageBubbleProps> = React.memo((props) =>
)}
{props.message.interactionId ? (
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="How was this generated?"
data-test-subj={`trace-icon-${props.message.interactionId}`}
onClick={() => {
Expand Down
6 changes: 3 additions & 3 deletions public/tabs/history/chat_history_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { useCallback } from 'react';
import {
EuiButtonIcon,
EuiSmallButtonIcon,
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
Expand Down Expand Up @@ -75,15 +75,15 @@ export const ChatHistoryListItem = ({
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="s" responsive={false}>
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
onClick={handleEditClick}
iconType="pencil"
aria-label="Edit conversation name"
color="text"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
onClick={handleDeleteClick}
iconType="trash"
color="danger"
Expand Down
4 changes: 2 additions & 2 deletions public/tabs/history/chat_history_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
EuiSpacer,
EuiText,
EuiTitle,
EuiButtonIcon,
EuiSmallButtonIcon,
EuiFlexGroup,
EuiFlexItem,
} from '@elastic/eui';
Expand Down Expand Up @@ -148,7 +148,7 @@ export const ChatHistoryPage: React.FC<ChatHistoryPageProps> = React.memo((props
{flyoutFullScreen ? (
<EuiFlexGroup gutterSize="none" justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<EuiButtonIcon
<EuiSmallButtonIcon
aria-label="full screen back"
iconType="cross"
onClick={handleBack}
Expand Down
4 changes: 2 additions & 2 deletions public/tabs/history/chat_history_search_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import {
EuiFieldSearch,
EuiCompressedFieldSearch,
EuiFieldSearchProps,
EuiPanel,
EuiSpacer,
Expand Down Expand Up @@ -81,7 +81,7 @@ export const ChatHistorySearchList = ({
);
return (
<>
<EuiFieldSearch
<EuiCompressedFieldSearch
placeholder="Search by conversation name"
value={search}
onChange={onSearchChange}
Expand Down
Loading

0 comments on commit 7572794

Please sign in to comment.