feat(react): custom properties are now sortable by name in the UI (#2622)

This commit is contained in:
Rickard Cardell 2021-06-02 18:48:39 +02:00 committed by GitHub
parent b512920022
commit 2f3de31ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<StringMapEntry> = [
{
title: 'Name',
dataIndex: 'key',
sorter: (a, b) => a.key.localeCompare(b.key),
defaultSortOrder: 'ascend',
},
{
title: 'Value',