From 2f3de31ec3ad5f9c6f979f53f7e170bb6f83a3bf Mon Sep 17 00:00:00 2001 From: Rickard Cardell Date: Wed, 2 Jun 2021 18:48:39 +0200 Subject: [PATCH] feat(react): custom properties are now sortable by name in the UI (#2622) --- datahub-web-react/src/app/entity/shared/Properties.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/entity/shared/Properties.tsx b/datahub-web-react/src/app/entity/shared/Properties.tsx index 4d3b9f2392..a718b44f38 100644 --- a/datahub-web-react/src/app/entity/shared/Properties.tsx +++ b/datahub-web-react/src/app/entity/shared/Properties.tsx @@ -1,5 +1,6 @@ import { Space, Table, Typography } from 'antd'; import React from 'react'; +import { ColumnsType } from 'antd/es/table'; import { StringMapEntry } from '../../../types.generated'; export type Props = { @@ -7,10 +8,12 @@ export type Props = { }; export function Properties({ properties }: Props) { - const propertyTableColumns = [ + const propertyTableColumns: ColumnsType = [ { title: 'Name', dataIndex: 'key', + sorter: (a, b) => a.key.localeCompare(b.key), + defaultSortOrder: 'ascend', }, { title: 'Value',