-
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.
[8.x] [Inventory] Change discover link to use entity definition (#201433
) (#202154) # Backport This will backport the following commits from `main` to `8.x`: - [[Inventory] Change discover link to use entity definition (#201433)](#201433) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"jennypavlova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-28T11:44:20Z","message":"[Inventory] Change discover link to use entity definition (#201433)\n\nCloses #200595 \r\n\r\n## Summary\r\n\r\nThis PR changes the link to discover: \r\n- Pass a different data view (using the entity definition indices)\r\n- from Open in Discover to Explore in Discover\r\n\r\n## Testing\r\n\r\n- To have the test data I used metricbeat (for the host entity) and\r\nsynthtrace (for the other entities type)\r\n- Open the inventory page and expand an entity type\r\n- Click on the `...` in the actions column\r\n- Click on `Explore in Discover`\r\n\r\nThe results should be filtered by the selected entity and the dataview\r\nshould include the indices from the entity definition:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29bb46b4-719e-4874-b1aa-056ac28d234a\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/36c08b8b-f507-445e-a7b5-8eb1176beb90\r\n\r\n\r\nWith service type filter (should not persist)\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ae6ef28a-e55a-4a32-9128-802ebea25607\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"afc5e51e296eb499a17ad82de560d20c352cd2a9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","backport:version","v8.17.0"],"title":"[Inventory] Change discover link to use entity definition","number":201433,"url":"https://github.com/elastic/kibana/pull/201433","mergeCommit":{"message":"[Inventory] Change discover link to use entity definition (#201433)\n\nCloses #200595 \r\n\r\n## Summary\r\n\r\nThis PR changes the link to discover: \r\n- Pass a different data view (using the entity definition indices)\r\n- from Open in Discover to Explore in Discover\r\n\r\n## Testing\r\n\r\n- To have the test data I used metricbeat (for the host entity) and\r\nsynthtrace (for the other entities type)\r\n- Open the inventory page and expand an entity type\r\n- Click on the `...` in the actions column\r\n- Click on `Explore in Discover`\r\n\r\nThe results should be filtered by the selected entity and the dataview\r\nshould include the indices from the entity definition:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29bb46b4-719e-4874-b1aa-056ac28d234a\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/36c08b8b-f507-445e-a7b5-8eb1176beb90\r\n\r\n\r\nWith service type filter (should not persist)\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ae6ef28a-e55a-4a32-9128-802ebea25607\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"afc5e51e296eb499a17ad82de560d20c352cd2a9"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201433","number":201433,"mergeCommit":{"message":"[Inventory] Change discover link to use entity definition (#201433)\n\nCloses #200595 \r\n\r\n## Summary\r\n\r\nThis PR changes the link to discover: \r\n- Pass a different data view (using the entity definition indices)\r\n- from Open in Discover to Explore in Discover\r\n\r\n## Testing\r\n\r\n- To have the test data I used metricbeat (for the host entity) and\r\nsynthtrace (for the other entities type)\r\n- Open the inventory page and expand an entity type\r\n- Click on the `...` in the actions column\r\n- Click on `Explore in Discover`\r\n\r\nThe results should be filtered by the selected entity and the dataview\r\nshould include the indices from the entity definition:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29bb46b4-719e-4874-b1aa-056ac28d234a\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/36c08b8b-f507-445e-a7b5-8eb1176beb90\r\n\r\n\r\nWith service type filter (should not persist)\r\n\r\n\r\nhttps://github.com/user-attachments/assets/ae6ef28a-e55a-4a32-9128-802ebea25607\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"afc5e51e296eb499a17ad82de560d20c352cd2a9"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: jennypavlova <[email protected]>
- Loading branch information
1 parent
6289b6c
commit 5036fd6
Showing
15 changed files
with
207 additions
and
136 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/kbn-server-route-repository-utils/src/format_request.test.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,30 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { formatRequest } from './format_request'; | ||
|
||
describe('formatRequest', () => { | ||
const version = 1; | ||
it('should return the correct path if the optional or required param is provided', () => { | ||
const pathParams = { param: 'testParam' }; | ||
const resultOptionalEnd = formatRequest(`GET /api/endpoint/{param?} ${version}`, pathParams); | ||
expect(resultOptionalEnd.pathname).toBe('/api/endpoint/testParam'); | ||
const resultRequiredEnd = formatRequest(`GET /api/endpoint/{param} ${version}`, pathParams); | ||
expect(resultRequiredEnd.pathname).toBe('/api/endpoint/testParam'); | ||
}); | ||
it('should return the correct path if the only an optional param is provided', () => { | ||
const resultOptEnd = formatRequest(`GET /api/endpoint/{id?} ${version}`, { id: 123 }); | ||
expect(resultOptEnd.pathname).toBe('/api/endpoint/123'); | ||
}); | ||
it('should return the correct path if the optional param is not provided', () => { | ||
const pathParams = {}; | ||
const resultEnd = formatRequest(`GET /api/endpoint/{pathParamReq?} ${version}`, pathParams); | ||
expect(resultEnd.pathname).toBe('/api/endpoint'); | ||
}); | ||
}); |
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
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
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
Oops, something went wrong.