Commit 8c542370 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Revert merge request states renaming

Replaced:
* "Accepted" with "Merged"
* "Rejected" with "Closed"
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent baa699a7
......@@ -47,8 +47,8 @@ v 7.12.0 (unreleased)
- Add validation to wiki page creation (only [a-zA-Z0-9/_-] are allowed) (Jeroen van Baarsen)
- Fix new/empty milestones showing 100% completion value (Jonah Bishop)
- Add a note when an Issue or Merge Request's title changes
- Consistently refer to MRs as either Accepted or Rejected.
- Add Accepted and Rejected tabs to MR lists.
- Consistently refer to MRs as either Merged or Closed.
- Add Merged tab to MR lists.
- Prefix EmailsOnPush email subject with `[Git]`.
- Group project contributions by both name and email.
- Clarify navigation labels for Project Settings and Group Settings.
......
......@@ -45,10 +45,10 @@ class IssuableFinder
def group
return @group if defined?(@group)
@group =
@group =
if params[:group_id].present?
Group.find(params[:group_id])
else
else
nil
end
end
......@@ -56,10 +56,10 @@ class IssuableFinder
def project
return @project if defined?(@project)
@project =
@project =
if params[:project_id].present?
Project.find(params[:project_id])
else
else
nil
end
end
......@@ -76,7 +76,7 @@ class IssuableFinder
return @milestones if defined?(@milestones)
@milestones =
if milestones? && params[:milestone_title] != NONE
if milestones? && params[:milestone_title] != NONE
Milestone.where(title: params[:milestone_title])
else
nil
......@@ -90,7 +90,7 @@ class IssuableFinder
def assignee
return @assignee if defined?(@assignee)
@assignee =
@assignee =
if assignee? && params[:assignee_id] != NONE
User.find(params[:assignee_id])
else
......@@ -105,7 +105,7 @@ class IssuableFinder
def author
return @author if defined?(@author)
@author =
@author =
if author? && params[:author_id] != NONE
User.find(params[:author_id])
else
......@@ -148,8 +148,6 @@ class IssuableFinder
case params[:state]
when 'closed'
items.closed
when 'rejected'
items.respond_to?(:rejected) ? items.rejected : items.closed
when 'merged'
items.respond_to?(:merged) ? items.merged : items.closed
when 'all'
......
......@@ -327,10 +327,9 @@ module ApplicationHelper
def state_filters_text_for(entity, project)
titles = {
opened: "Open",
merged: "Accepted"
opened: "Open"
}
entity_title = titles[entity] || entity.to_s.humanize
count =
......
......@@ -125,16 +125,14 @@ class MergeRequest < ActiveRecord::Base
validate :validate_fork
scope :of_group, ->(group) { where("source_project_id in (:group_project_ids) OR target_project_id in (:group_project_ids)", group_project_ids: group.project_ids) }
scope :merged, -> { with_state(:merged) }
scope :by_branch, ->(branch_name) { where("(source_branch LIKE :branch) OR (target_branch LIKE :branch)", branch: branch_name) }
scope :cared, ->(user) { where('assignee_id = :user OR author_id = :user', user: user.id) }
scope :by_milestone, ->(milestone) { where(milestone_id: milestone) }
scope :in_projects, ->(project_ids) { where("source_project_id in (:project_ids) OR target_project_id in (:project_ids)", project_ids: project_ids) }
scope :of_projects, ->(ids) { where(target_project_id: ids) }
# Closed scope for merge request should return
# both merged and closed mr's
scope :closed, -> { with_states(:closed, :merged) }
scope :rejected, -> { with_states(:closed) }
scope :merged, -> { with_state(:merged) }
scope :closed, -> { with_state(:closed) }
scope :closed_and_merged, -> { with_states(:closed, :merged) }
def self.reference_prefix
'!'
......@@ -417,4 +415,14 @@ class MergeRequest < ActiveRecord::Base
def can_be_merged_by?(user)
::Gitlab::GitAccess.new(user, project).can_push_to_branch?(target_branch)
end
def state_human_name
if merged?
"Merged"
elsif closed?
"Closed"
else
"Open"
end
end
end
......@@ -56,7 +56,7 @@ class Milestone < ActiveRecord::Base
end
def closed_items_count
self.issues.closed.count + self.merge_requests.closed.count
self.issues.closed.count + self.merge_requests.closed_and_merged.count
end
def total_items_count
......
......@@ -9,11 +9,11 @@
- if merge_request.merged?
%span
%i.fa.fa-check
ACCEPTED
MERGED
- elsif merge_request.closed?
%span
%i.fa.fa-ban
REJECTED
CLOSED
- else
%span.hidden-xs.hidden-sm
%span.label-branch<
......
%h4.page-title
.issue-box{ class: issue_box_class(@merge_request) }
- if @merge_request.merged?
Accepted
- elsif @merge_request.closed?
Rejected
- else
Open
= @merge_request.state_human_name
= "Merge Request ##{@merge_request.iid}"
%small.creator
&middot;
......
......@@ -2,7 +2,7 @@
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Rejected
Closed
- if @merge_request.closed_event
by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
......
......@@ -2,7 +2,7 @@
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Accepted
Merged
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
......
......@@ -89,7 +89,7 @@
= render('merge_requests', title: 'Rejected (closed)', merge_requests: @merge_requests.rejected, id: 'closed')
.col-md-3
.panel.panel-primary
.panel-heading Accepted
.panel-heading Merged
%ul.well-list
- @merge_requests.merged.each do |merge_request|
= render 'merge_request', merge_request: merge_request
......
......@@ -11,6 +11,6 @@
#{merge_request.project.name_with_namespace}
.pull-right
- if merge_request.merged?
%span.label.label-primary Accepted
%span.label.label-primary Merged
- elsif merge_request.closed?
%span.label.label-danger Rejected
%span.label.label-danger Closed
......@@ -12,10 +12,10 @@
= icon('check-circle')
#{state_filters_text_for(:merged, @project)}
%li{class: ("active" if params[:state] == 'rejected')}
= link_to page_filter_path(state: 'rejected') do
%li{class: ("active" if params[:state] == 'closed')}
= link_to page_filter_path(state: 'closed') do
= icon('ban')
#{state_filters_text_for(:rejected, @project)}
#{state_filters_text_for(:closed, @project)}
- else
%li{class: ("active" if params[:state] == 'closed')}
= link_to page_filter_path(state: 'closed') do
......
......@@ -11,7 +11,7 @@ Feature: Project Merge Requests
And I should not see "Feature NS-03" in merge requests
Scenario: I should see rejected merge requests
Given I click link "Rejected"
Given I click link "Closed"
Then I should see "Feature NS-03" in merge requests
And I should not see "Bug NS-04" in merge requests
......
......@@ -19,8 +19,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_link "All"
end
step 'I click link "Rejected"' do
click_link "Rejected"
step 'I click link "Closed"' do
click_link "Closed"
end
step 'I should see merge request "Wiki Feature"' do
......@@ -32,7 +32,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see closed merge request "Bug NS-04"' do
merge_request = MergeRequest.find_by!(title: "Bug NS-04")
expect(merge_request.closed?).to be_true
expect(page).to have_content "Rejected by"
expect(page).to have_content "Closed by"
end
step 'I should see merge request "Bug NS-04"' do
......@@ -206,7 +206,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see merged request' do
page.within '.issue-box' do
expect(page).to have_content "Accepted"
expect(page).to have_content "Merged"
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