mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[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:
parent
f433e7aa97
commit
4b4023fd3c
4 changed files with 9 additions and 9 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"@kbn/serverless",
|
||||
"@kbn/utility-types",
|
||||
"@kbn/search-navigation",
|
||||
"@kbn/search-queries"
|
||||
"@kbn/search-queries",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
|
@ -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/**/*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue