diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index e4bf9dfc6..83926aed1 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -102,13 +102,12 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController node = Action::Node.find_by(name: job["data"]["name"]) next if node.blank? node.label = job["data"]["label"] if job["data"]["label"].present? - node.node_id = job["data"]["id"] if job["data"]["id"].present? + node.node_id = job["id"] if job["id"].present? next_edge_nodes = JSON.parse(demo2.to_json)["edges"].select { |edge| edge["source"]["cell"].include?(job["id"]) } node_ids = next_edge_nodes.map { |t| t["target"]["cell"] } - next_step_node = JSON.parse(demo2.to_json)["nodes"].select { |node| node_ids.include?(node["data"]["id"]) && !node["data"]["name"].to_s.include?("job") }&.first + next_step_node = JSON.parse(demo2.to_json)["nodes"].select { |node| node_ids.include?(node["id"]) && !node["data"]["name"].to_s.include?("job") }&.first node.sub_nodes = [] get_all_child_nodes(node, next_step_node) if next_step_node.present? - Rails.logger.info "node.sub_nodes=========================#{node.sub_nodes}" @job_nodes.push(node) end yaml = ERB.new(File.read(File.join(Rails.root, "app/views/api/v1/projects/pipelines", "build_pipeline.yaml.erb"))).result(binding) @@ -152,7 +151,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController node = Action::Node.find_by(name: input_node["data"]["name"]) next if node.blank? node.label = input_node["data"]["label"] if input_node["data"]["label"].present? - node.node_id = input_node["data"]["id"] if input_node["data"]["id"].present? + node.node_id = input_node["id"] if input_node["id"].present? run_values = {} input_values = {} if input_node["data"]["inputs"].present? @@ -185,7 +184,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController node = Action::Node.find_by(name: input_node["data"]["name"]) return nil if node.blank? node.label = input_node["data"]["label"] if input_node["data"]["label"].present? - node.node_id = input_node["data"]["id"] if input_node["data"]["id"].present? + node.node_id = input_node["id"] if input_node["id"].present? run_values = {} input_values = {} if input_node["data"]["inputs"].present?