Skip to content

Commit

Permalink
Fix UX issues on models page (#7164)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
- Fixed centering of empty block
- Fixed inconsistency in top bar
- Fixed padding of page numbers


![image](https://github.com/opencv/cvat/assets/50956430/12d1784c-7af0-4989-9ac2-673100d8f31c)

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have created a changelog fragment <!-- see top comment in
CHANGELOG.md -->
- ~~[] I have updated the documentation accordingly~~
- ~~[ ] I have added tests to cover my changes~~
- ~~[ ] 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))~~
- ~~[ ] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))~~

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.

---------

Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>
  • Loading branch information
klakhov and bsekachev authored Nov 23, 2023
1 parent e530ebb commit e401679
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Minor styling issues on empty models page
(<https://github.com/opencv/cvat/pull/7164>)
47 changes: 24 additions & 23 deletions cvat-ui/src/components/models-page/empty-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,29 @@ import config from 'config';

export default function EmptyListComponent(): JSX.Element {
return (
<Empty
className='cvat-empty-models-list'
description={(
<div>
<Row justify='center' align='middle'>
<Col>
<Text strong>No models deployed yet...</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>To annotate your tasks automatically</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>deploy a model with </Text>
<a href={`${config.NUCLIO_GUIDE}`}>nuclio</a>
</Col>
</Row>
</div>
)}
/>
<div className='cvat-empty-models-list'>
<Empty
description={(
<div>
<Row justify='center' align='middle'>
<Col>
<Text strong>No models deployed yet...</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>To annotate your tasks automatically</Text>
</Col>
</Row>
<Row justify='center' align='middle'>
<Col>
<Text type='secondary'>deploy a model with </Text>
<a href={`${config.NUCLIO_GUIDE}`}>nuclio</a>
</Col>
</Row>
</div>
)}
/>
</div>
);
}
21 changes: 13 additions & 8 deletions cvat-ui/src/components/models-page/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@
padding-top: $grid-unit-size * 2;
padding-bottom: $grid-unit-size;
overflow: auto;
position: fixed;
height: 100%;
width: 100%;

.cvat-models-page-top-bar {
padding-bottom: $grid-unit-size;
}

>div:nth-child(2) {
height: 80%;
&:not(.cvat-empty-models-list) {
height: 90%;
}
}
}

.cvat-empty-models-list {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.ant-empty {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

.cvat-models-list {
Expand Down Expand Up @@ -68,8 +75,6 @@
}

.cvat-models-page-top-bar {
margin: $grid-unit-size * 3 0;

.cvat-models-page-search-bar {
width: $grid-unit-size * 32;
padding-left: $grid-unit-size * 0.5;
Expand Down

0 comments on commit e401679

Please sign in to comment.