Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Use natural sorting across the UI #1796

Closed
1 task done
rszwajko opened this issue Mar 25, 2024 · 1 comment · Fixed by #1918
Closed
1 task done

[BUG] Use natural sorting across the UI #1796

rszwajko opened this issue Mar 25, 2024 · 1 comment · Fixed by #1918
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/normal Higher priority than priority/minor. Nice to have. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@rszwajko
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

0.3

Priority

Minor

Current Behavior

Currently we use in the UI:

  1. server side sorting - backed by SQL order by clause, algorithm depends from DB config
  2. client side sorting - mostly default JS sort routine
  3. no sorting - i.e. see [BUG] Selected filters seem to dissappear when not present in opened multi select filter #1774

Expected Behavior

Natural sort is used consistently across the UI.
This includes:

  1. tables
  2. dropdowns
  3. lists of items

How Reproducible

Always (Default)

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

@rszwajko rszwajko added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 25, 2024
@konveyor-ci-bot
Copy link

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members.

@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Mar 25, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Mar 25, 2024
@rszwajko rszwajko self-assigned this May 20, 2024
@sjd78 sjd78 added this to the v0.5.0 milestone May 22, 2024
@sjd78 sjd78 moved this from 🆕 New to 🏗 In progress in Planning May 22, 2024
@sjd78 sjd78 added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/normal Higher priority than priority/minor. Nice to have. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. labels May 22, 2024
sjd78 pushed a commit that referenced this issue May 23, 2024
Replace default alphabetical sort order (i.e. a, a11, a2)               
with human friendly "natural" sort (i.e. a, a2, a11).                   
The change applies to all found cases of string sorting.                
For convenience the comparator converts all values to strings (with     
nullish values being converted to empty string).                         
                                                                        
In addition, the natural sort with string conversion (universal
comparator) was used as a replacement in sorting hooks. There a general 
sorting algorithm was implemented with type-specific comparators.     
Benefits of universal comparator:                                       
1. better handling of mixed types (i.e. string and number). String value
   most likely gets converted to NaN.                                   
2. better handling of undefined (numeric value NaN)                     
2. simplified coercion logic compared to less than/greater then         
   operators 

Note that one functional change was introduced in the sorting hook:
space removal logic was dropped as it creates visually confusing results
for stable sorting.

Resolves: #1796 

Reference-Url:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than

---------

Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Planning May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/normal Higher priority than priority/minor. Nice to have. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants