fix(frontend): resolve superposed edit dialogs

This commit is contained in:
yassinedorbozgithub 2025-02-10 14:52:54 +01:00
parent 55d8d89d5c
commit e954e3e1de

View File

@ -198,11 +198,7 @@ const Diagrams = () => {
onRemoveNode: openDeleteDialog, onRemoveNode: openDeleteDialog,
onDbClickNode: (event, id) => { onDbClickNode: (event, id) => {
if (id) { if (id) {
const block = getBlockFromCache(id); openEditDialog(id);
dialogs.open(BlockEditFormDialog, block, {
maxWidth: "md",
});
} }
}, },
targetPortChanged: ({ targetPortChanged: ({
@ -458,6 +454,14 @@ const Diagrams = () => {
} }
} }
}; };
const openEditDialog = (selectedBlockId: string) => {
const block = getBlockFromCache(selectedBlockId);
dialogs.open(BlockEditFormDialog, block, {
maxWidth: "md",
isSingleton: true,
});
};
const handleMoveButton = () => { const handleMoveButton = () => {
const ids = getSelectedIds(); const ids = getSelectedIds();
const { blockIds } = getGroupedIds(ids); const { blockIds } = getGroupedIds(ids);
@ -650,11 +654,7 @@ const Diagrams = () => {
startIcon={<EditIcon />} startIcon={<EditIcon />}
onClick={() => { onClick={() => {
if (selectedBlockId) { if (selectedBlockId) {
const block = getBlockFromCache(selectedBlockId); openEditDialog(selectedBlockId);
dialogs.open(BlockEditFormDialog, block, {
maxWidth: "md",
});
} }
}} }}
disabled={getSelectedIds().length > 1 || !hasSelectedBlock()} disabled={getSelectedIds().length > 1 || !hasSelectedBlock()}