diff --git a/changelog.d/20241209_110126_sekachev.bs_support_boolean.md b/changelog.d/20241209_110126_sekachev.bs_support_boolean.md new file mode 100644 index 000000000000..4e0e98e1aba2 --- /dev/null +++ b/changelog.d/20241209_110126_sekachev.bs_support_boolean.md @@ -0,0 +1,4 @@ +### Added + +- Support for boolean parameters in annotations actions + () diff --git a/cvat-core/src/annotations-actions/base-action.ts b/cvat-core/src/annotations-actions/base-action.ts index 3246261d2c9a..2ec2148b24c7 100644 --- a/cvat-core/src/annotations-actions/base-action.ts +++ b/cvat-core/src/annotations-actions/base-action.ts @@ -9,6 +9,7 @@ import { Job, Task } from '../session'; export enum ActionParameterType { SELECT = 'select', NUMBER = 'number', + CHECKBOX = 'checkbox', } // For SELECT values should be a list of possible options diff --git a/cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx b/cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx index f33dd9bf231a..fc98e3c27fa8 100644 --- a/cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx +++ b/cvat-ui/src/components/annotation-page/annotations-actions/annotations-actions-modal.tsx @@ -25,10 +25,12 @@ import { getCVATStore } from 'cvat-store'; import { BaseCollectionAction, BaseAction, Job, getCore, ObjectState, + ActionParameterType, } from 'cvat-core-wrapper'; import { Canvas } from 'cvat-canvas-wrapper'; import { fetchAnnotationsAsync } from 'actions/annotation-actions'; import { clamp } from 'utils/math'; +import { Switch } from 'antd/lib'; const core = getCore(); @@ -248,7 +250,7 @@ function ActionParameterComponent(props: ActionParameterProps & { onChange: (val const computedValues = typeof values === 'function' ? values({ instance: job }) : values; - if (type === 'select') { + if (type === ActionParameterType.SELECT) { return (