Commit c9b79a56 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '12196-support-hidden-field-for-cycle-analytics-stages' into 'master'

Support 'hidden' field for cycle analytics stages

See merge request gitlab-org/gitlab!19543
parents 7d63c693 05f58fea
...@@ -109,7 +109,7 @@ module Analytics ...@@ -109,7 +109,7 @@ module Analytics
end end
def update_params def update_params
params.permit(:name, :start_event_identifier, :end_event_identifier, :id, :move_after_id, :move_before_id) params.permit(:name, :start_event_identifier, :end_event_identifier, :id, :move_after_id, :move_before_id, :hidden)
end end
def create_params def create_params
......
...@@ -4,6 +4,7 @@ module Analytics ...@@ -4,6 +4,7 @@ module Analytics
module CycleAnalytics module CycleAnalytics
class StageEntity < Grape::Entity class StageEntity < Grape::Entity
expose :title expose :title
expose :hidden
expose :legend expose :legend
expose :description expose :description
expose :id expose :id
......
...@@ -118,6 +118,20 @@ describe Analytics::CycleAnalytics::StagesController do ...@@ -118,6 +118,20 @@ describe Analytics::CycleAnalytics::StagesController do
expect(stage.name).to eq(params[:name]) expect(stage.name).to eq(params[:name])
end end
context 'hidden attribute' do
before do
params[:hidden] = true
end
it 'updates the hidden attribute' do
subject
stage.reload
expect(stage.hidden).to eq(true)
end
end
context 'when positioning parameter is given' do context 'when positioning parameter is given' do
before do before do
params[:move_before_id] = create(:cycle_analytics_group_stage, parent: group, relative_position: 10).id params[:move_before_id] = create(:cycle_analytics_group_stage, parent: group, relative_position: 10).id
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"title": { "title": {
"type": "string" "type": "string"
}, },
"hidden": {
"type": "boolean"
},
"legend": { "legend": {
"type": "string" "type": "string"
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment