Merge remote-tracking branch 'origin/mr-broken'

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-12-09 21:06:04 +01:00
commit 7a4d468576
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
8 changed files with 66 additions and 32 deletions

View file

@ -123,6 +123,24 @@ ul.content-list {
padding: 10px 14px;
}
}
ul.controls {
list-style: none;
li {
float: left;
padding-right: 10px;
.author_link {
display: inline-block;
.avatar-inline {
margin-left: 0;
margin-right: 0;
}
}
}
}
}
}

View file

@ -58,7 +58,7 @@ module CiStatusHelper
def render_ci_status(ci_commit)
link_to ci_status_path(ci_commit),
class: "c#{ci_status_color(ci_commit)}",
title: "Build status: #{ci_status_label(ci_commit)}",
title: "Build #{ci_status_label(ci_commit)}",
data: { toggle: 'tooltip', placement: 'left' } do
ci_status_icon(ci_commit)
end

View file

@ -509,4 +509,8 @@ class MergeRequest < ActiveRecord::Base
def ci_commit
@ci_commit ||= source_project.ci_commit(last_commit.id) if last_commit && source_project
end
def broken?
self.commits.blank? || branch_missing? || cannot_be_merged?
end
end

View file

@ -6,23 +6,26 @@
.issue-title
%span.issue-title-text
= link_to_gfm issue.title, issue_path(issue), class: "row_title"
.pull-right.light
%ul.controls.light
- if issue.closed?
%span
%li
CLOSED
- if issue.assignee
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
%li
= link_to_member(@project, issue.assignee, name: false, title: "Assigned to :name")
- note_count = issue.notes.user.count
- if note_count > 0
&nbsp;
= link_to issue_path(issue) + "#notes" do
= icon('comments')
= note_count
%li
= link_to issue_path(issue) + "#notes" do
= icon('comments')
= note_count
- else
&nbsp;
= link_to issue_path(issue) + "#notes", class: "issue-no-comments" do
= icon('comments')
= 0
%li
= link_to issue_path(issue) + "#notes", class: "issue-no-comments" do
= icon('comments')
= note_count
.issue-info
#{issue.to_reference} &middot;

View file

@ -2,31 +2,40 @@
.merge-request-title
%span.merge-request-title-text
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
.pull-right.light
- if merge_request.ci_commit
= render_ci_status(merge_request.ci_commit)
%ul.controls.light
- if merge_request.merged?
%span
%li
= icon('check')
MERGED
- elsif merge_request.closed?
%span
%li
= icon('ban')
CLOSED
- note_count = merge_request.mr_and_commit_notes.user.count
- if merge_request.ci_commit
%li
= render_ci_status(merge_request.ci_commit)
- if merge_request.open? && merge_request.broken?
%li
= link_to merge_request_path(merge_request), class: "has_tooltip", title: "Cannot be merged automatically", data: {container: 'body'} do
= icon('exclamation-triangle')
- if merge_request.assignee
&nbsp;
= link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name")
%li
= link_to_member(merge_request.source_project, merge_request.assignee, name: false, title: "Assigned to :name")
- note_count = merge_request.mr_and_commit_notes.user.count
- if note_count > 0
&nbsp;
= link_to merge_request_path(merge_request) + "#notes" do
= icon('comments')
= note_count
%li
= link_to merge_request_path(merge_request) + "#notes" do
= icon('comments')
= note_count
- else
&nbsp;
= link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do
= icon('comments')
= 0
%li
= link_to merge_request_path(merge_request) + "#notes", class: "merge-request-no-comments" do
= icon('comments')
= note_count
.merge-request-info
\##{merge_request.iid} &middot;

View file

@ -12,7 +12,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I should see "Shop" project CI status' do
expect(page).to have_link "Build status: skipped"
expect(page).to have_link "Build skipped"
end
step 'I should see last push widget' do

View file

@ -367,7 +367,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see merge request "Bug NS-05" with CI status' do
page.within ".mr-list" do
expect(page).to have_link "Build status: pending"
expect(page).to have_link "Build pending"
end
end

View file

@ -293,10 +293,10 @@ describe 'Issues', feature: true do
end
def first_issue
page.all('ul.issues-list li').first.text
page.all('ul.issues-list > li').first.text
end
def last_issue
page.all('ul.issues-list li').last.text
page.all('ul.issues-list > li').last.text
end
end