Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: cancel button is not visible when removing a label/attribute #8196

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 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 @@ -416,14 +416,17 @@ export default class LabelForm extends React.Component<Props> {
<CVATTooltip title='Delete the attribute'>
<Form.Item>
<Button
disabled={attr.id >= 0} // temporary disabled, does not work on the server
type='link'
className='cvat-delete-attribute-button'
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
Loading