fix: Adjust flow cascade deletion and improve flow delete message UI (#6667)
* 🐛 (utils.py): fix cascade delete flow function to correctly delete related entities in the database and handle exceptions properly * ✨ (grid/index.tsx): Update descriptionModal to differentiate between component and flow types for better user experience ✨ (list/index.tsx): Update descriptionModal to differentiate between component and flow types for better user experience * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
94952c0524
commit
c3305e4bd5
3 changed files with 23 additions and 6 deletions
|
|
@ -64,7 +64,10 @@ const GridComponent = ({ flowData }: { flowData: FlowType }) => {
|
|||
});
|
||||
};
|
||||
|
||||
const descriptionModal = useDescriptionModal([flowData?.id], "flow");
|
||||
const descriptionModal = useDescriptionModal(
|
||||
[flowData?.id],
|
||||
flowData.is_component ? "component" : "flow",
|
||||
);
|
||||
|
||||
const { onDragStart } = useDragStart(flowData);
|
||||
|
||||
|
|
@ -145,6 +148,11 @@ const GridComponent = ({ flowData }: { flowData: FlowType }) => {
|
|||
setOpen={setOpenDelete}
|
||||
onConfirm={handleDelete}
|
||||
description={descriptionModal}
|
||||
note={
|
||||
!flowData.is_component
|
||||
? "Deleting the selected flow will remove all associated messages."
|
||||
: ""
|
||||
}
|
||||
>
|
||||
<></>
|
||||
</DeleteConfirmationModal>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,10 @@ const ListComponent = ({ flowData }: { flowData: FlowType }) => {
|
|||
|
||||
const { onDragStart } = useDragStart(flowData);
|
||||
|
||||
const descriptionModal = useDescriptionModal([flowData?.id], "flow");
|
||||
const descriptionModal = useDescriptionModal(
|
||||
[flowData?.id],
|
||||
flowData.is_component ? "component" : "flow",
|
||||
);
|
||||
|
||||
const swatchIndex =
|
||||
(flowData.gradient && !isNaN(parseInt(flowData.gradient))
|
||||
|
|
@ -164,6 +167,11 @@ const ListComponent = ({ flowData }: { flowData: FlowType }) => {
|
|||
setOpen={setOpenDelete}
|
||||
onConfirm={handleDelete}
|
||||
description={descriptionModal}
|
||||
note={
|
||||
!flowData.is_component
|
||||
? "Deleting the selected flow will remove all associated messages."
|
||||
: ""
|
||||
}
|
||||
>
|
||||
<></>
|
||||
</DeleteConfirmationModal>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue