Skip to content
代码片段 群组 项目
提交 0391f92a 编辑于 作者: Jiaan Louw's avatar Jiaan Louw
浏览文件

Merge branch 'show-pa-toggle-root' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -101,8 +101,11 @@ def group_params_ee
params_ee << :enforce_ssh_certificates if current_group&.ssh_certificates_available?
params_ee << :code_suggestions if ai_assist_ui_enabled?
params_ee << { value_stream_dashboard_aggregation_attributes: [:enabled] } if can?(current_user, :modify_value_stream_dashboard_settings, current_group)
params_ee << :product_analytics_enabled
params_ee << :experiment_features_enabled if experiment_settings_allowed?
if experiment_settings_allowed?
params_ee << :product_analytics_enabled
params_ee << :experiment_features_enabled
end
end
end
......
- return unless group.experiment_settings_allowed?
- learn_more = help_page_path('user/product_analytics/index')
%h5
= s_('ProductAnalytics|Product Analytics')
......
......@@ -61,4 +61,35 @@
end
end
end
context 'for product analytics settings' do
before do
allow(view).to receive(:ai_assist_ui_enabled?).and_return(true)
allow(group).to receive(:licensed_feature_available?).and_call_original
allow(group).to receive(:licensed_feature_available?).with(:experimental_features).and_return(true)
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?).and_return(true)
end
context 'as a sub-group' do
it 'renders nothing' do
allow(group).to receive(:root?).and_return(false)
render
expect(rendered).to render_template('groups/settings/_product_analytics_settings')
expect(rendered).not_to have_content(_('Product Analytics'))
end
end
context 'as a root group' do
it 'renders the product analytics settings' do
allow(group).to receive(:root?).and_return(true)
render
expect(rendered).to render_template('groups/settings/_product_analytics_settings')
expect(rendered).to have_content(_('Product Analytics'))
end
end
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册