Skip to content

Commit

Permalink
Registrered features to feature catalog for ingest manager, ml, and i…
Browse files Browse the repository at this point in the history
…ndex lifecycle management
  • Loading branch information
cqliu1 committed Jul 13, 2020
1 parent 1167e2d commit 65dfb70
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Props {
defaultRoute?: string;
}

export const ChangeHomeRoute: FunctionComponent<Props = ({ defaultRoute }) => {
export const ChangeHomeRoute: FunctionComponent<Props> = ({ defaultRoute }) => {
const { uiSettings } = getServices();
const changeDefaultRoute = () => uiSettings.set('defaultRoute', defaultRoute);

Expand Down
49 changes: 28 additions & 21 deletions src/plugins/home/public/application/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,17 @@ export class Home extends Component {

renderNormal() {
const { addBasePath, canChangeHomeRoute = true, directories } = this.props;

console.log({ directories });

const fileDataVisualizer = this.findDirectoryById('ml_file_data_visualizer');
const ingestManager = this.findDirectoryById('ingest_manager', { isBeta: true });
const ingestManager = this.findDirectoryById('ingestManager', { isBeta: true });
const security = this.findDirectoryById('security');
const monitoring = this.findDirectoryById('monitoring');
const snapshotRestore = this.findDirectoryById('snapshot_restore');
const indexLifecycleManagement = this.findDirectoryById('index_lifecycle_management');
const devTools = this.findDirectoryById('console');
const stackManagement = this.findDirectoryById('stack-management');

return (
<EuiPage restrictWidth={1200} data-test-subj="homeApp">
Expand Down Expand Up @@ -179,33 +182,37 @@ export class Home extends Component {
})}
</EuiButtonEmpty>
</EuiFlexItem>
{stackManagement ? (
<EuiFlexItem>
<EuiButtonEmpty
onClick={createAppNavigationHandler(stackManagement.path)}
iconType="gear"
>
{i18n.translate('home.pageHeader.managementButtonLabel', {
defaultMessage: 'Manage',
})}
</EuiButtonEmpty>
</EuiFlexItem>
) : null}
{devTools ? (
<EuiFlexItem>
<EuiButtonEmpty
onClick={createAppNavigationHandler(devTools.path)}
iconType="wrench"
>
{i18n.translate('home.pageHeader.devToolsButtonLabel', {
defaultMessage: 'Dev tools',
})}
</EuiButtonEmpty>
</EuiFlexItem>
) : null}
<EuiFlexItem>
<EuiButtonEmpty href="#/feature_directory" iconType="apps">
{i18n.translate('home.pageHeader.appDirectoryButtonLabel', {
defaultMessage: 'App directory',
})}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem>
<EuiButtonEmpty
onClick={createAppNavigationHandler('/app/dev_tools')} // TODO: passing both causes EUI lint error, but providing an href allows the user to open the link in a new tab
iconType="wrench"
>
{i18n.translate('home.pageHeader.devToolsButtonLabel', {
defaultMessage: 'Dev tools',
})}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem>
<EuiButtonEmpty
onClick={createAppNavigationHandler('/app/management')} // TODO: passing both causes EUI lint error, but providing an href allows the user to open the link in a new tab
iconType="gear"
>
{i18n.translate('home.pageHeader.managementButtonLabel', {
defaultMessage: 'Manage',
})}
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageHeaderSection>
</EuiPageHeader>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart
}),
icon: 'managementApp',
path: '/app/management',
showOnHomePage: false,
showOnHomePage: true,
category: FeatureCatalogueCategory.ADMIN,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class IndexLifecycleManagementPlugin {
});

home.featureCatalogue.register({
id: 'index_lifecycle_management',
id: PLUGIN.ID,
title: i18n.translate('xpack.indexLifecycleManagement.featureCatalogueTitle', {
defaultMessage: 'Manage index lifecycles',
}),
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/ingest_manager/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '../../../../src/plugins/home/public';
import { LicensingPluginSetup } from '../../licensing/public';
import { PLUGIN_ID, CheckPermissionsResponse, PostIngestSetupResponse } from '../common';
import { BASE_PATH } from './constants';

import { IngestManagerConfigType } from '../common/types';
import { setupRouteService, appRoutesService } from '../common';
Expand Down Expand Up @@ -99,16 +100,16 @@ export class IngestManagerPlugin
deps.home.tutorials.registerModuleNotice(PLUGIN_ID, TutorialModuleNotice);

deps.home.featureCatalogue.register({
id: 'ingest_manager',
id: 'ingestManager',
title: i18n.translate('xpack.ingestManager.featureCatalogueTitle', {
defaultMessage: 'Manage ingest',
}),
description: i18n.translate('xpack.ingestManager.featureCatalogueTitle', {
defaultMessage: 'Management for Elastic Agents and integrations.',
}),
icon: 'logstashInput',
path: '/app/ingestManager',
showOnHomePage: true,
path: BASE_PATH,
category: FeatureCatalogueCategory.ADMIN, // TODO: is the correct category for this plugin?
});
}
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/ingest_manager/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ export class IngestManagerPlugin
icon: 'savedObjectsApp',
navLinkId: PLUGIN_ID,
app: [PLUGIN_ID, 'kibana'],
catalogue: ['ingestManager'],
privileges: {
all: {
api: [`${PLUGIN_ID}-read`, `${PLUGIN_ID}-all`],
app: [PLUGIN_ID, 'kibana'],
catalogue: ['ingestManager'],
savedObject: {
all: allSavedObjectTypes,
read: [],
Expand All @@ -188,6 +190,7 @@ export class IngestManagerPlugin
read: {
api: [`${PLUGIN_ID}-read`],
app: [PLUGIN_ID, 'kibana'],
catalogue: ['ingestManager'],
savedObject: {
all: [],
read: allSavedObjectTypes,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/ml/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class MlServerPlugin implements Plugin<MlPluginSetup, MlPluginStart, Plug
order: 500,
navLinkId: PLUGIN_ID,
app: [PLUGIN_ID, 'kibana'],
catalogue: [PLUGIN_ID],
catalogue: [PLUGIN_ID, `${PLUGIN_ID}_file_data_visualizer`],
privileges: null,
reserved: {
description: i18n.translate('xpack.ml.feature.reserved.description', {
Expand All @@ -99,7 +99,7 @@ export class MlServerPlugin implements Plugin<MlPluginSetup, MlPluginStart, Plug
privilege: {
api: user.api,
app: [PLUGIN_ID, 'kibana'],
catalogue: [PLUGIN_ID],
catalogue: [PLUGIN_ID, `${PLUGIN_ID}_file_data_visualizer`],
savedObject: {
all: [],
read: [],
Expand All @@ -112,7 +112,7 @@ export class MlServerPlugin implements Plugin<MlPluginSetup, MlPluginStart, Plug
privilege: {
api: admin.api,
app: [PLUGIN_ID, 'kibana'],
catalogue: [PLUGIN_ID],
catalogue: [PLUGIN_ID, `${PLUGIN_ID}_file_data_visualizer`],
savedObject: {
all: [],
read: [],
Expand Down

0 comments on commit 65dfb70

Please sign in to comment.