Skip to content

Resolve "Element ordering is wrong after the 9th element"

What is in this MR

This MR solves the issue of us treating order as a string and therefore we were incorrectly establishing order beyond 10 elements since a gt/lt comparison doesn't work anymore like a numeric one once you go into double digits.

The proposed solution here is to cast the order values to BigNumber wherever they are compared.

This approach is taken from the database module which deals with the same problem.

There would have been an alternative scenario where we could have casted order to BigNumber when the data is received and undo said action when data is sent to the backend, but for the sake of consistency (and I also personally prefer the other solution) I stuck with the solution used by the database team.

How to test this MR

  • Create a new page
  • Start adding elements to it
    • At least 10
  • Make sure they are all added in the appropriate place
  • Make sure to check all the edge cases
    • Adding an element at the start
    • Adding an element at the beginning
    • Adding an element before/after another element

Merge Request Checklist

  • changelog.md has been updated if required.
  • New/updated Premium/Enterprise features are separated correctly in the premium or enterprise folder
  • The latest Chrome and Firefox have been used to test any new frontend features
  • Documentation has been updated
  • Quality Standards are met
  • Performance: tables are still fast with 100k+ rows, 100+ field tables
  • The redoc API pages have been updated for any REST API changes
  • Our custom API docs are updated for changes to endpoints accessed via api tokens
  • The UI/UX has been updated following UI Style Guide

Closes #1876 (closed)

Edited by Alexander Haller

Merge request reports