-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #851 from OpenSourceBrain/develop
Release 0.7.4.1
- Loading branch information
Showing
6 changed files
with
155 additions
and
29 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
applications/osb-portal/src/components/dialogs/DeleteDialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import DialogTitle from "@mui/material/DialogTitle"; | ||
import DialogContent from "@mui/material/DialogContent"; | ||
import DialogActions from "@mui/material/DialogActions"; | ||
import Dialog from "@mui/material/Dialog"; | ||
import { | ||
useNavigate, | ||
} from "react-router-dom"; | ||
import { Button } from "@mui/material"; | ||
|
||
|
||
const DeleteDialog = ({ | ||
open, | ||
setOpen, | ||
workspace, | ||
handleDeleteWorkspace, | ||
}) => { | ||
const navigate = useNavigate(); | ||
|
||
const handleDelete = () => { | ||
handleDeleteWorkspace(); | ||
if (window.location.pathname !== "/") { | ||
navigate("/"); | ||
} | ||
} | ||
|
||
return ( | ||
<Dialog | ||
open={open} | ||
onClose={() => setOpen(false)} | ||
> | ||
<DialogTitle>{'Delete Workspace "' + workspace.name + '"'}</DialogTitle> | ||
<DialogContent>{'You are about to delete Workspace "' + workspace.name + '". This action cannot be undone. Are you sure?'}</DialogContent> | ||
<DialogActions> | ||
<Button | ||
color="primary" | ||
onClick={() => { | ||
setOpen(false); | ||
}} | ||
> | ||
CANCEL | ||
</Button> | ||
<Button color="primary" variant="contained" onClick={handleDelete}> | ||
DELETE | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
) | ||
} | ||
|
||
export default DeleteDialog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters