Skip to content

Commit

Permalink
chore: open shouldStopPropagation prop for DeleteDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekA1509 committed Nov 21, 2023
1 parent 4ff6b01 commit 6ca9c44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 8 additions & 2 deletions src/Common/Dialogs/DeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import { DeleteDialogProps } from './Types'

export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = 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()
}

Expand Down
1 change: 1 addition & 0 deletions src/Common/Dialogs/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface DeleteDialogProps {
apiCallInProgress?: boolean
dataTestId?: string
buttonPrimaryText?: string
shouldStopPropagation?: boolean
}

export interface ForceDeleteDialogType {
Expand Down

0 comments on commit 6ca9c44

Please sign in to comment.