Commit 7c54c171 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'billings-gold-trial-callout-fe-dashboard' into 'master'

FE Refactor dashboard gold trial callouts

See merge request gitlab-org/gitlab-ee!9644
parents 98d3448c c8b14584
......@@ -5,7 +5,7 @@
= auto_discovery_link_tag(:atom, dashboard_projects_url(rss_url_options), title: "All activity")
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- page_title "Activity"
- header_title "Activity", activity_dashboard_path
......
......@@ -2,7 +2,7 @@
- page_title "Groups"
- header_title "Groups", dashboard_groups_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
= render 'dashboard/groups_head'
- if params[:filter].blank? && @groups.empty?
......
......@@ -4,7 +4,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{current_user.name} issues")
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
.page-title-holder
%h1.page-title= _('Issues')
......
......@@ -2,7 +2,7 @@
- page_title _("Merge Requests")
- @breadcrumb_link = merge_requests_dashboard_path(assignee_username: current_user.username)
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
.page-title-holder
%h1.page-title= _('Merge Requests')
......
......@@ -4,7 +4,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, dashboard_projects_url(rss_url_options), title: "All activity")
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- page_title "Projects"
- header_title "Projects", dashboard_projects_path
......
......@@ -4,7 +4,7 @@
- page_title _("Starred Projects")
- header_title _("Projects"), dashboard_projects_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
%div{ class: container_class }
= render "projects/last_push"
......
......@@ -2,7 +2,7 @@
- page_title "Todos"
- header_title "Todos", dashboard_todos_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
.page-title-holder
%h1.page-title= _('Todos')
......
......@@ -2,7 +2,7 @@
- page_title _("Groups")
- header_title _("Groups"), dashboard_groups_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- if current_user
= render 'dashboard/groups_head'
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- if current_user
= render 'dashboard/projects_head'
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- if current_user
= render 'dashboard/projects_head'
......
......@@ -2,7 +2,7 @@
- page_title _("Projects")
- header_title _("Projects"), dashboard_projects_path
= render_if_exists "shared/gold_trial_callout"
= render_dashboard_gold_trial(current_user)
- if current_user
= render 'dashboard/projects_head'
......
......@@ -21,7 +21,7 @@ module EE
end
end
def user_default_dashboard?(user = current_user)
def user_default_dashboard?(user)
controller_action_to_child_dashboards.any? {|dashboard| dashboard == user.dashboard }
end
end
......
......@@ -48,11 +48,11 @@ module EE
override :render_dashboard_gold_trial
def render_dashboard_gold_trial(user)
return unless user_default_dashboard?(user) &&
show_gold_trial?(user, GOLD_TRIAL) &&
return unless show_gold_trial?(user, GOLD_TRIAL) &&
user_default_dashboard?(user) &&
has_no_trial_or_gold_plan?(user)
render 'shared/gold_trial_callout'
render 'shared/gold_trial_callout_content'
end
def render_billings_gold_trial(user, namespace)
......
- if show_gold_trial?(current_user) && user_default_dashboard?(current_user) && has_no_trial_or_gold_plan?(current_user)
= render 'shared/gold_trial_callout_content'
......@@ -6,5 +6,5 @@ describe 'Dashboard activity' do
let(:user) { create(:user) }
let(:page_path) { activity_dashboard_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -6,5 +6,5 @@ describe 'Dashboard groups' do
let(:user) { create(:user) }
let(:page_path) { dashboard_groups_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -6,5 +6,5 @@ describe 'Dashboard issues' do
let(:user) { create(:user) }
let(:page_path) { issues_dashboard_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -6,5 +6,5 @@ describe 'Dashboard merge requests' do
let(:user) { create(:user) }
let(:page_path) { merge_requests_dashboard_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -6,5 +6,5 @@ describe 'Dashboard projects' do
let(:user) { create(:user) }
let(:page_path) { dashboard_projects_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -6,5 +6,5 @@ describe 'Dashboard todos' do
let(:user) { create(:user) }
let(:page_path) { dashboard_todos_path }
it_behaves_like 'gold trial callout'
it_behaves_like 'dashboard gold trial callout'
end
......@@ -195,7 +195,7 @@ describe EE::UserCalloutsHelper do
it do
if should_render?
expect(helper).to receive(:render).with('shared/gold_trial_callout')
expect(helper).to receive(:render).with('shared/gold_trial_callout_content')
else
expect(helper).not_to receive(:render)
end
......
# frozen_string_literal: true
shared_examples 'gold trial callout' do
shared_examples 'dashboard gold trial callout' do
before do
sign_in(user)
end
......
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