Add support for multiple default sort orders in dependency list page
Problem to solve
In order to fix the bug described in Default dependency list sort order icon is incorrect, a change was made to set the default sort order to descending
in the dependency list page. As a result of this change, the sort order for the Severity
drop down is correct, however, the sort order for the Component Name
and Packager
drop down menus are now ordered in descending alphabetical order, which is the opposite of the normal sorting order that a user would expect (ascending alphabetical order, from a-z
)
Proposal
When the user changes the sort field, the sort direction is changed to that field's default sort order (per the below table).
More information:
It's not possible to have a single sort order that makes sense for all three different drop down menus, so we need to add some logic to the frontend code to allow the following sort orders on the dependency list page:
Field | Default Sort Order |
---|---|
Component Name | asc |
Packager | asc |
Severity | desc |
See this discussion for more details
We need to change the hardcoded SORT_ORDER.descending
value to allow it to change depending on the field type.
Related issues
User experience goal
The default sort order for the Component Name
and Packager
drop down menus should be asc
while the default sort order for the Severity
drop down menu should be desc
What is the type of buyer?
GitLab Ultimate Enterprise Edition
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation Plan
- Create a map of default sort orders
- Modify the sortBy value when the field is changed
- Consider updating the component to use https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-sorting--default in a follow up issue