Open anisometropie opened 1 year ago
Rolling stocks Previously were sorted like this :
filteredRollingStockListNew = filteredRollingStockListNew.sort((a, b) => { if (a.reference && b.reference && a.reference !== b.reference) { return a.name.localeCompare(b.name) && a.reference.localeCompare(b.reference); } return a.name.localeCompare(b.name); });
the && operator probably doesn’t do what’s intended for this function.
&&
—> we can either sort by name or by metadata.reference, (or a one then the other?) but some elements are at the beginning (missing name or reference).
name
metadata.reference
(since https://github.com/DGEXSolutions/osrd/pull/3820, left sorted like the back is sending us.)
Rolling stocks correctly sorted.
This will be converted into a proper feature, but it needs a bit of refinement from users.
Description and goal
Rolling stocks Previously were sorted like this :
the
&&
operator probably doesn’t do what’s intended for this function.—> we can either sort by
name
or bymetadata.reference
, (or a one then the other?) but some elements are at the beginning (missing name or reference).(since https://github.com/DGEXSolutions/osrd/pull/3820, left sorted like the back is sending us.)
Acceptance criteria
Rolling stocks correctly sorted.