From 0d6ddad0130623ba238ce95686cc5e855cc714bc Mon Sep 17 00:00:00 2001 From: moshenglv Date: Tue, 19 Jan 2021 16:23:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2steps=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ci/pipelines_controller.rb | 1 + app/views/ci/pipeline_stage_steps/_list.json.jbuilder | 2 +- app/views/ci/pipelines/steps.json.jbuilder | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/ci/pipelines_controller.rb b/app/controllers/ci/pipelines_controller.rb index 371f062b6..bb5bcc0a7 100644 --- a/app/controllers/ci/pipelines_controller.rb +++ b/app/controllers/ci/pipelines_controller.rb @@ -139,6 +139,7 @@ class Ci::PipelinesController < Ci::BaseController # ========步骤相关接口========= # def steps + @stage_type = Ci::PipelineStage.find(params[:stage_id]).stage_type @pipeline_stage_steps = Ci::PipelineStageStep.where('stage_id=?', params[:stage_id]).order('show_index asc') end diff --git a/app/views/ci/pipeline_stage_steps/_list.json.jbuilder b/app/views/ci/pipeline_stage_steps/_list.json.jbuilder index 904df8341..133783972 100644 --- a/app/views/ci/pipeline_stage_steps/_list.json.jbuilder +++ b/app/views/ci/pipeline_stage_steps/_list.json.jbuilder @@ -4,7 +4,7 @@ json.stage_id pipeline_stage_step.stage_id json.show_index pipeline_stage_step.show_index json.content pipeline_stage_step.content json.template_id pipeline_stage_step.template_id -json.category Ci::Template.find(pipeline_stage_step.template_id).category +json.category stage_type == 'customize' ? Ci::Template.find(pipeline_stage_step.template_id).parent_category : Ci::Template.find(pipeline_stage_step.template_id).category json.created_at pipeline_stage_step.created_at json.updated_at pipeline_stage_step.updated_at diff --git a/app/views/ci/pipelines/steps.json.jbuilder b/app/views/ci/pipelines/steps.json.jbuilder index 31e8ca6ac..e2421e2ae 100644 --- a/app/views/ci/pipelines/steps.json.jbuilder +++ b/app/views/ci/pipelines/steps.json.jbuilder @@ -1,3 +1,3 @@ json.steps @pipeline_stage_steps do |pipeline_stage_step| - json.partial! "/ci/pipeline_stage_steps/list", pipeline_stage_step: pipeline_stage_step + json.partial! "/ci/pipeline_stage_steps/list", pipeline_stage_step: pipeline_stage_step, stage_type: @stage_type end \ No newline at end of file