balena-io-modules / rendition

A library of React UI components
https://balena-io-modules.github.io/rendition
Apache License 2.0
213 stars 27 forks source link

Sorting a "tag column" isn't fully ordered #1734

Open JesseAChristensen opened 5 months ago

JesseAChristensen commented 5 months ago

Describe the bug Adding a tag column and sorting the device list by that column results in partial (or segmented) ordering.

To Reproduce Steps to reproduce the behavior:

  1. Go to a fleet that has a common tag that can be logically ordered.
  2. Click on the columns settings and select "Add Tag Column"
  3. On the created "Tag" column, click "Choose Tag" and select the common tag (that can be logically ordered)
  4. On the created column, click the sort button to sort the device list
  5. Observe the list of devices isn't ordered by the created column

Expected behavior Sorting a device list by an individual tag column should result in the device list ordered by the value in the tag column. Regardless of a mismatch in the number of tags between devices, and regardless of the keys:values of tags not being sorted-by.

Screenshots In this screenshot the redacted information is identical for all devices. Screenshot-3

Specifications (please complete the following information):

Additional context The sorting problem sometimes occurs even when all other tag key/value pairs are equal between the sorted devices. Having a different number of key/value pairs seems to break the ordering consistently.