From c6aeecb33cab9001885c8792c364a60fd7e03b55 Mon Sep 17 00:00:00 2001 From: moshenglv Date: Mon, 18 Jan 2021 09:58:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=98=B6=E6=AE=B5=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=B5=81=E6=B0=B4=E7=BA=BF=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ci/pipelines_controller.rb | 4 ++-- app/views/ci/pipeline_stages/_list.json.jbuilder | 1 + app/views/ci/pipelines/stages.json.jbuilder | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/ci/pipelines_controller.rb b/app/controllers/ci/pipelines_controller.rb index 43b58e4c0..253d399d0 100644 --- a/app/controllers/ci/pipelines_controller.rb +++ b/app/controllers/ci/pipelines_controller.rb @@ -72,6 +72,7 @@ class Ci::PipelinesController < Ci::BaseController # =========阶段相关接口========= # def stages pipeline_id = params[:id] + @pipeline_name = Ci::Pipeline.find(pipeline_id).pipeline_name @pipeline_stages = Ci::PipelineStage.where('pipeline_id=?', pipeline_id).order('show_index asc') end @@ -171,8 +172,7 @@ class Ci::PipelinesController < Ci::BaseController steps.each do |step| pipeline_stage_step = Ci::PipelineStageStep.find(step[:id]) if pipeline_stage_step - pipeline_stage_step.update(step_name: step[:step_name], content: step[:content], - show_index: step[:show_index], template_id: step[:template_id]) + pipeline_stage_step.update(step_name: step[:step_name], content: step[:content], template_id: step[:template_id]) end end end diff --git a/app/views/ci/pipeline_stages/_list.json.jbuilder b/app/views/ci/pipeline_stages/_list.json.jbuilder index 1e782ee40..a0c8b314f 100644 --- a/app/views/ci/pipeline_stages/_list.json.jbuilder +++ b/app/views/ci/pipeline_stages/_list.json.jbuilder @@ -2,6 +2,7 @@ json.id pipeline_stage.id json.stage_name pipeline_stage.stage_name json.stage_type pipeline_stage.stage_type json.pipeline_id pipeline_stage.pipeline_id +json.pipeline_name pipeline_name json.show_index pipeline_stage.show_index json.created_at pipeline_stage.created_at json.updated_at pipeline_stage.updated_at diff --git a/app/views/ci/pipelines/stages.json.jbuilder b/app/views/ci/pipelines/stages.json.jbuilder index c7a65ecfe..74f27358a 100644 --- a/app/views/ci/pipelines/stages.json.jbuilder +++ b/app/views/ci/pipelines/stages.json.jbuilder @@ -1,3 +1,3 @@ json.stages @pipeline_stages do |pipeline_stage| - json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage + json.partial! "/ci/pipeline_stages/list", pipeline_stage: pipeline_stage, pipeline_name: @pipeline_name end \ No newline at end of file