From 961e157897d6f4285f459c1367f1e856af19d241 Mon Sep 17 00:00:00 2001 From: Josh Dover Date: Sun, 19 Apr 2020 13:40:43 -0600 Subject: [PATCH] PR comments --- .../management/public/management_service.ts | 1 - .../{sections => application}/breadcrumbs.js | 0 ...confirm_delete_pipeline_modal.test.js.snap | 0 .../flex_item_setting.test.js.snap | 0 .../form_label_with_icon_tip.test.js.snap | 0 .../pipeline_editor.test.js.snap | 0 .../confirm_delete_pipeline_modal.js | 0 .../confirm_delete_pipeline_modal.test.js | 0 .../components/pipeline_editor/constants.js | 0 .../pipeline_editor/flex_item_setting.js | 0 .../pipeline_editor/flex_item_setting.test.js | 0 .../form_label_with_icon_tip.js | 0 .../form_label_with_icon_tip.test.js | 0 .../components/pipeline_editor/index.js | 0 .../pipeline_editor/pipeline_editor.js | 5 +- .../pipeline_editor/pipeline_editor.test.js | 0 .../__snapshots__/add_role_alert.test.js.snap | 0 .../__snapshots__/alert_call_out.test.js.snap | 0 .../confirm_delete_modal.test.js.snap | 0 .../enable_monitoring_alert.test.js.snap | 0 .../__snapshots__/info_alerts.test.js.snap | 0 .../pipelines_table.test.js.snap | 0 .../pipeline_list/add_role_alert.js | 0 .../pipeline_list/add_role_alert.test.js | 0 .../pipeline_list/alert_call_out.js | 0 .../pipeline_list/alert_call_out.test.js | 0 .../pipeline_list/confirm_delete_modal.js | 0 .../confirm_delete_modal.test.js | 0 .../components/pipeline_list/constants.js | 0 .../pipeline_list/enable_monitoring_alert.js | 0 .../enable_monitoring_alert.test.js | 0 .../components/pipeline_list/index.js | 0 .../components/pipeline_list/info_alerts.js | 0 .../pipeline_list/info_alerts.test.js | 0 .../components/pipeline_list/pipeline_list.js | 0 .../pipeline_list/pipeline_list.test.js | 0 .../pipeline_list/pipelines_table.js | 0 .../pipeline_list/pipelines_table.test.js | 0 .../upgrade_failure.test.js.snap | 0 .../upgrade_failure_actions.test.js.snap | 0 .../upgrade_failure_title.test.js.snap | 0 .../components/upgrade_failure/constants.js | 0 .../components/upgrade_failure/index.js | 0 .../upgrade_failure/upgrade_failure.js | 0 .../upgrade_failure/upgrade_failure.test.js | 0 .../upgrade_failure_actions.js | 0 .../upgrade_failure_actions.test.js | 0 .../upgrade_failure/upgrade_failure_title.js | 0 .../upgrade_failure_title.test.js | 0 .../{sections => application}/index.tsx | 10 +-- .../pipeline_edit_view.tsx | 38 +++----- .../pipeline_list_item/pipeline_list_item.js | 4 +- x-pack/plugins/logstash/public/plugin.ts | 86 +++++++++---------- .../logstash/server/routes/pipeline/save.ts | 1 - 54 files changed, 58 insertions(+), 87 deletions(-) rename x-pack/plugins/logstash/public/{sections => application}/breadcrumbs.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/__snapshots__/confirm_delete_pipeline_modal.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/__snapshots__/flex_item_setting.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/__snapshots__/form_label_with_icon_tip.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/__snapshots__/pipeline_editor.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/confirm_delete_pipeline_modal.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/confirm_delete_pipeline_modal.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/constants.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/flex_item_setting.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/flex_item_setting.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/form_label_with_icon_tip.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/form_label_with_icon_tip.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/index.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/pipeline_editor.js (99%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_editor/pipeline_editor.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/add_role_alert.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/alert_call_out.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/confirm_delete_modal.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/enable_monitoring_alert.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/info_alerts.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/__snapshots__/pipelines_table.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/add_role_alert.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/add_role_alert.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/alert_call_out.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/alert_call_out.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/confirm_delete_modal.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/confirm_delete_modal.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/constants.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/enable_monitoring_alert.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/enable_monitoring_alert.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/index.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/info_alerts.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/info_alerts.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/pipeline_list.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/pipeline_list.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/pipelines_table.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/pipeline_list/pipelines_table.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/__snapshots__/upgrade_failure.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/__snapshots__/upgrade_failure_actions.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/__snapshots__/upgrade_failure_title.test.js.snap (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/constants.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/index.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure_actions.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure_actions.test.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure_title.js (100%) rename x-pack/plugins/logstash/public/{ => application}/components/upgrade_failure/upgrade_failure_title.test.js (100%) rename x-pack/plugins/logstash/public/{sections => application}/index.tsx (92%) rename x-pack/plugins/logstash/public/{sections => application}/pipeline_edit_view.tsx (77%) diff --git a/src/plugins/management/public/management_service.ts b/src/plugins/management/public/management_service.ts index ed31a22992da8..8fc207e32e6ce 100644 --- a/src/plugins/management/public/management_service.ts +++ b/src/plugins/management/public/management_service.ts @@ -80,7 +80,6 @@ export class ManagementService { ); register({ id: 'kibana', title: 'Kibana', order: 30, euiIconType: 'logoKibana' }); - register({ id: 'logstash', title: 'Logstash', order: 30, euiIconType: 'logoLogstash' }); register({ id: 'elasticsearch', title: 'Elasticsearch', diff --git a/x-pack/plugins/logstash/public/sections/breadcrumbs.js b/x-pack/plugins/logstash/public/application/breadcrumbs.js similarity index 100% rename from x-pack/plugins/logstash/public/sections/breadcrumbs.js rename to x-pack/plugins/logstash/public/application/breadcrumbs.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/confirm_delete_pipeline_modal.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/confirm_delete_pipeline_modal.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/confirm_delete_pipeline_modal.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/confirm_delete_pipeline_modal.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/flex_item_setting.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/flex_item_setting.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/flex_item_setting.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/flex_item_setting.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/form_label_with_icon_tip.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/form_label_with_icon_tip.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/form_label_with_icon_tip.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/form_label_with_icon_tip.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/pipeline_editor.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/pipeline_editor.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/__snapshots__/pipeline_editor.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/__snapshots__/pipeline_editor.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/confirm_delete_pipeline_modal.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/confirm_delete_pipeline_modal.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/confirm_delete_pipeline_modal.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/confirm_delete_pipeline_modal.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/constants.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/constants.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/constants.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/constants.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/flex_item_setting.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/flex_item_setting.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/flex_item_setting.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/flex_item_setting.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/flex_item_setting.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/flex_item_setting.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/flex_item_setting.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/flex_item_setting.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/form_label_with_icon_tip.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/form_label_with_icon_tip.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/form_label_with_icon_tip.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/form_label_with_icon_tip.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/form_label_with_icon_tip.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/form_label_with_icon_tip.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/form_label_with_icon_tip.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/form_label_with_icon_tip.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/index.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/index.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/index.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/index.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/pipeline_editor.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js similarity index 99% rename from x-pack/plugins/logstash/public/components/pipeline_editor/pipeline_editor.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js index f5f0087fdc8a3..e45820d56cc03 100644 --- a/x-pack/plugins/logstash/public/components/pipeline_editor/pipeline_editor.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js @@ -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 '../../../../common/constants/tooltips'; import { EuiButton, EuiButtonEmpty, @@ -40,7 +40,6 @@ class PipelineEditorUi extends React.Component { const { pipeline: { id, description, pipeline, settings }, - username, } = this.props; const pipelineWorkersSet = typeof settings['pipeline.workers'] === 'number'; @@ -60,7 +59,6 @@ class PipelineEditorUi extends React.Component { 'queue.max_bytes': settings['queue.max_bytes.number'] + settings['queue.max_bytes.units'], 'queue.type': settings['queue.type'], }, - username, }, pipelineIdErrors: [], pipelineIdPattern: /^[A-Za-z\_][A-Za-z0-9\-\_]*$/, @@ -526,7 +524,6 @@ PipelineEditorUi.propTypes = { addSuccess: PropTypes.func.isRequired, addError: PropTypes.func.isRequired, }).isRequired, - username: PropTypes.string, }; export const PipelineEditor = injectI18n(PipelineEditorUi); diff --git a/x-pack/plugins/logstash/public/components/pipeline_editor/pipeline_editor.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_editor/pipeline_editor.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/add_role_alert.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/add_role_alert.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/add_role_alert.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/add_role_alert.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/alert_call_out.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/alert_call_out.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/alert_call_out.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/alert_call_out.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/confirm_delete_modal.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/confirm_delete_modal.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/confirm_delete_modal.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/confirm_delete_modal.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/enable_monitoring_alert.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/enable_monitoring_alert.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/enable_monitoring_alert.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/enable_monitoring_alert.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/info_alerts.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/info_alerts.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/info_alerts.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/info_alerts.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/pipelines_table.test.js.snap b/x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/pipelines_table.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/__snapshots__/pipelines_table.test.js.snap rename to x-pack/plugins/logstash/public/application/components/pipeline_list/__snapshots__/pipelines_table.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/add_role_alert.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/add_role_alert.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/add_role_alert.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/add_role_alert.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/alert_call_out.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/alert_call_out.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/alert_call_out.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/alert_call_out.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/confirm_delete_modal.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/confirm_delete_modal.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/confirm_delete_modal.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/confirm_delete_modal.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/constants.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/constants.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/constants.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/constants.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/enable_monitoring_alert.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/enable_monitoring_alert.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/enable_monitoring_alert.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/enable_monitoring_alert.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/index.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/index.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/index.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/index.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/info_alerts.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/info_alerts.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/info_alerts.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/info_alerts.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/info_alerts.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/info_alerts.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/info_alerts.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/info_alerts.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/pipeline_list.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/pipeline_list.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/pipeline_list.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/pipeline_list.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.test.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/pipelines_table.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/pipelines_table.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js diff --git a/x-pack/plugins/logstash/public/components/pipeline_list/pipelines_table.test.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/pipeline_list/pipelines_table.test.js rename to x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.test.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure.test.js.snap b/x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure.test.js.snap rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure_actions.test.js.snap b/x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure_actions.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure_actions.test.js.snap rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure_actions.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure_title.test.js.snap b/x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure_title.test.js.snap similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/__snapshots__/upgrade_failure_title.test.js.snap rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/__snapshots__/upgrade_failure_title.test.js.snap diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/constants.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/constants.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/constants.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/constants.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/index.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/index.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/index.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/index.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure.test.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure.test.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure.test.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_actions.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_actions.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_actions.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_actions.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_actions.test.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_actions.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_actions.test.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_actions.test.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_title.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_title.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_title.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_title.js diff --git a/x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_title.test.js b/x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_title.test.js similarity index 100% rename from x-pack/plugins/logstash/public/components/upgrade_failure/upgrade_failure_title.test.js rename to x-pack/plugins/logstash/public/application/components/upgrade_failure/upgrade_failure_title.test.js diff --git a/x-pack/plugins/logstash/public/sections/index.tsx b/x-pack/plugins/logstash/public/application/index.tsx similarity index 92% rename from x-pack/plugins/logstash/public/sections/index.tsx rename to x-pack/plugins/logstash/public/application/index.tsx index e35e2862ddce7..438038d6c885e 100644 --- a/x-pack/plugins/logstash/public/sections/index.tsx +++ b/x-pack/plugins/logstash/public/application/index.tsx @@ -21,21 +21,19 @@ import { // @ts-ignore } from '../services'; // @ts-ignore -import { PipelineList } from '../components/pipeline_list'; +import { PipelineList } from './components/pipeline_list'; import { PipelineEditView } from './pipeline_edit_view'; // @ts-ignore import { Pipeline } from '../models/pipeline'; -import { SecurityPluginSetup } from '../../../security/public'; // @ts-ignore import * as Breadcrumbs from './breadcrumbs'; export const renderApp = async ( core: CoreStart, { basePath, element, setBreadcrumbs }: ManagementAppMountParams, - license$: Observable, - security?: SecurityPluginSetup + licenseService$: Observable ) => { - const logstashLicenseService = await license$.pipe(first()).toPromise(); + const logstashLicenseService = await licenseService$.pipe(first()).toPromise(); const clusterService = new ClusterService(core.http); const monitoringService = new MonitoringService( core.http, @@ -82,7 +80,6 @@ export const renderApp = async ( setBreadcrumbs={setBreadcrumbs} logstashLicenseService={logstashLicenseService} pipelineService={pipelineService} - security={security} toasts={core.notifications.toasts} upgradeService={upgradeService} /> @@ -102,7 +99,6 @@ export const renderApp = async ( setBreadcrumbs={setBreadcrumbs} logstashLicenseService={logstashLicenseService} pipelineService={pipelineService} - security={security} toasts={core.notifications.toasts} upgradeService={upgradeService} id={match.params.id} diff --git a/x-pack/plugins/logstash/public/sections/pipeline_edit_view.tsx b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx similarity index 77% rename from x-pack/plugins/logstash/public/sections/pipeline_edit_view.tsx rename to x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx index ef6a7c91f578b..daebad2a2c728 100644 --- a/x-pack/plugins/logstash/public/sections/pipeline_edit_view.tsx +++ b/x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx @@ -12,12 +12,11 @@ import { i18n } from '@kbn/i18n'; import { ToastsStart } from 'src/core/public'; // @ts-ignore -import { UpgradeFailure } from '../components/upgrade_failure'; +import { UpgradeFailure } from './components/upgrade_failure'; // @ts-ignore -import { PipelineEditor } from '../components/pipeline_editor'; +import { PipelineEditor } from './components/pipeline_editor'; // @ts-ignore import { Pipeline } from '../models/pipeline'; -import { SecurityPluginSetup, AuthenticatedUser } from '../../../security/public'; import { ManagementAppMountParams } from '../../../../../src/plugins/management/public'; // @ts-ignore import * as Breadcrumbs from './breadcrumbs'; @@ -26,7 +25,7 @@ const usePipeline = ( pipelineService: any, logstashLicenseService: any, toasts: ToastsStart, - clone: boolean, + shouldClone: boolean, id?: string ) => { const mounted = usePromise(); @@ -40,7 +39,7 @@ const usePipeline = ( try { const result = await mounted(pipelineService.loadPipeline(id) as Promise); - setPipeline(clone ? result.clone : result); + setPipeline(shouldClone ? result.clone : result); } catch (e) { await logstashLicenseService.checkValidity(); if (e.status !== 403) { @@ -55,7 +54,7 @@ const usePipeline = ( } } })(); - }, [pipelineService, id, mounted, clone, logstashLicenseService, toasts]); + }, [pipelineService, id, mounted, shouldClone, logstashLicenseService, toasts]); return pipeline; }; @@ -73,24 +72,10 @@ const useIsUpgraded = (upgradeService: any) => { return isUpgraded; }; -const useCurrentUser = (security?: SecurityPluginSetup) => { - const [currentUser, setCurrentUser] = useState(null); - const mounted = usePromise(); - - useLayoutEffect(() => { - if (security) { - mounted(security.authc.getCurrentUser()).then(result => setCurrentUser(result)); - } - }, [mounted, security]); - - return currentUser; -}; - interface EditProps { pipelineService: any; logstashLicenseService: any; upgradeService: any; - security?: SecurityPluginSetup; toasts: ToastsStart; history: History; setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs']; @@ -103,19 +88,17 @@ export const PipelineEditView: React.FC = ({ pipelineService, logstashLicenseService, upgradeService, - security, toasts, history, setBreadcrumbs, id, }) => { const params = new URLSearchParams(history.location.search); - const retry = params.get('retry') === 'true'; - const clone = params.get('clone') === ''; + const shouldRetry = params.get('retry') === 'true'; + const shouldClone = params.get('clone') === ''; - const pipeline = usePipeline(pipelineService, logstashLicenseService, toasts, clone, id); + const pipeline = usePipeline(pipelineService, logstashLicenseService, toasts, shouldClone, id); const isUpgraded = useIsUpgraded(upgradeService); - const currentUser = useCurrentUser(security); const onRetry = useCallback(() => { const newParams = new URLSearchParams(history.location.search); @@ -147,7 +130,7 @@ export const PipelineEditView: React.FC = ({ return ( @@ -157,11 +140,10 @@ export const PipelineEditView: React.FC = ({ return ( { + private licenseSubscription?: Subscription; + public setup(core: CoreSetup, plugins: SetupDeps) { const logstashLicense$ = plugins.licensing.license$.pipe( map(license => new LogstashLicenseService(license)) ); - const section = plugins.management.sections.getSection('logstash')!; + const section = plugins.management.sections.register({ + id: 'logstash', + title: 'Logstash', + order: 30, + euiIconType: 'logoLogstash', + }); const managementApp = section.registerApp({ id: 'pipelines', title: i18n.translate('xpack.logstash.managementSection.pipelinesTitle', { @@ -50,47 +50,45 @@ export class LogstashPlugin implements Plugin { order: 10, mount: async params => { const [coreStart] = await core.getStartServices(); - const { renderApp } = await import('./sections'); + const { renderApp } = await import('./application'); - return renderApp(coreStart, params, logstashLicense$, plugins.security); + return renderApp(coreStart, params, logstashLicense$); }, }); - logstashLicense$ - .pipe(first()) - .toPromise() - .then((license: any) => { - if (license.enableLinks) { - managementApp.enable(); - } else { - managementApp.disable(); - } + this.licenseSubscription = logstashLicense$.subscribe((license: any) => { + 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, - }); + 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, }); - } - }); + }); + } + }); } public start(core: CoreStart) {} - public stop() {} + public stop() { + if (this.licenseSubscription) { + this.licenseSubscription.unsubscribe(); + } + } } diff --git a/x-pack/plugins/logstash/server/routes/pipeline/save.ts b/x-pack/plugins/logstash/server/routes/pipeline/save.ts index 556c281944a85..e484d0e221b6d 100644 --- a/x-pack/plugins/logstash/server/routes/pipeline/save.ts +++ b/x-pack/plugins/logstash/server/routes/pipeline/save.ts @@ -25,7 +25,6 @@ export function registerPipelineSaveRoute(router: IRouter, security?: SecurityPl id: schema.string(), description: schema.string(), pipeline: schema.string(), - username: schema.string(), settings: schema.maybe(schema.object({}, { unknowns: 'allow' })), }), },