Skip to content

Commit

Permalink
[NP] Migrate logstash server side code to NP (#63135)
Browse files Browse the repository at this point in the history
* convert api_integration test into TS

* create logstash NP plugin and move models

* move common/constants to NP

* type fetch all from scroll

* move route declaration to NP

* add licence checker wrapper

* register logstash route handlers in NP

* track logstash NP i18n

* address shaunak comment

* fix validation

* udpdate security tests since for new mock defaults

* address Pierres comments

* rename upgrade file route
  • Loading branch information
mshustov authored and wayneseymour committed Apr 15, 2020
1 parent 7d9ad9e commit 5fefc72
Show file tree
Hide file tree
Showing 91 changed files with 959 additions and 873 deletions.
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"xpack.lens": "legacy/plugins/lens",
"xpack.licenseMgmt": "plugins/license_management",
"xpack.licensing": "plugins/licensing",
"xpack.logstash": "legacy/plugins/logstash",
"xpack.logstash": ["plugins/logstash", "legacy/plugins/logstash"],
"xpack.main": "legacy/plugins/xpack_main",
"xpack.maps": ["plugins/maps", "legacy/plugins/maps"],
"xpack.ml": ["plugins/ml", "legacy/plugins/ml"],
Expand Down
10 changes: 1 addition & 9 deletions x-pack/legacy/plugins/logstash/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
*/

import { resolve } from 'path';
import { registerLogstashPipelinesRoutes } from './server/routes/api/pipelines';
import { registerLogstashPipelineRoutes } from './server/routes/api/pipeline';
import { registerLogstashUpgradeRoutes } from './server/routes/api/upgrade';
import { registerLogstashClusterRoutes } from './server/routes/api/cluster';
import { registerLicenseChecker } from './server/lib/register_license_checker';
import { PLUGIN } from './common/constants';
import { PLUGIN } from '../../../plugins/logstash/common/constants';

export const logstash = kibana =>
new kibana.Plugin({
Expand All @@ -32,9 +28,5 @@ export const logstash = kibana =>
},
init: server => {
registerLicenseChecker(server);
registerLogstashPipelinesRoutes(server);
registerLogstashPipelineRoutes(server);
registerLogstashUpgradeRoutes(server);
registerLogstashClusterRoutes(server);
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'brace/mode/plain_text';
import 'brace/theme/github';

import { isEmpty } from 'lodash';
import { TOOLTIPS } from '../../../common/constants/tooltips';
import { TOOLTIPS } from '../../../../../../plugins/logstash/common/constants/tooltips';
import {
EuiButton,
EuiButtonEmpty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { npSetup } from 'ui/new_platform';
import { xpackInfo } from 'plugins/xpack_main/services/xpack_info';
import { FeatureCatalogueCategory } from '../../../../../../src/plugins/home/public';
// @ts-ignore
import { PLUGIN } from '../../common/constants';
import { PLUGIN } from '../../../../../plugins/logstash/common/constants';

const {
plugins: { home },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { pick, capitalize } from 'lodash';

import { getSearchValue } from 'plugins/logstash/lib/get_search_value';
import { getMoment } from 'plugins/logstash/../common/lib/get_moment';
import { PIPELINE } from '../../../common/constants';
import { PIPELINE } from '../../../../../../plugins/logstash/common/constants';

/**
* Represents the model for listing pipelines in the UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import chrome from 'ui/chrome';
import { ROUTES } from '../../../common/constants';
import { ROUTES } from '../../../../../../plugins/logstash/common/constants';
import { Cluster } from 'plugins/logstash/models/cluster';

export class ClusterService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { toastNotifications } from 'ui/notify';
import { MarkdownSimple } from '../../../../../../../src/plugins/kibana_react/public';
import { PLUGIN } from '../../../common/constants';
import { PLUGIN } from '../../../../../../plugins/logstash/common/constants';

export class LogstashLicenseService {
constructor(xpackInfoService, kbnUrlService, $timeout) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import moment from 'moment';
import chrome from 'ui/chrome';
import { ROUTES, MONITORING } from '../../../common/constants';
import { ROUTES, MONITORING } from '../../../../../../plugins/logstash/common/constants';
import { PipelineListItem } from 'plugins/logstash/models/pipeline_list_item';

export class MonitoringService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import chrome from 'ui/chrome';
import { ROUTES } from '../../../common/constants';
import { ROUTES } from '../../../../../../plugins/logstash/common/constants';
import { Pipeline } from 'plugins/logstash/models/pipeline';

export class PipelineService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import chrome from 'ui/chrome';
import { ROUTES, MONITORING } from '../../../common/constants';
import { ROUTES, MONITORING } from '../../../../../../plugins/logstash/common/constants';
import { PipelineListItem } from 'plugins/logstash/models/pipeline_list_item';

const RECENTLY_DELETED_PIPELINE_IDS_STORAGE_KEY = 'xpack.logstash.recentlyDeletedPipelines';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import chrome from 'ui/chrome';
import { ROUTES } from '../../../common/constants';
import { ROUTES } from '../../../../../../plugins/logstash/common/constants';

export class UpgradeService {
constructor($http) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5fefc72

Please sign in to comment.