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
fbbfefdd
Commit
fbbfefdd
authored
Mar 03, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '205248-remove-ci-status-from-project-dashboard' into 'master'"
This reverts merge request !25225
parent
d0713e85
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
2 deletions
+77
-2
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+8
-0
app/views/dashboard/projects/_projects.html.haml
app/views/dashboard/projects/_projects.html.haml
+1
-1
app/views/explore/projects/_projects.html.haml
app/views/explore/projects/_projects.html.haml
+1
-1
app/views/shared/projects/_project.html.haml
app/views/shared/projects/_project.html.haml
+7
-0
changelogs/unreleased/revert-e0613e64.yml
changelogs/unreleased/revert-e0613e64.yml
+5
-0
spec/features/dashboard/projects_spec.rb
spec/features/dashboard/projects_spec.rb
+55
-0
No files found.
app/assets/stylesheets/pages/projects.scss
View file @
fbbfefdd
...
@@ -1006,6 +1006,14 @@ pre.light-well {
...
@@ -1006,6 +1006,14 @@ pre.light-well {
}
}
}
}
&
:not
(
.with-pipeline-status
)
{
.icon-wrapper
:first-of-type
{
@include
media-breakpoint-up
(
lg
)
{
margin-left
:
$gl-padding-32
;
}
}
}
.ci-status-link
{
.ci-status-link
{
display
:
inline-flex
;
display
:
inline-flex
;
}
}
...
...
app/views/dashboard/projects/_projects.html.haml
View file @
fbbfefdd
=
render
'shared/projects/list'
,
projects:
@projects
,
user:
current_user
=
render
'shared/projects/list'
,
projects:
@projects
,
pipeline_status:
Feature
.
enabled?
(
:dashboard_pipeline_status
,
default_enabled:
true
),
user:
current_user
app/views/explore/projects/_projects.html.haml
View file @
fbbfefdd
-
is_explore_page
=
defined?
(
explore_page
)
&&
explore_page
-
is_explore_page
=
defined?
(
explore_page
)
&&
explore_page
=
render
'shared/projects/list'
,
projects:
projects
,
user:
current_user
,
explore_page:
is_explore_page
=
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/shared/projects/_project.html.haml
View file @
fbbfefdd
...
@@ -12,7 +12,9 @@
...
@@ -12,7 +12,9 @@
-
css_class
+=
" no-description"
if
project
.
description
.
blank?
&&
!
show_last_commit_as_description
-
css_class
+=
" no-description"
if
project
.
description
.
blank?
&&
!
show_last_commit_as_description
-
cache_key
=
project_list_cache_key
(
project
,
pipeline_status:
pipeline_status
)
-
cache_key
=
project_list_cache_key
(
project
,
pipeline_status:
pipeline_status
)
-
updated_tooltip
=
time_ago_with_tooltip
(
project
.
last_activity_date
)
-
updated_tooltip
=
time_ago_with_tooltip
(
project
.
last_activity_date
)
-
show_pipeline_status_icon
=
pipeline_status
&&
can?
(
current_user
,
:read_cross_project
)
&&
project
.
pipeline_status
.
has_status?
&&
can?
(
current_user
,
:read_build
,
project
)
-
css_controls_class
=
compact_mode
?
[]
:
[
"flex-lg-row"
,
"justify-content-lg-between"
]
-
css_controls_class
=
compact_mode
?
[]
:
[
"flex-lg-row"
,
"justify-content-lg-between"
]
-
css_controls_class
<<
"with-pipeline-status"
if
show_pipeline_status_icon
-
avatar_container_class
=
project
.
creator
&&
use_creator_avatar
?
''
:
'rect-avatar'
-
avatar_container_class
=
project
.
creator
&&
use_creator_avatar
?
''
:
'rect-avatar'
-
license_name
=
project_license_name
(
project
)
-
license_name
=
project_license_name
(
project
)
...
@@ -61,6 +63,11 @@
...
@@ -61,6 +63,11 @@
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary
{
class:
css_controls_class
.
join
(
" "
)
}
.controls.d-flex.flex-sm-column.align-items-center.align-items-sm-end.flex-wrap.flex-shrink-0.text-secondary
{
class:
css_controls_class
.
join
(
" "
)
}
.icon-container.d-flex.align-items-center
.icon-container.d-flex.align-items-center
-
if
show_pipeline_status_icon
-
pipeline_path
=
pipelines_project_commit_path
(
project
.
pipeline_status
.
project
,
project
.
pipeline_status
.
sha
,
ref:
project
.
pipeline_status
.
ref
)
%span
.icon-wrapper.pipeline-status
=
render
'ci/status/icon'
,
status:
project
.
last_pipeline
.
detailed_status
(
current_user
),
tooltip_placement:
'top'
,
path:
pipeline_path
=
render_if_exists
'shared/projects/archived'
,
project:
project
=
render_if_exists
'shared/projects/archived'
,
project:
project
-
if
stars
-
if
stars
=
link_to
project_starrers_path
(
project
),
=
link_to
project_starrers_path
(
project
),
...
...
changelogs/unreleased/revert-e0613e64.yml
0 → 100644
View file @
fbbfefdd
---
title
:
Show CI status in project dashboards
merge_request
:
26403
author
:
type
:
fixed
spec/features/dashboard/projects_spec.rb
View file @
fbbfefdd
...
@@ -152,6 +152,61 @@ describe 'Dashboard Projects' do
...
@@ -152,6 +152,61 @@ describe 'Dashboard Projects' do
end
end
end
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
)
}
before
do
# Since the cache isn't updated when a new pipeline is created
# we need the pipeline to advance in the pipeline since the cache was created
# by visiting the login page.
pipeline
.
succeed
end
it
'shows that the last pipeline passed'
do
visit
dashboard_projects_path
page
.
within
(
'.controls'
)
do
expect
(
page
).
to
have_xpath
(
"//a[@href='
#{
pipelines_project_commit_path
(
project
,
project
.
commit
,
ref:
pipeline
.
ref
)
}
']"
)
expect
(
page
).
to
have_css
(
'.ci-status-link'
)
expect
(
page
).
to
have_css
(
'.ci-status-icon-success'
)
expect
(
page
).
to
have_link
(
'Pipeline: passed'
)
end
end
shared_examples
'hidden pipeline status'
do
it
'does not show the pipeline status'
do
visit
dashboard_projects_path
page
.
within
(
'.controls'
)
do
expect
(
page
).
not_to
have_xpath
(
"//a[@href='
#{
pipelines_project_commit_path
(
project
,
project
.
commit
,
ref:
pipeline
.
ref
)
}
']"
)
expect
(
page
).
not_to
have_css
(
'.ci-status-link'
)
expect
(
page
).
not_to
have_css
(
'.ci-status-icon-success'
)
expect
(
page
).
not_to
have_link
(
'Pipeline: passed'
)
end
end
end
context
'guest user of project and project has private pipelines'
do
let
(
:guest_user
)
{
create
(
:user
)
}
before
do
project
.
update
(
public_builds:
false
)
project
.
add_guest
(
guest_user
)
sign_in
(
guest_user
)
end
it_behaves_like
'hidden pipeline status'
end
context
'when dashboard_pipeline_status is disabled'
do
before
do
stub_feature_flags
(
dashboard_pipeline_status:
false
)
end
it_behaves_like
'hidden pipeline status'
end
end
context
'last push widget'
,
:use_clean_rails_memory_store_caching
do
context
'last push widget'
,
:use_clean_rails_memory_store_caching
do
before
do
before
do
event
=
create
(
:push_event
,
project:
project
,
author:
user
)
event
=
create
(
:push_event
,
project:
project
,
author:
user
)
...
...
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