Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5206] improvement(web): Web UI add delete metalake/catalog reminder #5216

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/web/src/app/metalakes/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ const TableBody = props => {

const handleDeleteMetalake = name => () => {
setOpenConfirmDelete(true)
setConfirmCacheData(name)
setConfirmCacheData({ name, type: 'metalake' })
}

const handleConfirmDeleteSubmit = () => {
if (confirmCacheData) {
dispatch(deleteMetalake(confirmCacheData))
dispatch(deleteMetalake(confirmCacheData.name))
setOpenConfirmDelete(false)
}
}
Expand Down
25 changes: 20 additions & 5 deletions web/web/src/components/ConfirmDeleteDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Box, Button, Typography, Dialog, DialogContent, DialogActions } from '@
import Icon from '@/components/Icon'

const ConfirmDeleteDialog = props => {
const { open, setOpen, handleConfirmDeleteSubmit } = props
const { open, setOpen, confirmCacheData, handleConfirmDeleteSubmit } = props

const handleClose = () => setOpen(false)

Expand All @@ -34,10 +34,25 @@ const ConfirmDeleteDialog = props => {
sx={{ '& svg': { mb: 8, color: 'warning.main' } }}
>
<Icon icon='tabler:alert-circle' fontSize='6rem' />
<Typography variant='h4' className={'twc-mb-5 '} sx={{ color: 'text.secondary' }}>
Confirm Delete?
<Typography variant='h4' className={'twc-mb-5'} sx={{ color: 'text.secondary' }}>
Confirm {['metalake', 'catalog'].includes(confirmCacheData?.type) && <span>Force</span>} Drop?
</Typography>
<Typography>This action can not be reversed!</Typography>
{['metalake', 'catalog'].includes(confirmCacheData?.type) ? (
<div className='twc-text-left'>
<Typography>This irreversible action will:</Typography>
<Typography>
· Delete all sub-entities{' '}
{confirmCacheData?.type === 'metalake'
? '(tags, catalogs, schemas, tables, etc.)'
: '(schemas, tables)'}{' '}
in Gravitino
</Typography>
<Typography>· Remove the {confirmCacheData?.type} even if in use</Typography>
<Typography>· Keep external resources unless managed</Typography>
</div>
) : (
<Typography>This action can not be reversed!</Typography>
)}
</Box>
</DialogContent>
<DialogActions className={'twc-justify-center twc-px-5 twc-pb-8'}>
Expand All @@ -47,7 +62,7 @@ const ConfirmDeleteDialog = props => {
className={'twc-mr-2'}
onClick={() => handleConfirmDeleteSubmit()}
>
Delete
Drop
</Button>
<Button variant='outlined' color='secondary' onClick={() => handleClose()}>
Cancel
Expand Down
Loading