mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +00:00
fix(frontend): resolve superposed edit dialogs
This commit is contained in:
parent
55d8d89d5c
commit
e954e3e1de
@ -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()}
|
||||||
|
Loading…
Reference in New Issue
Block a user