From 79927bfa95f0c83e519b883796e89ad6baca1584 Mon Sep 17 00:00:00 2001 From: Kirill Lakhov Date: Thu, 27 Jun 2024 10:45:16 +0300 Subject: [PATCH] Fixed ordering of `frame intersection` column on Quality page (#8089) ### Motivation and context Resolved #8022 Before: ![ordering-before](https://github.com/cvat-ai/cvat/assets/50956430/08c5c48b-e3a5-40f9-ac3e-eb6c3a4fd11d) After: ![ordering-updated](https://github.com/cvat-ai/cvat/assets/50956430/998513cf-aa0c-4bf1-b04b-032047d85c21) ### How has this been tested? ### Checklist - [x] I submit my changes into the `develop` branch - [x] I have created a changelog fragment - ~~[ ] I have updated the documentation accordingly~~ - ~~[ ] I have added tests to cover my changes~~ - [x] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) - [x] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. ## Summary by CodeRabbit - **Bug Fixes** - Corrected the ordering of the `frame intersection` column on the task quality page. - **New Features** - Enhanced filtering in job lists to accept additional types, improving flexibility. - **Chores** - Updated `cvat-ui` package version from 1.63.11 to 1.63.12. --- ...0626_104311_klakhov_fix_frame_intersection_ordering.md | 4 ++++ cvat-ui/package.json | 2 +- .../components/analytics-page/task-quality/job-list.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 changelog.d/20240626_104311_klakhov_fix_frame_intersection_ordering.md diff --git a/changelog.d/20240626_104311_klakhov_fix_frame_intersection_ordering.md b/changelog.d/20240626_104311_klakhov_fix_frame_intersection_ordering.md new file mode 100644 index 000000000000..183348a155db --- /dev/null +++ b/changelog.d/20240626_104311_klakhov_fix_frame_intersection_ordering.md @@ -0,0 +1,4 @@ +### Fixed + +- Ordering of `frame intersection` column on task quality page + () diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 95e3002352e4..1a12cb291427 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.63.11", + "version": "1.63.12", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/analytics-page/task-quality/job-list.tsx b/cvat-ui/src/components/analytics-page/task-quality/job-list.tsx index 538b0bbd0d31..3e3dbc04cbfd 100644 --- a/cvat-ui/src/components/analytics-page/task-quality/job-list.tsx +++ b/cvat-ui/src/components/analytics-page/task-quality/job-list.tsx @@ -6,7 +6,7 @@ import React, { useState } from 'react'; import { useHistory } from 'react-router'; import { Row, Col } from 'antd/lib/grid'; import { DownloadOutlined, QuestionCircleOutlined } from '@ant-design/icons'; -import { ColumnFilterItem } from 'antd/lib/table/interface'; +import { ColumnFilterItem, Key } from 'antd/lib/table/interface'; import Table from 'antd/lib/table'; import Button from 'antd/lib/button'; import Text from 'antd/lib/typography/Text'; @@ -120,7 +120,7 @@ function JobListComponent(props: Props): JSX.Element { { text: 'validation', value: 'validation' }, { text: 'acceptance', value: 'acceptance' }, ], - onFilter: (value: string | number | boolean, record: any) => record.stage.stage === value, + onFilter: (value: boolean | Key, record: any) => record.stage.stage === value, }, { title: 'Assignee', @@ -132,7 +132,7 @@ function JobListComponent(props: Props): JSX.Element { ), sorter: sorter('assignee.assignee.username'), filters: collectUsers('assignee'), - onFilter: (value: string | number | boolean, record: any) => ( + onFilter: (value: boolean | Key, record: any) => ( record.assignee.assignee?.username || false ) === value, }, @@ -141,7 +141,7 @@ function JobListComponent(props: Props): JSX.Element { dataIndex: 'frame_intersection', key: 'frame_intersection', className: 'cvat-job-item-frame-intersection', - sorter: sorter('frame_intersection'), + sorter: sorter('frame_intersection.summary.frameCount'), render: (report?: QualityReport): JSX.Element => { const frames = report?.summary.frameCount; const frameSharePercent = report?.summary?.frameSharePercent;