From 6fe59028c37847b2db5408459cc5e1d34fd1f25a Mon Sep 17 00:00:00 2001 From: Philipp Otto Date: Wed, 13 Nov 2019 11:29:39 +0100 Subject: [PATCH] Fix sorting in antd dataset table (#4318) * fix sorting in antd dataset table * update changelog --- CHANGELOG.md | 4 ++-- frontend/javascripts/components/fixed_expandable_table.js | 8 ++++++-- .../oxalis/view/action-bar/tracing_actions_view.js | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6486d2b28f..c99e8ad45df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). - ### Fixed -- +- Fixed broken sorting in the dataset table of the dashboard. [#4318](https://github.com/scalableminds/webknossos/pull/4318) ### Removed - @@ -30,7 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md). ### Fixed - Cleaned up error reporting wording in case of dataset access failures (e.g. due to not being logged in). [#4301](https://github.com/scalableminds/webknossos/pull/4301) -- Fixed handling of uint64 data layers in sql evolution. [4303](https://github.com/scalableminds/webknossos/pull/4303) +- Fixed handling of uint64 data layers in sql evolution. [#4303](https://github.com/scalableminds/webknossos/pull/4303) ## [19.10.0](https://github.com/scalableminds/webknossos/releases/tag/19.10.0) - 2019-09-30 diff --git a/frontend/javascripts/components/fixed_expandable_table.js b/frontend/javascripts/components/fixed_expandable_table.js index 3f1ebeba25f..934615c8d0e 100644 --- a/frontend/javascripts/components/fixed_expandable_table.js +++ b/frontend/javascripts/components/fixed_expandable_table.js @@ -3,7 +3,7 @@ import { Table } from "antd"; import * as React from "react"; type Props = { - children: React.Node, + children: Array>, expandedRowRender: Function, }; @@ -26,7 +26,11 @@ export default class FixedExpandableTable extends React.PureComponent { + + // Don't use React.Children.map here, since this adds .$ prefixes + // to the keys. However, the keys are needed when managing the sorters + // of the table. + const columnsWithAdjustedFixedProp = children.map(child => { const columnFixed = expandedColumns.length > 0 ? false : child.props.fixed; return React.cloneElement(child, { fixed: columnFixed }); }); diff --git a/frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.js b/frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.js index 6efabfb66e2..d3fbf6c31e6 100644 --- a/frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.js +++ b/frontend/javascripts/oxalis/view/action-bar/tracing_actions_view.js @@ -287,7 +287,7 @@ class TracingActionsView extends React.PureComponent { key="sandbox-tooltip" > ),