-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.x`: - [[Search] Onboarding ux improvements (#196726)](#196726) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Yan Savitski","email":"yan.savitski@elastic.co"},"sourceCommit":{"committedDate":"2024-10-18T16:32:33Z","message":"[Search] Onboarding ux improvements (#196726)\n\nAcceptance Criteria\r\n\r\n- [x] Update Use in Playground to be a filled button and labelled\r\n“Search in Playground” (not empty button)\r\n- [x] Include View in Discover as a default button in page header\r\n- [x] Hide 'Add reference' in context menu when documents not presented\r\nin index to avoid duplication of this button\r\n- [x] Add Spacer in settings\r\n\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bcdfca68-b30f-4597-9e80-b0f27fcf6c9b\">\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/48d78874-806f-4ba1-bca6-ba5516e4fcfa\">","sha":"01d32b0dc0f377d8608a4b63c455b4982b1f33d3","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:prev-minor","v8.16.0"],"title":"[Search] Onboarding ux improvements","number":196726,"url":"https://github.com/elastic/kibana/pull/196726","mergeCommit":{"message":"[Search] Onboarding ux improvements (#196726)\n\nAcceptance Criteria\r\n\r\n- [x] Update Use in Playground to be a filled button and labelled\r\n“Search in Playground” (not empty button)\r\n- [x] Include View in Discover as a default button in page header\r\n- [x] Hide 'Add reference' in context menu when documents not presented\r\nin index to avoid duplication of this button\r\n- [x] Add Spacer in settings\r\n\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bcdfca68-b30f-4597-9e80-b0f27fcf6c9b\">\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/48d78874-806f-4ba1-bca6-ba5516e4fcfa\">","sha":"01d32b0dc0f377d8608a4b63c455b4982b1f33d3"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196726","number":196726,"mergeCommit":{"message":"[Search] Onboarding ux improvements (#196726)\n\nAcceptance Criteria\r\n\r\n- [x] Update Use in Playground to be a filled button and labelled\r\n“Search in Playground” (not empty button)\r\n- [x] Include View in Discover as a default button in page header\r\n- [x] Hide 'Add reference' in context menu when documents not presented\r\nin index to avoid duplication of this button\r\n- [x] Add Spacer in settings\r\n\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bcdfca68-b30f-4597-9e80-b0f27fcf6c9b\">\r\n<img width=\"1212\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/48d78874-806f-4ba1-bca6-ba5516e4fcfa\">","sha":"01d32b0dc0f377d8608a4b63c455b4982b1f33d3"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Yan Savitski <yan.savitski@elastic.co>
1 parent
ecf451f
commit 17ddf8d
Showing
6 changed files
with
116 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
x-pack/plugins/search_indices/public/hooks/use_navigate_to_discover.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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 { useCallback } from 'react'; | ||
import { useKibana } from './use_kibana'; | ||
|
||
const DISCOVER_LOCATOR_ID = 'DISCOVER_APP_LOCATOR'; | ||
|
||
export const useNavigateToDiscover = (indexName: string) => { | ||
const { share } = useKibana().services; | ||
|
||
return useCallback(async () => { | ||
const discoverLocator = share.url.locators.get(DISCOVER_LOCATOR_ID); | ||
if (discoverLocator && indexName) { | ||
await discoverLocator.navigate({ dataViewSpec: { title: indexName } }); | ||
} | ||
}, [share, indexName]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters