mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Fleet] Link to the installed version of an integration from global search (#115736)
* remove version from integrations global search link * fix tests Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c491d8c366
commit
eb2b886a39
2 changed files with 25 additions and 27 deletions
|
@ -87,22 +87,22 @@ describe('Package search provider', () => {
|
|||
).toBe('--(a|)', {
|
||||
a: [
|
||||
{
|
||||
id: 'test-test',
|
||||
id: 'test',
|
||||
score: 80,
|
||||
title: 'test',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test-test/overview',
|
||||
path: 'undefined/detail/test/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'test1-test1',
|
||||
id: 'test1',
|
||||
score: 80,
|
||||
title: 'test1',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test1-test1/overview',
|
||||
path: 'undefined/detail/test1/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
|
@ -170,12 +170,12 @@ describe('Package search provider', () => {
|
|||
).toBe('--(a|)', {
|
||||
a: [
|
||||
{
|
||||
id: 'test1-test1',
|
||||
id: 'test1',
|
||||
score: 80,
|
||||
title: 'test1',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test1-test1/overview',
|
||||
path: 'undefined/detail/test1/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
|
@ -226,22 +226,22 @@ describe('Package search provider', () => {
|
|||
).toBe('--(a|)', {
|
||||
a: [
|
||||
{
|
||||
id: 'test-test',
|
||||
id: 'test',
|
||||
score: 80,
|
||||
title: 'test',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test-test/overview',
|
||||
path: 'undefined/detail/test/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'test1-test1',
|
||||
id: 'test1',
|
||||
score: 80,
|
||||
title: 'test1',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test1-test1/overview',
|
||||
path: 'undefined/detail/test1/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
|
@ -269,12 +269,12 @@ describe('Package search provider', () => {
|
|||
).toBe('--(a|)', {
|
||||
a: [
|
||||
{
|
||||
id: 'test1-test1',
|
||||
id: 'test1',
|
||||
score: 80,
|
||||
title: 'test1',
|
||||
type: 'integration',
|
||||
url: {
|
||||
path: 'undefined/detail/test1-test1/overview',
|
||||
path: 'undefined/detail/test1/overview',
|
||||
prependBasePath: false,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -53,21 +53,19 @@ export const toSearchResult = (
|
|||
pkg: PackageListItem,
|
||||
application: ApplicationStart,
|
||||
basePath: IBasePath
|
||||
): GlobalSearchProviderResult => {
|
||||
const pkgkey = `${pkg.name}-${pkg.version}`;
|
||||
return {
|
||||
id: pkgkey,
|
||||
type: packageType,
|
||||
title: pkg.title,
|
||||
score: 80,
|
||||
icon: getEuiIconType(pkg, basePath),
|
||||
url: {
|
||||
// prettier-ignore
|
||||
path: `${application.getUrlForApp(INTEGRATIONS_PLUGIN_ID)}${pagePathGetters.integration_details_overview({ pkgkey })[1]}`,
|
||||
prependBasePath: false,
|
||||
},
|
||||
};
|
||||
};
|
||||
): GlobalSearchProviderResult => ({
|
||||
id: pkg.name,
|
||||
type: packageType,
|
||||
title: pkg.title,
|
||||
score: 80,
|
||||
icon: getEuiIconType(pkg, basePath),
|
||||
url: {
|
||||
path: `${application.getUrlForApp(INTEGRATIONS_PLUGIN_ID)}${
|
||||
pagePathGetters.integration_details_overview({ pkgkey: pkg.name })[1]
|
||||
}`,
|
||||
prependBasePath: false,
|
||||
},
|
||||
});
|
||||
|
||||
export const createPackageSearchProvider = (core: CoreSetup): GlobalSearchResultProvider => {
|
||||
const coreStart$ = from(core.getStartServices()).pipe(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue