From f99f81b25be391e3e1a9d18dfaef92b7e523c81a Mon Sep 17 00:00:00 2001 From: albertojuanL Date: Mon, 6 Feb 2023 20:01:37 +0100 Subject: [PATCH] Change to use the same way of sorting as the custom sorting Signed-off-by: albertojuanL --- .../src/components/CatalogTable/CatalogTable.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx index f8617ba4b2..18080bb7b0 100644 --- a/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx +++ b/plugins/catalog/src/components/CatalogTable/CatalogTable.tsx @@ -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 */