Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d076ad1
Add setting to configure default LLM
KDKHD Aug 15, 2025
779ffdc
Add tests
KDKHD Aug 15, 2025
208f283
lint
KDKHD Aug 18, 2025
3563bde
lint
KDKHD Aug 18, 2025
48a2772
lint
KDKHD Aug 18, 2025
041d4cf
lint
KDKHD Aug 18, 2025
6ac17a7
lint
KDKHD Aug 18, 2025
b4a1986
lint
KDKHD Aug 18, 2025
3517b93
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Aug 18, 2025
3b01e0b
lint
KDKHD Aug 18, 2025
9a3379c
Merge branch 'main' into feature/default-llm-setting
elasticmachine Aug 18, 2025
a791032
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 18, 2025
f284831
roles
KDKHD Aug 18, 2025
8a78db9
types
KDKHD Aug 18, 2025
d5b18c3
[CI] Auto-commit changed files from 'node scripts/telemetry_check'
kibanamachine Aug 18, 2025
08af810
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 18, 2025
9abe55c
code review
KDKHD Aug 20, 2025
514f167
Merge branch 'main' of github.com:elastic/kibana into feature/default…
KDKHD Aug 20, 2025
1505aa5
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 20, 2025
0d01972
cr
KDKHD Aug 21, 2025
8735c66
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 21, 2025
98dd5ef
@rbrtj code review
KDKHD Aug 28, 2025
f7a1838
Merge branch 'main' into feature/default-llm-setting
elasticmachine Aug 28, 2025
334e6ac
style
KDKHD Aug 28, 2025
8c20a40
Merge branch 'feature/default-llm-setting' of github.com:KDKHD/kibana…
KDKHD Aug 28, 2025
2463262
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 28, 2025
62b3851
typo
KDKHD Aug 28, 2025
aaa797b
fix test
KDKHD Aug 29, 2025
131f051
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Aug 29, 2025
c2091b7
Merge branch 'main' into feature/default-llm-setting
KDKHD Aug 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING =
'observability:aiAssistantSimulatedFunctionCalling';
export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN =
'observability:aiAssistantSearchConnectorIndexPattern';
export const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR = 'genAiSettings:defaultAIConnector';
export const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY =
'genAiSettings:defaultAIConnectorOnly';
export const AI_ASSISTANT_PREFERRED_AI_ASSISTANT_TYPE = 'aiAssistant:preferredAIAssistantType';
export const AI_ANONYMIZATION_SETTINGS = 'ai:anonymizationSettings';
export const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = 'observability:searchExcludedDataTiers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,4 +696,16 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
description: 'Enable diagnostic mode',
},
},
'genAiSettings:defaultAIConnector': {
type: 'keyword',
_meta: {
description: 'Default AI connector',
},
},
'genAiSettings:defaultAIConnectorOnly': {
type: 'boolean',
_meta: {
description: 'Restrict to default AI connector only',
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,7 @@ export interface UsageStats {
'observability:enableStreamsUI': boolean;
'observability:enableDiagnosticMode': boolean;
'observability:streamsEnableSignificantEvents': boolean;
'genAiSettings:defaultAIConnector': string;
'genAiSettings:defaultAIConnectorOnly': boolean;
'observability:streamsEnableGroupStreams': boolean;
}
12 changes: 12 additions & 0 deletions src/platform/plugins/shared/telemetry/schema/oss_platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -11071,6 +11071,18 @@
"_meta": {
"description": "Enable diagnostic mode"
}
},
"genAiSettings:defaultAIConnector": {
"type": "keyword",
"_meta": {
"description": "Default AI connector"
}
},
"genAiSettings:defaultAIConnectorOnly": {
"type": "boolean",
"_meta": {
"description": "Restrict to default AI connector only"
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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.
*/

export const NO_DEFAULT_CONNECTOR = 'NO_DEFAULT_CONNECTOR';
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 { render, screen } from '@testing-library/react';
import { BottomBarActions } from './bottom_bar_actions';
import React from 'react';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';

describe('bottom_bar_actions', () => {
beforeEach(() => {
jest.clearAllMocks();
});

function Providers({ children }: { children: React.ReactNode }) {
return (
<IntlProvider locale="en" messages={{}}>
{children}
</IntlProvider>
);
}

it('renders correctly', () => {
const onDiscardChanges = jest.fn();
const onSave = jest.fn();
render(
<BottomBarActions
isLoading={true}
onDiscardChanges={onDiscardChanges}
onSave={onSave}
unsavedChangesCount={5}
saveLabel="Save Changes"
appTestSubj="genAiSettings"
/>,
{ wrapper: Providers }
);

expect(screen.getByTestId('genAiSettingsBottomBar')).toBeInTheDocument();
expect(screen.getByText('5 unsaved changes')).toBeInTheDocument();
expect(screen.getByText('Save Changes')).toBeInTheDocument();
expect(screen.getByText('Discard changes')).toBeInTheDocument();

expect(onDiscardChanges).not.toHaveBeenCalled();
screen.getByText('Discard changes').click();
expect(onDiscardChanges).toHaveBeenCalled();

expect(onSave).not.toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* 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 {
EuiBottomBar,
EuiButton,
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiHealth,
EuiText,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';

interface Props {
unsavedChangesCount: number;
isLoading: boolean;
onDiscardChanges: () => void;
onSave: () => void;
saveLabel: string;
appTestSubj: string;
areChangesInvalid?: boolean;
}

export const BottomBarActions = ({
isLoading,
onDiscardChanges,
onSave,
unsavedChangesCount,
saveLabel,
appTestSubj,
areChangesInvalid = false,
}: Props) => {
return (
<EuiBottomBar paddingSize="s" data-test-subj={`${appTestSubj}BottomBar`}>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem
grow={false}
css={{
flexDirection: 'row',
alignItems: 'center',
}}
>
<EuiHealth color="warning" />
<EuiText>
<FormattedMessage
id="xpack.gen_ai_settings.bottomBarActions.unsavedChanges"
defaultMessage="{unsavedChangesCount, plural, =0{0 unsaved changes} one {1 unsaved change} other {# unsaved changes}}"
values={{ unsavedChangesCount }}
/>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexItem grow={false}>
<EuiButtonEmpty
data-test-subj={`${appTestSubj}BottomBarActionsDiscardChangesButton`}
color="text"
onClick={onDiscardChanges}
>
<FormattedMessage
id="xpack.gen_ai_settings.bottomBarActions.discardChangesButtonAriaLabel"
defaultMessage="Discard changes"
/>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
content={
areChangesInvalid &&
i18n.translate(
Comment thread
KDKHD marked this conversation as resolved.
'xpack.gen_ai_settings.bottomBarActions.saveButtonTooltipWithInvalidChanges',
{
defaultMessage: 'Fix invalid settings before saving.',
}
)
}
>
<EuiButton
disabled={areChangesInvalid}
data-test-subj={`${appTestSubj}BottomBarActionsButton`}
onClick={onSave}
fill
isLoading={isLoading}
color="success"
iconType="check"
>
{saveLabel}
</EuiButton>
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</EuiBottomBar>
);
};
Loading