From ff8d30bc6cc9e14e0ec1907eba271a93e66097a5 Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Mon, 11 Jan 2021 14:32:19 -0500 Subject: [PATCH] [Monitoring] Stop using constructor.name for logstash pipelines (#87386) * Use typeString instead * Used wrong type string Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../pipeline_viewer/models/pipeline/make_statement.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/make_statement.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/make_statement.js index 120230c0ffa1..b257182566f5 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/make_statement.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/models/pipeline/make_statement.js @@ -9,15 +9,14 @@ import { IfStatement } from './if_statement'; import { Queue } from './queue'; export function makeStatement(pipelineGraphVertex, pipelineStage) { - const klass = pipelineGraphVertex.constructor.name; - switch (klass) { - case 'PluginVertex': + switch (pipelineGraphVertex.typeString) { + case 'plugin': return PluginStatement.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage); - case 'IfVertex': + case 'if': return IfStatement.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage); - case 'QueueVertex': + case 'queue': return Queue.fromPipelineGraphVertex(pipelineGraphVertex, pipelineStage); default: - throw new Error(`Unknown vertex class: ${klass}`); + throw new Error(`Unknown vertex class: ${pipelineGraphVertex.typeString}`); } }