Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Apr 14, 2020
1 parent ca6c71a commit e5ad3da
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
45 changes: 27 additions & 18 deletions x-pack/plugins/logstash/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/

import { i18n } from '@kbn/i18n';
import { CoreSetup, CoreStart, Plugin } from 'src/core/public';
import { first, map } from 'rxjs/operators';
import { once } from 'lodash';

import { CoreSetup, CoreStart, Plugin } from 'src/core/public';
import {
HomePublicPluginSetup,
FeatureCatalogueCategory,
Expand All @@ -27,9 +29,10 @@ import { registerListSection } from './sections/pipeline_list';
import { SecurityPluginSetup } from '../../security/public';

interface SetupDeps {
home?: HomePublicPluginSetup;
licensing: LicensingPluginSetup;
management: ManagementSetup;

home?: HomePublicPluginSetup;
security?: SecurityPluginSetup;
}

Expand Down Expand Up @@ -57,27 +60,33 @@ export class LogstashPlugin implements Plugin<void, void, SetupDeps> {
.pipe(first())
.toPromise()
.then((license: any) => {
if (plugins.home && license.enableLinks) {
plugins.home.featureCatalogue.register({
id: 'management_logstash',
title: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesTitle', {
defaultMessage: 'Logstash Pipelines',
}),
description: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesDescription', {
defaultMessage: 'Create, delete, update, and clone data ingestion pipelines.',
}),
icon: 'pipelineApp',
path: '/app/kibana#/management/logstash/pipelines',
showOnHomePage: true,
category: FeatureCatalogueCategory.ADMIN,
});
}

if (license.enableLinks) {
managementApp.enable();
} else {
managementApp.disable();
}

if (plugins.home && license.enableLinks) {
// Ensure that we don't register the feature more than once
once(() => {
plugins.home!.featureCatalogue.register({
id: 'management_logstash',
title: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesTitle', {
defaultMessage: 'Logstash Pipelines',
}),
description: i18n.translate(
'xpack.logstash.homeFeature.logstashPipelinesDescription',
{
defaultMessage: 'Create, delete, update, and clone data ingestion pipelines.',
}
),
icon: 'pipelineApp',
path: '/app/kibana#/management/logstash/pipelines',
showOnHomePage: true,
category: FeatureCatalogueCategory.ADMIN,
});
});
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { i18n } from '@kbn/i18n';
import React from 'react';
import { MarkdownSimple } from '../../../../../../src/plugins/kibana_react/public';
import { PLUGIN } from '../../../common/constants';

export class LogstashLicenseService {
constructor(license, navigateToApp, toasts) {
Expand Down Expand Up @@ -38,9 +37,7 @@ export class LogstashLicenseService {

notifyAndRedirect() {
this.toasts.addDanger({
title: (
<MarkdownSimple>{this.license.getFeature(`features.${PLUGIN.ID}.message`)}</MarkdownSimple>
),
title: <MarkdownSimple>{this.calculated.message}</MarkdownSimple>,
});
this.navigateToApp('kibana', '#/management');
}
Expand Down

0 comments on commit e5ad3da

Please sign in to comment.