Преглед изворни кода

feat: deleting a node does not require a confirmation box to pop up #918 (#1380)

### What problem does this PR solve?

feat: deleting a node does not require a confirmation box to pop up #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
tags/v0.8.0
balibabu пре 1 година
родитељ
комит
957cd55e4a
No account linked to committer's email address

+ 7
- 1
web/src/components/operate-dropdown/index.tsx Прегледај датотеку

@@ -11,6 +11,7 @@ interface IProps {
iconFontSize?: number;
items?: MenuProps['items'];
height?: number;
needsDeletionValidation?: boolean;
}

const OperateDropdown = ({
@@ -19,12 +20,17 @@ const OperateDropdown = ({
iconFontSize = 30,
items: otherItems = [],
height = 24,
needsDeletionValidation = true,
}: React.PropsWithChildren<IProps>) => {
const { t } = useTranslation();
const showDeleteConfirm = useShowDeleteConfirm();

const handleDelete = () => {
showDeleteConfirm({ onOk: deleteItem });
if (needsDeletionValidation) {
showDeleteConfirm({ onOk: deleteItem });
} else {
deleteItem();
}
};

const handleDropdownMenuClick: MenuProps['onClick'] = ({ domEvent, key }) => {

+ 1
- 0
web/src/pages/flow/canvas/node/dropdown.tsx Прегледај датотеку

@@ -41,6 +41,7 @@ const NodeDropdown = ({ id }: IProps) => {
height={14}
deleteItem={deleteNode}
items={items}
needsDeletionValidation={false}
></OperateDropdown>
);
};

Loading…
Откажи
Сачувај