-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add tf import checks and tests #1567
Changes from 10 commits
6aaeea9
14fe4c4
a65400e
f88bb40
1b4ca30
40aba1f
1b9598c
e916530
7b226d4
001adfb
ed69506
8c5528e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ function isDefaultFormat(dumperName: string, taskMode: string): boolean { | |
interface Props { | ||
taskMode: string; | ||
menuKey: string; | ||
dumpers: string[]; | ||
dumpers: any[]; | ||
dumpActivities: string[] | null; | ||
} | ||
|
||
|
@@ -30,17 +30,21 @@ export default function DumpSubmenu(props: Props): JSX.Element { | |
return ( | ||
<Menu.SubMenu key={menuKey} title='Dump annotations'> | ||
{ | ||
dumpers.map((dumper: string): JSX.Element => { | ||
const pending = (dumpActivities || []).includes(dumper); | ||
const isDefault = isDefaultFormat(dumper, taskMode); | ||
dumpers | ||
.sort((a: any, b: any) => a.name.localeCompare(b.name)) | ||
.map((dumper: any): JSX.Element => | ||
{ | ||
const pending = (dumpActivities || []).includes(dumper.name); | ||
const disabled = !dumper.enabled || pending; | ||
const isDefault = isDefaultFormat(dumper.name, taskMode); | ||
return ( | ||
<Menu.Item | ||
key={dumper} | ||
disabled={pending} | ||
key={dumper.name} | ||
disabled={disabled} | ||
className='cvat-menu-dump-submenu-item' | ||
> | ||
<Icon type='download' /> | ||
<Text strong={isDefault}>{dumper}</Text> | ||
<Text strong={isDefault} disabled={disabled}>{dumper.name}</Text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can try something like that:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more option is to use style attribute:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to just pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use version 3.x. It was the latest version when we started doing this UI. |
||
{pending && <Icon style={{ marginLeft: 10 }} type='loading' />} | ||
</Menu.Item> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import Text from 'antd/lib/typography/Text'; | |
|
||
interface Props { | ||
menuKey: string; | ||
exporters: string[]; | ||
exporters: any[]; | ||
exportActivities: string[] | null; | ||
} | ||
|
||
|
@@ -23,16 +23,20 @@ export default function ExportSubmenu(props: Props): JSX.Element { | |
return ( | ||
<Menu.SubMenu key={menuKey} title='Export as a dataset'> | ||
{ | ||
exporters.map((exporter: string): JSX.Element => { | ||
const pending = (exportActivities || []).includes(exporter); | ||
exporters | ||
.sort((a: any, b: any) => a.name.localeCompare(b.name)) | ||
.map((exporter: any): JSX.Element => | ||
{ | ||
const pending = (exportActivities || []).includes(exporter.name); | ||
const disabled = !exporter.enabled || pending; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bsekachev, can we show disabled formats in gray? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zhiltsov-max What means "disabled formats"? Maybe just do not show them at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Existing, but not available. |
||
return ( | ||
<Menu.Item | ||
key={exporter} | ||
disabled={pending} | ||
key={exporter.name} | ||
disabled={disabled} | ||
className='cvat-menu-export-submenu-item' | ||
> | ||
<Icon type='export' /> | ||
<Text>{exporter}</Text> | ||
<Text disabled={disabled}>{exporter.name}</Text> | ||
{pending && <Icon style={{ marginLeft: 10 }} type='loading' />} | ||
</Menu.Item> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an interface definition for loader and dumper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, can I? I'd just have used the class name, but for some reason they are never used here, so I just followed the style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsekachev, can we use more specific types here than any for objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhiltsov-max
On the one hand, of course, we can declare temporary interfaces in
cvat-ui
forloaders
anddumpers
and specify them here.But on the other hand it is only temporary solution. In general case need to rewrite
cvat-core
on typescript or at least create typings file for the library. This is quite huge change.