Skip to content
代码片段 群组 项目
提交 794bcbf6 编辑于 作者: Alper Akgun's avatar Alper Akgun
浏览文件

Merge branch '355655-remove-epic-discovery-moment-in-ee' into 'master'

Remove epic feature discovery moment on EE

See merge request gitlab-org/gitlab!85962
No related branches found
No related tags found
无相关合并请求
......@@ -28,12 +28,14 @@ def new_trial_url
uri.to_s
end
def show_promotions?(selected_user = current_user)
def show_promotions?(selected_user = current_user, hide_on_self_managed: false)
return false unless selected_user
if Gitlab::CurrentSettings.current_application_settings
.should_check_namespace_plan?
.should_check_namespace_plan? # that checks Gitlab.com? too
true
elsif hide_on_self_managed
false
else
license = License.current
license.nil? || license.expired?
......
- promotion_feature = 'promote_epics_sidebar_dismissed'
- if show_promotions? && show_callout?(promotion_feature)
- if show_promotions?(hide_on_self_managed: true) && show_callout?(promotion_feature)
.block.js-epics-sidebar-callout.promotion-issue-sidebar{ data: { uid: promotion_feature } }
.sidebar-collapsed-icon{ data: { toggle: "dropdown", target: ".js-epics-sidebar-callout" } }
%span{ data: { toggle: "tooltip", placement: "left", container: "body" }, title: _('Epic') }
......
......@@ -163,7 +163,12 @@
sign_in(user)
end
it_behaves_like 'Epics promotion'
it 'does not appear on the page' do
visit project_issue_path(project, issue)
wait_for_requests
expect(page).not_to have_selector('.js-epics-sidebar-callout')
end
end
end
......@@ -214,7 +219,6 @@
click_link 'Learn more'
expect(page).to have_selector('.js-weight-sidebar-callout')
expect(page).to have_selector('.promotion-issue-sidebar-message', visible: false)
end
context 'when checking namespace plans' do
......
......@@ -120,4 +120,74 @@ def stub_default_url_options(host: "localhost", protocol: "http", port: nil, scr
end
end
end
describe '#show_promotions?' do
context 'without a user' do
subject { helper.show_promotions?(nil) }
it { is_expected.to eq(false) }
end
context 'with a user' do
let_it_be(:selected_user) { create(:user) }
subject { helper.show_promotions?(selected_user) }
context 'on saas' do
before do
stub_ee_application_setting(should_check_namespace_plan: true)
end
it { is_expected.to eq(true) }
end
context 'when gitlabdotcom returns false' do
before do
allow(Gitlab).to receive(:com?).and_return(false)
end
it { is_expected.to eq(false) }
end
context 'on EE' do
context 'with hide on self managed true' do
subject { helper.show_promotions?(selected_user, hide_on_self_managed: true) }
it { is_expected.to eq(false) }
end
context 'without a valid license' do
before do
allow(License).to receive(:current).and_return(nil)
end
it { is_expected.to eq(true) }
end
context 'with a valid license' do
let_it_be(:license) { create(:license) }
before do
allow(License).to receive(:current).and_return(license)
end
context 'expired license' do
before do
allow(license).to receive(:expired?).and_return(true)
end
it { is_expected.to eq(true) }
end
context 'non expired license' do
before do
allow(license).to receive(:expired?).and_return(false)
end
it { is_expected.to eq(false) }
end
end
end
end
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册