diff --git a/cvat-ui/src/actions/grades-actions.ts b/cvat-ui/src/actions/grades-actions.ts index b9124273cd4c..edb47cbf0ee7 100644 --- a/cvat-ui/src/actions/grades-actions.ts +++ b/cvat-ui/src/actions/grades-actions.ts @@ -136,10 +136,9 @@ interface SubmitAnnotationFrameInput { certificateId?: string | null; } -export const submitAnnotationFrameToGradeAsync = (input: SubmitAnnotationFrameInput): ThunkAction => async ( - dispatch, - getState, -) => { +export const submitAnnotationFrameToGradeAsync = ( + input: SubmitAnnotationFrameInput & { withMasks?: boolean }, +): ThunkAction => async (dispatch, getState) => { if (!input.orientation) { dispatch(setWarningAsync(orientationNotFound)); } @@ -147,11 +146,13 @@ export const submitAnnotationFrameToGradeAsync = (input: SubmitAnnotationFrameIn const state = getState() as CombinedState; const { states } = state.annotation.annotations; const { frame } = state.annotation.player; - const job = state.annotation.job.instance; - const image = await job.frames.frameData(frame.number); - const formData = new FormData(); - formData.append('image', image, frame.filename); + + if (input.withMasks) { + const job = state.annotation.job.instance; + const image = await job.frames.frameData(frame.number); + formData.append('image', image, frame.filename); + } formData.append( 'payload', diff --git a/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.scss b/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.scss new file mode 100644 index 000000000000..c5d48d02535c --- /dev/null +++ b/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.scss @@ -0,0 +1,3 @@ +.grades-form-advanced-controls { + position: relative; +} diff --git a/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.tsx b/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.tsx new file mode 100644 index 000000000000..ff05608818c3 --- /dev/null +++ b/cvat-ui/src/components/annotation-page/grades-form/grades-form-advanced-controls.tsx @@ -0,0 +1,35 @@ +// Copyright (C) 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT +import React, { useCallback } from 'react'; +import './grades-form-advanced-controls.scss'; +import Button from 'antd/lib/button'; + +interface Props { + onRobogradesAndMasks(): void; +} + +function GradesFormAdvancedControls({ onRobogradesAndMasks }: Props): JSX.Element { + const [isExpanded, setIsExpanded] = React.useState(false); + + const handleToggle = useCallback((): void => { + setIsExpanded((prev) => !prev); + }, []); + + return ( + <> +