Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
03843402
Commit
03843402
authored
Dec 16, 2020
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates based on maintainer review
Removed MemberSortOptionsHelper class.
parent
652f71f7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
116 additions
and
110 deletions
+116
-110
app/helpers/member_sort_options_helper.rb
app/helpers/member_sort_options_helper.rb
+0
-18
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+13
-1
app/helpers/sorting_titles_values_helper.rb
app/helpers/sorting_titles_values_helper.rb
+2
-0
ee/app/helpers/ee/sorting_helper.rb
ee/app/helpers/ee/sorting_helper.rb
+0
-88
ee/app/helpers/ee/sorting_titles_values_helper.rb
ee/app/helpers/ee/sorting_titles_values_helper.rb
+92
-0
ee/lib/ee/api/helpers/members_helpers.rb
ee/lib/ee/api/helpers/members_helpers.rb
+1
-3
ee/spec/lib/ee/api/helpers/members_helpers_spec.rb
ee/spec/lib/ee/api/helpers/members_helpers_spec.rb
+8
-0
No files found.
app/helpers/member_sort_options_helper.rb
deleted
100644 → 0
View file @
652f71f7
# frozen_string_literal: true
module
MemberSortOptionsHelper
include
SortingTitlesValuesHelper
def
member_sort_options_hash
{
sort_value_access_level_asc
=>
sort_title_access_level_asc
,
sort_value_access_level_desc
=>
sort_title_access_level_desc
,
sort_value_last_joined
=>
sort_title_last_joined
,
sort_value_name
=>
sort_title_name_asc
,
sort_value_name_desc
=>
sort_title_name_desc
,
sort_value_oldest_joined
=>
sort_title_oldest_joined
,
sort_value_oldest_signin
=>
sort_title_oldest_signin
,
sort_value_recently_signin
=>
sort_title_recently_signin
}
end
end
app/helpers/sorting_helper.rb
View file @
03843402
...
...
@@ -2,7 +2,6 @@
module
SortingHelper
include
SortingTitlesValuesHelper
include
MemberSortOptionsHelper
def
sort_options_hash
{
...
...
@@ -177,6 +176,19 @@ module SortingHelper
}
end
def
member_sort_options_hash
{
sort_value_access_level_asc
=>
sort_title_access_level_asc
,
sort_value_access_level_desc
=>
sort_title_access_level_desc
,
sort_value_last_joined
=>
sort_title_last_joined
,
sort_value_name
=>
sort_title_name_asc
,
sort_value_name_desc
=>
sort_title_name_desc
,
sort_value_oldest_joined
=>
sort_title_oldest_joined
,
sort_value_oldest_signin
=>
sort_title_oldest_signin
,
sort_value_recently_signin
=>
sort_title_recently_signin
}
end
def
sortable_item
(
item
,
path
,
sorted_by
)
link_to
item
,
path
,
class:
sorted_by
==
item
?
'is-active'
:
''
end
...
...
app/helpers/sorting_titles_values_helper.rb
View file @
03843402
...
...
@@ -335,3 +335,5 @@ module SortingTitlesValuesHelper
'relevant'
end
end
SortingHelper
.
include_if_ee
(
'::EE::SortingTitlesValuesHelper'
)
ee/app/helpers/ee/sorting_helper.rb
View file @
03843402
...
...
@@ -75,93 +75,5 @@ module EE
class:
"btn btn-default has-tooltip qa-reverse-sort btn-sort-direction"
,
title:
_
(
"Sort direction"
)
end
def
sort_title_start_date
s_
(
'SortOptions|Start date'
)
end
def
sort_title_end_date
s_
(
'SortOptions|Due date'
)
end
def
sort_title_less_weight
s_
(
'SortOptions|Less weight'
)
end
def
sort_title_more_weight
s_
(
'SortOptions|More weight'
)
end
def
sort_title_weight
s_
(
'SortOptions|Weight'
)
end
def
sort_title_blocking
s_
(
'SortOptions|Blocking'
)
end
def
sort_title_project_name
s_
(
'SortOptions|Project'
)
end
def
sort_title_version
s_
(
'SortOptions|Version'
)
end
def
sort_title_type
s_
(
'SortOptions|Type'
)
end
def
sort_value_start_date
'start_date_asc'
end
def
sort_value_end_date
'end_date_asc'
end
def
sort_value_end_date_later
'end_date_desc'
end
def
sort_value_less_weight
'weight_asc'
end
def
sort_value_more_weight
'weight_desc'
end
def
sort_value_weight
'weight'
end
def
sort_value_blocking_desc
'blocking_issues_desc'
end
def
sort_value_project_name_asc
'project_name_asc'
end
def
sort_value_project_name_desc
'project_name_desc'
end
def
sort_value_version_asc
'version_asc'
end
def
sort_value_version_desc
'version_desc'
end
def
sort_value_type_asc
'type_asc'
end
def
sort_value_type_desc
'type_desc'
end
end
end
ee/app/helpers/ee/sorting_titles_values_helper.rb
0 → 100644
View file @
03843402
# frozen_string_literal: true
module
EE
module
SortingTitlesValuesHelper
def
sort_title_start_date
s_
(
'SortOptions|Start date'
)
end
def
sort_title_end_date
s_
(
'SortOptions|Due date'
)
end
def
sort_title_less_weight
s_
(
'SortOptions|Less weight'
)
end
def
sort_title_more_weight
s_
(
'SortOptions|More weight'
)
end
def
sort_title_weight
s_
(
'SortOptions|Weight'
)
end
def
sort_title_blocking
s_
(
'SortOptions|Blocking'
)
end
def
sort_title_project_name
s_
(
'SortOptions|Project'
)
end
def
sort_title_version
s_
(
'SortOptions|Version'
)
end
def
sort_title_type
s_
(
'SortOptions|Type'
)
end
def
sort_value_start_date
'start_date_asc'
end
def
sort_value_end_date
'end_date_asc'
end
def
sort_value_end_date_later
'end_date_desc'
end
def
sort_value_less_weight
'weight_asc'
end
def
sort_value_more_weight
'weight_desc'
end
def
sort_value_weight
'weight'
end
def
sort_value_blocking_desc
'blocking_issues_desc'
end
def
sort_value_project_name_asc
'project_name_asc'
end
def
sort_value_project_name_desc
'project_name_desc'
end
def
sort_value_version_asc
'version_asc'
end
def
sort_value_version_desc
'version_desc'
end
def
sort_value_type_asc
'type_asc'
end
def
sort_value_type_desc
'type_desc'
end
end
end
ee/lib/ee/api/helpers/members_helpers.rb
View file @
03843402
...
...
@@ -8,10 +8,8 @@ module EE
extend
::
Gitlab
::
Utils
::
Override
class
<<
self
include
::
MemberSortOptionsHelper
def
member_sort_options
member_sort_options_hash
.
keys
%w(access_level_asc access_level_desc last_joined name_asc name_desc oldest_joined oldest_sign_in recent_sign_in)
end
end
...
...
ee/spec/lib/ee/api/helpers/members_helpers_spec.rb
View file @
03843402
...
...
@@ -2,6 +2,8 @@
require
'spec_helper'
RSpec
.
describe
EE
::
API
::
Helpers
::
MembersHelpers
do
include
SortingHelper
let
(
:members_helpers
)
{
Class
.
new
.
include
(
described_class
).
new
}
before
do
...
...
@@ -33,4 +35,10 @@ RSpec.describe EE::API::Helpers::MembersHelpers do
let
(
:member
)
{
create
(
:project_member
,
project:
source
,
user:
create
(
:user
))
}
end
end
describe
'.member_sort_options'
do
it
'lists all keys available in group member view'
do
expect
(
described_class
.
member_sort_options
).
to
match_array
(
member_sort_options_hash
.
keys
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment