[Search] Default onboarding workflow to semantic text (#224844)

## Summary

Defaults the onboarding workflow to semantic text.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Sander Philipse 2025-06-24 19:31:52 +02:00 committed by GitHub
parent f433e7aa97
commit 4b4023fd3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -69,8 +69,6 @@ describe('AddDocumentsCodeExample', () => {
<AddDocumentsCodeExample indexName={indexName} mappingProperties={mappingProperties} />
);
expect(generateSampleDocument).toHaveBeenCalledTimes(3);
exampleTexts.forEach((text, index) => {
expect(generateSampleDocument).toHaveBeenNthCalledWith(index + 1, mappingProperties, text);
});
@ -81,10 +79,8 @@ describe('AddDocumentsCodeExample', () => {
render(<AddDocumentsCodeExample indexName={indexName} mappingProperties={{}} />);
expect(generateSampleDocument).toHaveBeenCalledTimes(3);
const mappingProperties: Record<string, MappingProperty> = {
text: { type: 'text' },
text: { type: 'semantic_text' },
};
exampleTexts.forEach((text, index) => {

View file

@ -63,10 +63,14 @@ function onboardingTokenToWorkflowId(token: string | undefined | null): Workflow
}
}
const DEFAULT_WORKFLOW_ID: WorkflowId = 'semantic';
export const useWorkflow = () => {
const localStorageWorkflow = localStorage.getItem(WORKFLOW_LOCALSTORAGE_KEY);
const workflowId = isWorkflowId(localStorageWorkflow) ? localStorageWorkflow : null;
const [selectedWorkflowId, setSelectedWorkflowId] = useState<WorkflowId>(workflowId || 'default');
const [selectedWorkflowId, setSelectedWorkflowId] = useState<WorkflowId>(
workflowId || DEFAULT_WORKFLOW_ID
);
const { data } = useOnboardingTokenQuery();
useEffect(() => {

View file

@ -41,7 +41,7 @@
"@kbn/serverless",
"@kbn/utility-types",
"@kbn/search-navigation",
"@kbn/search-queries"
"@kbn/search-queries",
],
"exclude": [
"target/**/*",

View file

@ -54,11 +54,11 @@
"@kbn/logging-mocks",
"@kbn/inference-plugin",
"@kbn/code-editor",
"@kbn/monaco",
"@kbn/react-hooks",
"@kbn/core-http-router-server-mocks",
"@kbn/core-saved-objects-server",
"@kbn/search-queries"
"@kbn/search-queries",
"@kbn/monaco"
],
"exclude": [
"target/**/*",