forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Onboarding] Introduce search index details page locator and update a…
…ll reference (elastic#205005) ## Summary * Introducing new locator for onboarding `search_indices` plugin index details page - `SEARCH_INDEX_DETAILS_LOCATOR_ID`. * In stack, Updated view index details usage(connector table, connector details page, search application & web crawler) to use this locator to navigate to onboarding index details page ONLY when its `search - Elasticsearch solution nav` * Index management view index details would use extensionService with active solution id check in search_indices plugin * verified locally existing FTR & unit tests * Added FTR for index management in functional_search tests for search solution nav and classic nav https://github.com/user-attachments/assets/8f0fea00-3dce-449e-805a-b3cf317f4066 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
b6176b2
commit 54436e3
Showing
21 changed files
with
1,170 additions
and
77 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
36 changes: 36 additions & 0 deletions
36
...cations/applications/components/search_application/search_application_view_index_link.tsx
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,36 @@ | ||
/* | ||
* 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 React from 'react'; | ||
|
||
import { useValues } from 'kea'; | ||
|
||
import { EuiLink } from '@elastic/eui'; | ||
|
||
import { KibanaLogic } from '../../../shared/kibana'; | ||
|
||
export const SearchApplicationViewIndexLink: React.FC<{ | ||
indexName: string; | ||
dataTestSubj?: string; | ||
dataTelemetryId?: string; | ||
}> = ({ indexName, dataTestSubj, dataTelemetryId }) => { | ||
const { share } = useValues(KibanaLogic); | ||
|
||
const searchIndexDetailsUrl: string = | ||
share?.url.locators.get('SEARCH_INDEX_DETAILS_LOCATOR_ID')?.useUrl({ indexName }) ?? ''; | ||
|
||
return searchIndexDetailsUrl ? ( | ||
<EuiLink | ||
data-telemetry-id={dataTelemetryId} | ||
data-test-subj={dataTestSubj} | ||
href={searchIndexDetailsUrl} | ||
> | ||
{indexName} | ||
</EuiLink> | ||
) : ( | ||
<>{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
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
36 changes: 36 additions & 0 deletions
36
...ts/shared/connector_view_search_indices_details/connector_view_search_indices_details.tsx
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,36 @@ | ||
/* | ||
* 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 React from 'react'; | ||
|
||
import { useValues } from 'kea'; | ||
|
||
import { EuiLink } from '@elastic/eui'; | ||
|
||
import { KibanaLogic } from '../../../../shared/kibana'; | ||
|
||
export const ConnectorViewIndexLink: React.FC<{ | ||
indexName: string; | ||
target?: boolean; | ||
}> = ({ indexName, target }) => { | ||
const { share } = useValues(KibanaLogic); | ||
|
||
const searchIndexDetailsUrl = share?.url.locators | ||
.get('SEARCH_INDEX_DETAILS_LOCATOR_ID') | ||
?.useUrl({ indexName }); | ||
|
||
return searchIndexDetailsUrl ? ( | ||
<EuiLink | ||
target={target ? '_blank' : undefined} | ||
external={target ?? false} | ||
href={searchIndexDetailsUrl} | ||
> | ||
{indexName} | ||
</EuiLink> | ||
) : ( | ||
<>{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
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
15 changes: 15 additions & 0 deletions
15
x-pack/solutions/search/plugins/search_indices/public/locators/index.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,15 @@ | ||
/* | ||
* 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 { SharePluginSetup } from '@kbn/share-plugin/public'; | ||
import { SerializableRecord } from '@kbn/utility-types'; | ||
import { CreateIndexLocatorDefinition } from './create_index_locator'; | ||
import { SearchIndicesLocatorDefinition } from './search_indices_locator'; | ||
|
||
export function registerLocators(share: SharePluginSetup) { | ||
share.url.locators.create<SerializableRecord>(new CreateIndexLocatorDefinition()); | ||
share.url.locators.create<SerializableRecord>(new SearchIndicesLocatorDefinition()); | ||
} |
35 changes: 35 additions & 0 deletions
35
x-pack/solutions/search/plugins/search_indices/public/locators/search_indices_locator.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,35 @@ | ||
/* | ||
* 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 type { LocatorDefinition } from '@kbn/share-plugin/common'; | ||
import type { SerializableRecord } from '@kbn/utility-types'; | ||
|
||
import { INDICES_APP_ID } from '../../common'; | ||
import { SearchIndexDetailsTabValues } from '../routes'; | ||
|
||
export interface SearchIndicesLocatorParams extends SerializableRecord { | ||
indexName: string; | ||
detailsTabId: string; | ||
} | ||
|
||
export class SearchIndicesLocatorDefinition | ||
implements LocatorDefinition<SearchIndicesLocatorParams> | ||
{ | ||
public readonly getLocation = async (params: SearchIndicesLocatorParams) => { | ||
const path = `/index_details/${params.indexName}`; | ||
|
||
return { | ||
app: INDICES_APP_ID, | ||
path: SearchIndexDetailsTabValues.includes(params.detailsTabId) | ||
? `${path}/${params.detailsTabId}` | ||
: path, | ||
state: {}, | ||
}; | ||
}; | ||
|
||
public readonly id = 'SEARCH_INDEX_DETAILS_LOCATOR_ID'; | ||
} |
Oops, something went wrong.