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)
- 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)
- Consistently refer to MRs as either Accepted or Rejected.
- Add Accepted and Rejected tabs to MR lists.
v 7.11.2
- no changes
......
......@@ -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'
......
......@@ -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?
......
......@@ -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'
......@@ -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'
......@@ -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'
......@@ -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'
......@@ -18,7 +18,7 @@
%i.fa.fa-plus
New Issue
= render 'shared/issuable_filter'
= render 'shared/issuable_filter', type: :issues
.issues-holder
= render "issues"
......@@ -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'
......@@ -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
......
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