diff --git a/cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx b/cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx index 00efde94..4bbcd26a 100644 --- a/cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx +++ b/cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx @@ -41,8 +41,7 @@ function isPositiveInteger(_: any, value: any, callback: any): void { } const intValue = +value; - if (Number.isNaN(intValue) - || !Number.isInteger(intValue) || intValue < 1) { + if (Number.isNaN(intValue) || !Number.isInteger(intValue) || intValue < 1) { callback('Value must be a positive integer'); } @@ -70,10 +69,7 @@ function isIntegerRange(min: number, max: number, _: any, value: any, callback: } const intValue = +value; - if (Number.isNaN(intValue) - || !Number.isInteger(intValue) - || intValue < min || intValue > max - ) { + if (Number.isNaN(intValue) || !Number.isInteger(intValue) || intValue < min || intValue > max) { callback(`Value must be an integer [${min}, ${max}]`); } @@ -83,10 +79,7 @@ function isIntegerRange(min: number, max: number, _: any, value: any, callback: class AdvancedConfigurationForm extends React.PureComponent { public submit(): Promise { return new Promise((resolve, reject) => { - const { - form, - onSubmit, - } = this.props; + const { form, onSubmit } = this.props; form.validateFields((error, values): void => { if (!error) { @@ -97,8 +90,10 @@ class AdvancedConfigurationForm extends React.PureComponent { reject(new Error('Segment size must be more than overlap size')); } - if (typeof (values.startFrame) !== 'undefined' && typeof (values.stopFrame) !== 'undefined' - && +values.stopFrame < +values.startFrame + if ( + typeof values.startFrame !== 'undefined' && + typeof values.stopFrame !== 'undefined' && + +values.stopFrame < +values.startFrame ) { reject(new Error('Stop frame must be more or equal start frame')); } @@ -129,9 +124,7 @@ class AdvancedConfigurationForm extends React.PureComponent { valuePropName: 'checked', })( - - Z-order - + Z-order , )} @@ -146,19 +139,16 @@ class AdvancedConfigurationForm extends React.PureComponent { {form.getFieldDecorator('imageQuality', { initialValue: 70, - rules: [{ - required: true, - message: 'The field is required.', - }, { - validator: isIntegerRange.bind(null, 5, 100), - }], - })( - } - />, - )} + rules: [ + { + required: true, + message: 'The field is required.', + }, + { + validator: isIntegerRange.bind(null, 5, 100), + }, + ], + })(} />)} ); @@ -171,12 +161,12 @@ class AdvancedConfigurationForm extends React.PureComponent { Overlap size}> {form.getFieldDecorator('overlapSize', { - rules: [{ - validator: isNonNegativeInteger, - }], - })( - , - )} + rules: [ + { + validator: isNonNegativeInteger, + }, + ], + })()} ); @@ -189,12 +179,12 @@ class AdvancedConfigurationForm extends React.PureComponent { Segment size}> {form.getFieldDecorator('segmentSize', { - rules: [{ - validator: isPositiveInteger, - }], - })( - , - )} + rules: [ + { + validator: isPositiveInteger, + }, + ], + })()} ); @@ -206,17 +196,12 @@ class AdvancedConfigurationForm extends React.PureComponent { return ( Start frame}> {form.getFieldDecorator('startFrame', { - rules: [{ - validator: isNonNegativeInteger, - }], - })( - , - )} + rules: [ + { + validator: isNonNegativeInteger, + }, + ], + })()} ); } @@ -227,17 +212,12 @@ class AdvancedConfigurationForm extends React.PureComponent { return ( Stop frame}> {form.getFieldDecorator('stopFrame', { - rules: [{ - validator: isNonNegativeInteger, - }], - })( - , - )} + rules: [ + { + validator: isNonNegativeInteger, + }, + ], + })()} ); } @@ -248,17 +228,12 @@ class AdvancedConfigurationForm extends React.PureComponent { return ( Frame step}> {form.getFieldDecorator('frameStep', { - rules: [{ - validator: isPositiveInteger, - }], - })( - , - )} + rules: [ + { + validator: isPositiveInteger, + }, + ], + })()} ); } @@ -273,9 +248,7 @@ class AdvancedConfigurationForm extends React.PureComponent { initialValue: false, })( - - Use LFS (Large File Support): - + Use LFS (Large File Support): , )} @@ -292,24 +265,26 @@ class AdvancedConfigurationForm extends React.PureComponent { extra='Attach a repository to store annotations there' > {form.getFieldDecorator('repository', { - rules: [{ - validator: (_, value, callback): void => { - if (!value) { - callback(); - } else { - const [url, path] = value.split(/\s+/); - if (!patterns.validateURL.pattern.test(url)) { - callback('Git URL is not a valid'); - } - - if (path && !patterns.validatePath.pattern.test(path)) { - callback('Git path is not a valid'); + rules: [ + { + validator: (_, value, callback): void => { + if (!value) { + callback(); + } else { + const [url, path] = value.split(/\s+/); + if (!patterns.validateURL.pattern.test(url)) { + callback('Git URL is not a valid'); + } + + if (path && !patterns.validatePath.pattern.test(path)) { + callback('Git path is not a valid'); + } + + callback(); } - - callback(); - } + }, }, - }], + ], })( { return ( <> - - {this.renderGitRepositoryURL()} - + {this.renderGitRepositoryURL()} - - {this.renderGitLFSBox()} - + {this.renderGitLFSBox()} ); @@ -347,18 +318,18 @@ class AdvancedConfigurationForm extends React.PureComponent { extra='Attach issue tracker where the task is described' > {form.getFieldDecorator('bugTracker', { - rules: [{ - validator: (_, value, callback): void => { - if (value && !patterns.validateURL.pattern.test(value)) { - callback('Issue tracker must be URL'); - } else { - callback(); - } + rules: [ + { + validator: (_, value, callback): void => { + if (value && !patterns.validateURL.pattern.test(value)) { + callback('Issue tracker must be URL'); + } else { + callback(); + } + }, }, - }], - })( - , - )} + ], + })()} ); } @@ -372,9 +343,7 @@ class AdvancedConfigurationForm extends React.PureComponent { valuePropName: 'checked', })( - - Use zip chunks - + Use zip chunks , )} @@ -386,13 +355,11 @@ class AdvancedConfigurationForm extends React.PureComponent { return ( {form.getFieldDecorator('useCache', { - initialValue: false, + initialValue: true, valuePropName: 'checked', })( - - Use cache - + Use cache , )} @@ -405,11 +372,10 @@ class AdvancedConfigurationForm extends React.PureComponent { return ( Chunk size}> - Defines a number of frames to be packed in - a chunk when send from client to server. - Server defines automatically if empty. + Defines a number of frames to be packed in a chunk when send from client to server. Server + defines automatically if empty.
Recommended values:
@@ -421,16 +387,16 @@ class AdvancedConfigurationForm extends React.PureComponent {
More: 1 - 4 - )} + } mouseLeaveDelay={0} > {form.getFieldDecorator('dataChunkSize', { - rules: [{ - validator: isPositiveInteger, - }], - })( - , - )} + rules: [ + { + validator: isPositiveInteger, + }, + ], + })()}
); @@ -442,27 +408,19 @@ class AdvancedConfigurationForm extends React.PureComponent { return (
- - {this.renderZOrder()} - + {this.renderZOrder()} - - {this.renderUzeZipChunks()} - + {this.renderUzeZipChunks()} - - {this.renderCreateTaskMethod()} - + {this.renderCreateTaskMethod()} - - {this.renderImageQuality()} - + {this.renderImageQuality()} {this.renderOverlap()} @@ -472,9 +430,7 @@ class AdvancedConfigurationForm extends React.PureComponent { - - {this.renderStartFrame()} - + {this.renderStartFrame()} {this.renderStopFrame()} @@ -484,17 +440,13 @@ class AdvancedConfigurationForm extends React.PureComponent { - - {this.renderChunkSize()} - + {this.renderChunkSize()} - { installedGit ? this.renderGit() : null} + {installedGit ? this.renderGit() : null} - - {this.renderBugTracker()} - + {this.renderBugTracker()}
);