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
end
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
def create_params
......
......@@ -4,6 +4,7 @@ module Analytics
module CycleAnalytics
class StageEntity < Grape::Entity
expose :title
expose :hidden
expose :legend
expose :description
expose :id
......
......@@ -118,6 +118,20 @@ describe Analytics::CycleAnalytics::StagesController do
expect(stage.name).to eq(params[:name])
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
before do
params[:move_before_id] = create(:cycle_analytics_group_stage, parent: group, relative_position: 10).id
......
......@@ -5,6 +5,9 @@
"title": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"legend": {
"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