Commit f9c6cca3 authored by Doug Stull's avatar Doug Stull Committed by Dylan Griffith

Remove feature flag on customize homepage

- no need to have a toggle.
parent f8dac0be
......@@ -13,7 +13,6 @@ class RootController < Dashboard::ProjectsController
before_action :redirect_unlogged_user, if: -> { current_user.nil? }
before_action :redirect_logged_user, if: -> { current_user.present? }
before_action :customize_homepage, only: :index, if: -> { current_user.present? }
# We only need to load the projects when the user is logged in but did not
# configure a dashboard. In which case we render projects. We can do that straight
# from the #index action.
......@@ -69,10 +68,6 @@ class RootController < Dashboard::ProjectsController
root_urls.exclude?(home_page_url)
end
def customize_homepage
@customize_homepage = Feature.enabled?(:customize_homepage, default_enabled: :yaml)
end
end
RootController.prepend_if_ee('EE::RootController')
......@@ -49,8 +49,8 @@ module UserCalloutsHelper
!user_dismissed?(WEBHOOKS_MOVED)
end
def show_customize_homepage_banner?(customize_homepage)
customize_homepage && !user_dismissed?(CUSTOMIZE_HOMEPAGE)
def show_customize_homepage_banner?
!user_dismissed?(CUSTOMIZE_HOMEPAGE)
end
def show_feature_flags_new_version?
......
......@@ -3,7 +3,7 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, dashboard_projects_url(rss_url_options), title: "All activity")
- if show_customize_homepage_banner?(@customize_homepage)
- if show_customize_homepage_banner?
= content_for :customize_homepage_banner do
.gl-display-none.gl-md-display-block{ class: "gl-pt-6! gl-pb-2! #{(container_class unless @no_container)} #{@content_class}" }
.js-customize-homepage-banner{ data: { svg_path: image_path('illustrations/monitoring/getting_started.svg'),
......
---
title: Remove feature flag for customize homepage banner
merge_request: 57147
author:
type: other
---
name: customize_homepage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54357
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/299895
milestone: '13.10'
type: development
group: group::expansion
default_enabled: true
......@@ -134,26 +134,6 @@ RSpec.describe RootController do
expect(response).to render_template 'dashboard/projects/index'
end
context 'when customize_homepage is enabled' do
it 'renders the default dashboard' do
get :index
expect(assigns[:customize_homepage]).to be true
end
end
context 'when customize_homepage is not enabled' do
before do
stub_feature_flags(customize_homepage: false)
end
it 'renders the default dashboard' do
get :index
expect(assigns[:customize_homepage]).to be false
end
end
end
end
end
......
......@@ -3,9 +3,9 @@
require 'spec_helper'
RSpec.describe 'Dashboard Projects' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, name: 'awesome stuff') }
let(:project2) { create(:project, :public, name: 'Community project') }
let_it_be(:user) { create(:user) }
let_it_be(:project, reload: true) { create(:project, :repository) }
let_it_be(:project2) { create(:project, :public) }
before do
project.add_developer(user)
......@@ -18,17 +18,10 @@ RSpec.describe 'Dashboard Projects' do
end
end
it 'shows the project the user in a member of in the list' do
visit dashboard_projects_path
expect(page).to have_content('awesome stuff')
end
it 'shows "New project" button' do
it 'shows the customize banner', :js do
visit dashboard_projects_path
page.within '#content-body' do
expect(page).to have_link('New project')
end
expect(page).to have_content('Do you want to customize this page?')
end
context 'when user has access to the project' do
......@@ -153,7 +146,7 @@ RSpec.describe 'Dashboard Projects' do
end
describe 'with a pipeline', :clean_gitlab_redis_shared_state do
let(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit.sha, ref: project.default_branch) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit.sha, ref: project.default_branch) }
before do
# Since the cache isn't updated when a new pipeline is created
......
......@@ -102,24 +102,14 @@ RSpec.describe UserCalloutsHelper do
end
describe '.show_customize_homepage_banner?' do
let(:customize_homepage) { true }
subject { helper.show_customize_homepage_banner?(customize_homepage) }
subject { helper.show_customize_homepage_banner? }
context 'when user has not dismissed' do
before do
allow(helper).to receive(:user_dismissed?).with(described_class::CUSTOMIZE_HOMEPAGE) { false }
end
context 'when customize_homepage is set' do
it { is_expected.to be true }
end
context 'when customize_homepage is false' do
let(:customize_homepage) { false }
it { is_expected.to be false }
end
it { is_expected.to be true }
end
context 'when user dismissed' do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'dashboard/projects/index.html.haml' do
let_it_be(:user) { build(:user) }
before do
allow(view).to receive(:limited_counter_with_delimiter)
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:project_list_cache_key)
allow(view).to receive(:time_ago_with_tooltip)
allow(view).to receive(:project_icon)
assign(:projects, [build(:project, name: 'awesome stuff')])
end
it 'shows the project the user is a member of in the list' do
render
expect(rendered).to have_content('awesome stuff')
end
it 'shows the "New project" button' do
render
expect(rendered).to have_link('New project')
end
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