Skip to content

Commit

Permalink
Added loading icon while importing a task/project backup (#8534)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Oct 11, 2024
1 parent 12dac6d commit f49c1c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cvat-ui/src/components/projects-page/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Row, Col } from 'antd/lib/grid';
import Button from 'antd/lib/button';
import Popover from 'antd/lib/popover';
import Input from 'antd/lib/input';
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
import { LoadingOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
import { importActions } from 'actions/import-actions';
import { usePrevious } from 'utils/hooks';
import { ProjectsQuery } from 'reducers';
Expand Down Expand Up @@ -109,7 +109,7 @@ function TopBarComponent(props: Props): JSX.Element {
className='cvat-import-project-button'
type='primary'
disabled={importing}
icon={<UploadOutlined />}
icon={importing ? <LoadingOutlined /> : <UploadOutlined />}
onClick={() => dispatch(importActions.openImportBackupModal('project'))}
>
Create from backup
Expand Down
5 changes: 3 additions & 2 deletions cvat-ui/src/components/tasks-page/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useHistory } from 'react-router';

import { Row, Col } from 'antd/lib/grid';
import Popover from 'antd/lib/popover';
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
import { LoadingOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
import Button from 'antd/lib/button';
import Input from 'antd/lib/input';
import { importActions } from 'actions/import-actions';
Expand Down Expand Up @@ -117,7 +117,8 @@ export default function TopBarComponent(props: VisibleTopBarProps): JSX.Element
<Button
className='cvat-import-task-button'
type='primary'
icon={<UploadOutlined />}
disabled={importing}
icon={importing ? <LoadingOutlined /> : <UploadOutlined />}
onClick={() => dispatch(importActions.openImportBackupModal('task'))}
>
Create from backup
Expand Down

0 comments on commit f49c1c6

Please sign in to comment.