Skip to content

Migrate ui/registry/feature_catalogue to New Platform plugin#48818

Merged
joshdover merged 6 commits intoelastic:masterfrom
joshdover:np/feature-catalogue
Oct 28, 2019
Merged

Migrate ui/registry/feature_catalogue to New Platform plugin#48818
joshdover merged 6 commits intoelastic:masterfrom
joshdover:np/feature-catalogue

Conversation

@joshdover
Copy link
Copy Markdown
Contributor

@joshdover joshdover commented Oct 21, 2019

Summary

Fixes #46738

This PR adds a new feature_catalogue plugin which provides an interface for registering and reading a catalogue items.

For the time being, the Home app will register all items out of the legacy registry with the new plugin, and then read these items out of the new plugin.

Dev Docs

The ui/registries/feature_catalogue module has been deprecated for removal in 8.0

Plugins wishing to migrate may remove their usage of ui/registries/feature_catalogue and rely on either:

// For legacy plugins
import { npSetup } from 'ui/new_platform';
npSetup.plugins.feature_catalogue.register(/* same details here */);

// For new plugins: first add 'feature_catalogue` to the list of `optionalPlugins` 
// in your kibana.json file. Then access the plugin directly in `setup`:

class MyPlugin {
  setup(core, plugins) {
    if (plugins.feature_catalogue) {
      plugins.feature_catalogue.register(/* same details here. */);
    }
  }
}

Note that the old module supported providing a Angular DI function to receive Angular dependencies. This is no longer supported as we migrate away from Angular.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@joshdover joshdover added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// Feature:New Platform release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v8.0.0 v7.6.0 labels Oct 21, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is desired behaviour https://github.com/elastic/kibana/pull/48818/files#diff-a757f884a32fbf9bab5a0c977e69bb9eR54
just curious why? to allow OSS ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for plugins that haven't registered features, eg. 3rd party plugins, functional test plugins, etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: not sure those are really useful tests if TS enforces the contract

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can go either way here, but I prefer some coverage here over nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then probably we should rename either?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be more clear once this registry moves into a "home" plugin with the actual UI. I opted not to name this plugin "home" right now since it may not be split out until 8.x and I thought that would be confusing in the meantime.

@joshdover joshdover force-pushed the np/feature-catalogue branch from b56a005 to f612fb9 Compare October 23, 2019 14:15
@joshdover joshdover requested a review from a team as a code owner October 23, 2019 14:37
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@joshdover
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@joshdover
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

merge conflict between base and head

@joshdover joshdover force-pushed the np/feature-catalogue branch from 7b58502 to e6a27c2 Compare October 28, 2019 16:26
(Private(FeatureCatalogueRegistryProvider as any) as any).inTitleOrder.map(
npSetup.plugins.feature_catalogue.register
);
return npStart.plugins.feature_catalogue.get();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flash1293 Any issues with doing this here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all, that's fine 👍

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@joshdover joshdover merged commit 23a9058 into elastic:master Oct 28, 2019
@joshdover joshdover deleted the np/feature-catalogue branch October 28, 2019 18:08
joshdover added a commit to joshdover/kibana that referenced this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:New Platform release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v7.6.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate ui/registry/feature_catalogue to New Platform

5 participants