Skip to content

Commit

Permalink
Fixed: cancel button is not visible when removing a label/attribute (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Jul 18, 2024
1 parent 511a2d9 commit 6fea78c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Delete label modal window does not have cancellation button
(<https://github.com/cvat-ai/cvat/pull/8196>)
8 changes: 6 additions & 2 deletions cvat-ui/src/components/labels-editor/label-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { RefObject } from 'react';
import { Row, Col } from 'antd/lib/grid';
import Icon, { DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons';
import Icon, { DeleteOutlined, PlusCircleOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import Input from 'antd/lib/input';
import Button from 'antd/lib/button';
import Checkbox from 'antd/lib/checkbox';
Expand Down Expand Up @@ -422,8 +422,12 @@ export default class LabelForm extends React.Component<Props> {
onClick={(): void => {
if (attr.id >= 0) {
Modal.confirm({
className: 'cvat-modal-delete-label-attribute',
icon: <ExclamationCircleOutlined />,
title: `Do you want to remove the "${attr.name}" attribute?`,
content: 'This action is irreversible. It will remove corresponding annotations.',
content: 'This action is undone. All annotations associated to the attribute will be removed',
type: 'warning',
okButtonProps: { type: 'primary', danger: true },
onOk: () => {
this.removeAttribute(key);
setTimeout(() => {
Expand Down
12 changes: 5 additions & 7 deletions cvat-ui/src/components/labels-editor/labels-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import './styles.scss';
import React from 'react';
import Tabs from 'antd/lib/tabs';
import Text from 'antd/lib/typography/Text';
import ModalConfirm from 'antd/lib/modal/confirm';
import {
EditOutlined, BuildOutlined, ExclamationCircleOutlined,
} from '@ant-design/icons';
import modal from 'antd/lib/modal';
import { EditOutlined, BuildOutlined, ExclamationCircleOutlined } from '@ant-design/icons';

import { SerializedLabel, SerializedAttribute } from 'cvat-core-wrapper';
import RawViewer from './raw-viewer';
Expand Down Expand Up @@ -160,13 +158,13 @@ export default class LabelsEditor extends React.PureComponent<LabelsEditorProps,
};

if (typeof label.id !== 'undefined' && label.id >= 0) {
ModalConfirm({
modal.confirm({
className: 'cvat-modal-delete-label',
icon: <ExclamationCircleOutlined />,
title: `Do you want to delete "${label.name}" label?`,
content: 'This action is irreversible. Annotation corresponding with this label will be deleted.',
content: 'This action is undone. All annotations associated to the label will be deleted.',
type: 'warning',
okType: 'danger',
okButtonProps: { type: 'primary', danger: true },
onOk() {
deleteLabel();
},
Expand Down

0 comments on commit 6fea78c

Please sign in to comment.