Commit d25026a5 authored by Douwe Maan's avatar Douwe Maan

Add Accepted and Rejected tabs to MR lists.

parent ebe9c890
...@@ -8,6 +8,7 @@ v 7.12.0 (unreleased) ...@@ -8,6 +8,7 @@ v 7.12.0 (unreleased)
- Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka) - Fix resolving of relative links to repository files in AsciiDoc documents. (Jakub Jirutka)
- Use the user list from the target project in a merge request (Stan Hu) - Use the user list from the target project in a merge request (Stan Hu)
- Consistently refer to MRs as either Accepted or Rejected. - Consistently refer to MRs as either Accepted or Rejected.
- Add Accepted and Rejected tabs to MR lists.
v 7.11.2 v 7.11.2
- no changes - no changes
......
...@@ -75,6 +75,10 @@ class IssuableFinder ...@@ -75,6 +75,10 @@ class IssuableFinder
case params[:state] case params[:state]
when 'closed' when 'closed'
items.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' when 'all'
items items
when 'opened' when 'opened'
......
...@@ -330,7 +330,12 @@ module ApplicationHelper ...@@ -330,7 +330,12 @@ module ApplicationHelper
end end
def state_filters_text_for(entity, project) 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 = count =
if project.nil? if project.nil?
......
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
= link_to issues_dashboard_url(format: :atom, private_token: current_user.private_token), class: 'btn' do = link_to issues_dashboard_url(format: :atom, private_token: current_user.private_token), class: 'btn' do
%i.fa.fa-rss %i.fa.fa-rss
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :issues
= render 'shared/issues' = render 'shared/issues'
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
List all merge requests from all projects you have access to. List all merge requests from all projects you have access to.
%hr %hr
.append-bottom-20 .append-bottom-20
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :merge_requests
= render 'shared/merge_requests' = render 'shared/merge_requests'
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
= link_to issues_group_url(@group, format: :atom, private_token: current_user.private_token), class: 'btn' do = link_to issues_group_url(@group, format: :atom, private_token: current_user.private_token), class: 'btn' do
%i.fa.fa-rss %i.fa.fa-rss
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :issues
= render 'shared/issues' = render 'shared/issues'
...@@ -10,5 +10,5 @@ ...@@ -10,5 +10,5 @@
To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page. To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page.
%hr %hr
.append-bottom-20 .append-bottom-20
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :merge_requests
= render 'shared/merge_requests' = render 'shared/merge_requests'
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
%i.fa.fa-plus %i.fa.fa-plus
New Issue New Issue
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :issues
.issues-holder .issues-holder
= render "issues" = render "issues"
...@@ -7,6 +7,6 @@ ...@@ -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 = 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 %i.fa.fa-plus
New Merge Request New Merge Request
= render 'shared/issuable_filter' = render 'shared/issuable_filter', type: :merge_requests
.merge-requests-holder .merge-requests-holder
= render 'merge_requests' = render 'merge_requests'
...@@ -3,15 +3,28 @@ ...@@ -3,15 +3,28 @@
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li{class: ("active" if params[:state] == 'opened')} %li{class: ("active" if params[:state] == 'opened')}
= link_to page_filter_path(state: 'opened') do = link_to page_filter_path(state: 'opened') do
%i.fa.fa-exclamation-circle = icon('exclamation-circle')
#{state_filters_text_for(:opened, @project)} #{state_filters_text_for(:opened, @project)}
%li{class: ("active" if params[:state] == 'closed')}
= link_to page_filter_path(state: 'closed') do - if defined?(type) && type == :merge_requests
%i.fa.fa-check-circle %li{class: ("active" if params[:state] == 'merged')}
#{state_filters_text_for(:closed, @project)} = 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')} %li{class: ("active" if params[:state] == 'all')}
= link_to page_filter_path(state: 'all') do = link_to page_filter_path(state: 'all') do
%i.fa.fa-compass = icon('compass')
#{state_filters_text_for(:all, @project)} #{state_filters_text_for(:all, @project)}
.issues-details-filters .issues-details-filters
......
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