Added minor changes

main
Boris Sekachev 5 years ago
parent 6883ee3155
commit c1ddd637b4

@ -68,6 +68,7 @@ export default function ActionsMenuComponent(props: Props): JSX.Element {
onClickMenu(copyParams, file); onClickMenu(copyParams, file);
}, },
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
okText: 'Update', okText: 'Update',
@ -84,6 +85,7 @@ export default function ActionsMenuComponent(props: Props): JSX.Element {
onClickMenu(copyParams); onClickMenu(copyParams);
}, },
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
okText: 'Delete', okText: 'Delete',

@ -46,7 +46,8 @@
.cvat-merge-control, .cvat-merge-control,
.cvat-group-control, .cvat-group-control,
.cvat-split-track-control, .cvat-split-track-control,
.cvat-issue-control { .cvat-issue-control,
.cvat-tools-control {
border-radius: 3.3px; border-radius: 3.3px;
transform: scale(0.65); transform: scale(0.65);
padding: 2px; padding: 2px;

@ -102,6 +102,7 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element {
onClickMenu(copyParams, file); onClickMenu(copyParams, file);
}, },
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
okText: 'Update', okText: 'Update',
@ -120,6 +121,7 @@ export default function AnnotationMenuComponent(props: Props): JSX.Element {
onClickMenu(copyParams); onClickMenu(copyParams);
}, },
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
okText: 'Delete', okText: 'Delete',

@ -62,10 +62,13 @@ export default function ProjectSearchField(props: Props): JSX.Element {
if (value && !projects.filter((project) => project.id === value).length) { if (value && !projects.filter((project) => project.id === value).length) {
core.projects.get({ id: value }).then((result: Project[]) => { core.projects.get({ id: value }).then((result: Project[]) => {
const [project] = result; const [project] = result;
setProjects([...projects, { setProjects([
...projects,
{
id: project.id, id: project.id,
name: project.name, name: project.name,
}]); },
]);
setSearchPhrase(project.name); setSearchPhrase(project.name);
onSelect(project.id); onSelect(project.id);
}); });
@ -80,12 +83,10 @@ export default function ProjectSearchField(props: Props): JSX.Element {
onSelect={handleSelect} onSelect={handleSelect}
className='cvat-project-search-field' className='cvat-project-search-field'
onDropdownVisibleChange={handleFocus} onDropdownVisibleChange={handleFocus}
dataSource={ options={projects.map((proj) => ({
projects.map((proj) => ({
value: proj.id.toString(), value: proj.id.toString(),
text: proj.name, text: proj.name,
})) }))}
}
/> />
); );
} }

@ -279,8 +279,15 @@ export default class LabelForm extends React.Component<Props> {
return ( return (
<Tooltip title='Can this attribute be changed frame to frame?' mouseLeaveDelay={0}> <Tooltip title='Can this attribute be changed frame to frame?' mouseLeaveDelay={0}>
<Form.Item name={[key, 'mutable']} fieldKey={[fieldInstance.fieldKey, 'mutable']} initialValue={value} valuePropName='checked'> <Form.Item
<Checkbox className='cvat-attribute-mutable-checkbox' disabled={locked}>Mutable</Checkbox> name={[key, 'mutable']}
fieldKey={[fieldInstance.fieldKey, 'mutable']}
initialValue={value}
valuePropName='checked'
>
<Checkbox className='cvat-attribute-mutable-checkbox' disabled={locked}>
Mutable
</Checkbox>
</Form.Item> </Form.Item>
</Tooltip> </Tooltip>
); );
@ -315,12 +322,8 @@ export default class LabelForm extends React.Component<Props> {
const attr = label ? label.attributes.filter((_attr: any): boolean => _attr.id === fieldValue.id)[0] : null; const attr = label ? label.attributes.filter((_attr: any): boolean => _attr.id === fieldValue.id)[0] : null;
return ( return (
<Form.Item <Form.Item noStyle key={key} shouldUpdate>
noStyle {() => (
key={key}
shouldUpdate
>
{() => ((
<Row <Row
justify='space-between' justify='space-between'
align='middle' align='middle'
@ -350,7 +353,7 @@ export default class LabelForm extends React.Component<Props> {
<Col span={5}>{this.renderMutableAttributeInput(fieldInstance, attr)}</Col> <Col span={5}>{this.renderMutableAttributeInput(fieldInstance, attr)}</Col>
<Col span={2}>{this.renderDeleteAttributeButton(fieldInstance, attr)}</Col> <Col span={2}>{this.renderDeleteAttributeButton(fieldInstance, attr)}</Col>
</Row> </Row>
))} )}
</Form.Item> </Form.Item>
); );
}; };
@ -365,8 +368,7 @@ export default class LabelForm extends React.Component<Props> {
hasFeedback hasFeedback
name='labelName' name='labelName'
initialValue={value} initialValue={value}
rules={ rules={[
[
{ {
required: true, required: true,
message: 'Please specify a name', message: 'Please specify a name',
@ -382,8 +384,7 @@ export default class LabelForm extends React.Component<Props> {
} }
}, },
}, },
] ]}
}
> >
<Input disabled={locked} placeholder='Label name' /> <Input disabled={locked} placeholder='Label name' />
</Form.Item> </Form.Item>
@ -444,6 +445,7 @@ export default class LabelForm extends React.Component<Props> {
return ( return (
<Tooltip title='Do not save the label and return' mouseLeaveDelay={0}> <Tooltip title='Do not save the label and return' mouseLeaveDelay={0}>
<Button <Button
type='primary'
danger danger
style={{ width: '150px' }} style={{ width: '150px' }}
onClick={(): void => { onClick={(): void => {
@ -485,11 +487,14 @@ export default class LabelForm extends React.Component<Props> {
const { label } = this.props; const { label } = this.props;
if (this.formRef.current) { if (this.formRef.current) {
this.formRef.current.setFieldsValue({ this.formRef.current.setFieldsValue({
attributes: label ? label.attributes attributes: label ?
.map((attribute: Attribute): Store => ({ label.attributes.map(
(attribute: Attribute): Store => ({
...attribute, ...attribute,
type: attribute.input_type, type: attribute.input_type,
})) : [], }),
) :
[],
}); });
} }
} }
@ -498,35 +503,21 @@ export default class LabelForm extends React.Component<Props> {
return ( return (
<Form onFinish={this.handleSubmit} layout='vertical' ref={this.formRef}> <Form onFinish={this.handleSubmit} layout='vertical' ref={this.formRef}>
<Row justify='start' align='middle'> <Row justify='start' align='middle'>
<Col span={10}> <Col span={10}>{this.renderLabelNameInput()}</Col>
{this.renderLabelNameInput()}
</Col>
<Col span={1} /> <Col span={1} />
<Col span={3}> <Col span={3}>{this.renderChangeColorButton()}</Col>
{this.renderChangeColorButton()}
</Col>
<Col span={1} /> <Col span={1} />
<Col span={6}> <Col span={6}>{this.renderNewAttributeButton()}</Col>
{this.renderNewAttributeButton()}
</Col>
</Row> </Row>
<Row justify='start' align='middle'> <Row justify='start' align='middle'>
<Col span={24}> <Col span={24}>
<Form.List name='attributes'> <Form.List name='attributes'>{this.renderAttributes()}</Form.List>
{ this.renderAttributes() }
</Form.List>
</Col> </Col>
</Row> </Row>
<Row justify='start' align='middle'> <Row justify='start' align='middle'>
<Col> <Col>{this.renderDoneButton()}</Col>
{this.renderDoneButton()} <Col offset={1}>{this.renderContinueButton()}</Col>
</Col> <Col offset={1}>{this.renderCancelButton()}</Col>
<Col offset={1}>
{this.renderContinueButton()}
</Col>
<Col offset={1}>
{this.renderCancelButton()}
</Col>
</Row> </Row>
</Form> </Form>
); );

@ -96,6 +96,7 @@ export default class RawViewer extends React.PureComponent<Props> {
<Col offset={1}> <Col offset={1}>
<Tooltip title='Do not save the label and return' mouseLeaveDelay={0}> <Tooltip title='Do not save the label and return' mouseLeaveDelay={0}>
<Button <Button
type='primary'
danger danger
style={{ width: '150px' }} style={{ width: '150px' }}
onClick={(): void => { onClick={(): void => {

@ -26,6 +26,7 @@ export default function ProjectActionsMenuComponent(props: Props): JSX.Element {
dispatch(deleteProjectAsync(projectInstance)); dispatch(deleteProjectAsync(projectInstance));
}, },
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
okText: 'Delete', okText: 'Delete',

@ -100,7 +100,7 @@ export default function UserSelector(props: Props): JSX.Element {
onSelect={handleSelect} onSelect={handleSelect}
className={combinedClassName} className={combinedClassName}
onDropdownVisibleChange={handleFocus} onDropdownVisibleChange={handleFocus}
dataSource={users.map((user) => ({ options={users.map((user) => ({
value: user.id.toString(), value: user.id.toString(),
text: user.username, text: user.username,
}))} }))}

@ -48,6 +48,7 @@ export default function AutomaticAnnotationProgress(props: Props): JSX.Element |
title: 'You are going to cancel automatic annotation?', title: 'You are going to cancel automatic annotation?',
content: 'Reached progress will be lost. Continue?', content: 'Reached progress will be lost. Continue?',
okButtonProps: { okButtonProps: {
type: 'primary',
danger: true, danger: true,
}, },
onOk() { onOk() {

Loading…
Cancel
Save