Commit 6a326089 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ci-status-projects-page' into 'master'

Show CI status on Your projects page and Starred projects page
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Part of #2594 

Screenshot: 

![Screenshot_2015-09-24_13.42.52](https://gitlab.com/gitlab-org/gitlab-ce/uploads/0516ea02b72457a431bd72d3f6619dfe/Screenshot_2015-09-24_13.42.52.png)


See merge request !1420
parents 3e866b2a 353d426e
...@@ -7,6 +7,7 @@ v 8.1.0 (unreleased) ...@@ -7,6 +7,7 @@ v 8.1.0 (unreleased)
- Fix cases where Markdown did not render links in activity feed (Stan Hu) - Fix cases where Markdown did not render links in activity feed (Stan Hu)
- Add first and last to pagination (Zeger-Jan van de Weg) - Add first and last to pagination (Zeger-Jan van de Weg)
- Show CI status on commit page - Show CI status on commit page
- Show CI status on Your projects page and Starred projects page
v 8.0.2 (unreleased) v 8.0.2 (unreleased)
- Skip check_initd_configured_correctly on omnibus installs - Skip check_initd_configured_correctly on omnibus installs
......
...@@ -297,9 +297,15 @@ pre.light-well { ...@@ -297,9 +297,15 @@ pre.light-well {
color: #4c4e54; color: #4c4e54;
} }
.pull-right.light { .project-controls {
float: right;
color: $gl-gray;
line-height: 45px; line-height: 45px;
color: #7f8fa4; color: #7f8fa4;
a:hover {
text-decoration: none;
}
} }
.project-description { .project-description {
......
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
= link_to new_project_path, class: 'btn btn-success' do = link_to new_project_path, class: 'btn btn-success' do
New project New project
= render 'shared/projects/list', projects: @projects = render 'shared/projects/list', projects: @projects, ci: true
- projects_limit = 20 unless local_assigns[:projects_limit] - projects_limit = 20 unless local_assigns[:projects_limit]
- avatar = true unless local_assigns[:avatar] == false - avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false - stars = true unless local_assigns[:stars] == false
- ci = false unless local_assigns[:ci] == true
%ul.projects-list %ul.projects-list
- projects.each_with_index do |project, i| - projects.each_with_index do |project, i|
- css_class = (i >= projects_limit) ? 'hide' : nil - css_class = (i >= projects_limit) ? 'hide' : nil
= render "shared/projects/project", project: project, = render "shared/projects/project", project: project,
avatar: avatar, stars: stars, css_class: css_class avatar: avatar, stars: stars, css_class: css_class, ci: ci
- if projects.size > projects_limit - if projects.size > projects_limit
%li.bottom.center %li.bottom.center
......
- avatar = true unless local_assigns[:avatar] == false - avatar = true unless local_assigns[:avatar] == false
- stars = true unless local_assigns[:stars] == false - stars = true unless local_assigns[:stars] == false
- ci = false unless local_assigns[:ci] == true
- css_class = '' unless local_assigns[:css_class] - css_class = '' unless local_assigns[:css_class]
- css_class += " no-description" unless project.description.present? - css_class += " no-description" unless project.description.present?
%li.project-row{ class: css_class } %li.project-row{ class: css_class }
= cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2.1'] do = cache [project.namespace, project, controller.controller_name, controller.action_name, 'v2.2'] do
= link_to project_path(project), class: dom_class(project) do = link_to project_path(project), class: dom_class(project) do
- if avatar - if avatar
.dash-project-avatar .dash-project-avatar
...@@ -15,8 +16,16 @@ ...@@ -15,8 +16,16 @@
\/ \/
%span.project-name.filter-title %span.project-name.filter-title
= project.name = project.name
.project-controls
- if ci && !project.empty_repo?
- if ci_commit = project.ci_commit(project.commit.sha)
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
= ci_status_icon(ci_commit)
&nbsp;
- if stars - if stars
%span.pull-right.light %span
%i.fa.fa-star %i.fa.fa-star
= project.star_count = project.star_count
- if project.description.present? - if project.description.present?
......
...@@ -4,12 +4,14 @@ Feature: Dashboard ...@@ -4,12 +4,14 @@ Feature: Dashboard
Given I sign in as a user Given I sign in as a user
And I own project "Shop" And I own project "Shop"
And project "Shop" has push event And project "Shop" has push event
And project "Shop" has CI enabled
And project "Shop" has CI build
And I visit dashboard page And I visit dashboard page
@javascript
Scenario: I should see projects list Scenario: I should see projects list
Then I should see "New Project" link Then I should see "New Project" link
Then I should see "Shop" project link Then I should see "Shop" project link
Then I should see "Shop" project CI status
@javascript @javascript
Scenario: I should see activity list Scenario: I should see activity list
......
...@@ -11,6 +11,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -11,6 +11,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
expect(page).to have_link "Shop" expect(page).to have_link "Shop"
end end
step 'I should see "Shop" project CI status' do
expect(page).to have_link "Build status: skipped"
end
step 'I should see last push widget' do step 'I should see last push widget' do
expect(page).to have_content "You pushed to fix" expect(page).to have_content "You pushed to fix"
expect(page).to have_link "Create Merge Request" expect(page).to have_link "Create Merge Request"
......
...@@ -23,10 +23,6 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps ...@@ -23,10 +23,6 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
visit ci_namespace_project_graph_path(project.namespace, project, 'master') visit ci_namespace_project_graph_path(project.namespace, project, 'master')
end end
step 'project "Shop" has CI enabled' do
project.enable_ci(@user)
end
step 'page should have CI graphs' do step 'page should have CI graphs' do
expect(page).to have_content 'Overall' expect(page).to have_content 'Overall'
expect(page).to have_content 'Builds chart for last week' expect(page).to have_content 'Builds chart for last week'
......
...@@ -196,4 +196,14 @@ module SharedProject ...@@ -196,4 +196,14 @@ module SharedProject
create(:label, project: project, title: 'feature') create(:label, project: project, title: 'feature')
create(:label, project: project, title: 'enhancement') create(:label, project: project, title: 'enhancement')
end end
step 'project "Shop" has CI enabled' do
project = Project.find_by(name: "Shop")
project.enable_ci(@user)
end
step 'project "Shop" has CI build' do
project = Project.find_by(name: "Shop")
create :ci_commit, project: project.gitlab_ci_project, sha: project.commit.sha
end
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