Browse Source

查询steps接口修改

tags/v3.0.1
moshenglv 5 years ago
parent
commit
0d6ddad013
3 changed files with 3 additions and 2 deletions
  1. +1
    -0
      app/controllers/ci/pipelines_controller.rb
  2. +1
    -1
      app/views/ci/pipeline_stage_steps/_list.json.jbuilder
  3. +1
    -1
      app/views/ci/pipelines/steps.json.jbuilder

+ 1
- 0
app/controllers/ci/pipelines_controller.rb View File

@@ -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



+ 1
- 1
app/views/ci/pipeline_stage_steps/_list.json.jbuilder View File

@@ -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



+ 1
- 1
app/views/ci/pipelines/steps.json.jbuilder View File

@@ -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

Loading…
Cancel
Save