Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f9c6cca3
Commit
f9c6cca3
authored
Mar 24, 2021
by
Doug Stull
Committed by
Dylan Griffith
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag on customize homepage
- no need to have a toggle.
parent
f8dac0be
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
61 deletions
+44
-61
app/controllers/root_controller.rb
app/controllers/root_controller.rb
+0
-5
app/helpers/user_callouts_helper.rb
app/helpers/user_callouts_helper.rb
+2
-2
app/views/dashboard/projects/index.html.haml
app/views/dashboard/projects/index.html.haml
+1
-1
changelogs/unreleased/299895-experiment-cleanup-customize_homepage-banner-2.yml
...299895-experiment-cleanup-customize_homepage-banner-2.yml
+5
-0
config/feature_flags/development/customize_homepage.yml
config/feature_flags/development/customize_homepage.yml
+0
-8
spec/controllers/root_controller_spec.rb
spec/controllers/root_controller_spec.rb
+0
-20
spec/features/dashboard/projects_spec.rb
spec/features/dashboard/projects_spec.rb
+6
-13
spec/helpers/user_callouts_helper_spec.rb
spec/helpers/user_callouts_helper_spec.rb
+2
-12
spec/views/dashboard/projects/index.html.haml_spec.rb
spec/views/dashboard/projects/index.html.haml_spec.rb
+28
-0
No files found.
app/controllers/root_controller.rb
View file @
f9c6cca3
...
...
@@ -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'
)
app/helpers/user_callouts_helper.rb
View file @
f9c6cca3
...
...
@@ -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?
...
...
app/views/dashboard/projects/index.html.haml
View file @
f9c6cca3
...
...
@@ -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'
),
...
...
changelogs/unreleased/299895-experiment-cleanup-customize_homepage-banner-2.yml
0 → 100644
View file @
f9c6cca3
---
title
:
Remove feature flag for customize homepage banner
merge_request
:
57147
author
:
type
:
other
config/feature_flags/development/customize_homepage.yml
deleted
100644 → 0
View file @
f8dac0be
---
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
spec/controllers/root_controller_spec.rb
View file @
f9c6cca3
...
...
@@ -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
...
...
spec/features/dashboard/projects_spec.rb
View file @
f9c6cca3
...
...
@@ -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
...
...
spec/helpers/user_callouts_helper_spec.rb
View file @
f9c6cca3
...
...
@@ -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
...
...
spec/views/dashboard/projects/index.html.haml_spec.rb
0 → 100644
View file @
f9c6cca3
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment