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
770a12bf
Commit
770a12bf
authored
Sep 21, 2020
by
Nicolò Maria Mezzopera
Committed by
Jose Ivan Vargas
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sort filter naming and structure
- constants - utils - components binding
parent
d0a4f311
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
26 deletions
+21
-26
app/assets/javascripts/packages/list/components/packages_sort.vue
...ts/javascripts/packages/list/components/packages_sort.vue
+1
-1
app/assets/javascripts/packages/list/constants.js
app/assets/javascripts/packages/list/constants.js
+8
-20
app/assets/javascripts/packages/list/utils.js
app/assets/javascripts/packages/list/utils.js
+2
-3
changelogs/unreleased/225175-change-the-default-order-for-packages-in-the-package-registry-list.yml
...fault-order-for-packages-in-the-package-registry-list.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/support/shared_examples/features/packages_shared_examples.rb
...port/shared_examples/features/packages_shared_examples.rb
+2
-2
No files found.
app/assets/javascripts/packages/list/components/packages_sort.vue
View file @
770a12bf
...
...
@@ -51,7 +51,7 @@ export default {
<gl-sorting-item
v-for=
"item in sortableFields"
ref=
"packageListSortItem"
:key=
"item.
ke
y"
:key=
"item.
orderB
y"
@
click=
"onSortItemClick(item.orderBy)"
>
{{
item
.
label
}}
...
...
app/assets/javascripts/packages/list/constants.js
View file @
770a12bf
...
...
@@ -15,7 +15,7 @@ export const GROUP_PAGE_TYPE = 'groups';
export
const
LIST_KEY_NAME
=
'
name
'
;
export
const
LIST_KEY_PROJECT
=
'
project_path
'
;
export
const
LIST_KEY_VERSION
=
'
version
'
;
export
const
LIST_KEY_PACKAGE_TYPE
=
'
package_
type
'
;
export
const
LIST_KEY_PACKAGE_TYPE
=
'
type
'
;
export
const
LIST_KEY_CREATED_AT
=
'
created_at
'
;
export
const
LIST_KEY_ACTIONS
=
'
actions
'
;
...
...
@@ -23,47 +23,35 @@ export const LIST_LABEL_NAME = __('Name');
export
const
LIST_LABEL_PROJECT
=
__
(
'
Project
'
);
export
const
LIST_LABEL_VERSION
=
__
(
'
Version
'
);
export
const
LIST_LABEL_PACKAGE_TYPE
=
__
(
'
Type
'
);
export
const
LIST_LABEL_CREATED_AT
=
__
(
'
Creat
ed
'
);
export
const
LIST_LABEL_CREATED_AT
=
__
(
'
Publish
ed
'
);
export
const
LIST_LABEL_ACTIONS
=
''
;
export
const
LIST_ORDER_BY_PACKAGE_TYPE
=
'
type
'
;
export
const
ASCENDING_ODER
=
'
asc
'
;
export
const
DESCENDING_ORDER
=
'
desc
'
;
// The following is not translated because it is used to build a JavaScript exception error message
export
const
MISSING_DELETE_PATH_ERROR
=
'
Missing delete_api_path link
'
;
export
const
TABLE_HEADER
_FIELDS
=
[
export
const
SORT
_FIELDS
=
[
{
key
:
LIST_KEY_NAME
,
label
:
LIST_LABEL_NAME
,
orderBy
:
LIST_KEY_NAME
,
class
:
[
'
text-left
'
]
,
label
:
LIST_LABEL_NAME
,
},
{
key
:
LIST_KEY_PROJECT
,
label
:
LIST_LABEL_PROJECT
,
orderBy
:
LIST_KEY_PROJECT
,
class
:
[
'
text-left
'
]
,
label
:
LIST_LABEL_PROJECT
,
},
{
key
:
LIST_KEY_VERSION
,
label
:
LIST_LABEL_VERSION
,
orderBy
:
LIST_KEY_VERSION
,
class
:
[
'
text-center
'
]
,
label
:
LIST_LABEL_VERSION
,
},
{
ke
y
:
LIST_KEY_PACKAGE_TYPE
,
orderB
y
:
LIST_KEY_PACKAGE_TYPE
,
label
:
LIST_LABEL_PACKAGE_TYPE
,
orderBy
:
LIST_ORDER_BY_PACKAGE_TYPE
,
class
:
[
'
text-center
'
],
},
{
key
:
LIST_KEY_CREATED_AT
,
label
:
LIST_LABEL_CREATED_AT
,
orderBy
:
LIST_KEY_CREATED_AT
,
class
:
[
'
text-center
'
]
,
label
:
LIST_LABEL_CREATED_AT
,
},
];
...
...
app/assets/javascripts/packages/list/utils.js
View file @
770a12bf
import
{
LIST_KEY_PROJECT
,
TABLE_HEADER
_FIELDS
}
from
'
./constants
'
;
import
{
LIST_KEY_PROJECT
,
SORT
_FIELDS
}
from
'
./constants
'
;
export
default
isGroupPage
=>
TABLE_HEADER_FIELDS
.
filter
(
f
=>
f
.
key
!==
LIST_KEY_PROJECT
||
isGroupPage
);
export
default
isGroupPage
=>
SORT_FIELDS
.
filter
(
f
=>
f
.
key
!==
LIST_KEY_PROJECT
||
isGroupPage
);
/**
* A small util function that works out if the delete action has deleted the
...
...
changelogs/unreleased/225175-change-the-default-order-for-packages-in-the-package-registry-list.yml
0 → 100644
View file @
770a12bf
---
title
:
Rename Created to Published in package sort dropdown
merge_request
:
42677
author
:
type
:
changed
locale/gitlab.pot
View file @
770a12bf
...
...
@@ -20682,6 +20682,9 @@ msgstr ""
msgid "Publish to status page"
msgstr ""
msgid "Published"
msgstr ""
msgid "Published on status page"
msgstr ""
...
...
spec/support/shared_examples/features/packages_shared_examples.rb
View file @
770a12bf
...
...
@@ -84,11 +84,11 @@ RSpec.shared_examples 'shared package sorting' do
let
(
:packages
)
{
[
package_two
,
package_one
]
}
end
it_behaves_like
'correctly sorted packages list'
,
'
Creat
ed'
do
it_behaves_like
'correctly sorted packages list'
,
'
Publish
ed'
do
let
(
:packages
)
{
[
package_two
,
package_one
]
}
end
it_behaves_like
'correctly sorted packages list'
,
'
Creat
ed'
,
ascending:
true
do
it_behaves_like
'correctly sorted packages list'
,
'
Publish
ed'
,
ascending:
true
do
let
(
:packages
)
{
[
package_one
,
package_two
]
}
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