Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade React and Antd till the latest version #7466

Merged
merged 77 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
3350a94
Upgrade react from 16 to 18
bsekachev Feb 9, 2024
f3506d6
Updated types
bsekachev Feb 9, 2024
7bde2c4
Upgraded antd
bsekachev Feb 9, 2024
0a6ada1
Many fixes
bsekachev Feb 9, 2024
c6ea227
Normalized styles
bsekachev Feb 9, 2024
d829ffb
Fixed styles
bsekachev Feb 9, 2024
0fe1c51
Enhanced actions
bsekachev Feb 9, 2024
86e7d99
Adjusted styles
bsekachev Feb 9, 2024
5330c8b
Merged develop
bsekachev Feb 9, 2024
0c241da
Setup menu
bsekachev Feb 9, 2024
ac3d77e
Fixed styles
bsekachev Feb 9, 2024
5f49a7c
Refactoring
bsekachev Feb 9, 2024
43e0897
Refactored tab panes
bsekachev Feb 9, 2024
876f893
Merge branch 'develop' into bs/upgrade_react
bsekachev Feb 13, 2024
ffac39e
Reduce repetitive code in cvat/apps/events/handlers.py (#7430)
SpecLad Feb 13, 2024
1740ac4
Add failure_ttl when enqueueing task creation job (#7475)
Marishka17 Feb 13, 2024
33ecea2
Defer most signal handling code until after the end of the current tr…
SpecLad Feb 13, 2024
0782dac
Run actions documentation added (#7448)
mdacoca Feb 13, 2024
8f99200
Refactoring
bsekachev Feb 13, 2024
209876d
Refactored components
bsekachev Feb 13, 2024
7ad4395
Couple of minor style fixes
bsekachev Feb 13, 2024
7aaa3ed
Merge branch 'develop' into bs/upgrade_react
bsekachev Feb 13, 2024
31f4584
Updated urls
bsekachev Feb 13, 2024
264142f
aborted change
bsekachev Feb 13, 2024
49609f5
Aborted files
bsekachev Feb 16, 2024
85380fb
Merge branch 'develop' into bs/upgrade_react
bsekachev Feb 16, 2024
aeca07b
Merged develop
bsekachev Feb 16, 2024
5696d31
Fixed one test
bsekachev Feb 16, 2024
a258342
Merge branch 'develop' into bs/upgrade_react
bsekachev Feb 22, 2024
f9e75be
Refactored annotation menu
bsekachev Feb 22, 2024
5249a37
Refactored many dropdowns
bsekachev Feb 22, 2024
d2a84dd
Fixed opencv loading
bsekachev Feb 22, 2024
1931d7a
Stylelint
bsekachev Feb 22, 2024
080b84f
Fixed vulnerability
bsekachev Feb 22, 2024
438d4c0
Aborted
bsekachev Feb 22, 2024
2f90f6f
Merged develop
bsekachev May 9, 2024
717c600
Removed one more conflcit
bsekachev May 9, 2024
b0526b7
updated minor antd version
bsekachev May 9, 2024
085ebea
Fixed brush tools test
bsekachev May 9, 2024
92d7329
Fixed async setState
bsekachev May 9, 2024
d4b5782
Minor improvements
bsekachev May 9, 2024
99a7e2d
Fixed one more pipeline
bsekachev May 9, 2024
37bc540
Fixed more tests
bsekachev May 9, 2024
0cb3b96
Fixed more tests
bsekachev May 9, 2024
4f04285
Fixed more tests
bsekachev May 9, 2024
05046a0
Aborted extra functionality
bsekachev May 9, 2024
f54e5b9
Adjusted styles
bsekachev May 9, 2024
bb727d2
Fixed couple more tests
bsekachev May 9, 2024
3e74edd
Fixed saving test
bsekachev May 9, 2024
5b612f5
Fixed multi tasks test
bsekachev May 9, 2024
8fd47e6
Fixed cypress test with colors
bsekachev May 9, 2024
36b31e9
Fixed one more test
bsekachev May 9, 2024
0ab88ff
Tried to fix two tests
bsekachev May 9, 2024
6cf4c67
Updated license headers
bsekachev May 9, 2024
e156bc2
Updated license headers
bsekachev May 9, 2024
f57e915
Fixed tooltip
bsekachev May 9, 2024
ebdf406
Added changelog entry
bsekachev May 9, 2024
e4ed7fe
Minor style improvement
bsekachev May 9, 2024
dd30df2
Updated border radius
bsekachev May 9, 2024
f478bff
Unified border raduis
bsekachev May 9, 2024
f38c4f2
Unified border raduis
bsekachev May 9, 2024
4ddd93b
Fixed hint
bsekachev May 9, 2024
98fb3fa
Applied comments
bsekachev May 14, 2024
f8e2054
Applied comments
bsekachev May 14, 2024
ab37d23
Removed border radius
bsekachev May 14, 2024
6f15b46
Applied comments
bsekachev May 14, 2024
bec8ea4
Aligned cards
bsekachev May 16, 2024
80bc79b
Fixed top bars
bsekachev May 16, 2024
790d2b1
Fixed sider
bsekachev May 16, 2024
2729121
Merge branch 'develop' into bs/upgrade_react
bsekachev May 16, 2024
b13f9ca
Merge branch 'develop' into bs/upgrade_react
bsekachev May 22, 2024
562cf76
Minor updates
bsekachev May 22, 2024
fa85d88
Minor updates
bsekachev May 22, 2024
e0cbf60
Minor changes
bsekachev May 22, 2024
9fba898
Minor update
bsekachev May 22, 2024
85bd533
minor fix
bsekachev May 22, 2024
eee0294
Minor fix
bsekachev May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ questions and get our support.
- [How to Use CVAT (Roboflow guide)](https://blog.roboflow.com/cvat/)
- [How to auto-label data in CVAT with one of 50,000+ models on Roboflow Universe](https://blog.roboflow.com/how-to-use-roboflow-models-in-cvat/)

<!-- prettier-ignore-start -->
<!-- Badges -->

[docker-server-pulls-img]: https://img.shields.io/docker/pulls/cvat/server.svg?style=flat-square&label=server%20pulls
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/20240509_160805_boris_upgrade_react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Changed

- Upgraded React and Antd dependencies, it leads to stylistic changes in the user interface
(<https://github.com/cvat-ai/cvat/pull/7466>)
2 changes: 1 addition & 1 deletion cvat-core/src/annotations-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async function runSingleFrameChain(
// Ignore deleted frames
if (!frameData.deleted) {
// Get annotations according to filter
const states: ObjectState[] = await getAnnotations(instance, frame, false, filters, null);
const states: ObjectState[] = await getAnnotations(instance, frame, false, filters);
const frameCollectionIDs = states.reduce<IDsToHandle>((acc, val) => {
if (val.objectType === ObjectType.SHAPE) {
acc.shapes.push(val.clientID as number);
Expand Down
11 changes: 6 additions & 5 deletions cvat-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
"author": "CVAT.ai",
"license": "MIT",
"dependencies": {
"@ant-design/compatible": "^5.1.2",
"@ant-design/icons": "^4.6.3",
"@react-awesome-query-builder/antd": "^6.2.1",
"@types/json-logic-js": "^2.0.2",
"@types/lru-cache": "^7.10.10",
"@types/platform": "^1.3.4",
"@types/react": "^16.14.15",
"@types/react": "18.2.55",
"@types/react-color": "^3.0.5",
"@types/react-dom": "^16.9.14",
"@types/react-dom": "18.2.19",
"@types/react-grid-layout": "^1.3.2",
"@types/react-redux": "^7.1.18",
"@types/react-router": "^5.1.16",
"@types/react-router-dom": "^5.1.9",
"@types/redux-logger": "^3.0.9",
"@types/resize-observer-browser": "^0.1.6",
"@uiw/react-md-editor": "^3.22.0",
"antd": "~4.18.9",
"antd": "5.17.1",
"chart.js": "^4.3.0",
"copy-to-clipboard": "^3.3.1",
"cvat-canvas": "link:./../cvat-canvas",
Expand All @@ -50,11 +51,11 @@
"onnxruntime-web": "1.14.0",
"platform": "^1.3.6",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react": "18.2.0",
"react-chartjs-2": "^5.2.0",
"react-color": "^2.19.3",
"react-cookie": "^4.0.3",
"react-dom": "^16.14.0",
"react-dom": "18.2.0",
"react-grid-layout": "^1.3.4",
"react-markdown": "^8.0.4",
"react-moment": "^1.1.1",
Expand Down
3 changes: 1 addition & 2 deletions cvat-ui/src/actions/projects-actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) 2022-2023 CVAT.ai Corporation
// Copyright (C) 2022-2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -32,7 +32,6 @@ export enum ProjectsActionTypes {
GET_PROJECT_PREVIEW_FAILED = 'GET_PROJECT_PREVIEW_FAILED',
}

// prettier-ignore
const projectActions = {
getProjects: () => createAction(ProjectsActionTypes.GET_PROJECTS),
getProjectsSuccess: (array: any[], count: number) => (
Expand Down
9 changes: 5 additions & 4 deletions cvat-ui/src/base.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
// Copyright (C) 2023-2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -15,7 +15,7 @@ $hover-menu-color: rgba(24, 144, 255, 5%);
$completed-progress-color: #61c200;
$validation-progress-color: #1890ff;
$annotation-progress-color: #c1c1c1;
$border-color-1: #d9d9d9;
$border-color-1: #f0f0f0;;
$border-color-hover: #40a9ff;
$background-color-1: white;
$background-color-2: #f1f1f1;
Expand All @@ -32,8 +32,9 @@ $objects-bar-icons-color: #242424; // #6e6e6e
$active-label-background-color: #d8ecff;
$object-item-border-color: rgba(0, 0, 0, 70%);
$slider-color: #1890ff;
$box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 12%), 0 6px 16px 0 rgba(0, 0, 0, 8%),
0 9px 28px 8px rgba(0, 0, 0, 5%);
$border-radius-base: 8px;
$box-shadow-base: 0 1px 2px -2px rgba(0, 0, 0, 16%), 0 3px 6px 0 rgba(0, 0, 0, 12%), 0 5px 12px 4px rgba(0, 0, 0, 9%);
$box-shadow-transition: 0.2s;
$monospaced-fonts-stack: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono,
Courier New, monospace;

Expand Down
30 changes: 3 additions & 27 deletions cvat-ui/src/components/actions-menu/styles.scss
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2022 CVAT.ai Corporation
// Copyright (C) 2022-2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

@import '../../base.scss';

.ant-menu.cvat-actions-menu {
box-shadow: $box-shadow-base;

> li:hover {
background-color: $hover-menu-color;
}

.ant-menu-submenu-title {
margin: 0;
width: 13em;
}
}

.cvat-menu-dump-submenu-item,
.cvat-menu-export-submenu-item {
> span[role='img'] {
color: $info-icon-color;
}

&:hover {
background-color: $hover-menu-color;
}
}
@import 'base';

.cvat-menu-icon {
font-size: 16px;
margin-left: 8px;
margin-left: $grid-unit-size;
align-self: center;
}

Expand Down
35 changes: 19 additions & 16 deletions cvat-ui/src/components/analytics-page/analytics-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,25 @@ function AnalyticsPage(): JSX.Element {
defaultActiveKey={AnalyticsTabs.OVERVIEW}
onChange={onTabKeyChange}
className='cvat-task-analytics-tabs'
>
<Tabs.TabPane tab='Performance' key={AnalyticsTabs.OVERVIEW}>
<AnalyticsOverview
report={analyticsReport}
timePeriod={timePeriod}
reportRefreshingStatus={reportRefreshingStatus}
onTimePeriodChange={setTimePeriod}
onCreateReport={onCreateReport}
/>
</Tabs.TabPane>
{instanceType === 'task' && (
<Tabs.TabPane tab='Quality' key={AnalyticsTabs.QUALITY}>
<TaskQualityComponent task={instance} onJobUpdate={onJobUpdate} />
</Tabs.TabPane>
)}
</Tabs>
items={[{
key: AnalyticsTabs.OVERVIEW,
label: 'Performance',
children: (
<AnalyticsOverview
report={analyticsReport}
timePeriod={timePeriod}
reportRefreshingStatus={reportRefreshingStatus}
onTimePeriodChange={setTimePeriod}
onCreateReport={onCreateReport}
/>
),
},
...(instanceType === 'task' ? [{
key: AnalyticsTabs.QUALITY,
label: 'Quality',
children: <TaskQualityComponent task={instance} onJobUpdate={onJobUpdate} />,
}] : [])]}
/>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Notification from 'antd/lib/notification';
import { Col, Row } from 'antd/lib/grid';
import Button from 'antd/lib/button';
import Card from 'antd/lib/card';
import Title from 'antd/lib/typography/Title';
import { ReloadOutlined, LoadingOutlined } from '@ant-design/icons';

import { AnalyticsReport, AnalyticsEntryViewType } from 'cvat-core-wrapper';
Expand Down Expand Up @@ -66,7 +65,7 @@ function AnalyticsOverview(props: Props): JSX.Element | null {
<Card>
<div className='cvat-empty-performance-analytics-item'>
{reportRefreshingStatus ? <Text>{reportRefreshingStatus}</Text> :
<Title level={5}> Performance report was not calculated yet... </Title>}
<Text>{`A performance report for the ${report.target} was not computed`}</Text>}
<Button
onClick={onCreateReport}
loading={reportRefreshingStatus !== null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function QualitySettingsModal(props: Props): JSX.Element | null {
okText='Save'
cancelText='Cancel'
title={<Text strong>Annotation Quality Settings</Text>}
visible={visible}
open={visible}
onOk={onOk}
onCancel={onCancel}
confirmLoading={fetching}
Expand Down
8 changes: 5 additions & 3 deletions cvat-ui/src/components/analytics-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
//
// SPDX-License-Identifier: MIT

@import '../../base';
@import 'base';

.cvat-analytics-inner {
background: $background-color-1;
min-height: $grid-unit-size * 95;
padding: $grid-unit-size * 4;
padding-bottom: $grid-unit-size;
border-radius: $border-radius-base;

.ant-tabs {
height: 100%;
Expand All @@ -25,6 +26,7 @@

.cvat-empty-performance-analytics-item {
display: flex;
align-items: center;
justify-content: space-between;
}

Expand Down Expand Up @@ -128,8 +130,8 @@
.cvat-quality-settings-switch {
padding: 6px 8px;
border: 1px solid lightgray;
margin-left: 8px;
border-radius: 2px;
margin-left: $grid-unit-size;
border-radius: $border-radius-base;
}

.cvat-quality-settings-title {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Link } from 'react-router-dom';
import { Col, Row } from 'antd/lib/grid';
import Card from 'antd/lib/card';
import Button from 'antd/lib/button';
import Title from 'antd/lib/typography/Title';
import Text from 'antd/lib/typography/Text';

interface Props {
taskID: number,
Expand All @@ -23,7 +23,7 @@ function EmptyJobComponent(props: Props): JSX.Element {
<Card className='cvat-job-empty-ground-truth-item'>
<Row justify='space-between' align='middle'>
<Col>
<Title level={5}>No Ground Truth job created yet...</Title>
<Text>A ground truth job for the task was not created</Text>
</Col>
<Col>
<Button type='primary'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function AnnotationPageComponent(props: Props): JSX.Element {
type='link'
onClick={() => {
changeFrame(latestFrame);
notification.close(notificationKey);
notification.destroy(notificationKey);
}}
>
here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function AnnotationsActionsModalContent(props: { onClose: () => void; }): JSX.El
<Modal
closable={false}
width={640}
visible={modalVisible}
open={modalVisible}
destroyOnClose
footer={null}
afterClose={onClose}
Expand Down
Loading
Loading