From 95a444a84ced379f1d2ccc2f55a12e8baa3d4e85 Mon Sep 17 00:00:00 2001 From: Amanda Ng <10681923+ngamanda@users.noreply.github.com> Date: Thu, 28 Mar 2024 01:27:18 +0800 Subject: [PATCH] feat(ui): sort partition keys to the top of the table for better visibility (#9959) --- .../app/entity/shared/tabs/Dataset/Schema/SchemaTab.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/SchemaTab.tsx b/datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/SchemaTab.tsx index e869b227fd5149..f9d7c8db025690 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/SchemaTab.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Dataset/Schema/SchemaTab.tsx @@ -148,8 +148,15 @@ export const SchemaTab = ({ properties }: { properties?: any }) => { } }, [hasValueSchema, hasKeySchema, setShowKeySchema]); + const sortedFields = schemaMetadata?.fields?.slice().sort((a, b) => { + if (a.isPartitioningKey === b.isPartitioningKey) { + return 0; + } + return a.isPartitioningKey ? -1 : 1; + }); + const { filteredRows, expandedRowsFromFilter } = filterSchemaRows( - schemaMetadata?.fields, + sortedFields, editableSchemaMetadata, filterText, entityRegistry,