Skip to content

Commit e46f977

Browse files
Np kibana plugin home feature catalogue (#50838)
* Moves feature_catalogue services into the home plugin public folder.
1 parent 295f1df commit e46f977

32 files changed

+151
-71
lines changed

src/core/MIGRATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ import { setup, start } from '../core_plugins/visualizations/public/legacy';
11391139
| `ui/embeddable` | `embeddables` | still in progress |
11401140
| `ui/filter_manager` | `data.filter` | -- |
11411141
| `ui/index_patterns` | `data.indexPatterns` | still in progress |
1142-
| `ui/registry/feature_catalogue | `feature_catalogue.register` | Must add `feature_catalogue` as a dependency in your kibana.json. |
1142+
| `ui/registry/feature_catalogue` | `home.featureCatalogue.register` | Must add `home` as a dependency in your kibana.json. |
11431143
| `ui/registry/vis_types` | `visualizations.types` | -- |
11441144
| `ui/vis` | `visualizations.types` | -- |
11451145
| `ui/share` | `share` | `showShareContextMenu` is now called `toggleShareContextMenu`, `ShareContextMenuExtensionsRegistryProvider` is now called `register` |
@@ -1182,7 +1182,7 @@ This table shows where these uiExports have moved to in the New Platform. In mos
11821182
| `fieldFormatEditors` | | |
11831183
| `fieldFormats` | | |
11841184
| `hacks` | n/a | Just run the code in your plugin's `start` method. |
1185-
| `home` | [`plugins.feature_catalogue.register`](./src/plugins/feature_catalogue) | Must add `feature_catalogue` as a dependency in your kibana.json. |
1185+
| `home` | [`plugins.home.featureCatalogue.register`](./src/plugins/home/public/feature_catalogue) | Must add `home` as a dependency in your kibana.json. |
11861186
| `indexManagement` | | Should be an API on the indexManagement plugin. |
11871187
| `injectDefaultVars` | n/a | Plugins will only be able to "whitelist" config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
11881188
| `inspectorViews` | | Should be an API on the data (?) plugin. |

src/legacy/core_plugins/console/np_ready/public/legacy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ import { I18nContext } from 'ui/i18n';
3030

3131
export interface XPluginSet {
3232
devTools: DevToolsSetup;
33-
feature_catalogue: FeatureCatalogueSetup;
33+
home: HomePublicPluginSetup;
3434
__LEGACY: {
3535
I18nContext: any;
3636
};
3737
}
3838

3939
import { plugin } from '.';
4040
import { DevToolsSetup } from '../../../../../plugins/dev_tools/public';
41-
import { FeatureCatalogueSetup } from '../../../../../plugins/feature_catalogue/public';
41+
import { HomePublicPluginSetup } from '../../../../../plugins/home/public';
4242

4343
const pluginInstance = plugin({} as any);
4444

src/legacy/core_plugins/console/np_ready/public/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export class ConsoleUIPlugin implements Plugin<any, any> {
3232
const {
3333
__LEGACY: { I18nContext },
3434
devTools,
35-
feature_catalogue,
35+
home,
3636
} = pluginSet;
3737

38-
feature_catalogue.register({
38+
home.featureCatalogue.register({
3939
id: 'console',
4040
title: i18n.translate('console.devToolsTitle', {
4141
defaultMessage: 'Console',

src/legacy/core_plugins/kibana/public/home/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ let copiedLegacyCatalogue = false;
6464
const Private = injector.get<IPrivate>('Private');
6565
// Merge legacy registry with new registry
6666
(Private(FeatureCatalogueRegistryProvider as any) as any).inTitleOrder.map(
67-
npSetup.plugins.feature_catalogue.register
67+
npSetup.plugins.home.featureCatalogue.register
6868
);
6969
copiedLegacyCatalogue = true;
7070
}
71-
return npStart.plugins.feature_catalogue.get();
71+
return npStart.plugins.home.featureCatalogue.get();
7272
},
7373
getAngularDependencies,
7474
localApplicationService,

src/legacy/core_plugins/kibana/public/home/kibana_services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
UiSettingsState,
3030
} from 'kibana/public';
3131
import { UiStatsMetricType } from '@kbn/analytics';
32-
import { FeatureCatalogueEntry } from '../../../../../plugins/feature_catalogue/public';
32+
import { FeatureCatalogueEntry } from '../../../../../plugins/home/public';
3333

3434
export interface HomeKibanaServices {
3535
indexPatternService: any;

src/legacy/core_plugins/kibana/public/home/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { UiStatsMetricType } from '@kbn/analytics';
2323
import { DataStart } from '../../../data/public';
2424
import { LocalApplicationService } from '../local_application_service';
2525
import { setServices } from './kibana_services';
26-
import { FeatureCatalogueEntry } from '../../../../../plugins/feature_catalogue/public';
26+
import { FeatureCatalogueEntry } from '../../../../../plugins/home/public';
2727

2828
export interface LegacyAngularInjectedDependencies {
2929
telemetryOptInProvider: any;

src/legacy/ui/public/new_platform/new_platform.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@ import {
2929
} from '../../../../plugins/inspector/public';
3030
import { EuiUtilsStart } from '../../../../plugins/eui_utils/public';
3131
import { DevToolsSetup, DevToolsStart } from '../../../../plugins/dev_tools/public';
32-
import {
33-
FeatureCatalogueSetup,
34-
FeatureCatalogueStart,
35-
} from '../../../../plugins/feature_catalogue/public';
32+
import { HomePublicPluginSetup, HomePublicPluginStart } from '../../../../plugins/home/public';
3633
import { SharePluginSetup, SharePluginStart } from '../../../../plugins/share/public';
3734

3835
export interface PluginsSetup {
3936
data: ReturnType<DataPlugin['setup']>;
4037
embeddable: EmbeddableSetup;
4138
expressions: ReturnType<ExpressionsPlugin['setup']>;
42-
feature_catalogue: FeatureCatalogueSetup;
39+
home: HomePublicPluginSetup;
4340
inspector: InspectorSetup;
4441
uiActions: IUiActionsSetup;
4542
share: SharePluginSetup;
@@ -51,7 +48,7 @@ export interface PluginsStart {
5148
embeddable: EmbeddableStart;
5249
eui_utils: EuiUtilsStart;
5350
expressions: ReturnType<ExpressionsPlugin['start']>;
54-
feature_catalogue: FeatureCatalogueStart;
51+
home: HomePublicPluginStart;
5552
inspector: InspectorStart;
5653
uiActions: IUiActionsStart;
5754
share: SharePluginStart;

src/legacy/ui/public/registry/feature_catalogue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import { uiRegistry } from './_registry';
2121
import { capabilities } from '../capabilities';
22-
export { FeatureCatalogueCategory } from '../../../../plugins/feature_catalogue/public';
22+
export { FeatureCatalogueCategory } from '../../../../plugins/home/public';
2323

2424
export const FeatureCatalogueRegistryProvider = uiRegistry({
2525
name: 'featureCatalogue',

src/plugins/feature_catalogue/kibana.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/plugins/feature_catalogue/README.md renamed to src/plugins/home/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Feature catalogue plugin
1+
# home plugin
2+
Moves the legacy `ui/registry/feature_catalogue` module for registering "features" that should be shown in the home page's feature catalogue to a service within a "home" plugin. The feature catalogue refered to here should not be confused with the "feature" plugin for registering features used to derive UI capabilities for feature controls.
3+
4+
# Feature catalogue (public service)
25

36
Replaces the legacy `ui/registry/feature_catalogue` module for registering "features" that should be showed in the home
47
page's feature catalogue. This should not be confused with the "feature" plugin for registering features used to derive
@@ -9,15 +12,15 @@ UI capabilities for feature controls.
912
```ts
1013
// For legacy plugins
1114
import { npSetup } from 'ui/new_platform';
12-
npSetup.plugins.feature_catalogue.register(/* same details here */);
15+
npSetup.plugins.home.featureCatalogue.register(/* same details here */);
1316

14-
// For new plugins: first add 'feature_catalogue` to the list of `optionalPlugins`
17+
// For new plugins: first add 'home` to the list of `optionalPlugins`
1518
// in your kibana.json file. Then access the plugin directly in `setup`:
1619

1720
class MyPlugin {
1821
setup(core, plugins) {
19-
if (plugins.feature_catalogue) {
20-
plugins.feature_catalogue.register(/* same details here. */);
22+
if (plugins.home) {
23+
plugins.home.featureCatalgoue.register(/* same details here. */);
2124
}
2225
}
2326
}

0 commit comments

Comments
 (0)