Change to use the same way of sorting as the custom sorting

Signed-off-by: albertojuanL <alberto.juan@lansweeper.com>
This commit is contained in:
albertojuanL
2023-02-06 20:01:37 +01:00
parent 9d4a9598f4
commit f99f81b25b
@@ -65,21 +65,12 @@ const YellowStar = withStyles({
const refCompare = (a: Entity, b: Entity) => {
const toRef = (entity: Entity) =>
entity.metadata.title?.toLocaleLowerCase('en-US') ||
entity.metadata.title ||
humanizeEntityRef(entity, {
defaultKind: 'Component',
}).toLocaleLowerCase('en-US');
});
const aRef = toRef(a);
const bRef = toRef(b);
if (aRef < bRef) {
return -1;
}
if (aRef > bRef) {
return 1;
}
return 0;
return toRef(a).localeCompare(toRef(b));
};
/** @public */