Skip to content

refactor attempt with extension service#3

Closed
wildemat wants to merge 3 commits intosearch/indices/mappings/empty-statefrom
wip-refactor
Closed

refactor attempt with extension service#3
wildemat wants to merge 3 commits intosearch/indices/mappings/empty-statefrom
wip-refactor

Conversation

@wildemat
Copy link
Owner

@wildemat wildemat commented Sep 17, 2025

As part of adding index mapping empty state: PR

We want to conditionally hide the extra about/help text when there are no mappings.
To do this, we have to have the rendering of this content happen in the place that we know about whether or not mappings exist (only here: https://github.com/elastic/kibana/blob/db0b92448b751e3f8accee34f4e1cfe19309701d/x-pack/platform/plugins/shared/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx#L188)

That text is rendered in several places:

  • Stack Mgmt Index Mgmt (source of the IndexMappingComponent) - default "About" content
  • Stack Mgmt Connectors
    • sets showAboutMappings as false on IndexMappingComponent
    • Recreates the "About" and "Transform" panels within its own plugin code
  • Search Content Connectors
    • same as Stack Mgmt connectors with slightly different links and text
  • Serverless Search Index Mgmt
    • uses indexManagement?.extensionsService to populate the "Transform" section

This Draft PR is an attempt to consolidate some duplicated code. I tried adding to the Index Managment plugin's extension service. adding a method to set About and Extra content. Then all the users of the plugin could populate those items with just the unique text or link they want to use for About and Extra.

This doesn't work because extension service cannot call the same method twice. When two plugins are loaded that depend on Index Management plugin, they both try to set that content and one fails.

Solutions:

  • Don't conditionally show/hide the about/transform sections
  • Consolidate all of the extra text and links to be just one version, and put it in the Index Management plugin.
  • Add some props to the IndexManagement plugin and drill custom content for those sections through the props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant