@@ -494,6 +494,7 @@ function WSEditorDeleteDialog(props: {
494494} ) {
495495 const [ updating , setUpdating ] = React . useState < boolean > ( false ) ;
496496 const [ invalidText , setInvalidText ] = React . useState < string | undefined > ( undefined ) ;
497+ const [ confirmName , setConfirmName ] = React . useState < string | undefined > ( undefined ) ;
497498
498499 const handleClose = ( ) => {
499500 props . onClose ( false ) ;
@@ -525,10 +526,23 @@ function WSEditorDeleteDialog(props: {
525526 disableEscapeKeyDown
526527 open = { props . open }
527528 >
528- < DialogTitle > Confirm to delete workspace?</ DialogTitle >
529- < DialogContent >
530- { invalidText && < Alert variant = "filled" severity = 'error' > { invalidText } </ Alert > }
531- </ DialogContent >
529+ < DialogTitle > Delete '{ props . workspaceName } ' workspace?</ DialogTitle >
530+ < DialogContent dividers = { true } >
531+ { invalidText && < Alert variant = "filled" severity = 'error' > { invalidText } </ Alert > }
532+ < TextField
533+ id = "name"
534+ label = "Workspace Name"
535+ helperText = "Please type workspace name to confirm."
536+ type = "text"
537+ fullWidth
538+ variant = 'standard'
539+ value = { confirmName }
540+ onChange = { ( event : any ) => {
541+ setConfirmName ( event . target . value )
542+ } }
543+ margin = "normal" required
544+ />
545+ </ DialogContent >
532546 < DialogActions >
533547 { updating &&
534548 < Box sx = { { width : '100%' } } >
@@ -537,7 +551,7 @@ function WSEditorDeleteDialog(props: {
537551 }
538552 { ! updating && < React . Fragment >
539553 < Button onClick = { handleClose } > Cancel</ Button >
540- < Button onClick = { handleDelete } > Confirm</ Button >
554+ < Button onClick = { handleDelete } disabled = { props . workspaceName !== confirmName } > Confirm</ Button >
541555 </ React . Fragment > }
542556 </ DialogActions >
543557 </ Dialog >
0 commit comments