diff --git a/catalog/app/containers/Admin/Buckets/Tabulator.tsx b/catalog/app/containers/Admin/Buckets/Tabulator.tsx index 44506cff6b7..389cc932ff8 100644 --- a/catalog/app/containers/Admin/Buckets/Tabulator.tsx +++ b/catalog/app/containers/Admin/Buckets/Tabulator.tsx @@ -7,7 +7,7 @@ import * as M from '@material-ui/core' import tabulatorTableSchema from 'schemas/tabulatorTable.yml.json' -// import { useConfirm } from 'components/Dialog' +import { useConfirm } from 'components/Dialog' import { loadMode } from 'components/FileEditor/loader' import * as Notifications from 'containers/Notifications' import type * as Model from 'model' @@ -21,7 +21,7 @@ import * as yaml from 'utils/yaml' import * as Form from '../Form' -// import * as OnDirty from './OnDirty' +import * as OnDirty from './OnDirty' import SET_TABULATOR_TABLE_MUTATION from './gql/TabulatorTablesSet.generated' import RENAME_TABULATOR_TABLE_MUTATION from './gql/TabulatorTablesRename.generated' @@ -459,10 +459,12 @@ interface AddTableProps { function AddTable({ disabled, onCancel, onSubmit }: AddTableProps) { const classes = useAddTableStyles() + const { onChange: onFormSpy } = OnDirty.use() return ( {({ handleSubmit, error, submitError, submitFailed }) => (
+ confirmed && handleDelete(), + [handleDelete], + ), + }) return ( <> + {confirm.render(<>)} setOpen((x) => !x)} disabled={disabled}> {open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'} @@ -604,6 +616,7 @@ function TabulatorRow({ {({ handleSubmit, error, submitError, errors, submitErrors }) => ( + { setAnchorEl(null) - handleDelete() + confirm.open() }} disabled={disabled} > @@ -714,6 +727,7 @@ function TabulatorRow({ submitFailed, }) => ( +