diff --git a/package.json b/package.json index 2167d4d31..b689d4ce5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "0.0.40-beta-14", + "version": "0.0.40-beta-15", "description": "Supporting common component library", "main": "dist/index.js", "scripts": { diff --git a/src/Common/Dialogs/DeleteDialog.tsx b/src/Common/Dialogs/DeleteDialog.tsx index 113eb2fb1..5722e8933 100644 --- a/src/Common/Dialogs/DeleteDialog.tsx +++ b/src/Common/Dialogs/DeleteDialog.tsx @@ -6,12 +6,18 @@ import { DeleteDialogProps } from './Types' export const DeleteDialog: React.FC & { Description?: React.FC } = function (props) { const handleDelete = (e: React.MouseEvent) => { - e.stopPropagation() + if (props.shouldStopPropagation) { + e.stopPropagation() + } + props.delete() } const handleModalClose = (e: React.MouseEvent) => { - e.stopPropagation() + if (props.shouldStopPropagation) { + e.stopPropagation() + } + props.closeDelete() } diff --git a/src/Common/Dialogs/Types.ts b/src/Common/Dialogs/Types.ts index 519c3d73f..d65d33955 100644 --- a/src/Common/Dialogs/Types.ts +++ b/src/Common/Dialogs/Types.ts @@ -10,6 +10,7 @@ export interface DeleteDialogProps { apiCallInProgress?: boolean dataTestId?: string buttonPrimaryText?: string + shouldStopPropagation?: boolean } export interface ForceDeleteDialogType {