diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-27 11:40:36 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-27 11:40:36 +0000 |
commit | 9eec0d54362199b622fa14858c6f1ea600c295a0 (patch) | |
tree | 8b03d6ae66ad4f3986bba0d6ea84aeb234f1de89 /app | |
parent | 701c2e9a3b4b60642eba0ee00c3e11e1e43fb131 (diff) | |
parent | 7df45882a93220c6250294fb653f5e64464ebb64 (diff) | |
download | gitlab-ce-9eec0d54362199b622fa14858c6f1ea600c295a0.tar.gz |
Merge branch 'accepted-rejected-mrs' into 'master'
Add Accepted and Rejected tabs to MR lists.
Before, MRs were referred to as Merged or Closed, but the Merge button on the MR page read "Accept Merge Request", the activity feed even read "X accepted merge request Y", and the Closed tab on the MR index included both Merged _and_ Closed MRs. I've changed every occurrence to consistently refer to MRs as either Accepted or Rejected, which is less technical and more clearly two opposites.
![Screen_Shot_2015-05-25_at_17.02.31](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b0bf43aa1b5b9898a1c6b204dbcf669a/Screen_Shot_2015-05-25_at_17.02.31.png)
![Screen_Shot_2015-05-25_at_17.02.47](https://gitlab.com/gitlab-org/gitlab-ce/uploads/2ac05b1e1dba3b2d1692bd9242078f3a/Screen_Shot_2015-05-25_at_17.02.47.png)
![Screen_Shot_2015-05-25_at_17.03.03](https://gitlab.com/gitlab-org/gitlab-ce/uploads/4c0f0fa869c9130a6af18d80a1c6ebed/Screen_Shot_2015-05-25_at_17.03.03.png)
Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2201.
See merge request !702
Diffstat (limited to 'app')
-rw-r--r-- | app/finders/issuable_finder.rb | 4 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 7 | ||||
-rw-r--r-- | app/models/merge_request.rb | 2 | ||||
-rw-r--r-- | app/views/dashboard/issues.html.haml | 2 | ||||
-rw-r--r-- | app/views/dashboard/merge_requests.html.haml | 2 | ||||
-rw-r--r-- | app/views/groups/issues.html.haml | 2 | ||||
-rw-r--r-- | app/views/groups/merge_requests.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/issues/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_merge_request.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_title.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_state_widget.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/milestones/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/search/results/_merge_request.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/_issuable_filter.html.haml | 25 |
15 files changed, 47 insertions, 25 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index b8f367c6339..e658e141159 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -75,6 +75,10 @@ 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' items when 'opened' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bcd400b7e7b..89dcdf57798 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -330,7 +330,12 @@ module ApplicationHelper end def state_filters_text_for(entity, project) - entity_title = entity.to_s.humanize + titles = { + opened: "Open", + merged: "Accepted" + } + + entity_title = titles[entity] || entity.to_s.humanize count = if project.nil? diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index c57016dd6a2..5690c375b96 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -134,7 +134,7 @@ class MergeRequest < ActiveRecord::Base # Closed scope for merge request should return # both merged and closed mr's scope :closed, -> { with_states(:closed, :merged) } - scope :declined, -> { with_states(:closed) } + scope :rejected, -> { with_states(:closed) } def self.reference_prefix '!' diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index dfdf0d68c8f..0dd2edbb1bc 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -17,5 +17,5 @@ = link_to issues_dashboard_url(format: :atom, private_token: current_user.private_token), class: 'btn' do %i.fa.fa-rss - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :issues = render 'shared/issues' diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index a7e1b08a0a4..61d2fbe538c 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -7,5 +7,5 @@ List all merge requests from all projects you have access to. %hr .append-bottom-20 - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :merge_requests = render 'shared/merge_requests' diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 6a3da6adacf..e0756e909be 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -21,5 +21,5 @@ = link_to issues_group_url(@group, format: :atom, private_token: current_user.private_token), class: 'btn' do %i.fa.fa-rss - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :issues = render 'shared/issues' diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index 268f33d5761..3d9e857cc52 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -10,5 +10,5 @@ To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page. %hr .append-bottom-20 - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :merge_requests = render 'shared/merge_requests' diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index 709ea1f7897..a378b37f4a8 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -18,7 +18,7 @@ %i.fa.fa-plus New Issue - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :issues .issues-holder = render "issues" diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index 073476b0d27..65f5c3d6a19 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -9,11 +9,11 @@ - if merge_request.merged? %span %i.fa.fa-check - MERGED + ACCEPTED - elsif merge_request.closed? %span - %i.fa.fa-close - CLOSED + %i.fa.fa-ban + REJECTED - else %span.hidden-xs.hidden-sm %span.label-branch< diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index ab845a7e719..841d1e1cfe9 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -7,6 +7,6 @@ = link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new pull-left", title: "New Merge Request" do %i.fa.fa-plus New Merge Request - = render 'shared/issuable_filter' + = render 'shared/issuable_filter', type: :merge_requests .merge-requests-holder = render 'merge_requests' diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 46e92a9c558..0690fdb769f 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -1,9 +1,9 @@ %h4.page-title .issue-box{ class: issue_box_class(@merge_request) } - if @merge_request.merged? - Merged + Accepted - elsif @merge_request.closed? - Closed + Rejected - else Open = "Merge Request ##{@merge_request.iid}" diff --git a/app/views/projects/merge_requests/show/_state_widget.html.haml b/app/views/projects/merge_requests/show/_state_widget.html.haml index 44bd9347f51..e4c71bfc1be 100644 --- a/app/views/projects/merge_requests/show/_state_widget.html.haml +++ b/app/views/projects/merge_requests/show/_state_widget.html.haml @@ -11,7 +11,7 @@ - if @merge_request.closed? %h4 - Closed + Rejected - if @merge_request.closed_event by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)} #{time_ago_with_tooltip(@merge_request.closed_event.created_at)} @@ -19,7 +19,7 @@ - if @merge_request.merged? %h4 - Merged + Accepted - if @merge_request.merge_event by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)} #{time_ago_with_tooltip(@merge_request.merge_event.created_at)} diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 5845fd744f4..ee2139e75f6 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -86,10 +86,10 @@ .col-md-3 = render('merge_requests', title: 'Waiting for merge (open and assigned)', merge_requests: @merge_requests.opened.assigned, id: 'ongoing') .col-md-3 - = render('merge_requests', title: 'Declined (closed)', merge_requests: @merge_requests.declined, id: 'closed') + = render('merge_requests', title: 'Rejected (closed)', merge_requests: @merge_requests.rejected, id: 'closed') .col-md-3 .panel.panel-primary - .panel-heading Merged + .panel-heading Accepted %ul.well-list - @merge_requests.merged.each do |merge_request| = render 'merge_request', merge_request: merge_request diff --git a/app/views/search/results/_merge_request.html.haml b/app/views/search/results/_merge_request.html.haml index 2efa616d664..adfdd1c7506 100644 --- a/app/views/search/results/_merge_request.html.haml +++ b/app/views/search/results/_merge_request.html.haml @@ -11,6 +11,6 @@ #{merge_request.project.name_with_namespace} .pull-right - if merge_request.merged? - %span.label.label-primary Merged + %span.label.label-primary Accepted - elsif merge_request.closed? - %span.label.label-danger Closed + %span.label.label-danger Rejected diff --git a/app/views/shared/_issuable_filter.html.haml b/app/views/shared/_issuable_filter.html.haml index 4ab9421f013..a5187fa4ea7 100644 --- a/app/views/shared/_issuable_filter.html.haml +++ b/app/views/shared/_issuable_filter.html.haml @@ -3,15 +3,28 @@ %ul.nav.nav-tabs %li{class: ("active" if params[:state] == 'opened')} = link_to page_filter_path(state: 'opened') do - %i.fa.fa-exclamation-circle + = icon('exclamation-circle') #{state_filters_text_for(:opened, @project)} - %li{class: ("active" if params[:state] == 'closed')} - = link_to page_filter_path(state: 'closed') do - %i.fa.fa-check-circle - #{state_filters_text_for(:closed, @project)} + + - if defined?(type) && type == :merge_requests + %li{class: ("active" if params[:state] == 'merged')} + = link_to page_filter_path(state: 'merged') do + = icon('check-circle') + #{state_filters_text_for(:merged, @project)} + + %li{class: ("active" if params[:state] == 'rejected')} + = link_to page_filter_path(state: 'rejected') do + = icon('ban') + #{state_filters_text_for(:rejected, @project)} + - else + %li{class: ("active" if params[:state] == 'closed')} + = link_to page_filter_path(state: 'closed') do + = icon('check-circle') + #{state_filters_text_for(:closed, @project)} + %li{class: ("active" if params[:state] == 'all')} = link_to page_filter_path(state: 'all') do - %i.fa.fa-compass + = icon('compass') #{state_filters_text_for(:all, @project)} .issues-details-filters |