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
90f4c61b
Commit
90f4c61b
authored
Nov 04, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix empty state message in explore projects pages
Use the specific message defined for explore pages
parent
619ae3d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
34 deletions
+85
-34
app/views/explore/projects/_projects.html.haml
app/views/explore/projects/_projects.html.haml
+1
-2
app/views/explore/projects/trending.html.haml
app/views/explore/projects/trending.html.haml
+1
-1
changelogs/unreleased/26963-fix-empty-state-in-explore-projects-pages.yml
...eased/26963-fix-empty-state-in-explore-projects-pages.yml
+5
-0
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/shortcuts_spec.rb
+1
-1
spec/features/explore/user_explores_projects_spec.rb
spec/features/explore/user_explores_projects_spec.rb
+77
-30
No files found.
app/views/explore/projects/_projects.html.haml
View file @
90f4c61b
-
is_explore_page
=
defined?
(
explore_page
)
&&
explore_page
=
render
'shared/projects/list'
,
projects:
projects
,
user:
current_user
,
explore_page:
true
,
pipeline_status:
Feature
.
enabled?
(
:dashboard_pipeline_status
,
default_enabled:
true
)
=
render
'shared/projects/list'
,
projects:
projects
,
user:
current_user
,
explore_page:
is_explore_page
,
pipeline_status:
Feature
.
enabled?
(
:dashboard_pipeline_status
,
default_enabled:
true
)
app/views/explore/projects/trending.html.haml
View file @
90f4c61b
...
@@ -10,4 +10,4 @@
...
@@ -10,4 +10,4 @@
=
render
'explore/head'
=
render
'explore/head'
=
render
'explore/projects/nav'
unless
Feature
.
enabled?
(
:project_list_filter_bar
)
&&
current_user
=
render
'explore/projects/nav'
unless
Feature
.
enabled?
(
:project_list_filter_bar
)
&&
current_user
=
render
'projects'
,
projects:
@projects
,
explore_page:
true
=
render
'projects'
,
projects:
@projects
changelogs/unreleased/26963-fix-empty-state-in-explore-projects-pages.yml
0 → 100644
View file @
90f4c61b
---
title
:
Fix empty state message in explore projects page
merge_request
:
46860
author
:
type
:
fixed
spec/features/dashboard/shortcuts_spec.rb
View file @
90f4c61b
...
@@ -59,7 +59,7 @@ RSpec.describe 'Dashboard shortcuts', :js do
...
@@ -59,7 +59,7 @@ RSpec.describe 'Dashboard shortcuts', :js do
find
(
'body'
).
send_keys
([
:shift
,
'P'
])
find
(
'body'
).
send_keys
([
:shift
,
'P'
])
find
(
'.nothing-here-block'
)
find
(
'.nothing-here-block'
)
expect
(
page
).
to
have_content
(
"This user doesn't have any personal projects"
)
expect
(
page
).
to
have_content
(
'Explore public groups to find projects to contribute to.'
)
end
end
end
end
...
...
spec/features/explore/user_explores_projects_spec.rb
View file @
90f4c61b
...
@@ -3,65 +3,112 @@
...
@@ -3,65 +3,112 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'User explores projects'
do
RSpec
.
describe
'User explores projects'
do
let_it_be
(
:archived_project
)
{
create
(
:project
,
:archived
)
}
context
'when some projects exist'
do
let_it_be
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
let_it_be
(
:archived_project
)
{
create
(
:project
,
:archived
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:private_project
)
{
create
(
:project
,
:private
)
}
let_it_be
(
:public_project
)
{
create
(
:project
,
:public
)
}
context
'when not signed in'
do
context
'when viewing public projects'
do
context
'when not signed in'
do
before
do
context
'when viewing public projects'
do
visit
(
explore_projects_path
)
before
do
visit
(
explore_projects_path
)
end
include_examples
'shows public projects'
end
end
include_examples
'shows public projects'
context
'when visibility is restricted to public'
do
before
do
stub_application_setting
(
restricted_visibility_levels:
[
Gitlab
::
VisibilityLevel
::
PUBLIC
])
visit
(
explore_projects_path
)
end
it
'redirects to login page'
do
expect
(
page
).
to
have_current_path
(
new_user_session_path
)
end
end
end
end
context
'when visibility is restricted to public'
do
context
'when signed in'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
before
do
stub_application_setting
(
restricted_visibility_levels:
[
Gitlab
::
VisibilityLevel
::
PUBLIC
])
sign_in
(
user
)
visit
(
explore_projects_path
)
stub_feature_flags
(
project_list_filter_bar:
false
)
end
shared_examples
'empty search results'
do
it
'shows correct empty state message'
,
:js
do
fill_in
'name'
,
with:
'zzzzzzzzzzzzzzzzzzz'
expect
(
page
).
to
have_content
(
'Explore public groups to find projects to contribute to.'
)
end
end
end
it
'redirects to login page'
do
context
'when viewing public projects'
do
expect
(
page
).
to
have_current_path
(
new_user_session_path
)
before
do
visit
(
explore_projects_path
)
end
include_examples
'shows public and internal projects'
include_examples
'empty search results'
end
context
'when viewing most starred projects'
do
before
do
visit
(
starred_explore_projects_path
)
end
include_examples
'shows public and internal projects'
include_examples
'empty search results'
end
context
'when viewing trending projects'
do
before
do
[
archived_project
,
public_project
].
each
{
|
project
|
create
(
:note_on_issue
,
project:
project
)
}
TrendingProject
.
refresh!
visit
(
trending_explore_projects_path
)
end
include_examples
'shows public projects'
include_examples
'empty search results'
end
end
end
end
end
end
context
'when
signed in
'
do
context
'when
there are no projects
'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
shared_examples
'explore page empty state'
do
it
'shows correct empty state message'
do
before
do
expect
(
page
).
to
have_content
(
'Explore public groups to find projects to contribute to.'
)
sign_in
(
user
)
end
end
end
context
'when viewing public projects'
do
context
'when viewing public projects'
do
before
do
before
do
visit
(
explore_projects_path
)
visit
explore_projects_path
end
end
i
nclude_examples
'shows public and internal projects
'
i
t_behaves_like
'explore page empty state
'
end
end
context
'when viewing most starred projects'
do
context
'when viewing most starred projects'
do
before
do
before
do
visit
(
starred_explore_projects_path
)
visit
starred_explore_projects_path
end
end
i
nclude_examples
'shows public and internal projects
'
i
t_behaves_like
'explore page empty state
'
end
end
context
'when viewing trending projects'
do
context
'when viewing trending projects'
do
before
do
before
do
[
archived_project
,
public_project
].
each
{
|
project
|
create
(
:note_on_issue
,
project:
project
)
}
visit
trending_explore_projects_path
TrendingProject
.
refresh!
visit
(
trending_explore_projects_path
)
end
end
i
nclude_examples
'shows public projects
'
i
t_behaves_like
'explore page empty state
'
end
end
end
end
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