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
13d3e75a
Commit
13d3e75a
authored
Oct 04, 2019
by
Nick Kipling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes wrong title for type and updated tests
parent
91294fbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
7 deletions
+21
-7
ee/app/controllers/groups/packages_controller.rb
ee/app/controllers/groups/packages_controller.rb
+1
-1
ee/app/helpers/ee/sorting_helper.rb
ee/app/helpers/ee/sorting_helper.rb
+1
-1
ee/app/views/groups/packages/index.html.haml
ee/app/views/groups/packages/index.html.haml
+2
-2
ee/spec/features/groups/packages_spec.rb
ee/spec/features/groups/packages_spec.rb
+17
-3
No files found.
ee/app/controllers/groups/packages_controller.rb
View file @
13d3e75a
...
...
@@ -9,7 +9,7 @@ module Groups
def
index
@packages
=
::
Packages
::
GroupPackagesFinder
.
new
(
current_user
,
group
)
.
execute
.
sort_by_attribute
(
@sort
=
params
[
:sort
]
||
'created_desc'
)
.
sort_by_attribute
(
@sort
=
params
[
:sort
]
||
sort_value_recently_created
)
.
page
(
params
[
:page
])
end
...
...
ee/app/helpers/ee/sorting_helper.rb
View file @
13d3e75a
...
...
@@ -72,7 +72,7 @@ module EE
sort_value_name_desc
=>
sort_title_name
,
sort_value_version_desc
=>
sort_title_version
,
sort_value_version_asc
=>
sort_title_version
,
sort_value_type_desc
=>
sort_
value_type_desc
,
sort_value_type_desc
=>
sort_
title_type
,
sort_value_type_asc
=>
sort_title_type
,
sort_value_project_name_desc
=>
sort_title_project_name
,
sort_value_project_name_asc
=>
sort_title_project_name
...
...
ee/app/views/groups/packages/index.html.haml
View file @
13d3e75a
...
...
@@ -7,7 +7,7 @@
.dropdown.inline.prepend-top-default.append-bottom-default.package-sort-dropdown
.btn-group
{
role:
'group'
}
.btn-group
{
role:
'group'
}
%button
.dropdown-menu-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
display:
'static'
},
class:
'btn btn-default'
}
%button
.dropdown-menu-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
display:
'static'
,
'qa-selector'
:
'sort-dropdown-button'
},
class:
'btn btn-default'
}
=
sort_title
=
icon
(
'chevron-down'
)
%ul
.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort
...
...
@@ -32,7 +32,7 @@
.table-section.section-20
{
role:
'rowheader'
}
=
_
(
'Created'
)
-
@packages
.
each
do
|
package
|
.gl-responsive-table-row
.package-row
.gl-responsive-table-row
{
data:
{
'qa-selector'
:
'package-row'
}
}
.table-section.section-30
.table-mobile-header
{
role:
"rowheader"
}=
_
(
"Name"
)
.table-mobile-content.flex-truncate-parent
...
...
ee/spec/features/groups/packages_spec.rb
View file @
13d3e75a
...
...
@@ -78,49 +78,57 @@ describe 'Group Packages' do
end
it
'sorts by created date descending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_created_date
)
visit
group_packages_path
(
group
,
sort:
sort_value_recently_created
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_created_date
)
expect
(
first_package
).
to
include
(
bbb_package
.
name
)
expect
(
last_package
).
to
include
(
aaa_package
.
name
)
end
it
'sorts by created date ascending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_oldest_created
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_created_date
)
expect
(
first_package
).
to
include
(
aaa_package
.
name
)
expect
(
last_package
).
to
include
(
bbb_package
.
name
)
end
it
'sorts by name descending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_name_desc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_name
)
expect
(
first_package
).
to
include
(
bbb_package
.
name
)
expect
(
last_package
).
to
include
(
aaa_package
.
name
)
end
it
'sorts by name ascending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_name
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_name
)
expect
(
first_package
).
to
include
(
aaa_package
.
name
)
expect
(
last_package
).
to
include
(
bbb_package
.
name
)
end
it
'sorts by version descending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_version_desc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_version
)
expect
(
first_package
).
to
include
(
bbb_package
.
name
)
expect
(
last_package
).
to
include
(
aaa_package
.
name
)
end
it
'sorts by version ascending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_version_asc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_version
)
expect
(
first_package
).
to
include
(
aaa_package
.
name
)
expect
(
last_package
).
to
include
(
bbb_package
.
name
)
end
it
'sorts by project descending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_project_name_desc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_project_name
)
expect
(
first_package
).
to
include
(
bbb_package
.
name
)
expect
(
last_package
).
to
include
(
aaa_package
.
name
)
end
it
'sorts by project ascending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_project_name_asc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_project_name
)
expect
(
first_package
).
to
include
(
aaa_package
.
name
)
expect
(
last_package
).
to
include
(
bbb_package
.
name
)
end
...
...
@@ -132,12 +140,14 @@ describe 'Group Packages' do
it
'sorts by type descending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_type_desc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_type
)
expect
(
first_package
).
to
include
(
npm_package
.
name
)
expect
(
last_package
).
to
include
(
maven_package
.
name
)
end
it
'sorts by type ascending'
do
visit
group_packages_path
(
group
,
sort:
sort_value_type_asc
)
expect
(
sort_dropdown_button_text
).
to
eq
(
sort_title_type
)
expect
(
first_package
).
to
include
(
maven_package
.
name
)
expect
(
last_package
).
to
include
(
npm_package
.
name
)
end
...
...
@@ -148,10 +158,14 @@ describe 'Group Packages' do
end
def
first_package
page
.
all
(
'
.table-holder .package-row
'
).
first
.
text
page
.
all
(
'
[data-qa-selector="package-row"]
'
).
first
.
text
end
def
last_package
page
.
all
(
'.table-holder .package-row'
).
last
.
text
page
.
all
(
'[data-qa-selector="package-row"]'
).
last
.
text
end
def
sort_dropdown_button_text
page
.
find
(
'[data-qa-selector="sort-dropdown-button"]'
).
text
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